[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#48104: dpkg: [PATCH] translated field names in dpkg-deb



This is completed patch for dpkg and dpkg-deb.

Note: it modifies varbufrecord function (header).

diff -Nru8 dpkg-1.4.1.17/dpkg-deb/info.c dpkg-1.4.1.17-i18n/dpkg-deb/info.c
--- dpkg-1.4.1.17/dpkg-deb/info.c	Wed Oct 20 00:14:43 1999
+++ dpkg-1.4.1.17-i18n/dpkg-deb/info.c	Sat Oct 23 17:43:01 1999
@@ -32,16 +32,21 @@
 #include <limits.h>
 #include <ctype.h>
 
 #include <config.h>
 #include <dpkg.h>
 #include <myopt.h>
 #include "dpkg-deb.h"
 
+const char *translatedfields[]= {
+  "Essential",
+  "Priority"
+};
+
 static void cu_info_prepare(int argc, void **argv) {
   pid_t c1;
   int status;
   char *directory;
   struct stat stab;
 
   directory= (char*)(argv[0]);
   if (chdir("/")) { perror(_("failed to chdir to `/' for cleanup")); return; }
@@ -102,16 +107,66 @@
     } else {
       ohshite(_("open component `%.255s' (in %.255s) failed in an unexpected way"),
               component, directory);
     }
   }
   if (re) ohshit(_("at least one requested control component missing"));
 }
 
+static void info_control(const char *debar, const char *directory, const int ident) {
+  char fieldname[MAXFIELDNAME+1], fieldvalue[MAXFIELDNAME+1];
+  int lines;
+  char *pf;
+  FILE *cc;
+  const char *const *fp;
+  int c;
+  int translating, fnl;
+
+  if (!(cc= fopen("control","r"))) {
+    if (errno != ENOENT) ohshite(_("failed to read `control' (in `%.255s')"),directory);
+    if (fputs(_("(no `control' file in control archive!)\n"),stdout) < 0) werr("stdout");
+  } else {
+    lines= 1;
+    while ((c= getc(cc))!= EOF) {
+      if (ident)
+        if (lines) if (putc(' ',stdout) == EOF) werr("stdout");
+
+      if (!isspace(c)) {
+        for (pf=fieldname, fnl=0;
+           fnl <= MAXFIELDNAME && c!=EOF && !isspace(c) && c!=':';
+           c= getc(cc)) { *pf++= c; fnl++; }
+        *pf++= 0;
+        fputs(_(fieldname),stdout);
+
+	while(c!=EOF && c!='\n' && isspace(c)) {
+	  putc(c,stdout);
+	  c = getc(cc);
+        }
+	if(c!=EOF && c!='\n' && !isspace(c)) {
+          translating=0;
+          for (fp=translatedfields; !translating && *fp; fp++)
+            if (!strcasecmp(*fp,fieldname)) translating=1;
+          if (translating) {
+            for (pf=fieldvalue, fnl=0;
+               fnl <= MAXFIELDNAME && c!=EOF && !isspace(c) && c!='\n';
+               c= getc(cc)) { *pf++= c; fnl++; }
+            *pf++= 0;
+            fputs(_(fieldvalue),stdout);
+          }
+        }
+      }
+
+      if (putc(c,stdout) == EOF) werr("stdout");
+      lines= c=='\n';
+    }
+    if (!lines) if (putc('\n',stdout) == EOF) werr("stdout");
+  }
+}
+
 static void info_list(const char *debar, const char *directory) {
   char interpreter[INTERPRETER_MAX+1], *p;
   int il, lines;
   struct dirent **cdlist, *cdep;
   int cdn;
   FILE *cc;
   struct stat stab;
   int c;
@@ -147,55 +202,69 @@
                  S_IXUSR & stab.st_mode ? '*' : ' ',
                  cdep->d_name, interpreter) == EOF)
         werr("stdout");
     } else {
       if (printf(_("     not a plain file          %.255s\n"),cdep->d_name) == EOF)
         werr("stdout");
     }
   }
