From: Ian Jackson Date: Sat, 10 Aug 1996 01:13:47 +0000 (+0100) Subject: dpkg (1.3.2) experimental; urgency=LOW (MEDIUM for dpkg-source) X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0f5a81a8bfc7f3abd130b3806928d0c756e35473;p=dpkg 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 Sat, 10 Aug 1996 02:13:47 +0100 --- diff --git a/TODO b/TODO index 5f461ba1..816c203d 100644 --- a/TODO +++ b/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) diff --git a/debian/changelog b/debian/changelog index 07025f1c..b48d6098 100644 --- a/debian/changelog +++ b/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 Sat, 10 Aug 1996 02:13:47 +0100 + dpkg (1.3.1) experimental; urgency=LOW * manpage for dpkg-source et al now available. diff --git a/debian/copyright b/debian/copyright index 0774320b..6f29f516 100644 --- a/debian/copyright +++ b/debian/copyright @@ -5,6 +5,7 @@ which is part of Debian. Copyright (C) 1994,1995,1996 Ian Jackson Copyright (C) 1995,1996 Erick Branderhorst +Copyright (C) 1996 Miquel van Smoorenburg Copyright (C) 1996 Kim-Minh Kaplan Copyright (C) 1996 Michael Shields Copyright (C) 1995 Bruce Perens diff --git a/debian/rules b/debian/rules index c3194638..dfa32378 100755 --- a/debian/rules +++ b/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 ; \ diff --git a/doc/Makefile.in b/doc/Makefile.in index dc906e19..3c0afeb9 100644 --- a/doc/Makefile.in +++ b/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 diff --git a/doc/developer-keys.pgp b/doc/developer-keys.pgp index 8e19ee19..e3073bbc 100644 Binary files a/doc/developer-keys.pgp and b/doc/developer-keys.pgp differ diff --git a/scripts/dpkg-source.1 b/scripts/dpkg-source.1 index bfead974..5b674732 100644 --- a/scripts/dpkg-source.1 +++ b/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 diff --git a/scripts/dpkg-source.pl b/scripts/dpkg-source.pl index ba33a53c..634a8248 100644 --- a/scripts/dpkg-source.pl +++ b/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"); diff --git a/scripts/install-info.pl b/scripts/install-info.pl index a5a2af05..0b41eb36 100755 --- a/scripts/install-info.pl +++ b/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") || diff --git a/scripts/update-rc.d.sh b/scripts/update-rc.d.old-sh similarity index 100% rename from scripts/update-rc.d.sh rename to scripts/update-rc.d.old-sh diff --git a/scripts/update-rc.d.pl b/scripts/update-rc.d.pl new file mode 100644 index 00000000..7c8c9116 --- /dev/null +++ b/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] remove +# update-rc.d [options] +# +# Options are: +# start . +# stop . +# +# defaults [ | ] +# (means start 2 3 4 5 +# as well as stop 0 1 2 3 4 5 6 +# 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 < remove + update-rc.d defaults [ | ] + update-rc.d start|stop . ... +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; diff --git a/version.h b/version.h index ff826e2e..4dcc9737 100644 --- a/version.h +++ b/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 */