On Mon, 23 Jan 2006, Igor Peshansky wrote:

> : > The attached patch fixes the parsing of installed.db package lines.
> : > Comments welcome.
> : >
> : > 2006-01-23  Igor Peshansky  <[EMAIL PROTECTED]>
> : >
> : >   * cygpackage.h (filesize): Remove unused field.
> : >   (cygpackage::createInstance): Ditto.
> : >   * cygpackage.cc (cygpackage::createInstance): Ditto.
> : >   * package_db.cc (packagedb::packagedb): Remove unused variables.
> : >   Simplify parsing of installed.db.
>
> In fact, let's use the attached patch instead.

YA ping?
        Igor
-- 
                                http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_            [EMAIL PROTECTED] | [EMAIL PROTECTED]
ZZZzz /,`.-'`'    -.  ;-;;,_            Igor Peshansky, Ph.D. (name changed!)
     |,4-  ) )-,_. ,\ (  `'-'           old name: Igor Pechtchanski
    '---''(_/--'  `-'\_) fL     a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte."
"But no -- you are no fool; you call yourself a fool, there's proof enough in
that!" -- Rostand, "Cyrano de Bergerac"
Index: setup/cygpackage.cc
===================================================================
RCS file: /cvs/cygwin-apps/setup/cygpackage.cc,v
retrieving revision 2.15
diff -u -p -r2.15 cygpackage.cc
--- setup/cygpackage.cc 14 May 2005 15:57:29 -0000      2.15
+++ setup/cygpackage.cc 23 Jan 2006 15:06:52 -0000
@@ -66,7 +66,7 @@ cygpackage::createInstance (const String
 
 packageversion
 cygpackage::createInstance (String const &pkgname, String const &filename,
-                           size_t const fs, String const &version,
+                           String const &version,
                            package_status_t const newstatus,
                            package_type_t const newtype)
 {
@@ -75,7 +75,6 @@ cygpackage::createInstance (String const
   temp->fn = filename;
   temp->status = newstatus;
   temp->type = newtype;
-  temp->filesize = fs;
   temp->setCanonicalVersion (version);
   return packageversion(temp);
 }
Index: setup/cygpackage.h
===================================================================
RCS file: /cvs/cygwin-apps/setup/cygpackage.h,v
retrieving revision 2.15
diff -u -p -r2.15 cygpackage.h
--- setup/cygpackage.h  14 May 2005 15:57:29 -0000      2.15
+++ setup/cygpackage.h  23 Jan 2006 15:06:52 -0000
@@ -72,7 +72,7 @@ public:
                                         const package_type_t type);
 
   static packageversion createInstance (String const &, String const &, 
-                                       size_t const, String const &,
+                                       String const &,
                                        package_status_t const, 
                                        package_type_t const);
 
@@ -92,7 +92,6 @@ private:
   package_type_t type;
 
   io_stream *listdata, *listfile;
-  size_t filesize;
 };
 
 #endif /* SETUP_CYGPACKAGE_H */
Index: setup/package_db.cc
===================================================================
RCS file: /cvs/cygwin-apps/setup/package_db.cc,v
retrieving revision 2.30
diff -u -p -r2.30 package_db.cc
--- setup/package_db.cc 14 Oct 2005 04:10:26 -0000      2.30
+++ setup/package_db.cc 23 Jan 2006 15:06:53 -0000
@@ -57,8 +57,8 @@ packagedb::packagedb ()
       if (!db)
        return;
       /* flush_local_db_package_data */
-      char line[1000], pkgname[1000], inst[1000], src[1000];
-      int instsz, srcsz;
+      char line[1000], pkgname[1000], inst[1000];
+      int instsz;
 
       if (db->gets (line, 1000))
        {
@@ -80,14 +80,11 @@ packagedb::packagedb ()
              while (db->gets (line, 1000))
                {
                  int parseable;
-                 src[0] = '\0';
+                 int ign;
                  pkgname[0] = '\0';
                  inst[0] = '\0';
-                 srcsz = 0;
-                 instsz = 0;
 
-                 sscanf (line, "%s %s %d %s %d", pkgname, inst, &instsz, src,
-                         &srcsz);
+                 sscanf (line, "%s %s %d", pkgname, inst, &ign);
 
                  if (pkgname[0] == '\0' || inst[0] == '\0')
                        continue;
@@ -109,7 +106,7 @@ packagedb::packagedb ()
                    }
 
                  packageversion binary = 
-                   cygpackage::createInstance (pkgname, inst, instsz, f.ver,
+                   cygpackage::createInstance (pkgname, inst, f.ver,
                                                package_installed,
                                                package_binary);
 

Reply via email to