-  if (!(cc= fopen("control","r"))) {
-    if (errno != ENOENT) ohshite(_("failed to read `control' (in `%.255s')"),directory);
-    if (fputs(_("(no `control' file in control archive!)\n"),stdout) < 0) werr("stdout");
-  } else {
-    lines= 1;
-    while ((c= getc(cc))!= EOF) {
-      if (lines) if (putc(' ',stdout) == EOF) werr("stdout");
-      if (putc(c,stdout) == EOF) werr("stdout");
-      lines= c=='\n';
-    }
-    if (!lines) if (putc('\n',stdout) == EOF) werr("stdout");
-  }
+  info_control(debar, directory, 1);
 }
 
 static void info_field(const char *debar, const char *directory,
                        const char *const *fields, int showfieldname) {
   FILE *cc;
-  char fieldname[MAXFIELDNAME+1];
+  char fieldname[MAXFIELDNAME+1], fieldvalue[MAXFIELDNAME+1];
   char *pf;
   const char *const *fp;
-  int doing, c, lno, fnl;
+  int doing, translating, c, lno, fnl;
 
   if (!(cc= fopen("control","r"))) ohshite(_("could not open the `control' component"));
   doing= 1; lno= 1;
   for (;;) {
     c= getc(cc);  if (c==EOF) { doing=0; break; }
     if (c == '\n') { lno++; doing=1; continue; }
     if (!isspace(c)) {
       doing= 0;
       for (pf=fieldname, fnl=0;
            fnl <= MAXFIELDNAME && c!=EOF && !isspace(c) && c!=':';
            c= getc(cc)) { *pf++= c; fnl++; }
       *pf++= 0;
       doing= fnl >= MAXFIELDNAME || c=='\n' || c==EOF;
       for (fp=fields; !doing && *fp; fp++)
         if (!strcasecmp(*fp,fieldname)) doing=1;
       if (showfieldname) {
-        if (doing)
-          fputs(fieldname,stdout);
+        if (doing) {
+          fputs(_(fieldname),stdout);
+
+	if (c==':') {
+	  putc(c,stdout);
+	  c = getc(cc);
+ 
+	while(c!=EOF && c!='\n' && isspace(c)) {
+	  putc(c,stdout);
+	  c = getc(cc);
+        }
+	if(c!=EOF && c!='\n' && !isspace(c)) {
+          translating=0;
+          for (fp=translatedfields; !translating && *fp; fp++)
+            if (!strcasecmp(*fp,fieldname)) translating=1;
+          if (translating) {
+            for (pf=fieldvalue, fnl=0;
+               fnl <= MAXFIELDNAME && c!=EOF && !isspace(c) && c!='\n';
+               c= getc(cc)) { *pf++= c; fnl++; }
+            *pf++= 0;
+            fputs(_(fieldvalue),stdout);
+          }
+        }
+
+        } }
+
+
       } else {
         if (c==':') c= getc(cc);
         while (c != '\n' && isspace(c)) c= getc(cc);
       }
     }
     for(;;) {
       if (c == EOF) break;
       if (doing) putc(c,stdout);
@@ -223,18 +292,17 @@
 
 void do_field(const char *const *argv) {
   const char *debar, *directory;
 
   info_prepare(&argv,&debar,&directory,1);
   if (*argv) {
     info_field(debar, directory, argv, argv[1]!=0);
   } else {
-    static const char *const controlonly[]= { "control", 0 };
-    info_spew(debar,directory, controlonly);
+    info_control(debar, directory, 0);
   }
 }
 
 void do_contents(const char *const *argv) {
   const char *debar;
   
   if (!(debar= *argv++) || *argv) badusage(_("--contents takes exactly one argument"));
   extracthalf(debar, 0, "tv", 0);
diff -Nru8 dpkg-1.4.1.17/dselect/pkginfo.cc dpkg-1.4.1.17-i18n/dselect/pkginfo.cc
--- dpkg-1.4.1.17/dselect/pkginfo.cc	Mon Sep 27 02:39:09 1999
+++ dpkg-1.4.1.17-i18n/dselect/pkginfo.cc	Sat Oct 23 19:57:32 1999
@@ -128,33 +128,33 @@
 void packagelist::itd_statuscontrol() {
   werase(infopad);
   if (!table[cursorline]->pkg->name) {
     severalinfoblurb("currently installed control info");
   } else {
     whatinfovb("installed control info for ");
     whatinfovb(table[cursorline]->pkg->name);
     varbuf vb;
-    varbufrecord(&vb,table[cursorline]->pkg,&table[cursorline]->pkg->installed);
+    varbufrecord(&vb,table[cursorline]->pkg,&table[cursorline]->pkg->installed,1);
     vb.terminate();
     if (debug)
       fprintf(debug,"packagelist[%p]::idt_statuscontrol(); `%s'\n",this,vb.string());
     waddstr(infopad,vb.string());
   }
 }
 
 void packagelist::itd_availablecontrol() {
   werase(infopad);
   if (!table[cursorline]->pkg->name) {
     severalinfoblurb("available version of control file info");
   } else {
     whatinfovb("available version of control info for ");
     whatinfovb(table[cursorline]->pkg->name);
     varbuf vb;
-    varbufrecord(&vb,table[cursorline]->pkg,&table[cursorline]->pkg->available);
+    varbufrecord(&vb,table[cursorline]->pkg,&table[cursorline]->pkg->available,1);
     vb.terminate();
     if (debug)
       fprintf(debug,"packagelist[%p]::idt_availablecontrol(); `%s'\n",this,vb.string());
     waddstr(infopad,vb.string());
   }
 }
 
 void packagelist::redrawinfo() {
diff -Nru8 dpkg-1.4.1.17/include/dpkg-db.h dpkg-1.4.1.17-i18n/include/dpkg-db.h
--- dpkg-1.4.1.17/include/dpkg-db.h	Mon Sep 27 02:39:09 1999
+++ dpkg-1.4.1.17-i18n/include/dpkg-db.h	Sat Oct 23 19:56:25 1999
@@ -274,17 +274,18 @@
 
 /*** from dump.c ***/
 
 void writerecord(FILE*, const char*,
                  const struct pkginfo*, const struct pkginfoperfile*);
 
 void writedb(const char *filename, int available, int mustsync);
 
-void varbufrecord(struct varbuf*, const struct pkginfo*, const struct pkginfoperfile*);
+void varbufrecord(struct varbuf*, const struct pkginfo*, const struct pkginfoperfile*, 
+	          const int translating);
 void varbufdependency(struct varbuf *vb, struct dependency *dep);
 void varbufprintf(struct varbuf *v, const char *fmt, ...) PRINTFFORMAT(2,3);
   /* NB THE VARBUF MUST HAVE BEEN INITIALISED AND WILL NOT BE NULL-TERMINATED */
 
 /*** from vercmp.c ***/
 
 int versionsatisfied(struct pkginfoperfile *it, struct deppossi *against);
 int versionsatisfied3(const struct versionrevision *it,
diff -Nru8 dpkg-1.4.1.17/lib/dbmodify.c dpkg-1.4.1.17-i18n/lib/dbmodify.c
--- dpkg-1.4.1.17/lib/dbmodify.c	Mon Sep 27 02:39:09 1999
+++ dpkg-1.4.1.17-i18n/lib/dbmodify.c	Sat Oct 23 19:57:47 1999
@@ -220,17 +220,17 @@
 }
 
 void modstatdb_note(struct pkginfo *pkg) {
   assert(cstatus >= msdbrw_write);
 
   onerr_abort++;
 
   varbufreset(&uvb);
-  varbufrecord(&uvb, pkg, &pkg->installed);
+  varbufrecord(&uvb, pkg, &pkg->installed,0);
   if (fwrite(uvb.buf, 1, uvb.used, importanttmp) != uvb.used)
     ohshite(_("unable to write updated status of `%.250s'"), pkg->name);
   if (fflush(importanttmp))
     ohshite(_("unable to flush updated status of `%.250s'"), pkg->name);
   if (ftruncate(fileno(importanttmp), uvb.used))
     ohshite(_("unable to truncate for updated status of `%.250s'"), pkg->name);
   if (fsync(fileno(importanttmp)))
     ohshite(_("unable to fsync updated status of `%.250s'"), pkg->name);
diff -Nru8 dpkg-1.4.1.17/lib/dump.c dpkg-1.4.1.17-i18n/lib/dump.c
--- dpkg-1.4.1.17/lib/dump.c	Thu Oct 21 12:38:39 1999
+++ dpkg-1.4.1.17-i18n/lib/dump.c	Sat Oct 23 20:08:20 1999
@@ -30,119 +30,132 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 
 #include <config.h>
 #include <dpkg.h>
 #include <dpkg-db.h>
 #include "parsedump.h"
 
+int fieldstranslating = 0;
+#define T_(text) ( fieldstranslating ? _((text)) : (text) )
+
 void w_name(struct varbuf *vb,
             const struct pkginfo *pigp, const struct pkginfoperfile *pifp,
             const struct fieldinfo *fip) {
   assert(pigp->name);
-  varbufaddstr(vb,"Package: "); varbufaddstr(vb, pigp->name);
+  varbufaddstr(vb,T_("Package")); 
+  varbufaddstr(vb,": "); 
+  varbufaddstr(vb, pigp->name);
   varbufaddc(vb,'\n');
 }
 
 void w_version(struct varbuf *vb,
                const struct pkginfo *pigp, const struct pkginfoperfile *pifp,
                const struct fieldinfo *fip) {
   /* Epoch and revision information is printed in version field too. */
   if (!informativeversion(&pifp->version)) return;
-  varbufaddstr(vb,"Version: ");
+  varbufaddstr(vb,T_("Version"));
+  varbufaddstr(vb,": "); 
   varbufversion(vb,&pifp->version,vdew_nonambig);
   varbufaddc(vb,'\n');
 }
 
 void w_configversion(struct varbuf *vb,
                      const struct pkginfo *pigp, const struct pkginfoperfile *pifp,
                      const struct fieldinfo *fip) {
   if (pifp != &pigp->installed) return;
   if (!informativeversion(&pigp->configversion)) return;
   if (pigp->status == stat_installed || pigp->status == stat_notinstalled) return;
-  varbufaddstr(vb,"Config-Version: ");
+  varbufaddstr(vb,T_("Config-Version"));
+  varbufaddstr(vb,": "); 
   varbufversion(vb,&pigp->configversion,vdew_nonambig);
   varbufaddc(vb,'\n');
 }
 
 void w_null(struct varbuf *vb,
             const struct pkginfo *pigp, const struct pkginfoperfile *pifp,
             const struct fieldinfo *fip) {
 }
 
 void w_section(struct varbuf *vb,
                const struct pkginfo *pigp, const struct pkginfoperfile *pifp,
                const struct fieldinfo *fip) {
   const char *value= pigp->section;
   if (!value || !*value) return;
-  varbufaddstr(vb,"Section: ");
+  varbufaddstr(vb,T_("Section"));
+  varbufaddstr(vb,": "); 
   varbufaddstr(vb,value);
   varbufaddc(vb,'\n');
 }
 
 void w_charfield(struct varbuf *vb,
                  const struct pkginfo *pigp, const struct pkginfoperfile *pifp,
                  const struct fieldinfo *fip) {
   const char *value= pifp->valid ? PKGPFIELD(pifp,fip->integer,char*) : 0;
   if (!value || !*value) return;
-  varbufaddstr(vb,fip->name); varbufaddstr(vb, ": "); varbufaddstr(vb,value);
+  varbufaddstr(vb,T_(fip->name)); varbufaddstr(vb, ": "); varbufaddstr(vb,value);
   varbufaddc(vb,'\n');
 }
 
 void w_filecharf(struct varbuf *vb,
                  const struct pkginfo *pigp, const struct pkginfoperfile *pifp,
                  const struct fieldinfo *fip) {
   struct filedetails *fdp;
   
   if (pifp != &pigp->available) return;
   fdp= pigp->files;
   if (!fdp || !FILEFFIELD(fdp,fip->integer,char*)) return;
-  varbufaddstr(vb,fip->name); varbufaddc(vb,':');
+  varbufaddstr(vb,T_(fip->name)); varbufaddc(vb,':');
   while (fdp) {
     varbufaddc(vb,' ');
     varbufaddstr(vb,FILEFFIELD(fdp,fip->integer,char*));
     fdp= fdp->next;
   }
   varbufaddc(vb,'\n');
 }
 
 void w_booleandefno(struct varbuf *vb,
                     const struct pkginfo *pigp, const struct pkginfoperfile *pifp,
                     const struct fieldinfo *fip) {
   int value= pifp->valid ? PKGPFIELD(pifp,fip->integer,int) : 0;
   if (!value) return;
   assert(value==1);
-  varbufaddstr(vb,"Essential: yes\n");
+  varbufaddstr(vb,T_("Essential"));
+  varbufaddstr(vb,": "); 
+  varbufaddstr(vb,T_("yes"));
+  varbufaddc(vb,'\n'); 
 }
 
 void w_priority(struct varbuf *vb,
                 const struct pkginfo *pigp, const struct pkginfoperfile *pifp,
                 const struct fieldinfo *fip) {
   if (pigp->priority == pri_unknown) return;
   assert(pigp->priority <= pri_unknown);
-  varbufaddstr(vb,"Priority: ");
-  varbufaddstr(vb,
+  varbufaddstr(vb,T_("Priority"));
+  varbufaddstr(vb,": "); 
+  varbufaddstr(vb, _(
                pigp->priority == pri_other
                ? pigp->otherpriority
-               : priorityinfos[pigp->priority].name);
+               : priorityinfos[pigp->priority].name ) );
   varbufaddc(vb,'\n');
 }
 
 void w_status(struct varbuf *vb,
               const struct pkginfo *pigp, const struct pkginfoperfile *pifp,
               const struct fieldinfo *fip) {
   if (pifp != &pigp->installed) return;
   assert(pigp->want <= want_purge &&
          pigp->eflag <= eflagv_reinstreq && /* hold and hold-reinstreq NOT allowed */
          pigp->status <= stat_configfiles);
-  varbufaddstr(vb,"Status: ");
-  varbufaddstr(vb,wantinfos[pigp->want].name); varbufaddc(vb,' ');
-  varbufaddstr(vb,eflaginfos[pigp->eflag].name); varbufaddc(vb,' ');
-  varbufaddstr(vb,statusinfos[pigp->status].name); varbufaddc(vb,'\n');
+  varbufaddstr(vb,T_("Status"));
+  varbufaddstr(vb,": "); 
+  varbufaddstr(vb,T_(wantinfos[pigp->want].name)); varbufaddc(vb,' ');
+  varbufaddstr(vb,T_(eflaginfos[pigp->eflag].name)); varbufaddc(vb,' ');
+  varbufaddstr(vb,T_(statusinfos[pigp->status].name)); varbufaddc(vb,'\n');
 }
 
 void varbufdependency(struct varbuf *vb, struct dependency *dep) {
   struct deppossi *dop;
   const char *possdel;
 
   possdel= "";
   for (dop= dep->list; dop; dop= dop->next) {
@@ -169,64 +182,68 @@
 void w_dependency(struct varbuf *vb,
                   const struct pkginfo *pigp, const struct pkginfoperfile *pifp,
                   const struct fieldinfo *fip) {
   char fnbuf[50];
   const char *depdel;
   struct dependency *dyp;
 
   if (!pifp->valid) return;
-  sprintf(fnbuf,"%s: ",fip->name); depdel= fnbuf;
+  sprintf(fnbuf,"%s: ",T_(fip->name)); depdel= fnbuf;
   for (dyp= pifp->depends; dyp; dyp= dyp->next) {
     if (dyp->type != fip->integer) continue;
     assert(dyp->up == pigp);
     varbufaddstr(vb,depdel); depdel= ", ";
     varbufdependency(vb,dyp);
   }
   if (depdel != fnbuf) varbufaddc(vb,'\n');
 }
 
 void w_conffiles(struct varbuf *vb,
                  const struct pkginfo *pigp, const struct pkginfoperfile *pifp,
                  const struct fieldinfo *fip) {
   struct conffile *i;
 
   if (!pifp->valid || !pifp->conffiles || pifp == &pigp->available) return;
-  varbufaddstr(vb,"Conffiles:\n");
+  varbufaddstr(vb,T_("Conffiles")); 
+  varbufaddstr(vb, ":\n");
   for (i=pifp->conffiles; i; i= i->next) {
     varbufaddc(vb,' '); varbufaddstr(vb,i->name); varbufaddc(vb,' ');
     varbufaddstr(vb,i->hash); varbufaddc(vb,'\n');
   }
 }
 
 void varbufrecord(struct varbuf *vb,
-                  const struct pkginfo *pigp, const struct pkginfoperfile *pifp) {
+                  const struct pkginfo *pigp, const struct pkginfoperfile *pifp,
+		  const int translating) {
   const struct fieldinfo *fip;
   const struct arbitraryfield *afp;
 
+  fieldstranslating = translating;
   for (fip= fieldinfos; fip->name; fip++) {
     fip->wcall(vb,pigp,pifp,fip);
   }
   if (pifp->valid) {
     for (afp= pifp->arbs; afp; afp= afp->next) {
-      varbufaddstr(vb,afp->name); varbufaddstr(vb,": ");
+      varbufaddstr(vb,T_(afp->name)); varbufaddstr(vb,": ");
       varbufaddstr(vb,afp->value); varbufaddc(vb,'\n');
     }
   }
+  fieldstranslating = 0;
 }
 
 void writerecord(FILE *file, const char *filename,
                  const struct pkginfo *pigp, const struct pkginfoperfile *pifp) {
   struct varbuf vb;
 
   varbufinit(&vb);
-  varbufrecord(&vb,pigp,pifp);
+  varbufrecord(&vb,pigp,pifp,1);
   varbufaddc(&vb,'\0');
   if (fputs(vb.buf,file) < 0)
-    ohshite("failed to write details of `%.50s' to `%.250s'", pigp->name, filename);
+    ohshite(_("failed to write details of `%.50s' to `%.250s'"), pigp->name, filename);
 }
 
 void writedb(const char *filename, int available, int mustsync) {
   static char writebuf[8192];
   
   struct pkgiterator *it;
   struct pkginfo *pigp;
   struct pkginfoperfile *pifp;
@@ -252,17 +269,17 @@
     ohshite(_("unable to set buffering on status file"));
 
   it= iterpkgstart();
   while ((pigp= iterpkgnext(it)) != 0) {
     pifp= available ? &pigp->available : &pigp->installed;
     /* Don't dump records which have no useful content. */
     if (!informative(pigp,pifp)) continue;
     if (!pifp->valid) blankpackageperfile(pifp);
-    varbufrecord(&vb,pigp,pifp);
+    varbufrecord(&vb,pigp,pifp,0);
     varbufaddc(&vb,'\n'); varbufaddc(&vb,0);
     if (fputs(vb.buf,file) < 0)
       ohshite(_("failed to write %s record about `%.50s' to `%.250s'"),
               which, pigp->name, filename);
     varbufreset(&vb);      
   }
   varbuffree(&vb);
   if (mustsync) {
diff -Nru8 dpkg-1.4.1.17/lib/parse.c dpkg-1.4.1.17-i18n/lib/parse.c
--- dpkg-1.4.1.17/lib/parse.c	Thu Oct 21 12:38:39 1999
+++ dpkg-1.4.1.17-i18n/lib/parse.c	Sat Oct 23 17:43:01 1999
@@ -26,41 +26,41 @@
 
 #include <config.h>
 #include <dpkg.h>
 #include <dpkg-db.h>
 #include "parsedump.h"
 
 const struct fieldinfo fieldinfos[]= {
   /* NB: capitalisation of these strings is important. */
-  { "Package",          f_name,            w_name                                     },
-  { "Essential",        f_boolean,         w_booleandefno,   PKGIFPOFF(essential)     },
-  { "Status",           f_status,          w_status                                   },
-  { "Priority",         f_priority,        w_priority                                 },
-  { "Section",          f_section,         w_section                                  },
-  { "Installed-Size",   f_charfield,       w_charfield,      PKGIFPOFF(installedsize) },
-  { "Maintainer",       f_charfield,       w_charfield,      PKGIFPOFF(maintainer)    },
-  { "Architecture",     f_charfield,       w_charfield,      PKGIFPOFF(architecture)  },
-  { "Source",           f_charfield,       w_charfield,      PKGIFPOFF(source)        },
-  { "Version",          f_version,         w_version                                  },
-  { "Revision",         f_revision,        w_null                                     },
-  { "Config-Version",   f_configversion,   w_configversion                            },
-  { "Replaces",         f_dependency,      w_dependency,     dep_replaces             },
-  { "Provides",         f_dependency,      w_dependency,     dep_provides             },
-  { "Depends",          f_dependency,      w_dependency,     dep_depends              },
-  { "Pre-Depends",      f_dependency,      w_dependency,     dep_predepends           },
-  { "Recommends",       f_dependency,      w_dependency,     dep_recommends           },
-  { "Suggests",         f_dependency,      w_dependency,     dep_suggests             },
-  { "Conflicts",        f_dependency,      w_dependency,     dep_conflicts            },
-  { "Conffiles",        f_conffiles,       w_conffiles                                },
-  { "Filename",         f_filecharf,       w_filecharf,      FILEFOFF(name)           },
-  { "Size",             f_filecharf,       w_filecharf,      FILEFOFF(size)           },
-  { "MD5sum",           f_filecharf,       w_filecharf,      FILEFOFF(md5sum)         },
-  { "MSDOS-Filename",   f_filecharf,       w_filecharf,      FILEFOFF(msdosname)      },
-  { "Description",      f_charfield,       w_charfield,      PKGIFPOFF(description)   },
+  { N_("Package"),          f_name,            w_name                                     },
+  { N_("Essential"),        f_boolean,         w_booleandefno,   PKGIFPOFF(essential)     },
+  { N_("Status"),           f_status,          w_status                                   },
+  { N_("Priority"),         f_priority,        w_priority                                 },
+  { N_("Section"),          f_section,         w_section                                  },
+  { N_("Installed-Size"),   f_charfield,       w_charfield,      PKGIFPOFF(installedsize) },
+  { N_("Maintainer"),       f_charfield,       w_charfield,      PKGIFPOFF(maintainer)    },
+  { N_("Architecture"),     f_charfield,       w_charfield,      PKGIFPOFF(architecture)  },
+  { N_("Source"),           f_charfield,       w_charfield,      PKGIFPOFF(source)        },
+  { N_("Version"),          f_version,         w_version                                  },
+  { N_("Revision"),         f_revision,        w_null                                     },
+  { N_("Config-Version"),   f_configversion,   w_configversion                            },
+  { N_("Replaces"),         f_dependency,      w_dependency,     dep_replaces             },
+  { N_("Provides"),         f_dependency,      w_dependency,     dep_provides             },
+  { N_("Depends"),          f_dependency,      w_dependency,     dep_depends              },
+  { N_("Pre-Depends"),      f_dependency,      w_dependency,     dep_predepends           },
+  { N_("Recommends"),       f_dependency,      w_dependency,     dep_recommends           },
+  { N_("Suggests"),         f_dependency,      w_dependency,     dep_suggests             },
+  { N_("Conflicts"),        f_dependency,      w_dependency,     dep_conflicts            },
+  { N_("Conffiles"),        f_conffiles,       w_conffiles                                },
+  { N_("Filename"),         f_filecharf,       w_filecharf,      FILEFOFF(name)           },
+  { N_("Size"),             f_filecharf,       w_filecharf,      FILEFOFF(size)           },
+  { N_("MD5sum"),           f_filecharf,       w_filecharf,      FILEFOFF(md5sum)         },
+  { N_("MSDOS-Filename"),   f_filecharf,       w_filecharf,      FILEFOFF(msdosname)      },
+  { N_("Description"),      f_charfield,       w_charfield,      PKGIFPOFF(description)   },
   /* Note that aliases are added to the nicknames table in parsehelp.c. */
   {  0   /* sentinel - tells code that list is ended */                               }
 };
 #define NFIELDS (sizeof(fieldinfos)/sizeof(struct fieldinfo))
 const int nfields= NFIELDS;
 
 static void cu_parsedb(int argc, void **argv) { fclose((FILE*)*argv); }
 
diff -Nru8 dpkg-1.4.1.17/lib/parsehelp.c dpkg-1.4.1.17-i18n/lib/parsehelp.c
--- dpkg-1.4.1.17/lib/parsehelp.c	Fri Jan 29 09:54:00 1999
+++ dpkg-1.4.1.17-i18n/lib/parsehelp.c	Sat Oct 23 17:46:47 1999
@@ -51,63 +51,63 @@
     strcat(q,"\n");
     if (vfprintf(warnto,buf2,al) == EOF)
       ohshite(_("failed to write parsing warning"));
   }
   va_end(al);
 }
 
 const struct namevalue booleaninfos[]= {  /* Note !  These must be in order ! */
-  { "no",                             0                  },
-  { "yes",                            1                  },
+  { N_("no"),                             0                  },
+  { N_("yes"),                            1                  },
   {  0                                                   }
 };
 
 const struct namevalue priorityinfos[]= {  /* Note !  These must be in order ! */
-  { "required",                       pri_required     },
-  { "important",                      pri_important    },
-  { "standard",                       pri_standard     },
-  { "recommended",                    pri_recommended  }, /* fixme: obsolete */
-  { "optional",                       pri_optional     },
-  { "extra",                          pri_extra        },
-  { "contrib",                        pri_contrib      }, /* fixme: keep? */
-  { "this is a bug - please report",  pri_other        },
-  { "unknown",                        pri_unknown      },
+  { N_("required"),                       pri_required     },
+  { N_("important"),                      pri_important    },
+  { N_("standard"),                       pri_standard     },
+  { N_("recommended"),                    pri_recommended  }, /* fixme: obsolete */
+  { N_("optional"),                       pri_optional     },
+  { N_("extra"),                          pri_extra        },
+  { N_("contrib"),                        pri_contrib      }, /* fixme: keep? */
+  { N_("this is a bug - please report"),  pri_other        },
+  { N_("unknown"),                        pri_unknown      },
   
-  { "base",                           pri_required     }, /* fixme: alias, remove */
+  { N_("base"),                           pri_required     }, /* fixme: alias, remove */
   {  0                                                 }
 };
 
 const struct namevalue statusinfos[]= {  /* Note !  These must be in order ! */
-  { "not-installed",   stat_notinstalled    },
-  { "unpacked",        stat_unpacked        },
-  { "half-configured", stat_halfconfigured  },
-  { "installed",       stat_installed       },
-  { "half-installed",  stat_halfinstalled   },
-  { "config-files",    stat_configfiles     },
+  { N_("not-installed"),   stat_notinstalled    },
+  { N_("unpacked"),        stat_unpacked        },
+  { N_("half-configured"), stat_halfconfigured  },
+  { N_("installed"),       stat_installed       },
+  { N_("half-installed"),  stat_halfinstalled   },
+  { N_("config-files"),    stat_configfiles     },
   /* These are additional entries for reading only, in any order ... */
-  { "postinst-failed", stat_halfconfigured  }, /* fixme: backwards compat., remove */
-  { "removal-failed",  stat_halfinstalled   }, /* fixme: backwards compat., remove */
+  { N_("postinst-failed"), stat_halfconfigured  }, /* fixme: backwards compat., remove */
+  { N_("removal-failed"),  stat_halfinstalled   }, /* fixme: backwards compat., remove */
   {  0                                      }
 };
 
 const struct namevalue eflaginfos[]= {  /* Note !  These must be in order ! */
-  { "ok",                      eflagv_ok                 },
-  { "reinstreq",               eflagv_reinstreq          },
-  { "hold",                    eflagv_obsoletehold       },
-  { "hold-reinstreq",          eflagv_obsoleteboth       },
+  { N_("ok"),                      eflagv_ok                 },
+  { N_("reinstreq"),               eflagv_reinstreq          },
+  { N_("hold"),                    eflagv_obsoletehold       },
+  { N_("hold-reinstreq"),          eflagv_obsoleteboth       },
   {  0                                                   }
 };
 
 const struct namevalue wantinfos[]= {  /* Note !  These must be in order ! */
-  { "unknown",   want_unknown    },
-  { "install",   want_install    },
-  { "hold",      want_hold       },
-  { "deinstall", want_deinstall  },
-  { "purge",     want_purge      },
+  { N_("unknown"),   want_unknown    },
+  { N_("install"),   want_install    },
+  { N_("hold"),      want_hold       },
+  { N_("deinstall"), want_deinstall  },
+  { N_("purge"),     want_purge      },
   {  0                           }
 };
 
 const char *illegal_packagename(const char *p, const char **ep) {
   static const char alsoallowed[]= "-+._"; /* _ is deprecated */
   static char buf[150];
   int c;
   
@@ -124,21 +124,21 @@
   snprintf(buf, sizeof(buf),
           _("character `%c' not allowed - only letters, digits and %s allowed"),
           c, alsoallowed);
   return buf;
 }
 
 const struct nickname nicknames[]= {
   /* NB: capitalisation of these strings is important. */
-  { "Recommended",       "Recommends"  },
-  { "Optional",          "Suggests"    },
-  { "Class",             "Priority"    },
-  { "Package-Revision",  "Revision"    },
-  { "Package_Revision",  "Revision"    },
+  { N_("Recommended"),       "Recommends"  },
+  { N_("Optional"),          "Suggests"    },
+  { N_("Class"),             "Priority"    },
+  { N_("Package-Revision"),  "Revision"    },
+  { N_("Package_Revision"),  "Revision"    },
   {  0                                 }
 };
 
 int informativeversion(const struct versionrevision *version) {
   return (version->epoch ||
           (version->version && *version->version) ||
           (version->revision && *version->revision));
 }


-- 

Piotr "Dexter" Roszatycki
mailto:dexter@fnet.pl


Reply to: