Selaa lähdekoodia

add -S option to only upload sources

Wichert Akkerman 26 vuotta sitten
vanhempi
commit
74096a67bc
4 muutettua tiedostoa jossa 62 lisäystä ja 39 poistoa
  1. 3 0
      ChangeLog
  2. 14 6
      scripts/dpkg-buildpackage.sh
  3. 38 30
      scripts/dpkg-genchanges.pl
  4. 7 3
      scripts/dpkg-source.1

+ 3 - 0
ChangeLog

@@ -3,6 +3,9 @@ Thu Sep 21 16:29:32 CEST 2000 Wichert Akkerman <wakkerma@debian.org>
   * debian/shlibs-default.template: removed
   * debian/shlibs-{default,override}: new files
   * debian/rules: install shlibs-{default,override} in /etc/dpkg in dpkg-dev
+  * scripts/{dpkg-buildpackage.sh,dpkg-genchanges.pl}: add -S option to only
+    upload sources
+  * scripts/dpkg-source.1: document new -S option
 
 Sun Sep 17 01:50:34 CEST 2000 Wichert Akkerman <wakkerma@debian.org>
 

+ 14 - 6
scripts/dpkg-buildpackage.sh

@@ -23,6 +23,7 @@ Options: -r<gain-root-command>
          -a<arch>      Debian architecture we build for
          -b            binary-only, do not build source } also passed to
          -B            binary-only, no arch-indep files } dpkg-genchanges
+         -S            source only, no binary files     } 
          -v<version>   changes since version <version>      }
          -m<maint>     maintainer for package is <maint>    } 
          -e<maint>     maintainer for release is <maint>    } only passed
@@ -82,8 +83,12 @@ do
 	-tc)	cleansource=true ;;
 	-t*)    targetgnusystem="$value" ;;          # Order DOES matter!
 	-nc)	noclean=true; if [ -z "$binaryonly" ]; then binaryonly=-b; fi ;;
-	-b)	binaryonly=-b ;;
-	-B)	binaryonly=-B; binarytarget=binary-arch ;;
+	-b)	binaryonly=-b; [ "$sourceonly" ] && \
+			{ echo >&2 "$progname: cannot combine $1 and -S" ; exit 2 ; } ;;
+	-B)	binaryonly=-B; binarytarget=binary-arch; [ "$sourceonly" ] && \
+			{ echo >&2 "$progname: cannot combine $1 and -S" ; exit 2 ; } ;;
+	-S)	sourceonly=-S; [ "$binaryonly" ] && \
+			{ echo >&2 "$progname: cannot combine $binaryonly and $1" ; exit 2 ; } ;;
 	-v*)	since="$value" ;;
 	-m*)	maint="$value" ;;
 	-e*)	changedby="$value" ;;
@@ -157,7 +162,7 @@ withecho () {
 	"$@"
 }
 
-set -- $binaryonly $sourcestyle
+set -- $binaryonly $sourceonly $sourcestyle
 if [ -n "$maint"	]; then set -- "$@" "-m$maint"		; fi
 if [ -n "$changedby"	]; then set -- "$@" "-e$changedby"	; fi
 if [ -n "$since"	]; then set -- "$@" "-v$since"		; fi
@@ -169,9 +174,10 @@ fi
 if [ x$binaryonly = x ]; then
 	cd ..; withecho dpkg-source $diffignore -b "$dirn"; cd "$dirn"
 fi
-withecho debian/rules build $archlist
-withecho $rootcommand debian/rules $binarytarget $archlist
-
+if [ x$sourceonly != x ]; then
+	withecho debian/rules build $archlist
+	withecho $rootcommand debian/rules $binarytarget $archlist
+fi
 if [ "$usepause" = "true" ] && [ x$binaryonly = x -o x$signchanges != x ] ; then
     echo Press the return key to start signing process
     read dummy_stuff
@@ -197,6 +203,8 @@ elif fileomitted '\.diff\.gz'; then
 	srcmsg='Debian-specific package; upload is full source'
 elif fileomitted '\.orig\.tar\.gz'; then
 	srcmsg='diff-only upload (original source NOT included)'
+elif fileomitted '\.deb'; then
+	srcmsg='source-only upload'
 else
 	srcmsg='full upload (original source is included)'
 fi

+ 38 - 30
scripts/dpkg-genchanges.pl

@@ -40,6 +40,7 @@ Usage: dpkg-genchanges [options ...]
 
 Options:  -b                     binary-only build - no source files
           -B                     arch-specific - no source or arch-indep files
+          -S                     source-only upload
           -c<controlfile>        get control info from this file
           -l<changelogfile>      get per-version info from this file
           -f<fileslistfile>      get .deb files list from this file
