From 8fb9de63dec1c836259f45d2adc54863910dff1c Mon Sep 17 00:00:00 2001 From: Steve McIntyre <93sam@debian.org> Date: Wed, 23 Mar 2011 17:26:03 +0000 Subject: [PATCH] * Update make_disc_trees.pl and which_deb to cope with different types of source file, and clean up the code in that area. --- squeeze/debian/changelog | 2 ++ squeeze/tools/make_disc_trees.pl | 19 ++++++++----------- squeeze/tools/which_deb | 5 ++--- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/squeeze/debian/changelog b/squeeze/debian/changelog index 24b62f65..3aa9d17b 100644 --- a/squeeze/debian/changelog +++ b/squeeze/debian/changelog @@ -22,6 +22,8 @@ debian-cd (3.1.6) UNRELEASED-backport; urgency=low * tools/start_new_disc: tone down messages about missing {BASE,UDEB}_{INCLUDE,EXCLUDE} files from ERROR to WARNING. Closes: #615043 + * Update make_disc_trees.pl and which_deb to cope with different + types of source file, and clean up the code in that area. -- Raphaƫl Hertzog Fri, 04 Feb 2011 09:59:21 +0100 diff --git a/squeeze/tools/make_disc_trees.pl b/squeeze/tools/make_disc_trees.pl index 725f033c..8fc4c34d 100755 --- a/squeeze/tools/make_disc_trees.pl +++ b/squeeze/tools/make_disc_trees.pl @@ -922,9 +922,8 @@ sub add_md5_entry { if ($arch eq "source") { m/^Directory: (\S+)/mi and $pdir = $1; - m/^ (\S+) (\S+) ((\S+).*dsc)/m and print MD5FILE "$1 ./$pdir/$3\n"; - m/^ (\S+) (\S+) ((\S+).*tar.gz)/m and print MD5FILE "$1 ./$pdir/$3\n"; - m/^ (\S+) (\S+) ((\S+).*diff.gz)/m and print MD5FILE "$1 ./$pdir/$3\n"; + # Explicitly use the md5 lines in the Sources stanza, hence the xdigit(32) here + while (/^ ([[:xdigit:]]{32}) (\d+) (\S+)/msg) { print MD5FILE "$1 ./$pdir/$3\n"; } } else { m/^Filename: (\S+)/m and $file = $1; m/^MD5sum: (\S+)/m and print MD5FILE "$1 ./$file\n"; @@ -1023,10 +1022,9 @@ sub remove_md5_entry { m/^Package: (\S+)/mi and $p = $1; if ($arch eq "source") { - m/^Directory: (\S+)/mi and $pdir = $1; - m/^ (\S+) (\S+) ((\S+).*dsc)/m and push(@fileslist, "$1 ./$pdir/$3"); - m/^ (\S+) (\S+) ((\S+).*diff.gz)/m and push(@fileslist, "$1 ./$pdir/$3"); - m/^ (\S+) (\S+) ((\S+).*tar.gz)/m and push(@fileslist, "$1 ./$pdir/$3"); + m/^Directory: (\S+)/mi and $pdir = $1; + # Explicitly use the md5 lines in the Sources stanza, hence the xdigit(32) here + while (/^ ([[:xdigit:]]{32}) (\d+) (\S+)/msg) { push(@fileslist, "$1 ./$pdir/$3"); } } else { m/^Filename: (\S+)/m and $file = $1; m/^MD5Sum: (\S+)/mi and push(@fileslist, "$1 ./$file"); @@ -1090,7 +1088,7 @@ sub add_packages { } my $pkg = shift; - my ($arch, $component, $pkgname, $pkgsize) = split /:/, $pkg; + my ($arch, $component, $pkgname, $pkgsize) = split /:/, $pkg; if ("$arch" eq "" or "$pkgname" eq "" or "$pkgname" eq "") { die "inconsistent data passed to add_packages: $pkg\n"; @@ -1105,9 +1103,8 @@ sub add_packages { if ($arch eq "source") { m/^Directory: (\S+)/m and $pdir = $1; $source=$security if $pdir=~m:updates/:; - m/^ (\S+) (\S+) ((\S+).*dsc)/m and push(@files, "$pdir/$3"); - m/^ (\S+) (\S+) ((\S+).*diff.gz)/m and push(@files, "$pdir/$3"); - m/^ (\S+) (\S+) ((\S+).*tar.gz)/m and push(@files, "$pdir/$3"); + # Explicitly use the md5 lines in the Sources stanza, hence the xdigit(32) here + while (/^ ([[:xdigit:]]{32}) (\d+) (\S+)/msg) { push(@files, "$pdir/$3"); } } else { m/^Filename: (\S+)/mi and push(@files, $1); $source=$security if $1=~m:updates/:; diff --git a/squeeze/tools/which_deb b/squeeze/tools/which_deb index e2cbcc39..629fdea5 100755 --- a/squeeze/tools/which_deb +++ b/squeeze/tools/which_deb @@ -127,9 +127,8 @@ if (length($pkgdata) > 2) { if (length($pkgdata) > 2) { my $dir; $pkgdata =~ m/^Directory: (\S+)/m and $dir = $1; - $pkgdata =~ m/^ (\S+) (\S+) ((\S+).*dsc)/m and print "$dir/$3\n"; - $pkgdata =~ m/^ (\S+) (\S+) ((\S+).*diff.gz)/m and print "$dir/$3\n"; - $pkgdata =~ m/^ (\S+) (\S+) ((\S+).*tar.gz)/m and print "$dir/$3\n"; + # Explicitly use the md5 lines in the Sources stanza, hence the xdigit(32) here + while ($pkgdata =~ m/^ ([[:xdigit:]]{32}) (\d+) (\S+)/msg) { print "$dir/$3\n"; } } } }