[Debpool-commits] [SCM] Debpool Project Repository branch, master, updated. 0.2.3-63-g38a32aa

ceros-guest ceros-guest at alioth.debian.org
Tue Jun 3 07:06:56 UTC 2008


The following commit has been merged in the master branch:
commit 180002206b0e68a63f7d325e5cd17def9ef1478e
Author: ceros-guest <ceros-guest>
Date:   Sat Dec 15 08:53:57 2007 +0000

    modified debpool to install compressed Packages/Sources files first before generating Release file. Modified Release.pm to use Digest::Sha module. Began working on using SHA256 checksums.

diff --git a/bin/debpool b/bin/debpool
index 3deab40..d29d36a 100755
--- a/bin/debpool
+++ b/bin/debpool
@@ -522,6 +522,25 @@ ARCH_LOOP:
                 push @zfiles, $zfile;
             }
 
+            # Install {Packages,Sources}{,.gz}
+
+            if (!Install_List(@triple, $file, @zfiles)) {
+
+                my($msg) = "Couldn't install distribution files for ";
+                $msg .= "$dist/$section/${arch}: " . $DebPool::Packages::Error;
+                Log_Message($msg, LOG_GENERAL, LOG_ERROR);
+
+                if (-e $file) {
+                    unlink($file);
+                }
+
+                foreach (@zfiles) {
+                    unlink if -e;
+                }
+
+                next;
+            }
+
             # If we're doing Release files, now is the time for triples.
 
             my($relfile);
@@ -564,33 +583,6 @@ ARCH_LOOP:
                 }
             }
 
-            # Install {Packages,Sources}{,.gz}
-
-            if (!Install_List(@triple, $file, @zfiles)) {
-
-                my($msg) = "Couldn't install distribution files for ";
-                $msg .= "$dist/$section/${arch}: " . $DebPool::Packages::Error;
-                Log_Message($msg, LOG_GENERAL, LOG_ERROR);
-
-                if (-e $file) {
-                    unlink($file);
-                }
-
-                foreach (@zfiles) {
-                    unlink if -e;
-                }
-
-                if (defined($relfile) && -e $relfile) {
-                    unlink($relfile);
-                }
-
-                if (defined($sigfile) && -e $sigfile) {
-                    unlink($sigfile);
-                }
-
-                next;
-            }
-
             # Install Release{,.gpg}
 
             if (defined($relfile) &&
diff --git a/share/DebPool/Release.pm b/share/DebPool/Release.pm
index 4bd8f4b..f4a26f6 100644
--- a/share/DebPool/Release.pm
+++ b/share/DebPool/Release.pm
@@ -49,7 +49,7 @@ use File::Temp qw(tempfile);
 # We need the Digest modules so that we can calculate the proper checksums.
 
 use Digest::MD5;
-use Digest::SHA1;
+use Digest::SHA;
 
 ### Module setup
 
@@ -167,13 +167,15 @@ sub Generate_Release_Triple {
         # Now calculate the checksums and put them into the hashes.
 
         my($md5) = Digest::MD5::md5_hex(@filetext);
-        my($sha1) = Digest::SHA1::sha1_hex(@filetext);
+        my($sha1) = Digest::SHA::sha1_hex(@filetext);
+        my($sha256) = Digest::SHA::sha256_hex(@filetext);
 
         push @Checksums, {
             'File' => $ck_file,
             'Size' => $size,
             'MD5' => $md5,
             'SHA1' => $sha1,
+            'SHA256' => $sha256,
         };
     }
 
@@ -211,6 +213,12 @@ sub Generate_Release_Triple {
             $checksum->{'Size'}, $checksum->{'File'};
     }
 
+    print $tmpfile_handle "SHA256:\n";
+    foreach my $checksum (@Checksums) {
+        printf $tmpfile_handle " %s %8d %s\n", $checksum->{'SHA256'},
+            $checksum->{'Size'}, $checksum->{'File'};
+    }
+
     close($tmpfile_handle);
 
     return $tmpfile_name;
@@ -260,13 +268,15 @@ sub Generate_Release_Dist {
         # Now calculate the checksums and put them into the hashes.
     
         my($md5) = Digest::MD5::md5_hex(@filetext);
-        my($sha1) = Digest::SHA1::sha1_hex(@filetext);
+        my($sha1) = Digest::SHA::sha1_hex(@filetext);
+        my($sha256) = Digest::SHA::sha256_hex(@filetext);
     
         push @Checksums, {
             'File' => $file,
             'Size' => $size,
             'MD5' => $md5,
             'SHA1' => $sha1,
+            'SHA256' => $sha256,
         };
     }
 
@@ -303,6 +313,12 @@ sub Generate_Release_Dist {
             $file->{'Size'}, $file->{'File'};
     }
 
+    print $tmpfile_handle "SHA256:\n";
+    foreach $file (@Checksums) {
+        printf $tmpfile_handle " %s %8d %s\n", $file->{'SHA256'},
+            $file->{'Size'}, $file->{'File'};
+    }
+
     close($tmpfile_handle);
 
     return $tmpfile_name;

-- 
Debpool Project Repository



More information about the Debpool-commits mailing list