From: Scott James Remnant Date: Sun, 25 Apr 2004 17:11:41 +0000 (+0000) Subject: Tollef and I gorged on low hanging fruit and got our hands sticky. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c8c452ed27c6e9601e51be60b49fe0cb3f2e7d0;p=dpkg Tollef and I gorged on low hanging fruit and got our hands sticky. --- diff --git a/ChangeLog b/ChangeLog index b6c15ce9..6e0a2a40 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +Sun Apr 25 18:02:34 BST 2004 Scott James Remnant + + * scripts/install-info.pl: Add gndn --dir-file option for compatibility + with GNU install-info. Correct code to break infinite loop. + +Sun Apr 25 17:57:46 BST 2004 Scott James Remnant + + * scripts/dpkg-divert.8: Document that diverting shared libraries + can be troublesome when combined with ldconfig. + +Sun Apr 25 17:53:06 BST 2004 Scott James Remnant + + * scripts/dpkg-checkbuilddeps.1: This script no longer checks for + build-essential, so don't document that it does. + +Sun Apr 25 17:45:47 BST 2004 Scott James Remnant + + * scripts/dpkg-genchanges.pl: Group the -o expression to find + using braces. + Sun Apr 25 17:17:16 BST 2004 Scott James Remnant * man/es/Makefile.in: Add new dpkg-source.1 manpage. @@ -10,6 +30,46 @@ Sun Apr 25 16:59:09 BST 2004 Scott James Remnant * configure.in: Add Norwegian Nynorsk and Portugese linguas. +Sun Apr 25 12:27:38 CEST 2004 Tollef Fog Heen + + * main/archive.c: make block and char devices work properly when + extracting. mknod can create other kinds of devices than just char + and block devices, so we need to pass the type of device to mknod in + the mode argument. + +Sun Apr 25 00:46:38 CEST 2004 Tollef Fog Heen + + * split/mksplit.pl: cut off anything after the first piece of whitespace + when getting the md5sum, since we now get a different-formatted md5sum + back. (It now has a trailing dash.) + +Sun Apr 25 00:23:27 CEST 2004 Tollef Fog Heen + + * lib/dump.c: Terminate buffer in order to not display garbage when + displaying dependency fields. + +Sun Apr 25 00:12:27 CEST 2004 Tollef Fog Heen + + * main/query.c, dpkg-deb/main.c: Fix up the query format to be + consistent with what the library expects. Remove the pkg: prefix from + the default showformat. + +Sun Apr 25 00:06:27 CEST 2004 Tollef Fog Heen + + * scripts/dpkg-statoverride.pl: Make sure the permissions passed to + dpkg-statoverride are numeric. + +Sat Apr 24 23:11:12 CEST 2004 Tollef Fog Heen + + * include/dpkg.h.in, lib/ehandle.c, lib/myopt.c: Failed opening of + configuration files are no longer a fatal error. Thanks to Max + Vozeler for the patch. + +Mon Apr 19 12:24:40 CEST 2004 Tollef Fog Heen + + * scripts/dpkg-shlibdeps.pl: Set LC_ALL to C before spawning off dpkg + --search, to avoid searching on localized strings. + Sun Mar 28 18:32:19 CEST 2004 Jordi Mallach * po/ca.po: Update Catalan translation. @@ -65,6 +125,10 @@ Thu Mar 8 00:54:00 CEST 2004 Tollef Fog Heen * man/ja/{dpkg-architecture.1,dpkg-query.8,dselect.8}: Update Japanese translation. Closes: #224616 +Thu Mar 8 00:38:00 CEST 2004 Tollef Fog Heen + + * release.sh: Remove .svn directories as well. + Mon Mar 8 19:37:00 GMT 2004 Scott James Remnant * version-nr, debian/changelog: Bump version to 1.10.20. diff --git a/debian/changelog b/debian/changelog index 9756ca76..ad15a085 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,36 @@ dpkg (1.10.21) unstable; urgency=low - * Don't require argument for start-stop-daemon -V. Closes: #237589. * Fix incorrect linked list node removal code that caused every second shared or diverted conffile to be deleted by dpkg. Closes: #10879, #33046, #47267, #90623, #98210, #109691, #146167. Closes: #155456, #204275. + * Call mknod with the required device type. Closes: #158916. + * Correct the default query output format to be consistent with + what the underlying library expects. Closes: #174973. + * Fix missing NULL-termination in dpkg-query -W display of dependency + fields. Closes: #174978 + * Strip output from md5sum(1) after the first whitespace character. + Closes: #200763. + * Output a warning if we cannot open a configuration file instead of + treating it as a fatal error, in case our home directory is not readable + by root. Closes: #200701. + * Set LC_ALL to C before spawning off dpkg --search, to avoid searching + on localized strings. Closes: #244316. + * Don't require argument for start-stop-daemon -V. Closes: #237589. + * Correct use of @ARGV within dpkg-scanpackages, allowing -u to work + once again. Closes: #225086, #241503. + * Make sure file permissions passed to dpkg-statoverride are numeric. + Closes: #161156. + * Correctly break out of the loop in install-info. + Closes: #124225, #160761. + * Add ignored --dir-file option to install-info for GNU install-info + compatibility. Closes: #179192 + * Refer to debian-policy in dpkg-doc's description instead of the + non-existant packaging-manual. Closes: #120970. + * Remove incorrect mention of build-essential from dpkg-checkbuilddeps + manpage. Closes: #219210. + * Add a note about diverting shared libraries to the dpkg-divert + manpage. Closes: #214699. * Updated Translations: - Brazilian Portugese (Andre Luis Lopes). Closes: #237864. - Catalan (Jordi Mallach). diff --git a/debian/control b/debian/control index 38244eec..6454c2d7 100644 --- a/debian/control +++ b/debian/control @@ -70,7 +70,7 @@ Description: Dpkg Internals Documentation This document describes the internal operations of the dpkg program. It covers building as well as the internals functions. If you are interested in creating your own packages, then you may be more interested in the - packaging-manual documentation package. + debian-policy package. Package: dselect Architecture: any diff --git a/dpkg-deb/main.c b/dpkg-deb/main.c index 2cb8f290..42ce6d67 100644 --- a/dpkg-deb/main.c +++ b/dpkg-deb/main.c @@ -40,7 +40,7 @@ #include "dpkg-deb.h" -const char* showformat = "${pkg:Package}\t${pkg:Version}\n"; +const char* showformat = "${Package}\t${Version}\n"; static void printversion(void) { if (fputs(_("Debian `"), stdout) < 0) werr("stdout"); diff --git a/include/dpkg.h.in b/include/dpkg.h.in index 230fe539..c3fbd8a3 100644 --- a/include/dpkg.h.in +++ b/include/dpkg.h.in @@ -191,6 +191,7 @@ void ohshite(const char *fmt, ...) NONRETURNPRINTFFORMAT(1,2); void ohshitvb(struct varbuf*) NONRETURNING; void badusage(const char *fmt, ...) NONRETURNPRINTFFORMAT(1,2); void werr(const char *what) NONRETURNING; +void warningf(const char *fmt, ...); /*** from mlib.c ***/ diff --git a/lib/dump.c b/lib/dump.c index 48976d7f..888f3e0f 100644 --- a/lib/dump.c +++ b/lib/dump.c @@ -207,6 +207,8 @@ void w_dependency(struct varbuf *vb, if (!pifp->valid) return; if (flags&fw_printheader) sprintf(fnbuf,"%s: ",fip->name); + else + fnbuf[0] = '\0'; depdel= fnbuf; for (dyp= pifp->depends; dyp; dyp= dyp->next) { diff --git a/lib/ehandle.c b/lib/ehandle.c index d60804b5..f04217eb 100644 --- a/lib/ehandle.c +++ b/lib/ehandle.c @@ -256,6 +256,19 @@ void ohshite(const char *fmt, ...) { longjmp(*econtext->jbufp,1); } +void warningf(const char *fmt, ...) { + int e; + va_list al; + char buf[1024]; + + e=errno; + va_start(al,fmt); + vsnprintf(buf,sizeof(buf),fmt,al); + va_end(al); + + fprintf(stderr,"%s: %s",buf,strerror(e)); +} + void badusage(const char *fmt, ...) { char buf[1024]; va_list al; diff --git a/lib/myopt.c b/lib/myopt.c index adfef9b7..56c8f903 100644 --- a/lib/myopt.c +++ b/lib/myopt.c @@ -37,7 +37,8 @@ void myfileopt(const char* fn, const struct cmdinfo* cmdinfos) { if (!file) { if (errno==ENOENT) return; - ohshite(_("failed to open configuration file `%.255s' for reading"), fn); + warningf(_("failed to open configuration file `%.255s' for reading"),fn); + return; } while (fgets(linebuf, sizeof(linebuf), file)) { diff --git a/main/archives.c b/main/archives.c index 7d61497e..76d61edc 100644 --- a/main/archives.c +++ b/main/archives.c @@ -525,10 +525,16 @@ int tarobject(struct TarInfo *ti) { debug(dbg_eachfiledetail,"tarobject FIFO"); newtarobject_allmodes(fnamenewvb.buf,ti, nifd->namenode->statoverride); break; - case CharacterDevice: case BlockDevice: - if (mknod(fnamenewvb.buf,0,ti->Device)) + case CharacterDevice: + if (mknod(fnamenewvb.buf,S_IFCHR, ti->Device)) ohshite(_("error creating device `%.255s'"),ti->Name); - debug(dbg_eachfiledetail,"tarobject CharacterDevice|BlockDevice"); + debug(dbg_eachfiledetail,"tarobject CharacterDevice"); + newtarobject_allmodes(fnamenewvb.buf,ti, nifd->namenode->statoverride); + break; + case BlockDevice: + if (mknod(fnamenewvb.buf,S_IFBLK, ti->Device)) + ohshite(_("error creating device `%.255s'"),ti->Name); + debug(dbg_eachfiledetail,"tarobject BlockDevice"); newtarobject_allmodes(fnamenewvb.buf,ti, nifd->namenode->statoverride); break; case HardLink: diff --git a/main/query.c b/main/query.c index 51e0cffa..d4d8e81d 100644 --- a/main/query.c +++ b/main/query.c @@ -43,7 +43,7 @@ #include "filesdb.h" #include "main.h" -static const char* showformat = "${pkg:Package}\t${pkg:Version}\n"; +static const char* showformat = "${Package}\t${Version}\n"; void ensure_package_clientdata(struct pkginfo *pkg) { diff --git a/release.sh b/release.sh index 4c25eb1e..0274e9e0 100755 --- a/release.sh +++ b/release.sh @@ -8,6 +8,7 @@ # remove CVS files rm -rf `find . -name CVS -type d` rm -f `find . -name .cvsignore -type f` +rm -rf `find . -name .svn -type d` # Remove any cruft files... rm -f `find . -name '*.orig' -o -name '*.rej' -o -name '*~' -o -name '.#*'` diff --git a/scripts/dpkg-checkbuilddeps.1 b/scripts/dpkg-checkbuilddeps.1 index 529eb1af..4013b5ff 100644 --- a/scripts/dpkg-checkbuilddeps.1 +++ b/scripts/dpkg-checkbuilddeps.1 @@ -5,9 +5,8 @@ dpkg-checkbuilddeps -- check build dependencies and conflicts \fBdpkg-checkbuilddeps\fR -B [\fIcontrol-file\fR] .SH DESCRIPTION This program checks the installed packages in the system against the build -dependencies and build conflicts listed in the control file. It also checks -for build-essential. If any are not met, it displays them and exits with a -nonzero return code. +dependencies and build conflicts listed in the control file. If any are +not met, it displays them and exits with a nonzero return code. .P By default, \fBdebian/control\fR is read, but an alternate control filename may be specified on the command line. diff --git a/scripts/dpkg-divert.8 b/scripts/dpkg-divert.8 index 7817aa95..e2293253 100644 --- a/scripts/dpkg-divert.8 +++ b/scripts/dpkg-divert.8 @@ -66,8 +66,14 @@ Output program name and version and exit successfully. .SH NOTES When adding, default is --local and --divert .distrib. When removing, --package or --local and --divert must match if specified. -.br + Directories can't be diverted with dpkg-divert. + +Care should be taken when diverting shared libraries, ldconfig (8) creates +a symbolic link based on the DT_SONAME field embedded in the library. +Because ldconfig doesn't honour diverts (only dpkg does), if a diverted +ibrary has the same SONAME as the undiverted one the symlink may end up +pointing at the diverted library. .SH FILES .TP .I /var/lib/dpkg/diversions diff --git a/scripts/dpkg-scanpackages.pl b/scripts/dpkg-scanpackages.pl index 4f77944f..e5387355 100755 --- a/scripts/dpkg-scanpackages.pl +++ b/scripts/dpkg-scanpackages.pl @@ -33,7 +33,7 @@ $i=100; grep($pri{$_}=$i--,@fieldpri); $udeb = 0; $arch = ''; -while ($ARGV[1] =~ m/^-.*/) { +while ($ARGV[0] =~ m/^-.*/) { my $opt = shift @ARGV; if ($opt eq '-u') { $udeb = 1; @@ -49,7 +49,7 @@ while ($ARGV[1] =~ m/^-.*/) { } } $ext = $udeb ? 'udeb' : 'deb'; -$pattern = $arch ? "-name '*_all.$ext' -o -name '*_$arch.$ext'" : "-name '*.$ext'"; +$pattern = $arch ? "'(' -name '*_all.$ext' -o -name '*_$arch.$ext' ')'" : "-name '*.$ext'"; if ($ARGV[1] eq '-u') { $udeb = 1; shift @ARGV; diff --git a/scripts/dpkg-shlibdeps.pl b/scripts/dpkg-shlibdeps.pl index 64fa30f9..e5f0a56a 100755 --- a/scripts/dpkg-shlibdeps.pl +++ b/scripts/dpkg-shlibdeps.pl @@ -192,6 +192,7 @@ if ($#libfiles >= 0) { if (!$c) { close STDERR; # we don't need to see dpkg's errors open STDERR, "> /dev/null"; + $ENV{LC_ALL} = "C"; exec("dpkg","--search","--",map {"$_"} @libfiles); syserr("cannot exec dpkg"); } while (

) { diff --git a/scripts/dpkg-statoverride.pl b/scripts/dpkg-statoverride.pl index cdd01aa5..485f0bce 100755 --- a/scripts/dpkg-statoverride.pl +++ b/scripts/dpkg-statoverride.pl @@ -95,7 +95,7 @@ if ($mode eq "add") { } $mode= $ARGV[2]; - (($mode<0) or (oct($mode)>07777)) && &badusage("illegal mode $mode"); + (($mode<0) or (oct($mode)>07777) or ($mode !~ m/\d+/)) && &badusage("illegal mode $mode"); $file= $ARGV[3]; $file =~ m/\n/ && &badusage("file may not contain newlines"); $file =~ s,/+$,, && print STDERR "stripping trailing /\n"; diff --git a/scripts/install-info.pl b/scripts/install-info.pl index 6d1ccc23..5abf8613 100755 --- a/scripts/install-info.pl +++ b/scripts/install-info.pl @@ -23,7 +23,7 @@ usage: install-info [--version] [--help] [--debug] [--maxwidth=nnn] [--section regexp title] [--infodir=xxx] [--align=nnn] [--calign=nnn] [--quiet] [--menuentry=xxx] [--info-dir=xxx] [--keep-old] [--description=xxx] [--test] - [--remove | --remove-exactly ] + [--remove | --remove-exactly ] [--dir-file] [--] filename END @@ -37,6 +37,7 @@ $default='/usr/share/base-files/info.dir'; $menuentry=""; $description=""; +$infodir=""; $sectionre=""; $sectiontitle=""; $infoentry=""; @@ -90,6 +91,8 @@ while ($ARGV[0] =~ m/^--/) { $infodir=$'; } elsif (m/^--description=/) { $description=$'; + } elsif (m/^--dir-file=/) { # for compatibility with GNU install-info + $infodir=$'; } else { print STDERR "$name: unknown option \`$_'\n"; &usage(STDERR); exit 1; } @@ -280,7 +283,7 @@ open(OLD,"$infodir/dir") || &ulquit("open $infodir/dir: $!"); @work= ; eof(OLD) || &ulquit("read $infodir/dir: $!"); close(OLD) || &ulquit("close $infodir/dir after read: $!"); -while ($work[$#work] !~ m/\S/) { $#work--; last unless $#work; } +while (($#work >= 0) && ($work[$#work] !~ m/\S/)) { $#work--; } while (@work) { $_= shift(@work); diff --git a/split/mksplit.pl b/split/mksplit.pl index aa71a67b..f01741cf 100644 --- a/split/mksplit.pl +++ b/split/mksplit.pl @@ -32,6 +32,7 @@ sub output { $myversion='2.1'; $csum= &output("md5sum <\"$sourcefile\""); +$csum =~ s/\s.*//; $package= &output("dpkg-deb --field \"$sourcefile\" Package"); $version= &output("dpkg-deb --field \"$sourcefile\" Version"); $revision= &output("dpkg-deb --field \"$sourcefile\" Package_Revision");