@@ -69,11 +70,16 @@ $i=100;grep($fieldimps{$_}=$i--,
 while (@ARGV) {
     $_=shift(@ARGV);
     if (m/^-b$/) {
+    	$sourceonly && &usageerr("cannot combine -b or -B and -S");
         $binaryonly= 1;
     } elsif (m/^-B$/) {
+    	$sourceonly && &usageerr("cannot combine -b or -B and -S");
 	$archspecific=1;
 	$binaryonly= 1;
 	print STDERR "$progname: arch-specific upload - not including arch-independent packages\n";
+    } elsif (m/^-S$/) {
+    	$binaryonly && &usageerr("cannot combine -b or -B and -S");
+	$sourceonly= 1;
     } elsif (m/^-s([iad])$/) {
         $sourcestyle= $1;
     } elsif (m/^-q$/) {
@@ -115,38 +121,40 @@ while (@ARGV) {
 &parsechangelog;
 &parsecontrolfile;
 
-$fileslistfile="./$fileslistfile" if $fileslistfile =~ m/^\s/;
-open(FL,"< $fileslistfile") || &syserr("cannot read files list file");
-while(<FL>) {
-    if (m/^(([-+.0-9a-z]+)_([^_]+)_([-\w]+)\.deb) (\S+) (\S+)$/) {
-        defined($p2f{"$2 $4"}) &&
-            &warn("duplicate files list entry for package $2 (line $.)");
-	$f2p{$1}= $2;
-        $p2f{"$2 $4"}= $1;
-        $p2f{$2}= $1;
-        $p2ver{$2}= $3;
-        defined($f2sec{$1}) &&
-            &warn("duplicate files list entry for file $1 (line $.)");
-        $f2sec{$1}= $5;
-        $f2pri{$1}= $6;
-        push(@fileslistfiles,$1);
-    } elsif (m/^([-+.0-9a-z]+_[^_]+_([-\w]+)\.[a-z0-9.]+) (\S+) (\S+)$/) {
-	# A non-deb package
-	$f2sec{$1}= $3;
-	$f2pri{$1}= $4;
-	push(@archvalues,$2) unless !$2 || $archadded{$2}++;
-	push(@fileslistfiles,$1);
-    } elsif (m/^([-+.,_0-9a-zA-Z]+) (\S+) (\S+)$/) {
-	defined($f2sec{$1}) &&
-            &warn("duplicate files list entry for file $1 (line $.)");
-        $f2sec{$1}= $2;
-        $f2pri{$1}= $3;
-        push(@fileslistfiles,$1);
-    } else {
-        &error("badly formed line in files list file, line $.");
+if (not $sourceonly) {
+    $fileslistfile="./$fileslistfile" if $fileslistfile =~ m/^\s/;
+    open(FL,"< $fileslistfile") || &syserr("cannot read files list file");
+    while(<FL>) {
+	if (m/^(([-+.0-9a-z]+)_([^_]+)_([-\w]+)\.deb) (\S+) (\S+)$/) {
+	    defined($p2f{"$2 $4"}) &&
+		&warn("duplicate files list entry for package $2 (line $.)");
+	    $f2p{$1}= $2;
+	    $p2f{"$2 $4"}= $1;
+	    $p2f{$2}= $1;
+	    $p2ver{$2}= $3;
+	    defined($f2sec{$1}) &&
+		&warn("duplicate files list entry for file $1 (line $.)");
+	    $f2sec{$1}= $5;
+	    $f2pri{$1}= $6;
+	    push(@fileslistfiles,$1);
+	} elsif (m/^([-+.0-9a-z]+_[^_]+_([-\w]+)\.[a-z0-9.]+) (\S+) (\S+)$/) {
+	    # A non-deb package
+	    $f2sec{$1}= $3;
+	    $f2pri{$1}= $4;
+	    push(@archvalues,$2) unless !$2 || $archadded{$2}++;
+	    push(@fileslistfiles,$1);
+	} elsif (m/^([-+.,_0-9a-zA-Z]+) (\S+) (\S+)$/) {
+	    defined($f2sec{$1}) &&
+		&warn("duplicate files list entry for file $1 (line $.)");
+	    $f2sec{$1}= $2;
+	    $f2pri{$1}= $3;
+	    push(@fileslistfiles,$1);
+	} else {
+	    &error("badly formed line in files list file, line $.");
+	}
     }
+    close(FL);
 }
-close(FL);
 
 for $_ (keys %fi) {
     $v= $fi{$_};

+ 7 - 3
scripts/dpkg-source.1

@@ -179,15 +179,19 @@ Remove an output control file field.
 This option is understood by
 .BR dpkg-source ", " dpkg-gencontrol " and " dpkg-genchanges .
 .TP
-.BR -b | -B
+.BR -b | -B | -S
 For
 .BR dpkg-genchanges " and " dpkg-buildpackage
-this specifies that a binary-only build is taking place.
+.BR -b " and " -B
+specify that a binary-only build is taking place.
 .B -b
 indicates that no source files are to be built and/or distributed, and
 .B -B
 that no architecture-independent binary package files are to be
-distributed either.  The distinction between
+distributed either.
+.B -S
+specifies that only the source should be uploaded and no binary packages
+need to be made. The distinction between
 .BR -b " and " -B
 is only used by
 .BR dpkg-buildpackage ;