[PATCH] dpkg-genchanges: Add --checksum option
* scripts/dpkg-genchanges.pl: Allow using another
checksum program. Increase changes format to 1.8.
---
man/dpkg-genchanges.1 | 7 +++++++
scripts/dpkg-genchanges.pl | 10 ++++++++--
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/man/dpkg-genchanges.1 b/man/dpkg-genchanges.1
index 37ab325..6d65af8 100644
--- a/man/dpkg-genchanges.1
+++ b/man/dpkg-genchanges.1
@@ -117,6 +117,13 @@ checksums in the
.B .changes
file).
.TP
+.BI \-\-checksum= "checksum program"
+Specify which checksum to use in the files list in the generated
+.B .changes
+file. Supported values are:
+.IR md5sum ", " sha1sum ", and " sha256sum .
+\fImd5sum\fP is the default.
+.TP
.B \-q
Usually
.B dpkg\-genchanges
diff --git a/scripts/dpkg-genchanges.pl b/scripts/dpkg-genchanges.pl
index 38b7ecb..c2da679 100755
--- a/scripts/dpkg-genchanges.pl
+++ b/scripts/dpkg-genchanges.pl
@@ -35,7 +35,7 @@ my $uploadfilesdir = '..';
my $sourcestyle = 'i';
my $quiet = 0;
my $host_arch = get_host_arch();
-my $changes_format = "1.7";
+my $changes_format = "1.8";
my $checksum = 'md5sum';
my %f2p; # - file to package map
@@ -122,9 +122,11 @@ Options:
-T<varlistfile> read variables here, not debian/substvars.
-D<field>=<value> override or add a field and value.
-U<field> remove a field.
+ --checksum=<program> program to use to generate checksums (defaults
+ to 'md5sum', supported are: %s).
-h, --help show this help message.
--version show the version.
-"), $progname;
+"), $progname, "@check_supported";
}
@@ -174,6 +176,10 @@ while (@ARGV) {
$remove{$1}= 1;
} elsif (m/^-V(\w[-:0-9A-Za-z]*)[=:]/) {
$substvars->set($1, $POSTMATCH);
+ } elsif (m/^--checksum=/) {
+ $checksum = $POSTMATCH;
+ usageerr(_g("%s is not a supported checksum"), $checksum)
+ unless $check_supported{$checksum};
} elsif (m/^-(h|-help)$/) {
&usage; exit(0);
} elsif (m/^--version$/) {
--
1.5.3.8
Reply to: