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

Re: Description-less packages file



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Andreas,

I volunteered the other day to look at incorporating Description-md5 into 
UDD and the attached patch deals with this change in the packages tables. I 
think it is ready to apply to UDD right now as a pre-requisite to fixing the 
ddtp gatherer (I applied it to my local UDD a week or so ago); unless anyone 
has any comments on it, I guess I'll commit it to svn soon.

> I have written the UDD importer for DDTP descriptions and noticed
> that the location where I was drawing the dscriptions from are not
> featuring the English version.  Any hint were to get these?

Sure -- there's a i18n/Translation-en file in the same location as the other 
translations on the mirrors. That file is in the same format, mapping 
Description-md5 to the English version of the description.

The Description-md5 that is in the Packages and Translation files and the 
values that UDD has been calculating from description and long_description 
for the ddtp table are identical which should make it easier to adapt to the 
new setup -- much of the work done by the ddtp gatherer is now done by dak 
instead which in the long run should make the gatherer much simpler.

Finding the English long-description for a package will now need to be done 
with a join against the ddtp table. For UDD users that just want the English 
text, this is a little more work, but for ddtp, I suspect this will actually 
be a lot easier because everything is in the same table.

Are you happy to take on fixing the ddtp gatherer and whatever is using this 
table? (I think you're in a better position to do so than I am)

cheers
Stuart


- -- 
Stuart Prescott                 www.nanoNANOnano.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAk8lbqwACgkQn+i4zXHF0agTfQCfSVmP9dgT+cDRjFaZwy7fAw3b
pMIAoIMt3KapKZePhKtx1hTVDpUrFh4i
=B4FR
-----END PGP SIGNATURE-----
>From cd0ee3ade92b7b0740704d3879fd003194aa0271 Mon Sep 17 00:00:00 2001
From: Stuart Prescott <stuart+debian@nanonanonano.net>
Date: Mon, 23 Jan 2012 23:39:00 +0000
Subject: [PATCH] Add Description-md5 to the packages tables

---
 sql/setup.sql            |    6 +++---
 sql/upgrade.sql          |    6 ++++++
 udd/packages_gatherer.py |    8 ++++----
 3 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/sql/setup.sql b/sql/setup.sql
index 338ac71..1dfaf8f 100644
--- a/sql/setup.sql
+++ b/sql/setup.sql
@@ -59,7 +59,7 @@ component text, architecture text);
 
 CREATE TABLE packages
   (package text, version debversion, architecture text, maintainer text, maintainer_name text, maintainer_email text, description
-    text, long_description text, source text, source_version debversion, essential text, depends text,
+    text, long_description text, description_md5 text, source text, source_version debversion, essential text, depends text,
     recommends text, suggests text, enhances text, pre_depends text, breaks text,
     installed_size int, homepage text, size int,
     build_essential text, origin text, sha1 text, replaces text, section text,
@@ -113,7 +113,7 @@ component text, architecture text);
 
 CREATE TABLE ubuntu_packages
   (package text, version debversion, architecture text, maintainer text, maintainer_name text, maintainer_email text, description
-    text, long_description text, source text, source_version debversion, essential text, depends text,
+    text, long_description text, description_md5 text, source text, source_version debversion, essential text, depends text,
     recommends text, suggests text, enhances text, pre_depends text, breaks text,
     installed_size int, homepage text, size int,
     build_essential text, origin text, sha1 text, replaces text, section text,
@@ -168,7 +168,7 @@ component text, architecture text);
 
 CREATE TABLE derivatives_packages
   (package text, version debversion, architecture text, maintainer text, maintainer_name text, maintainer_email text, description
-    text, long_description text, source text, source_version debversion, essential text, depends text,
+    text, long_description text, description_md5 text, source text, source_version debversion, essential text, depends text,
     recommends text, suggests text, enhances text, pre_depends text, breaks text,
     installed_size int, homepage text, size int,
     build_essential text, origin text, sha1 text, replaces text, section text,
diff --git a/sql/upgrade.sql b/sql/upgrade.sql
index eda0710..1460300 100644
--- a/sql/upgrade.sql
+++ b/sql/upgrade.sql
@@ -344,3 +344,9 @@ ALTER TABLE derivatives_packages add ruby_versions text;
 -- 2011-05-31
 ALTER TABLE bugs add done_date timestamp;
 ALTER TABLE archived_bugs add done_date timestamp;
+
+-- 2012-01-23
+-- description-less packages files
+ALTER TABLE packages add description_md5 text;
+ALTER TABLE ubuntu_packages add description_md5 text;
+ALTER TABLE derivatives_packages add description_md5 text;
diff --git a/udd/packages_gatherer.py b/udd/packages_gatherer.py
index 83cc810..3748f76 100644
--- a/udd/packages_gatherer.py
+++ b/udd/packages_gatherer.py
@@ -35,13 +35,13 @@ class packages_gatherer(gatherer):
       'Homepage': 0, 'Size': 0, 'Build-Essential':0, 'Origin':0,
       'SHA1':0, 'Replaces':0, 'Section':0, 'MD5sum':0, 'Bugs':0, 'Priority':0,
       'Tag':0, 'Task':0, 'Python-Version':0, 'Ruby-Versions':0, 'Provides':0, 'Conflicts':0,
-      'SHA256':0, 'Original-Maintainer':0}
+      'SHA256':0, 'Original-Maintainer':0, 'Description-md5':0}
   ignorable = {'Modaliases':0, 'Filename':0, 'Npp-Filename':0, 'Npp-Name':0, 'Npp-Mimetype':0, 'Npp-Applications':0, 'Python-Runtime':0, 'Npp-File':0, 'Npp-Description':0, 'Url':0, 'Gstreamer-Elements':0, 'Gstreamer-Version':0, 'Gstreamer-Decoders':0, 'Gstreamer-Uri-Sinks':0, 'Gstreamer-Encoders':0, 'Gstreamer-Uri-Sources':0, 'url':0, 'Vdr-PatchLevel':0, 'Vdr-Patchlevel':0, 'originalmaintainer':0, 'Originalmaintainer':0, 'Build-Recommends':0, 'Multi-Arch':0, 'Maintainer-Homepage':0, 'Tads2-Version':0, 'Tads3-Version':0, 'Xul-Appid': 0, 'Subarchitecture':0, 'Package-Type':0, 'Kernel-Version': 0, 'Installer-Menu-Item':0, 'Supported':0, 'subarchitecture':0, 'package-type':0, 'Python3-Version':0, 'Built-Using':0 }
   ignorable_re = re.compile("^(Orig-|Original-|Origianl-|Orginal-|Orignal-|Orgiinal-|Orginial-|Debian-|X-Original-|Upstream-)")
 
   pkgquery = """EXECUTE package_insert
       (%(Package)s, %(Version)s, %(Architecture)s, %(Maintainer)s, %(maintainer_name)s, %(maintainer_email)s,
-      %(Description)s, %(Long_Description)s, %(Source)s, %(Source_Version)s, %(Essential)s,
+      %(Description)s, %(Long_Description)s, %(Description-md5)s, %(Source)s, %(Source_Version)s, %(Essential)s,
       %(Depends)s, %(Recommends)s, %(Suggests)s, %(Enhances)s,
       %(Pre-Depends)s, %(Breaks)s, %(Installed-Size)s, %(Homepage)s, %(Size)s,
       %(Build-Essential)s, %(Origin)s, %(SHA1)s,
@@ -174,7 +174,7 @@ class packages_gatherer(gatherer):
 	path = os.path.join(src_cfg['directory'], comp, 'binary-' + arch, 'Packages.gz')
 	try:
 	  cur.execute("""PREPARE package_insert AS INSERT INTO %s
-	    (Package, Version, Architecture, Maintainer, maintainer_name, maintainer_email, Description, Long_Description, Source,
+	    (Package, Version, Architecture, Maintainer, maintainer_name, maintainer_email, Description, Long_Description, description_md5, Source,
 	    Source_Version, Essential, Depends, Recommends, Suggests, Enhances,
 	    Pre_Depends, Breaks, Installed_Size, Homepage, Size,
 	    build_essential, origin, sha1, replaces, section,
@@ -184,7 +184,7 @@ class packages_gatherer(gatherer):
 	  VALUES
 	    ( $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15,
 	      $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28,
-	      $29, $30, $31, $32, $33, $34, $35, $36, '%s', '%s', '%s')
+	      $29, $30, $31, $32, $33, $34, $35, $36, $37, '%s', '%s', '%s')
 	    """ %  (table, self._distr, src_cfg['release'], comp))
 #	  aux.print_debug("Reading file " + path)
 	  # Copy content from gzipped file to temporary file, so that apt_pkg is
-- 
1.7.2.5



Reply to: