RFC: [PATCH] Simplify installed.db format
Igor Peshansky
pechtcha@cs.nyu.edu
Mon Jan 23 04:28:00 GMT 2006
On Sun, 22 Jan 2006, Igor Peshansky wrote:
> The attached patch fixes the parsing of installed.db package lines.
> Comments welcome.
Oops. That patch was from an outdated diff, please use the attached patch
instead. Sorry for the confusion. The updated ChangeLog is below.
Igor
==============================================================================
2006-01-23 Igor Peshansky <pechtcha@cs.nyu.edu>
* 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.
--
http://cs.nyu.edu/~pechtcha/
|\ _,,,---,,_ pechtcha@cs.nyu.edu | igor@watson.ibm.com
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"
-------------- next part --------------
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 22 Jan 2006 05:18:25 -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 04:23:13 -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 22 Jan 2006 05:18:26 -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,10 @@ packagedb::packagedb ()
while (db->gets (line, 1000))
{
int parseable;
- src[0] = '\0';
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", pkgname, inst);
if (pkgname[0] == '\0' || inst[0] == '\0')
continue;
@@ -109,7 +105,7 @@ packagedb::packagedb ()
}
packageversion binary =
- cygpackage::createInstance (pkgname, inst, instsz, f.ver,
+ cygpackage::createInstance (pkgname, inst, f.ver,
package_installed,
package_binary);
More information about the Cygwin-apps
mailing list