소스 검색

dpkg-buildpackage: factorize a command line sanity check

Raphael Hertzog 17 년 전
부모
커밋
77270d7bf4
1개의 변경된 파일3개의 추가작업 그리고 12개의 파일을 삭제
  1. 3 12
      scripts/dpkg-buildpackage.pl

+ 3 - 12
scripts/dpkg-buildpackage.pl

@@ -167,29 +167,17 @@ while (@ARGV) {
 	$binaryonly = '-b';
 	@checkbuilddep_args = ();
 	$binarytarget = 'binary';
-	if ($sourceonly) {
-	    usageerr(_g("cannot combine %s and %s"), '-b', '-S');
-	}
     } elsif (/^-B$/) {
 	$binaryonly = '-B';
 	@checkbuilddep_args = ('-B');
 	$binarytarget = 'binary-arch';
-	if ($sourceonly) {
-	    usageerr(_g("cannot combine %s and %s"), '-B', '-S');
-	}
     } elsif (/^-A$/) {
 	$binaryonly = '-A';
 	@checkbuilddep_args = ();
 	$binarytarget = 'binary-indep';
-	if ($sourceonly) {
-	    usageerr(_g("cannot combine %s and %s"), '-A', '-S');
-	}
     } elsif (/^-S$/) {
 	$sourceonly = '-S';
 	@checkbuilddep_args = ('-B');
-	if ($binaryonly) {
-	    usageerr(_g("cannot combine %s and %s"), $binaryonly, '-S');
-	}
     } elsif (/^-v(.*)$/) {
 	$since = $1;
     } elsif (/^-m(.*)$/) {
@@ -211,6 +199,9 @@ while (@ARGV) {
     }
 }
 
+if ($binaryonly and $sourceonly) {
+    usageerr(_g("cannot combine %s and %s"), $binaryonly, $sourceonly);
+}
 if ($noclean) {
     # -nc without -b/-B/-A/-S implies -b
     $binaryonly = '-b' unless ($binaryonly or $sourceonly);