From 837acb8f9c453b7d9350444548335b2f18dffd25 Mon Sep 17 00:00:00 2001 From: Wichert Akkerman Date: Mon, 4 Dec 2000 15:03:32 +0000 Subject: [PATCH] scripts/dpkg-statoverride.pl, main/filesdb.c: merge patch from Robert Luberda to fix statoverrides using numerical [ug]ids Merge updats from the v17 branch: + scripts/dpkg-buildpackage.sh: Quote test options for usepause + scripts/dpkg-shlibdeps.pl: resolve library paths using a combination of the libc major version, and ldconfig -p output. Solves problems with errant libc5 deps. + scripts/dpkg-shlibdeps.pl: Make it parse soname's in the format of "libfoo-X.X.so" (e.g. libdb-3.1.so) and use it. Also make it give a warning if there is a NEEDED line in the objdump output that we cannot grok. + scripts/update-rc.d.pl: fix typo in regexp for scripts + debian/rules: remove final occurance of emacs --- ChangeLog | 17 ++++++++++++++++ debian/changelog | 17 ++++++++++++++-- debian/rules | 1 - main/filesdb.c | 6 +++--- scripts/dpkg-buildpackage.sh | 6 +++--- scripts/dpkg-shlibdeps.pl | 38 ++++++++++++++++++++++++++++++------ scripts/dpkg-statoverride.pl | 14 ++++++------- scripts/update-rc.d.pl | 2 +- 8 files changed, 78 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index 003f055d..8f1cad08 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +Mon Dec 4 14:42:01 CET 2000 Wichert Akkerman + + * scripts/dpkg-statoverride.pl, main/filesdb.c: merge patch from + Robert Luberda to fix statoverrides + using numerical [ug]ids + * Merge updats from the v17 branch: + + scripts/dpkg-buildpackage.sh: Quote test options for usepause + + scripts/dpkg-shlibdeps.pl: resolve library paths using a combination + of the libc major version, and ldconfig -p output. Solves problems + with errant libc5 deps. + + scripts/dpkg-shlibdeps.pl: Make it parse soname's in the format of + "libfoo-X.X.so" (e.g. libdb-3.1.so) and use it. Also make it give a + warning if there is a NEEDED line in the objdump output that we cannot + grok. + + scripts/update-rc.d.pl: fix typo in regexp for scripts + + debian/rules: remove final occurance of emacs + Mon Dec 4 01:34:57 CET 2000 Wichert Akkerman * Merge more of Adams handywork to bring dpkg up to speed (literally :) diff --git a/debian/changelog b/debian/changelog index ff5fdefe..f7d16880 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,8 @@ dpkg (1.8.0) unstable; urgency=low * Update Galish translation * Add new --import option to dpkg-statoverride to make it easy to import suidmanager settings. + * Speedups patches by Adam Heath + * statoverride fixes by Robert Luberda, Closes: Bug#78436 -- Wichert Akkerman UNRELEASED @@ -15,8 +17,19 @@ dpkg (1.7.2) unstable; urgency=low * Add new powerpc-linux-gnu entry to archtable. Closes: Bug#76522 * No longer bother to install emacs things. I don't use emacs myself and can't support that properly. - - -- Wichert Akkerman UNRELEASED + * scripts/dpkg-shlibdeps.pl: Make it parse soname's in the format of + "libfoo-X.X.so" (e.g. libdb-3.1.so) and use it. Also make it give a + warning if there is a NEEDED line in the objdump output that we cannot + grok. + * scripts/dpkg-shlibdeps.pl: resolve library paths using a combination + of the libc major version, and ldconfig -p output. Solves problems + with errant libc5 deps. + * Correct name of .changes file when doing source-only builds + * Fix -ap option for dpkg-buildpackage. Closes: Bug#77305 + * Fix typo in update-alternatives manpage. Closes: Bug#77829 + * Fix typo in script-regexp update-rc.d. Closes: Bug#76029 + + -- Wichert Akkerman Thu, 23 Nov 2000 18:55:50 +0100 dpkg (1.7.1) unstable; urgency=medium diff --git a/debian/rules b/debian/rules index 2945abf8..c438c2d0 100755 --- a/debian/rules +++ b/debian/rules @@ -152,7 +152,6 @@ binary-dpkg-dev: stamp-binary install -d -m 755 -o root -g root $(TMP_DPKG_DEV)/usr/bin mv $(TMP)/usr/lib/dpkg/parsechangelog $(TMP_DPKG_DEV)/usr/lib/dpkg/ mv $(TMP)/usr/lib/dpkg/controllib.pl $(TMP_DPKG_DEV)/usr/lib/dpkg/ - mv $(TMP)/usr/share/emacs $(TMP_DPKG_DEV)/usr/share/ set -e ; for i in dpkg-name dpkg-source dpkg-genchanges dpkg-gencontrol \ dpkg-shlibdeps dpkg-buildpackage dpkg-distaddfile 822-date \ dpkg-scanpackages dpkg-scansources dpkg-architecture \ diff --git a/main/filesdb.c b/main/filesdb.c index e479eb8a..8312f20b 100644 --- a/main/filesdb.c +++ b/main/filesdb.c @@ -367,7 +367,7 @@ void ensure_statoverrides(void) { ohshit("syntax error in statusoverride file "); *ptr=0; if (thisline[0]=='#') { - fso->uid=strtol(thisline, &endptr, 10); + fso->uid=strtol(thisline + 1, &endptr, 10); if (*endptr!=0) ohshit("syntax error: invalid uid in statusoverride file "); } else { @@ -380,14 +380,14 @@ void ensure_statoverrides(void) { /* Move to the next bit */ thisline=ptr+1; if (thisline>=loaded_list_end) - ohshit("unexecpted end of line in statusoverride file"); + ohshit("unexpected end of line in statusoverride file"); /* Extract the gid */ if (!(ptr=memchr(thisline, ' ', nextline-thisline))) ohshit("syntax error in statusoverride file "); *ptr=0; if (thisline[0]=='#') { - fso->gid=strtol(thisline, &endptr, 10); + fso->gid=strtol(thisline + 1, &endptr, 10); if (*endptr!=0) ohshit("syntax error: invalid gid in statusoverride file "); } else { diff --git a/scripts/dpkg-buildpackage.sh b/scripts/dpkg-buildpackage.sh index d1f16115..a57addc3 100755 --- a/scripts/dpkg-buildpackage.sh +++ b/scripts/dpkg-buildpackage.sh @@ -51,8 +51,8 @@ elif command -v pgp > /dev/null 2>&1 ; then signcommand=pgp fi - signsource='withecho signfile' - signchanges='withecho signfile' +signsource='withecho signfile' +signchanges='withecho signfile' cleansource=false binarytarget=binary sourcestyle='' @@ -183,7 +183,7 @@ 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 +if [ "$usepause" = "true" ] && [ "x$binaryonly" = x -o "x$signchanges" != x ] ; then echo Press the return key to start signing process read dummy_stuff fi diff --git a/scripts/dpkg-shlibdeps.pl b/scripts/dpkg-shlibdeps.pl index e0dc1015..9f4a9717 100755 --- a/scripts/dpkg-shlibdeps.pl +++ b/scripts/dpkg-shlibdeps.pl @@ -93,14 +93,40 @@ sub isbin { for ($i=0;$i<=$#exec;$i++) { if (!isbin ($exec[$i])) { next; } + + # First we get an ldd output to see what libs + paths we have at out + # disposal. + my %so2path = (); + defined($c= open(P,"-|")) || syserr("cannot fork for ldd"); + if (!$c) { exec("ldd","--",$exec[$i]); syserr("cannot exec ldd"); } + while (

) { + if (m,^\s+(\S+)\s+=>\s+(\S+)\s+\(0x.+\)?$,) { + $so2path{$1} = $2; + } + } + close(P); $? && subprocerr("ldd on \`$exec[$i]'"); + + # Now we get the direct deps of the program. We then check back with + # the ldd output from above to see what our path is. defined($c= open(P,"-|")) || syserr("cannot fork for objdump"); if (!$c) { exec("objdump","-p","--",$exec[$i]); syserr("cannot exec objdump"); } while (

) { chomp; - if (m,^\s*NEEDED\s+(\S+)\.so\.(\S+)$,) { - push(@libname,$1); push(@libsoname,$2); - push(@libf,$execf[$i]); - push(@libfiles,"$1.so.$2"); + if (m,^\s*NEEDED\s+,) { + if (m,^\s*NEEDED\s+((\S+)\.so\.(\S+))$,) { + push(@libname,$2); push(@libsoname,$3); + push(@libf,$execf[$i]); + &warn("could not find path for $1") unless defined($so2path{$1}); + push(@libfiles,$so2path{$1}); + } elsif (m,^\s*NEEDED\s+((\S+)-(\S+)\.so)$,) { + push(@libname,$2); push(@libsoname,$3); + push(@libf,$execf[$i]); + &warn("could not find path for $1") unless defined($so2path{$1}); + push(@libfiles,$so2path{$1}); + } else { + m,^\s*NEEDED\s+(\S+)$,; + &warn("format of $1 not recognized"); + } } } close(P); $? && subprocerr("objdump on \`$exec[$i]'"); @@ -162,14 +188,14 @@ if ($#libfiles >= 0) { if (!$c) { close STDERR; # we don't need to see dpkg's errors open STDERR, "> /dev/null"; - exec("dpkg","--search","--",map {"*/$_"} @libfiles); syserr("cannot exec dpkg"); + exec("dpkg","--search","--",map {"$_"} @libfiles); syserr("cannot exec dpkg"); } while (

) { chomp; if (m/^local diversion |^diversion by/) { &warn("diversions involved - output may be incorrect"); print(STDERR " $_\n") || syserr("write diversion info to stderr"); - } elsif (m=^(\S+(, \S+)*): /.+/([^/]+)$=) { + } elsif (m=^(\S+(, \S+)*): (\S+)$=) { push @{$pathpackages{$+}}, split(/, /, $1); } else { &warn("unknown output from dpkg --search: \`$_'"); diff --git a/scripts/dpkg-statoverride.pl b/scripts/dpkg-statoverride.pl index b41391fc..b89a9547 100755 --- a/scripts/dpkg-statoverride.pl +++ b/scripts/dpkg-statoverride.pl @@ -82,7 +82,7 @@ if ($mode eq "add") { @ARGV==4 || &badusage("--add needs four arguments"); $user=$ARGV[0]; - if ($user =~ m/^#\(0-9+\)$/) { + if ($user =~ m/^#([0-9]+)$/) { $uid=$1; &badusage("illegal user $user") if ($uid<0); } else { @@ -90,15 +90,15 @@ if ($mode eq "add") { } $group=$ARGV[1]; - if ($group =~ m/^#\(0-9+\)$/) { + if ($group =~ m/^#([0-9]+)$/) { $gid=$1; &badusage("illegal group $group") if ($gid<0); } else { - (($name,$pw,$gid)=getgrnam($group)) || &badusage("illegal group $group"); + (($name,$pw,$gid)=getgrnam($group)) || &badusage("non-existing group $group"); } $mode= $ARGV[2]; - (($mode<0) or ($mode>07777)) && &badusage("illegal mode $mode"); + (($mode<0) or (oct($mode)>07777)) && &badusage("illegal mode $mode"); $file= $ARGV[3]; $file =~ m/\n/ && &badusage("file may not contain newlines"); @@ -116,12 +116,12 @@ if ($mode eq "add") { $mode{$file}=$mode; $dowrite=1; - if ($doupate) { + if ($doupdate) { if (not -f $file) { print STDERR "waring: --update given but $file does not exist\n"; } else { - chmod $mode,$file || warn "failed to chmod $file: $!\n"; - chown $uid,$gid,$file || warn "failed to chown $file: $!\n"; + chmod (oct($mode),$file) || warn "failed to chmod $file: $!\n"; + chown ($uid,$gid,$file) || warn "failed to chown $file: $!\n"; } } } elsif ($mode eq "remove") { diff --git a/scripts/update-rc.d.pl b/scripts/update-rc.d.pl index 8cad4044..ac9a1ae2 100644 --- a/scripts/update-rc.d.pl +++ b/scripts/update-rc.d.pl @@ -96,7 +96,7 @@ sub checklinks { } opendir(DIR, "."); foreach $_ (readdir(DIR)) { - next unless (/^[S|K]\d\d$bn$/); + next unless (/^[SK]\d\d$bn$/); $fn = "$etcd$i.d/$_"; $found = 1; $islnk = &is_link ($_[0], $fn, $bn); -- 2.39.5