r17951 - /trunk/dh-make-perl/dh-make-perl

dmn at users.alioth.debian.org dmn at users.alioth.debian.org
Mon Mar 24 14:14:32 UTC 2008


Author: dmn
Date: Mon Mar 24 14:14:30 2008
New Revision: 17951

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=17951
Log:
initial implementation of --refresh

Modified:
    trunk/dh-make-perl/dh-make-perl

Modified: trunk/dh-make-perl/dh-make-perl
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/dh-make-perl?rev=17951&op=diff
==============================================================================
--- trunk/dh-make-perl/dh-make-perl (original)
+++ trunk/dh-make-perl/dh-make-perl Mon Mar 24 14:14:30 2008
@@ -119,6 +119,7 @@
     $pkgversion, 
     $desc, $longdesc, $copyright, $author, $upsurl);
 my ($extrasfields, $extrapfields);
+my ($module_build);
 my (@docs, @examples, $changelog, @args);
 
 my %opts;
@@ -134,7 +135,8 @@
 	   'cpan-mirror=s', 'dbflags=s', 'depends=s', 'desc=s',
 	   'exclude|i:s{,}', 'help', 'install!', 'nometa', 'notest',
 	   'pkg-perl!', 'requiredeps', 'version=s', 'e=s', 'email=s',
-	   'p=s', 'packagename=s') or die usage_instructions();
+	   'p=s', 'packagename=s', 'refresh!', 'R!',
+) or die usage_instructions();
 
 @stdmodules = get_stdmodules();
 
@@ -142,8 +144,30 @@
 die usage_instructions() if $opts{help};
 die "CPANPLUS support disabled, sorry" if $opts{cpanplus};
 
-$opts{exclude} = '(?:\/|^)(?:CVS|.svn)\/' if (defined $opts{exclude} && 
+$opts{exclude} = '(?:\/|^)(?:CVS|.svn)\/' if (!defined $opts{exclude} or
 					  $opts{exclude} eq '');
+
+if ( $opts{R} or $opts{refresh} )
+{
+    print "Engaging refresh mode\n";
+    $maindir='.';
+    $module_build = (-f "$maindir/Build.PL") ? "Module-Build" : "MakeMaker";
+    $debiandir='./debian';
+    extract_changelog($maindir);
+    extract_docs($maindir);
+    extract_examples($maindir);
+    print "Found changelog: $changelog\n" if defined $changelog;
+    print "Found docs: @docs\n";
+    print "Found examples: @examples\n" if @examples;
+    create_rules("$debiandir/rules");
+    fix_rules(
+        "$debiandir/rules",
+        (defined $changelog ? $changelog : ''),
+        \@docs, \@examples,
+    );
+    print "Done\n";
+    exit 0;
+}
 
 load_overrides();
 my $tarball = setup_dir();
@@ -174,7 +198,7 @@
 	$pkgversion = $opts{version};
 }
 move ($tarball, dirname($tarball) . "/${pkgname}_${version}.orig.tar.gz") if ($tarball && $tarball =~ /(?:\.tar\.gz|\.tgz)$/);
-my $module_build = (-f "$maindir/Build.PL") ? "Module-Build" : "MakeMaker";
+$module_build = (-f "$maindir/Build.PL") ? "Module-Build" : "MakeMaker";
 extract_changelog($maindir);
 extract_docs($maindir);
 extract_examples($maindir);
@@ -232,6 +256,7 @@
 return <<"USAGE"
 Usage:
 $0 [ --build ] [ --install ] [ SOURCE_DIR | --cpan MODULE ]
+$0 --refresh|-R
 Other options: [ --desc DESCRIPTION ] [ --arch all|any ] [ --version VERSION ]
                [ --depends DEPENDS ] [ --bdepends BUILD-DEPENDS ]
                [ --bdependsi BUILD-DEPENDS-INDEP ] [ --cpan-mirror MIRROR ]
@@ -659,7 +684,7 @@
 	$dir .= '/' unless $dir =~ m(/$);
 	find(sub {
 		push (@docs, substr($File::Find::name, length($dir)))
-			if (/^(README|TODO|BUGS|NEWS|ANNOUNCE)/i && (! $opts{exclude} || ! $File::Find::name =~ /$opts{exclude}/)) ;
+			if (/^(README|TODO|BUGS|NEWS|ANNOUNCE)/i and (! $opts{exclude} or $File::Find::name !~ /$opts{exclude}/)) ;
 	}, $dir);
 }
 




More information about the Pkg-perl-cvs-commits mailing list