Преглед изворни кода

debian/dpkg-doc.postrm: Use doc-name instead of file-name
dselect/pkgdisplay.cc: Replace empty string for eflags to a space so gettext doesn't use the translation-info
po/update.sh: Generate dselect/helpmsgs.{cc,h} so we can translate them.
po/POTFILES.in: add dselect/helpmsgs.cc
dselect/pkgtop.cc: use ACS_HLINE instead of `-'
dselect/baselist.cc: change colour of column headings
dselect: add a new --export mode which suppresses the display of the helpscreen

Wichert Akkerman пре 26 година
родитељ
комит
d96f65430b
13 измењених фајлова са 57 додато и 11 уклоњено
  1. 18 0
      ChangeLog
  2. 3 0
      debian/changelog
  3. 1 1
      debian/dpkg-doc.prerm
  4. 3 0
      dselect/.cvsignore
  5. 4 3
      dselect/Makefile.in
  6. 3 1
      dselect/baselist.cc
  7. 1 0
      dselect/dselect.h
  8. 7 1
      dselect/main.cc
  9. 4 2
      dselect/pkgdisplay.cc
  10. 2 0
      dselect/pkglist.cc
  11. 3 3
      dselect/pkgtop.cc
  12. 1 0
      po/POTFILES.in
  13. 7 0
      po/update.sh

+ 18 - 0
ChangeLog

@@ -1,3 +1,21 @@
+Wed Dec 22 12:07:40 CET 1999 Wichert Akkerman <wakkerma@debian.org>
+
+  * debian/dpkg-doc.postrm: Use doc-name instead of file-name (probably
+    need to change the filename, but I'll be lazy now :)
+  * dselect/pkgdisplay.cc: Replace empty string for eflags to a space
+    so gettext doesn't use the translation-info
+  * po/update.sh: Generate dselect/helpmsgs.{cc,h} so we can translate them.
+  * po/POTFILES.in: add dselect/helpmsgs.cc
+  * dselect/Makefile.in: put helpmsgs.{cc,h} in $(srcdir), since gettext
+    will barf on us if we put them in the builddir. (The real issue here is
+    that when we generate the .po-files we don't know what the builddir will
+    be and gettext can't handle VPATH).
+  * dselect patches from Dan Gohman <gohmandj@mrs.umn.edu>:
+    + dselect/pkgtop.cc: use ACS_HLINE instead of `-'
+    + dselect/baselist.cc: change colour of column headings
+    + dselect: add a new --export mode which suppresses the display of the
+      helpscreen
+
 Tue Dec 21 15:59:35 CET 1999 Wichert Akkerman <wakkerma@debian.org>
 
   * scripts/dpkg-scansoures.pl: don't use \z since that is perl5.005-specific.

+ 3 - 0
debian/changelog

@@ -1,6 +1,9 @@
 dpkg (1.6.5) unstable; urgency=low
 
   * Don't use \z in dpkg-scansources, Closes: Bug# 53182
+  * Correctly unregister internals manual, Closes: Bug# 53200
+  * dselect helpessages can be translated now, Closes: Bug# 51381
+  * dselect UI tweaks, including a new --expert mode
 
  -- Wichert Akkerman <wakkerma@debian.org>  UNRELEASED
 

+ 1 - 1
debian/dpkg-doc.prerm

@@ -12,7 +12,7 @@ case "$1" in
     remove|deconfigure|upgrade)
 	if command -v install-docs >/dev/null 2>&1; then
 	    echo -n "Unregistering DPKG documentation..."
-	    install-docs -r dpkg-doc || true
+	    install-docs -r dpkg-internals || true
 	    echo "done."
 	fi
 	;;

+ 3 - 0
dselect/.cvsignore

@@ -1 +1,4 @@
 Makefile.in
+helpmsgs.cc
+helpmsgs.h
+curkeys.h

+ 4 - 3
dselect/Makefile.in

@@ -12,7 +12,8 @@ CXX_SOURCES	= basecmds.cc baselist.cc basetop.cc bindings.cc curkeys.cc \
 MAN8PAGES	= dselect.8
 
 OBJECTS		= $(patsubst %.cc, %.o, $(CXX_SOURCES))
-GENFILES	= $(OBJECTS) dselect helpmsgs.h
+GENFILES	= $(OBJECTS) dselect helpmsgs.h curkeys.h \
+		  $(srcdir)/helpmsgs.h $(srcdir)/helpmsgs.cc
 
 .PHONY: all
 all:: dselect
@@ -50,8 +51,8 @@ dselect: $(OBJECTS) ../lib/libdpkg.a
 basecmds.o: helpmsgs.h
 curkeys.o: curkeys.h
 
