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

[SCM] Debian package checker branch, master, updated. 2.5.1-16-g6b9dd85



The following commit has been merged in the master branch:
commit 6b9dd850443d3d1ca190dda403dacffeba8a8f6e
Author: Niels Thykier <niels@thykier.net>
Date:   Sat Jun 25 22:26:01 2011 +0200

    Refactored fields extraction for source pkgs into coll/fields

diff --git a/collection/fields b/collection/fields
index 9af5134..0155792 100755
--- a/collection/fields
+++ b/collection/fields
@@ -29,12 +29,12 @@ my $type = shift;
 my $file;
 my $data;
 
-exit 0 if ($type eq 'source'); #FIXME
-
 if ($type eq 'changes'){
     $file = 'changes';
 } elsif ($type eq 'binary' or $type eq 'udeb'){
     $file = 'control/control';
+} elsif ($type eq 'source') {
+    $file = 'dsc';
 }
 
 if (!defined($file)) {
@@ -52,7 +52,7 @@ exit 0 unless (defined($file));
 
 mkdir("fields", 0777) or fail("mkdir fields: $!");
 
-if($type eq 'changes'){
+if ($type eq 'changes' or $type eq 'source'){
     $data = get_dsc_info($file);
 } elsif ($type eq 'binary' or $type eq 'udeb'){
     $data = (read_dpkg_control($file))[0];
@@ -70,6 +70,19 @@ for my $field (keys %$data) {
     close(F) or fail("Could not write $field_file: $!");
 }
 
+if ($type eq 'source'){
+    # FIXME - the LAB really ought to handle this as it involves
+    # cross-pkg LAB layout.
+
+    # Create symbolic links to binary packages
+    mkdir('binary', 0777) or fail("mkdir binary: $!");
+    for my $bin (split(m/,\s+/o,$data->{'binary'})) {
+        next if ($bin =~ m,/,o);
+        symlink("../../../binary/$bin", "binary/$bin")
+            or fail("cannot symlink binary package $bin: $!");
+    }
+}
+
 if($type eq 'binary' or $type eq 'udeb'){
     # FIXME - the LAB really ought to handle this as it involves
     # cross-pkg LAB layout.
diff --git a/unpack/unpack-srcpkg-l1 b/unpack/unpack-srcpkg-l1
index 8e9e37a..27ac7c8 100755
--- a/unpack/unpack-srcpkg-l1
+++ b/unpack/unpack-srcpkg-l1
@@ -49,19 +49,6 @@ my $data = get_dsc_info($file);
 # create directory in lab
 print "N: Creating directory $base_dir ...\n" if $verbose;
 mkdir($base_dir, 0777) or fail("mkdir $base_dir: $!");
-mkdir("$base_dir/fields", 0777) or fail("mkdir $base_dir/fields: $!");
-
-# create control field files
-for my $field (keys %$data) {
-    my $value = $data->{$field};
-    # checks/fields will convert colons into slashes
-    $field =~ s,/,:,g;
-    my $field_file = "$base_dir/fields/$field";
-    open(F, '>', $field_file)
-        or fail("cannot open file $field_file for writing: $!");
-    print F $value,"\n";
-    close(F);
-}
 
 # Install symbolic links to source package files.  Version handling is based
 # on Dpkg::Version::parseversion.
@@ -164,14 +151,6 @@ if ($prefix) {
 my $job = { fail => 'error', out => "$base_dir/index" };
 spawn($job, sub { print @index }, '|', ['sort', '-k', '6'], '&');
 
-# Create symbolic links to binary packages
-mkdir("$base_dir/binary", 0777) or fail("mkdir $base_dir/binary: $!");
-for my $bin (split(/,\s+/o,$data->{'binary'})) {
-    next if ($bin =~ m,/,);
-    symlink("../../../binary/$bin", "$base_dir/binary/$bin")
-        or fail("cannot symlink binary package $bin: $!");
-}
-
 # Wait for all jobs to finish.
 reap($job);
 

-- 
Debian package checker


Reply to: