[php-apt-parser-maint] r21 - /branches/des/parse-apt-files.inc

php-apt-parser-maint at lists.alioth.debian.org php-apt-parser-maint at lists.alioth.debian.org
Sun Nov 19 03:29:13 CET 2006


Author: dleidert-guest
Date: Sun Nov 19 03:29:13 2006
New Revision: 21

URL: http://svn.debian.org/wsvn/php-apt-parser/?sc=1&rev=21
Log:
Fix Alioth#304143 [1]. I tried to read a non-existing field in Sources and it seems, this confused the script a bit.

[1] http://alioth.debian.org/tracker/?func=detail&aid=304143&group_id=30953&atid=412507

Modified:
    branches/des/parse-apt-files.inc

Modified: branches/des/parse-apt-files.inc
URL: http://svn.debian.org/wsvn/php-apt-parser/branches/des/parse-apt-files.inc?rev=21&op=diff
==============================================================================
--- branches/des/parse-apt-files.inc (original)
+++ branches/des/parse-apt-files.inc Sun Nov 19 03:29:13 2006
@@ -211,6 +211,9 @@
                 $chfile = False;
                 while (false !== ($file = readdir($dhandle)))
                 {
+                    // Packages with multiple binaries or a source-package
+                    // name != binary-package name normally have a Source-field
+                    // in Packages(.{gz,bz2}).
                     if ( isset($fields["Source"] ))
                     {
                         if (strpos($file, $fields["Source"] . '_' .
@@ -218,13 +221,18 @@
                             strpos($file, '.changes') !== False )
                             $chfile = $file;
                     }
-                    else if ( isset( $srcfields["Directory"] ))
-                    {
-                        if (strpos($file, $srcfields["Source"] . '_' .
+                    // If there is no Source-field, just try to use the
+                    // Packages-field in Sources(.{gz,bz2}).
+                    else if ( isset( $srcfields["Package"] ))
+                    {
+                        if (strpos($file, $srcfields["Package"] . '_' .
 preg_replace('/^[0-9]+\:/', '', $fields["Version"])) !== False &&
                             strpos($file, '.changes') !== False )
                             $chfile = $file;
                     }
+                    // And at least simply try the Package-field from
+                    // Packages(.{gz,bz2}) for those packages, that do not have
+                    // a Sources(.{gz,bz2}) entry.
                     else
                     {
                         if (strpos($file, $fields["Package"] . '_' .
@@ -259,6 +267,9 @@
                 $blfile = False;
                 while (false !== ($file = readdir($dhandle)))
                 {
+                    // Packages with multiple binaries or a source-package
+                    // name != binary-package name normally have a Source-field
+                    // in Packages(.{gz,bz2}).
                     if ( isset($fields["Source"] ))
                     {
                         if (strpos($file, $fields["Source"] . '_' .
@@ -266,13 +277,18 @@
                             strpos($file, '.build') !== False )
                             $blfile = $file;
                     }
-                    else if ( isset( $srcfields["Directory"] ))
-                    {
-                        if (strpos($file, $srcfields["Source"] . '_' .
+                    // If there is no Source-field, just try to use the
+                    // Packages-field in Sources(.{gz,bz2}).
+                    else if ( isset( $srcfields["Package"] ))
+                    {
+                        if (strpos($file, $srcfields["Package"] . '_' .
 preg_replace('/^[0-9]+\:/', '', $fields["Version"])) !== False &&
                             strpos($file, '.build') !== False )
                             $blfile = $file;
                     }
+                    // And at least simply try the Package-field from
+                    // Packages(.{gz,bz2}) for those packages, that do not have
+                    // a Sources(.{gz,bz2}) entry.
                     else
                     {
                         if (strpos($file, $fields["Package"] . '_' .




More information about the php-apt-parser-maint mailing list