On Wed, May 31, 2006 at 03:36:01PM +0200, Julien Danjou wrote:
> I have written a small patch for debdiff in order to be able to use it like 
> debsign
> or debrelease, i. e. without any arguments if we are in a source
> directory.
> This is quite useful where NMUing.

New version attached, fix a problem with epochs.

Cheers,
-- 
Julien Danjou
.''`.  Debian Developer
: :' : http://julien.danjou.info
`. `'  http://people.debian.org/~acid
  `-   9A0D 5FD9 EB42 22F6 8974  C95C A462 B51E C2FE E5CD
--- debdiff.pl.orig     2006-04-05 19:35:25.000000000 +0200
+++ debdiff.pl  2006-05-31 17:41:25.000000000 +0200
@@ -32,7 +32,8 @@
 
 sub usage {
     print <<"EOF";
-Usage: $progname [option] ... deb1 deb2
+Usage: $progname [option] ...
+   or: $progname [option] ... deb1 deb2
    or: $progname [option] ... changes1 changes2
    or: $progname [option] ... dsc1 dsc2
    or: $progname [option] ... --from deb1a deb1b ... --to deb2a deb2b ...
@@ -234,6 +235,24 @@
     }
 }
 
+my $guessedfiles = 0;
+
+# If no file given, we assume we are in a source directory
+# and try to diff with previous version
+if(@ARGV == 0) {
+    fatal "Can't read file: debian/changelog" unless -r "debian/changelog";
+    open CHL, "debian/changelog";
+    while(<CHL>) {
+       if(/^(.+)\s\((\d+:)?(.+)\)\s(\w+)\;\surgency=.+$/) {
+           unshift @ARGV, "../".$1."_".$3.".dsc";
+           $guessedfiles++;
+       }
+       last if $guessedfiles > 1;
+    }
+    close CHL;
+}
+
+
 if (! $type) {
     # we need 2 deb files or changes files to compare
     fatal "Need exactly two deb files or changes files to compare"

Attachment: signature.asc
Description: Digital signature

Reply via email to