Prechádzať zdrojové kódy

dpkg (1.3.2) experimental; urgency=LOW (MEDIUM for dpkg-source)

  * Faster update-rc.d written in Perl by Miquel van Smoorenburg.
  * install-info --test doesn't lock dir.  (Bug#3992, thanks Darren).

  * dpkg-source doesn't break in the presence of any symlinks.

  * More developers' keys added to doc/developer-keys.pgp.
  * Install developers' keys in /usr/doc/dpkg/developer-keys.pgp.
  * dpkg-source documents undefined substvar behaviour.
  * minor debian/rules cleanups.

 -- Ian Jackson <ian@chiark.chu.cam.ac.uk>  Sat, 10 Aug 1996 02:13:47 +0100
Ian Jackson 30 rokov pred
rodič
commit
0f5a81a8bf

+ 0 - 1
TODO

@@ -38,7 +38,6 @@ other stuff unlikely to get done soon
  * newbie interface to dselect. 1037
  * FTP installation method
  * `template' file giving default selections of dselect.
- * update-rc.d in C
  * start-stop-daemon in C. 1670
  * dselect per-half focus and keybindings improvements. 1555
  * floppy map (where are the files)

+ 14 - 0
debian/changelog

@@ -1,3 +1,17 @@
+dpkg (1.3.2) experimental; urgency=LOW (MEDIUM for dpkg-source)
+
+  * Faster update-rc.d written in Perl by Miquel van Smoorenburg.
+  * install-info --test doesn't lock dir.  (Bug#3992, thanks Darren).
+
+  * dpkg-source doesn't break in the presence of any symlinks.
+
+  * More developers' keys added to doc/developer-keys.pgp.
+  * Install developers' keys in /usr/doc/dpkg/developer-keys.pgp.
+  * dpkg-source documents undefined substvar behaviour.
+  * minor debian/rules cleanups.
+
+ -- Ian Jackson <ian@chiark.chu.cam.ac.uk>  Sat, 10 Aug 1996 02:13:47 +0100
+
 dpkg (1.3.1) experimental; urgency=LOW
 
   * manpage for dpkg-source et al now available.

+ 1 - 0
debian/copyright

@@ -5,6 +5,7 @@ which is part of Debian.
 
 Copyright (C) 1994,1995,1996 Ian Jackson <iwj10@cus.cam.ac.uk>
 Copyright (C) 1995,1996 Erick Branderhorst <branderhorst@heel.fgg.eur.nl>
+Copyright (C) 1996 Miquel van Smoorenburg <miquels@cistron.nl>
 Copyright (C) 1996 Kim-Minh Kaplan <kkaplan@cdfhp3.in2p3.fr>
 Copyright (C) 1996 Michael Shields <shields@crosslink.net>
 Copyright (C) 1995 Bruce Perens <bruce@pixar.com>

+ 1 - 1
debian/rules

@@ -21,7 +21,7 @@ clean:
 
 binary:	checkroot build
 	-rm -rf debian/tmp
-	mkdir debian/tmp debian/tmp/DEBIAN
+	install -d debian/tmp debian/tmp/DEBIAN
 	install -d debian/tmp/usr/doc/{copyright,dpkg}
 	set -e; if [ $(arch) = i386 ]; then \
 		dpkg-gencontrol -Vlibcver=' (>= 5.2.18-2)' >$(cidir)/control ; \

+ 2 - 2
doc/Makefile.in

@@ -37,10 +37,10 @@ TEXI2DVI = texi2dvi
 
 DPKGDOCS= auto-deconfiguration.txt dependency-ordering.txt \
  disappear-replace.txt diversions.text \
- essential-flag.txt version-ordering.txt
+ essential-flag.txt version-ordering.txt developer-keys.pgp
 
 # Files folded into main guidelines document
-OBSOLETEDOCS= descriptions.txt upgrades+errors.txt developer-keys.pgp \
+OBSOLETEDOCS= descriptions.txt upgrades+errors.txt \
  maintainer-script-args.txt virtual-dependencies.txt
 
 all:		$(DPKGDOCS) guidelines.info

BIN
doc/developer-keys.pgp


+ 3 - 0
scripts/dpkg-source.1

@@ -345,6 +345,9 @@ file will change too.
 .TP
 .BR newline ", " space ", " tab
 These variables each hold the corresponding character.
+
+If a variable is referred to but not defined it generates a warning
+and an empty value is assumed.
 .SH FILES
 .TP
 .B debian/control

+ 11 - 6
scripts/dpkg-source.pl

@@ -235,7 +235,7 @@ if ($opmode eq 'build') {
                     &syserr("cannot read link $dir/$fn");
                 defined($n2= readlink("$origdir/$fn")) ||
                     &syserr("cannot read orig link $origdir/$fn");
-                $n eq $nw || &unrepdiff2("symlink to $n2","symlink to $n");
+                $n eq $n2 || &unrepdiff2("symlink to $n2","symlink to $n");
             } elsif (-f _) {
                 $type{$fn}= 'plain file';
                 if (!lstat("$origdir/$fn")) {
@@ -322,7 +322,12 @@ if ($opmode eq 'build') {
     open(STDOUT,"> $basenamerev.dsc") || &syserr("create $basenamerev.dsc");
     &outputclose;
 
-    exit($ur ? 1 : 0);
+    if ($ur) {
+        print(STDERR "$progname: unrepresentable changes to source\n")
+            || &syserr("write error msg: $!");
+        exit(1);
+    }
+    exit(0);
 
 } else {
 
@@ -415,18 +420,18 @@ if ($opmode eq 'build') {
         s/\n$//;
         m,^(\S{10})\s, ||
             &error("tarfile contains unknown object listed by tar as \`$_'");
-        $fn= $filesinarchive[$efix++];
+        $fn= $filesinarchive[$efix++]; $mode= $1;
+        if ($mode =~ m/^l/) { $_ =~ s/ -\> .*//; }
         substr($_,length($_)-length($fn)-1) eq " $fn" ||
             &error("tarfile contains unexpected object listed by tar as \`$_',".
                    " expected \`$fn'");
-        $_= $1;
-        s/^([-dpsl])// ||
+        $mode =~ s/^([-dpsl])// ||
             &error("tarfile contains object \`$fn' with unknown or forbidden type \`".
                    substr($_,0,1)."'");
         $fn =~ m/\.dpkg-orig$/ &&
             &error("tarfile contains file with name ending .dpkg-orig");
         $type= $&;
-        m/[sStT]/ && $type ne 'd' &&
+        $mode =~ m/[sStT]/ && $type ne 'd' &&
             &error("tarfile contains setuid, setgid or sticky object \`$fn'");
         $fn eq "$expectprefix/debian" && $type ne 'd' &&
             &error("tarfile contains object `debian' that isn't a directory");

