[devscripts] 08/18: debuild: Remove support for $command_version = 'rules'

James McCoy jamessan at debian.org
Wed Nov 23 18:11:32 UTC 2016


This is an automated email from the git hooks/post-receive script.

jamessan pushed a commit to branch master
in repository devscripts.

commit f38f30a1cf6c5d73c1df8b06709714163882a2b7
Author: James McCoy <jamessan at debian.org>
Date:   Sun Nov 20 13:52:38 2016 -0500

    debuild: Remove support for $command_version = 'rules'
    
    Let dpkg-buildpackage handle building a specific target from the rules
    file.
    
    Signed-off-by: James McCoy <jamessan at debian.org>
---
 scripts/debuild.pl | 64 +++++-------------------------------------------------
 1 file changed, 5 insertions(+), 59 deletions(-)

diff --git a/scripts/debuild.pl b/scripts/debuild.pl
index fde5631..005196c 100755
--- a/scripts/debuild.pl
+++ b/scripts/debuild.pl
@@ -706,25 +706,7 @@ if ( $< != 0 && $> == 0 ) { $< = $> }
 my $gid=$(;
 if ( $( != 0 && $) == 0 ) { $( = $) }
 
-# Now let's look at our options, if any.  The first task is to decide
-# which version of debuild we wish to run.  The rule is as follows: we
-# want to run the first version (calling debian/rules explicitly) if
-# there is at most one initial -r... argument, and all of the others
-# are one of binary, binary-arch, binary-indep or clean.  We run the
-# second version otherwise.  Note that the -r option is the only one
-# stripped from the argument list.
-
-my $command_version='rules';
-
-if (@ARGV == 0) { $command_version='dpkg'; }
-else {
-    foreach (@ARGV) {
-	if ( ! /^(binary|binary-indep|binary-arch|clean)$/) {
-	    $command_version='dpkg';
-	    last;
-	}
-    }
-}
+my $command_version = 'dpkg';
 
 if ($command_version eq 'dpkg') {
     # We're going to emulate dpkg-buildpackage and possibly lintian.
@@ -905,6 +887,10 @@ if ($command_version eq 'dpkg') {
 	    shift;
 	    push(@lintian_opts, @ARGV);
 	}
+	else {
+	    # It must be a debian/rules target
+	    push(@dpkg_opts, '--target', @ARGV);
+	}
     }
 
     if ($< != 0) {
@@ -1255,46 +1241,6 @@ EOT
     open STDERR, ">&", \*OLDERR;
     exit 0;
 }
-else {
-    # Running debian/rules.  Do dpkg-checkbuilddeps first
-    if ($checkbuilddep) {
-	if ($ARGV[0] eq 'binary-arch') {
-	    system('dpkg-checkbuilddeps -B');
-	} elsif ($ARGV[0] eq 'binary-indep') {
-	    system('dpkg-checkbuilddeps -A');
-	} else {
-	    system('dpkg-checkbuilddeps');
-	}
-	if ($?>>8) {
-	    fatal <<"EOT";
-You do not appear to have all build dependencies properly met.
-You can use mk-build-deps to generate a dummy package which
-Depends on all the required packages, or you can install them
-manually using dpkg or apt using the error messages just above
-this message.
-EOT
-	}
-    }
-
-    # Don't try to use the root command if we are already running as root
-    if ( $< == 0 ) {
-	system ('debian/rules', @ARGV) == 0
-	    or fatal "couldn't exec debian/rules: $!";
-    }
-    else {
-	# So we'll use the selected or default root command
-	system ($root_command, 'debian/rules', @ARGV) == 0
-	    or fatal "couldn't exec $root_command debian/rules: $!";
-    }
-
-    # Any warnings?
-    if (@warnings) {
-	my $warns = @warnings > 1 ? "s" : "";
-	warn "Warning$warns generated by debuild:\n" .
-	    join("\n", @warnings) . "\n";
-    }
-    exit 0;
-}
 
 ###### Subroutines
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/devscripts.git



More information about the devscripts-devel mailing list