* Add support for Built-Using:

+ tools/sort_deps: parse out Built-Using from Packages files too and
      pass any such data on to tools/merge_package_lists
    + tools/merge_package_lists: if we have any built-using source
      packages listed when doing a combined binary/source set, add them in
      the same way as existing listed sources.
  * Other bug fixes in tools/merge_package_lists:
    + Fix handling of multi-line Binary: fields
    + Print out the accumulated size of source packages in output also
      (fix to printf format string)
This commit is contained in:
Steve McIntyre 2013-01-24 10:26:30 +00:00
parent e9ad5c11a4
commit 252013342e
3 changed files with 56 additions and 17 deletions

10
debian/changelog vendored
View File

@ -7,6 +7,16 @@ debian-cd (3.1.12) UNRELEASED; urgency=low
apt-cache output
+ We'll now pull in all the extra packages included in Sources.gz
because of Built-Using.
* Add support for Built-Using:
+ tools/sort_deps: parse out Built-Using from Packages files too and
pass any such data on to tools/merge_package_lists
+ tools/merge_package_lists: if we have any built-using source
packages listed when doing a combined binary/source set, add them in
the same way as existing listed sources.
* Other bug fixes in tools/merge_package_lists:
+ Fix handling of multi-line Binary: fields
+ Print out the accumulated size of source packages in output also
(fix to printf format string)
-- Steve McIntyre <93sam@debian.org> Wed, 26 Sep 2012 01:09:13 +0100

View File

@ -66,6 +66,7 @@ if [ $source = "yes" ] ; then
srcname=$2
srcs_done++
}
/^Binary:/ {
bins=$0
gsub("^Binary:","",bins)
@ -75,17 +76,32 @@ if [ $source = "yes" ] ; then
bin2src[binarray[i]] = srcname
bins_done++
}
in_binary = 1
in_files = 0
next
}
/^Files:/ {
in_files = 1
in_binary = 0
next
}
/^ / {
if (in_files) {
if (in_files) { # Cope with multiple lines of files for source packages
size[srcname]+=$2
next
}
if (in_binary) { # Cope with multi-line Binary: fields
bins=$0
gsub(",","",bins)
nb=split(bins, binarray)
for (i=1; i <= nb; i++) {
bin2src[binarray[i]] = srcname
bins_done++
}
next
}
}
# Done reading the Sources
@ -96,43 +112,47 @@ if [ $source = "yes" ] ; then
}
# Now start placing source packages, depending on the order of the binary packages
/.*/ {
/^./ {
in_files = 0
in_binary = 0
if (parsed) {
split($0,fields,":")
arch=fields[1]
component=fields[2]
pkg=fields[3]
pkgsize=fields[4]
source=bin2src[pkg]
if ("" == source) {
srcpkg=bin2src[pkg]
if ("" == srcpkg) {
if ("main-installer" == component) {
printf("# Ignoring source for udeb %s\n", pkg)
} else {
printf("# Source for pkg %s is UNKNOWN!\n", pkg)
}
} else {
}
built_using=fields[5]
if ("" != built_using) {
num_sources = split(built_using,sources,",")
}
num_sources++
sources[num_sources] = srcpkg
for(i = 1; i <= num_sources; i++) {
source = sources[i]
if (!included[source]) {
printf("# Adding source %s at %d because of %s:%s\n",
source, FNR, arch, pkg)
printf("# Adding source %s at %d because of %s:%s (%s)\n",
source, FNR, arch, pkg, (i == num_sources ? "dep" : "b-u"))
included[source] = pkg
incarch[source] = arch
indexnr[source] = FNR
sourcecomp[source] = component
} else {
if (FNR < indexnr[source]) {
printf("# Updating source %s: was due to %d:%s:%s, now moved earlier because of %d:%s:%s\n",
printf("# Updating source %s: was due to %d:%s:%s, now moved earlier because of %d:%s:%s (%s)\n",
source, indexnr[source],
incarch[source], included[source],
FNR, arch, pkg)
FNR, arch, pkg, (i == num_sources ? "dep" : "b-u"))
included[source] = pkg
incarch[source] = arch
indexnr[source] = FNR
} else {
printf("# Not adding pkg %s source (%d:%s:%s), already added due to %d:%s:%s\n",
pkg, FNR, arch, source,
indexnr[source], incarch[source],
included[source])
}
}
}
@ -147,9 +167,9 @@ if [ $source = "yes" ] ; then
END {
for (source in included) {
if (size[source] > max_size) {
printf("%d:aaaaaaaaaaaaaaaaaa:%s:%s-SRCTOOBIG\n", indexnr[source], sourcecomp[source], source, size[source])
printf("%d:aaaaaaaaaaaaaaaaaa:%s:%s-SRCTOOBIG:%d\n", indexnr[source], sourcecomp[source], source, size[source])
} else {
printf("%d:aaaaaaaaaaaaaaaaaa:%s:%s\n", indexnr[source], sourcecomp[source], source, size[source])
printf("%d:aaaaaaaaaaaaaaaaaa:%s:%s:%d\n", indexnr[source], sourcecomp[source], source, size[source])
}
}
}' $ADIR/$CODENAME-source/apt-state/lists/*Sources $BDIR/DONE $list | sort -nk 1 -t : >> $BDIR/list.mid

View File

@ -328,7 +328,8 @@ open(FWLIST, ">> $dir/firmware-packages")
foreach (@output) {
my $component = $packages{$_}{"Component"};
my $size = $packages{$_}{"Size"};
print CDLIST "$arch:$component:$_:$size\n";
my $bu = $packages{$_}{"Built-Using"};
print CDLIST "$arch:$component:$_:$size:$bu\n";
if ($packages{$_}{"IsFirmware"}) {
print FWLIST "$_\n";
}
@ -355,6 +356,14 @@ sub parse_package {
$packages{$p}{"Depends"} = [];
$packages{$p}{"Suggests"} = [];
$packages{$p}{"Recommends"} = [];
$packages{$p}{"Built-Using"} = "";
if (m/^Built-Using: (.*)$/m) {
my $built = $1;
$built =~ s/ \(= \S*\)//g;
$built =~ s/,//g;
$built =~ s/ /,/g;
$packages{$p}{"Built-Using"} = $built;
}
$packages{$p}{"IsUdeb"} = ($packages{$p}{"Filename"} =~ /.udeb$/) ? 1 : 0;
$packages{$p}{"IsFirmware"} = ($packages{$p}{"Filename"} =~ /(firmware|microcode)/) ? 1 : 0;
if ($packages{$p}{"Section"} =~ /contrib\//) {