+ 2 - 3
scripts/install-info.pl

@@ -205,7 +205,7 @@ END
     }
 }
 
-if (!link("$infodir/dir","$infodir/dir.lock")) {
+if (!$nowrite && !link("$infodir/dir","$infodir/dir.lock")) {
     die "$name: failed to lock dir for editing! $!\n".
         ($! =~ m/exists/i ? "try deleting $infodir/dir.lock ?\n" : '');
 }
@@ -335,9 +335,8 @@ if (!$nowrite) {
         &ulquit("$name: cannot backup old $infodir/dir, giving up: $!\n");
     rename("$infodir/dir.new","$infodir/dir") ||
         &ulquit("$name: install new $infodir/dir: $!\n");
-}
-
 unlink("$infodir/dir.lock") || die "$name: unlock $infodir/dir: $!\n";
+}
 
 sub ulquit {
     unlink("$infodir/dir.lock") ||

scripts/update-rc.d.sh → scripts/update-rc.d.old-sh


+ 166 - 0
scripts/update-rc.d.pl

@@ -0,0 +1,166 @@
+#! /usr/bin/perl
+#
+# update-rc.d	Perl script to update links in /etc/rc?.d
+#
+# Usage:
+#		update-rc.d [-f] <basename> remove
+#		update-rc.d <basename> [options]
+#
+# Options are:
+#		start <codenumber> <runlevel> <runlevel> <runlevel> .
+#		stop  <codenumber> <runlevel> <runlevel> <runlevel> .
+#
+#		defaults [<codenumber> | <startcode> <stopcode>]
+#		(means       start <startcode> 2 3 4 5
+#		 as well as  stop  <stopcode>  0 1 2 3 4 5 6
+#		<codenumber> defaults to 20)
+#
+# Version:	@(#)update-rc.d  1.02  11-Jul-1996  miquels@cistron.nl
+#
+# Changes:      1.00 Wrote perl version directly derived from shell version.
+#		1.01 Fixed problem when dangling symlinks are found in
+#		     /etc/rc?.d/. The shell version just exits silently!
+#		1.02 More misc bugs fixed caused by sh -> perl translation
+#
+
+$version= '1.3.2'; # This line modified by Makefile
+
+chdir('/etc') || die "chdir /etc: $!\n";
+
+$initd='init.d';
+
+sub usage {
+  print STDERR <<EOF;
+Debian GNU/Linux update-rc.d $version.  Copyright (C) 1996 Miquel van
+Smoorenburg.  This is free software; see the GNU General Public Licence
+version 2 or later for copying conditions.  There is NO warranty.
+
+update-rc.d: error: @_
+usage: update-rc.d [-f] <basename> remove
+       update-rc.d <basename> defaults [<cn> | <scn> <kcn>]
+       update-rc.d <basename> start|stop <cn> <r> <r> .  ...
+EOF
+  &leave(1);
+}
+
+
+sub getinode {
+	local @tmp;
+
+	unless (@tmp = stat($_[0])) {
+		print STDERR "stat($_[0]): $!\n";
+		$tmp[1] = 0;
+	}
+	$tmp[1];
+}
+
+sub leave {
+	eval $atexit if ($atexit ne '');
+	exit($_[0]);
+}
+
+$force = 0;
+if ($ARGV[0] eq '-f') {
+	shift @ARGV;
+	$force = 1;
+}
+
+&usage("too few arguments") if ($#ARGV < 1);
+
+$bn = shift @ARGV;
+$action = shift @ARGV;
+
+if ($action eq 'remove') {
+	&usage("remove must be only action") if ($#ARGV > 0);
+	if (-f "$initd/$bn") {
+		unless ($force) {
+			print STDERR "update-rc.d: error: /etc/$initd/$bn exists during rc.d purge (use -f to force).\n";
+			&leave(1);
+		}
+	} else {
+		$atexit = "unlink('$initd/$bn');";
+	}
+	print  " Removing any system startup links to /etc/$initd/$bn ...\n";
+	open(FD, ">>$initd/$bn");
+	close FD;
+	$own = &getinode("$initd/$bn");
+	@files = split(/\s+/, `echo rc?.d/[SK]*`);
+	foreach $f (@files) {
+		$inode = &getinode($f);
+		if ($inode == $own) {
+			unless (unlink($f))  {
+				print STDERR "unlink($f): $!\n";
+				&leave(1);
+			}
+			print "   $f\n";
+		}
+	}
+	&leave(0);
+} elsif ($action eq 'defaults') {
+	if ($#ARGV < 0) {
+		$sn = $kn = 20;
+	} elsif ($#ARGV == 0) {
+		$sn = $kn = $ARGV[0];
+	} elsif ($#ARGV == 1) {
+		$sn = $ARGV[0];
+		$kn = $ARGV[1];
+	} else {
+		&usage("defaults takes only one or two codenumbers");
+	}
+	@ARGV = ('start', "$sn", '2', '3', '4', '5', 'stop',
+			  "$kn", '0', '1', '6');
+} elsif ($action ne 'start' && $action ne 'stop') {
+	&usage("unknown mode or add action $action");
+}
+
+unless (-f "$initd/$bn") {
+	print STDERR "update-rc.d: warning /etc/$initd/$bn doesn't exist during rc.d setup.\n";
+	exit(0);
+}
+
+$own = &getinode("$initd/$bn");
+
+@files = split(/\s+/, `echo rc?.d/[SK]*`);
+foreach $f (@files) {
+	$inode = &getinode($f);
+	if ($inode == $own) {
+		print STDERR " System startup links pointing to /etc/$initd/$bn already exist.\n";
+		exit(0);
+	}
+}
+
+
+print " Adding system startup links pointing to /etc/$initd/$bn ...\n";
+while ($#ARGV >= 1) {
+	if ($ARGV[0] eq 'start') {
+		$ks = 'S';
+	} elsif ($ARGV[0] eq 'stop') {
+		$ks = 'K';
+	} else {
+		&usage("unknown action $1");
+	}
+	shift @ARGV;
+	$number = shift @ARGV;
+	while ($#ARGV >= 0) {
+		$_ = $ARGV[0];
+		if (/^\.$/) {
+			shift @ARGV;
+			last;
+		} elsif (/^.$/) {
+			symlink("../$initd/$bn", "rc$_.d/$ks$number$bn") ||
+				die "symlink: $!\n";
+			print "   rc$_.d/$ks$number$bn -> ../$initd/$bn\n";
+			shift @ARGV;
+			next;
+		} elsif (/^(start|stop)$/) {
+			last;
+		}
+		&usage('runlevel is more than one character\n');
+	}
+}
+
+if ($#ARGV >= 0) {
+	&usage("surplus arguments, but not enough for an add action: @ARGV\n");
+}
+
+0;

+ 1 - 1
version.h

@@ -1 +1 @@
-#define DPKG_VERSION "1.3.1" /* This line modified by Makefile */
+#define DPKG_VERSION "1.3.2" /* This line modified by Makefile */