-helpmsgs.h helpmsgs.cc: helpmsgs.src $(srcdir)/mkhelpmsgs.pl
-	perl $(srcdir)/mkhelpmsgs.pl $<
+$(srcdir)/helpmsgs.h $(srcdir)/helpmsgs.cc: helpmsgs.src $(srcdir)/mkhelpmsgs.pl
+	cd $(srcdir) ; perl $(srcdir)/mkhelpmsgs.pl $<
 
 curkeys.h: keyoverride $(srcdir)/mkcurkeys.pl
 	cursesfile=`echo '#include <curses.h>' | \

+ 3 - 1
dselect/baselist.cc

@@ -121,6 +121,7 @@ void baselist::startdisplay() {
     thisstate_attr= COLOR_PAIR(3);
     selstate_attr= list_attr|A_BOLD;
     selstatesel_attr= listsel_attr|A_BOLD;
+    colheads_attr= COLOR_PAIR(3);
   } else {
     title_attr= A_REVERSE;
     thisstate_attr= A_STANDOUT;
@@ -128,10 +129,11 @@ void baselist::startdisplay() {
     listsel_attr= A_STANDOUT;
     selstate_attr= A_BOLD;
     selstatesel_attr= A_STANDOUT;
+    colheads_attr= A_BOLD;
   }
   query_attr= title_attr;
   info_attr= list_attr;
-  colheads_attr= info_headattr= A_BOLD;
+  info_headattr= A_BOLD;
   whatinfo_attr= thisstate_attr;
 
   // set up windows and pads, based on screen size

+ 1 - 0
dselect/dselect.h

@@ -149,6 +149,7 @@ void cursesoff();
 
 extern const char *admindir;
 extern FILE *debug;
+extern int expertmode;
 
 enum urqresult { urqr_normal, urqr_fail, urqr_quitmenu };
 enum quitaction { qa_noquit, qa_quitchecksave, qa_quitnochecksave };

+ 7 - 1
dselect/main.cc

@@ -53,6 +53,7 @@ const char printforhelp[]= N_("Type dselect --help for help.");
 modstatdb_rw readwrite;
 const char *admindir= ADMINDIR;
 FILE *debug;
+int expertmode = 0;
 
 static keybindings packagelistbindings(packagelist_kinterps,packagelist_korgbindings);
 
@@ -93,7 +94,7 @@ static void usage(void) {
      _("Usage: dselect [options]\n"
        "       dselect [options] action ...\n"
        "Options:  --admindir <directory>  (default is /var/lib/dpkg)\n"
-       "          --help  --version  --licence   --debug <file> | -D<file> | -D\n"
+       "          --help  --version  --licence  --expert  --debug <file> | -D<file> | -D\n"
        "Actions:  access update select install config remove quit menu\n"),
        stdout)) werr("stdout");
 }
@@ -140,11 +141,16 @@ extern "C" {
     setvbuf(debug,0,_IONBF,0);
   }
 
+  static void setexpert() {
+    expertmode = 1;
+  }
+
 } /* End of extern "C" */
 
 static const struct cmdinfo cmdinfos[]= {
   { "admindir",   0,   1,  0,  &admindir,  0                      },
   { "debug",     'D',  1,  0,  0,          setdebug               },
+  { "expert",    'E',  0,  0,  0,          setexpert              },
   { "help",      'h',  0,  0,  0,          helponly               },
   { "version",    0,   0,  0,  0,          versiononly            },
   { "licence",    0,   0,  0,  0,          showcopyright          }, /* UK spelling */

+ 4 - 2
dselect/pkgdisplay.cc

@@ -41,8 +41,10 @@ const char
 			    N_("remove"), 
 			    N_("purge"),
 			    0 },
-
-  *const eflagstrings[]=   { N_(""), 
+/* WTA: the space is a trick to work aroung gettext which uses the empty
+ * string to store information about the translation
+ */
+  *const eflagstrings[]=   { N_(" "), 
 			     N_("REINSTALL"), 
 			     0 },
 

+ 2 - 0
dselect/pkglist.cc

@@ -491,6 +491,8 @@ pkginfo **packagelist::display() {
 
   setupsigwinch();
   startdisplay();
+
+  if (!expertmode)
   displayhelp(helpmenulist(),'i');
 
   if (debug) fprintf(debug,"packagelist[%p]::display() entering loop\n",this);

+ 3 - 3
dselect/pkgtop.cc

@@ -235,9 +235,9 @@ void packagelist::redraw1itemsel(int index, int selected) {
     indent= describemany(buf,priority,section,pkg->clientdata);
 
     mvwaddstr(listpad,index,0, "    ");
-    i= total_width-6;
+    i= total_width-7;
     j= (indent<<1) + 1;
-    while (j-- >0) { waddch(listpad,'-'); i--; }
+    while (j-- >0) { waddch(listpad,ACS_HLINE); i--; }
     waddch(listpad,' ');
 
     wattrset(listpad, selected ? selstatesel_attr : selstate_attr);
@@ -247,7 +247,7 @@ void packagelist::redraw1itemsel(int index, int selected) {
 
     waddch(listpad,' ');
     j= (indent<<1) + 1;
-    while (j-- >0) { waddch(listpad,'-'); i--; }
+    while (j-- >0) { waddch(listpad,ACS_HLINE); i--; }
 
     delete[] buf;
 

+ 1 - 0
po/POTFILES.in

@@ -57,3 +57,4 @@ dselect/pkglist.cc
 dselect/pkgsublist.cc
 dselect/pkgtop.cc
 
+dselect/helpmsgs.cc

+ 7 - 0
po/update.sh

@@ -1,10 +1,17 @@
 #!/bin/sh
 
+# We need to generate helpmsgs.cc so we can translate the
+# strings in it
+
+( cd ../dselect ;  perl mkhelpmsgs.pl helpmsgs.src )
+
 xgettext --default-domain=dpkg --directory=.. \
 	 --add-comments --keyword=_ --keyword=N_ \
 	 --files-from=POTFILES.in && test ! -f dpkg.po \
 	 || ( rm -f dpkg.pot && mv dpkg.po dpkg.pot )
 
+# Moving along..
+
 catalogs=`ls *.po`
 for cat in $catalogs; do
   if [ "$cat" = "dpkg.po" ] ; then continue ; fi