From 11cb48dd9abfde92d19cd60724ea6df603d0e25a Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Tue, 15 Jan 2008 10:09:03 +0200 Subject: [PATCH] Use the perl POSIX module instead of the enoent helper binary --- ChangeLog | 10 ++++++++++ debian/changelog | 1 + debian/dpkg.install | 1 - scripts/dpkg-divert.pl | 4 +--- scripts/update-alternatives.pl | 4 +--- utils/Makefile.am | 5 ----- utils/enoent.c | 12 ------------ 7 files changed, 13 insertions(+), 24 deletions(-) delete mode 100644 utils/enoent.c diff --git a/ChangeLog b/ChangeLog index 5be8f7ef..059d4203 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-01-16 Guillem Jover + + * scripts/dpkg-divert.pl: Use :errno_h from POSIX. + ($enoent): Remove variable. + (ENOENT): Remove function. + * scripts/update-alternatives.pl: Likewise. + * utils/Makefile.am (pkglib_PROGRAMS): Remove variable. + (enoent_SOURCES): Likewise. + * utils/enoent.c: Remove file. + 2008-01-16 Guillem Jover * dpkg-deb/build.c (do_build): Use NULL instead of 0. diff --git a/debian/changelog b/debian/changelog index 5778f49f..a8992a7e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,7 @@ dpkg (1.14.16) UNRELEASED; urgency=low Closes: #402901 * Do not warn about unrecognized Homepage field in binary package stanzas in dpkg-genchanges and dpkg-source. Closes: #460309 + * Do not use the enoent helper binary, and use perl POSIX module instead. [ Frank Lichtenheld ] * Make the -L option of dpkg-parsechangelog actually work (it's diff --git a/debian/dpkg.install b/debian/dpkg.install index 38e06f7f..2f546183 100644 --- a/debian/dpkg.install +++ b/debian/dpkg.install @@ -7,7 +7,6 @@ usr/bin/dpkg usr/bin/dpkg-deb usr/bin/dpkg-query usr/bin/dpkg-split -usr/lib/dpkg/enoent usr/lib/dpkg/mksplit usr/sbin usr/share/dpkg diff --git a/scripts/dpkg-divert.pl b/scripts/dpkg-divert.pl index 6eeb8188..8c13cb8d 100755 --- a/scripts/dpkg-divert.pl +++ b/scripts/dpkg-divert.pl @@ -3,14 +3,12 @@ use strict; use warnings; +use POSIX qw(:errno_h); use Dpkg; use Dpkg::Gettext; textdomain("dpkg"); -my $enoent = `$dpkglibdir/enoent` || die sprintf(_g("Cannot get ENOENT value from %s: %s"), "$dpkglibdir/enoent", $!); -sub ENOENT { $enoent; } - sub version { printf _g("Debian %s version %s.\n"), $progname, $version; diff --git a/scripts/update-alternatives.pl b/scripts/update-alternatives.pl index a7c85b44..07d12b91 100755 --- a/scripts/update-alternatives.pl +++ b/scripts/update-alternatives.pl @@ -3,6 +3,7 @@ use strict; use warnings; +use POSIX qw(:errno_h); use Dpkg; use Dpkg::Gettext; @@ -53,9 +54,6 @@ my @slavelinks; # List of slavelinks (indexed by slave-index) my %slavepath; # Map from (@version-index,slavename) to slave-path my %slavelinkcount; -my $enoent = `$dpkglibdir/enoent` || die sprintf(_g("Cannot get ENOENT value from %s: %s"), "$dpkglibdir/enoent", $!); -sub ENOENT { $enoent; } - sub version { printf _g("Debian %s version %s.\n"), $progname, $version; diff --git a/utils/Makefile.am b/utils/Makefile.am index 9cfd988d..e78f3dda 100644 --- a/utils/Makefile.am +++ b/utils/Makefile.am @@ -16,8 +16,3 @@ if WITH_START_STOP_DAEMON start_stop_daemon_LDADD = ../getopt/libopt.a $(SSD_LIBS) endif - -pkglib_PROGRAMS = enoent - -enoent_SOURCES = \ - enoent.c diff --git a/utils/enoent.c b/utils/enoent.c deleted file mode 100644 index 9d764e42..00000000 --- a/utils/enoent.c +++ /dev/null @@ -1,12 +0,0 @@ -/* This program ensures that dpkg-divert and update-alternatives don't depend on POSIX.pm - * being available and usable. This is probably a good thing since the perl packages have - * known deficiencies to ensure that during upgrades. */ - -#include -#include - -int main(int argc, char** argv) { - printf("%d", ENOENT); - return 0; -} - -- 2.39.5