]> git.donarmstrong.com Git - debhelper.git/blobdiff - dh_gencontrol
Merge branch 'dh_overrides'
[debhelper.git] / dh_gencontrol
index b9aaefb490d59873823e1fe703268d7872af7ff5..726d0855df6b457924c025aa7a652546406bb701 100755 (executable)
@@ -21,13 +21,13 @@ proper permissions.
 
 This program is merely a wrapper around L<dpkg-gencontrol(1)>, which calls
 it once for each package being acted on, and passes in some additional
-useful flags including "-isp". 
+useful flags.
 
 =head1 OPTIONS
 
 =over 4
 
-=item B<-u>I<params>, B<--dpkg-gencontrol-params>I<params>
+=item B<-u>I<params>, B<--dpkg-gencontrol-params>=I<params>
 
 =item B<--> I<params>
 
@@ -37,11 +37,15 @@ Pass "params" to L<dpkg-gencontrol(1)>.
 
 =cut
 
-init();
+init(options => {
+       "dpkg-gencontrol-params=s", => \$dh{U_PARAMS},
+});
 
 foreach my $package (@{$dh{DOPACKAGES}}) {
        my $tmp=tmpdir($package);
        my $ext=pkgext($package);
+
+       my $substvars="debian/${ext}substvars";
        
        my $changelog=pkgfile($package,'changelog');
        if (! $changelog) {
@@ -52,12 +56,17 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
                doit("install","-o",0,"-g",0,"-d","$tmp/DEBIAN");
        }
 
+       # avoid gratuitous warning
+       if (! -e $substvars || system("grep -q '^misc:Depends=' $substvars") != 0) {
+               complex_doit("echo misc:Depends= >> $substvars");
+       }
+       
        # Generate and install control file.
        my @command="dpkg-gencontrol";
-       if (GetPackages() > 1) {
+       if (getpackages() > 1) {
                push @command, "-p$package";
        }
-       doit(@command, "-l$changelog", "-isp", "-Tdebian/${ext}substvars", 
+       doit(@command, "-l$changelog", "-T$substvars", 
                "-P$tmp",@{$dh{U_PARAMS}});
 
        # This chmod is only necessary if the user sets the umask to