diff options
-rw-r--r-- | data/ostable | 2 | ||||
-rw-r--r-- | data/tupletable | 1 | ||||
-rw-r--r-- | debian/changelog | 156 | ||||
-rw-r--r-- | debian/control | 2 | ||||
-rw-r--r-- | debian/dpkg.install | 5 | ||||
-rw-r--r-- | debian/dpkg.manpages | 1 | ||||
-rwxr-xr-x | debian/rules | 22 | ||||
-rw-r--r-- | dpkg-deb/build.c | 11 | ||||
-rw-r--r-- | lib/compat/strsignal.c | 50 | ||||
-rw-r--r-- | lib/dpkg/buffer.c | 2 | ||||
-rw-r--r-- | lib/dpkg/compress.c | 2 | ||||
-rw-r--r-- | man/dpkg-deb.man | 2 | ||||
-rw-r--r-- | scripts/Dpkg/Arch.pm | 8 | ||||
-rw-r--r-- | scripts/Dpkg/Shlibs.pm | 27 | ||||
-rw-r--r-- | scripts/Dpkg/Shlibs/SymbolFile.pm | 2 | ||||
-rw-r--r-- | scripts/t/Dpkg_Arch.t | 2 | ||||
-rw-r--r-- | utils/start-stop-daemon.c | 89 |
17 files changed, 360 insertions, 24 deletions
diff --git a/data/ostable b/data/ostable index 99c1f889d..f9bd90339 100644 --- a/data/ostable +++ b/data/ostable @@ -14,6 +14,7 @@ # system part of the output of the GNU config.guess script. # # <Debian name> <GNU name> <config.guess regex> +base-solaris2.11-illumos pc-solaris2.11 solaris2.11[^-]* eabi-uclibc-linux linux-uclibceabi linux[^-]*-uclibceabi base-uclibc-linux linux-uclibc linux[^-]*-uclibc eabihf-musl-linux linux-musleabihf linux[^-]*-musleabihf @@ -37,7 +38,6 @@ base-bsd-freebsd freebsd freebsd[^-]* base-bsd-netbsd netbsd netbsd[^-]* base-bsd-openbsd openbsd openbsd[^-]* base-sysv-aix aix aix[^-]* -base-sysv-solaris solaris solaris[^-]* eabi-uclibc-uclinux uclinux-uclibceabi uclinux[^-]*-uclibceabi base-uclibc-uclinux uclinux-uclibc uclinux[^-]*(-uclibc.*)? base-tos-mint mint mint[^-]* diff --git a/data/tupletable b/data/tupletable index a7a878f5b..b83c4bf8d 100644 --- a/data/tupletable +++ b/data/tupletable @@ -20,6 +20,7 @@ # Supported variables: <cpu> # # <Debian arch tuple> <Debian arch name> +base-solaris2.11-illumos-<cpu> illumos-<cpu> eabi-uclibc-linux-arm uclibc-linux-armel base-uclibc-linux-<cpu> uclibc-linux-<cpu> eabihf-musl-linux-arm musl-linux-armhf diff --git a/debian/changelog b/debian/changelog index 7e41a3067..7ca3df581 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +dpkg (1.20.0~dyson2) unstable; urgency=medium + + * Package for Dyson. + * Do not break lsb-base on Dyson, because we do not use it and "breaking" + causes problem upgraring. + + -- Igor Pashev <pashev.igor@gmail.com> Thu, 28 Nov 2019 18:46:19 +0300 + dpkg (1.20.0) UNRELEASED; urgency=medium [ Guillem Jover ] @@ -891,7 +899,16 @@ dpkg (1.19.1) unstable; urgency=medium * German (Helge Kreutzmann). * Simplified Chinese (Zhou Mo). - -- Guillem Jover <guillem@debian.org> Wed, 26 Sep 2018 15:13:22 +0200 +dpkg (1.19.1~dyson2) unstable; urgency=medium + + * Fix crash in dpkg-deb/build.c caused by old code for charset.alias + + -- Igor Pashev <pashev.igor@gmail.com> Sun, 19 Nov 2017 17:15:25 +0300 + +dpkg (1.19.1~dyson1) unstable; urgency=medium + * Package for Dyson + + -- Igor Pashev <pashev.igor@gmail.com> Sun, 19 Nov 2017 14:15:25 +0300 dpkg (1.19.0) unstable; urgency=medium @@ -1936,6 +1953,7 @@ dpkg (1.18.9) unstable; urgency=medium Thanks to Sven Joachim <svenjoac@gmx.de>. Closes: #829546 -- Guillem Jover <guillem@debian.org> Mon, 04 Jul 2016 09:23:13 +0200 +>>>>>>> 3ed0cc75a0113a5eda762b9a19448e78ce43097e dpkg (1.18.8) unstable; urgency=medium @@ -2493,6 +2511,16 @@ dpkg (1.18.3) unstable; urgency=medium -- Guillem Jover <guillem@debian.org> Mon, 21 Sep 2015 07:11:42 +0200 +dpkg (1.18.2+dyson1) unstable; urgency=low + + [ Updated manpages translations ] + * German (Helge Kreutzmann). + + [ Igor Pashev ] + * Package for Dyson + + -- Igor Pashev <pashev.igor@gmail.com> Thu, 16 Jul 2015 17:53:34 +0300 + dpkg (1.18.2) unstable; urgency=low [ Guillem Jover ] @@ -3060,6 +3088,18 @@ dpkg (1.17.21) unstable; urgency=low -- Guillem Jover <guillem@debian.org> Sat, 25 Oct 2014 02:21:43 +0200 +dpkg (1.17.20+dyson2) unstable; urgency=medium + + * Fixed Dyson multiarch: illumos instead of pc-solaris2.11 + + -- Igor Pashev <pashev.igor@gmail.com> Sun, 26 Oct 2014 00:03:07 +0400 + +dpkg (1.17.20+dyson1) unstable; urgency=medium + + * Package for Dyson + + -- Igor Pashev <pashev.igor@gmail.com> Thu, 23 Oct 2014 22:26:58 +0400 + dpkg (1.17.20) unstable; urgency=low [ Guillem Jover ] @@ -3344,6 +3384,7 @@ dpkg (1.17.14) unstable; urgency=low * Czech (Miroslav Kure). * Polish (Łukasz Dulny). * Turkish (Mert Dirik). Closes: #763825 +>>>>>>> 10a25a6e0d7b264d7689ce8e4ff645fa381211ba [ Updated man pages translations ] * German (Helge Kreutzmann). @@ -3642,6 +3683,27 @@ dpkg (1.17.10) unstable; urgency=medium -- Guillem Jover <guillem@debian.org> Thu, 05 Jun 2014 20:18:04 +0200 +dpkg (1.17.10~dyson2) unstable; urgency=medium + + * Bring start-stop-daemon back. Thanks to Justin Maggard. + * Install start-stop-daemon into /usr/sbin on Dyson + + -- Igor Pashev <pashev.igor@gmail.com> Sun, 01 Jun 2014 14:11:26 +0400 + +dpkg (1.17.10~dyson1) unstable; urgency=low + + [ Updated manpages translations ] + * German (Helge Kreutzmann). + + [ Raphaël Hertzog ] + * Let dpkg-source unpack additional tarballs in a deterministic order. + Thanks to Samuel Bronson for the report. Closes: #747148 + + [ Igor Pashev ] + * Package for Dyson + + -- Igor Pashev <pashev.igor@gmail.com> Thu, 08 May 2014 22:06:11 +0400 + dpkg (1.17.9) unstable; urgency=high [ Guillem Jover ] @@ -3802,6 +3864,8 @@ dpkg (1.17.7) unstable; urgency=low Thanks to Andreas Beckmann <anbe@debian.org>. Closes: #735159 * Be verbose on «make check» errors by printing the test suite log. +dpkg (1.17.7~dyson1) unstable; urgency=low + [ Updated programs translations ] * German (Sven Joachim). * Swedish (Peter Krefting). @@ -3816,8 +3880,11 @@ dpkg (1.17.7) unstable; urgency=low * German (Helge Kreutzmann). * Italian (Beatrice Torracca). Closes: #742449 * Swedish (Peter Krefting). + + [ Igor Pashev ] + * Package for Dyson - -- Guillem Jover <guillem@debian.org> Mon, 21 Apr 2014 05:03:52 +0200 + -- Igor Pashev <pashev.igor@gmail.com> Sat, 01 Feb 2014 23:45:16 +0400 dpkg (1.17.6) unstable; urgency=low @@ -4284,6 +4351,15 @@ dpkg (1.17.0) unstable; urgency=low -- Guillem Jover <guillem@debian.org> Fri, 26 Jul 2013 23:54:54 +0200 +dpkg (1.17.0~dyson1) unstable; urgency=low + + * Package for Dyson + * Delete usr/sbin from d/dpkg.install + * Include compat/md5.h instead on juts md5.h in lib/dpkg/buffer.c: illumos + has md5.h and it is not what we want. + + -- Igor Pashev <pashev.igor@gmail.com> Thu, 25 Jul 2013 00:10:52 +0400 + dpkg (1.16.10) unstable; urgency=low [ Guillem Jover ] @@ -4317,6 +4393,44 @@ dpkg (1.16.10) unstable; urgency=low -- Guillem Jover <guillem@debian.org> Fri, 08 Mar 2013 04:41:26 +0100 +dpkg (1.16.10~dyson2) unstable; urgency=low + + * Fix parsing crle output, ld config file may be absent + + -- Igor Pashev <pashev.igor@gmail.com> Tue, 16 Apr 2013 00:21:47 +0000 + +dpkg (1.16.10~dyson1) unstable; urgency=low + + [ Guillem Jover ] + * Fix typos in 1.16.9 changelog entry. Closes: #691954 + Thanks to Nicolás Alvarez <nicolas.alvarez@gmail.com>. + + [ Updated programs translations ] + * Esperanto (Felipe Castro). + * Spanish (Javier Fernández-Sanguino). + * Vietnamesea (Trần Ngọc Quân). Closes: #692100 + + [ Updated scripts translations ] + * Fix mistranslation in French translation of scripts. + Thanks to Filipus Klutiero. Closes: #698530 + * Fix Russian translation (wrong order of parameters + in a string). Thanks to Andrey Rahmatullin for noticing, + to Sven Joachim for proposing a solution and Yuri Kozlov for + fixing the translation. Closes: #698869 + + [ Igor Pashev ] + * Built for Dyson + * Use xz level 9 by default + + -- Igor Pashev <pashev.igor@gmail.com> Sun, 17 Feb 2013 13:40:04 +0000 + +dpkg (1.16.9+dyson1) unstable; urgency=low + + * Built for Dyson + * Omit start-stop-daemon + + -- Igor Pashev <pashev.igor@gmail.com> Thu, 23 Aug 2012 17:16:34 +0000 + dpkg (1.16.9) unstable; urgency=low [ Raphaël Hertzog ] @@ -4727,6 +4841,44 @@ dpkg (1.16.3) unstable; urgency=low -- Guillem Jover <guillem@debian.org> Fri, 27 Apr 2012 10:10:10 +0200 +dpkg (1.16.2+dyson1) unstable; urgency=low + + * Restored start-stop-daemon (will use in SMF) + + -- Igor Pashev <pashev.igor@gmail.com> Sat, 17 Mar 2012 03:22:54 +0400 + +dpkg (1.16.2-5) unstable; urgency=low + + * dpkg-deb: don't include charset.alias file (if present) in archive + + -- Igor Pashev <pashev.igor@gmail.com> Thu, 16 Feb 2012 23:39:05 +0400 + +dpkg (1.16.2-4) unstable; urgency=low + + * dpkg-gensymbols: blacklisted symbols _etext and _lib_version (Re #12) + + -- Igor Pashev <pashev.igor@gmail.com> Thu, 16 Feb 2012 08:53:21 +0400 + +dpkg (1.16.2-3) unstable; urgency=low + + * Fixed parsing crle output for 32-bits paths + + -- Igor Pashev <pashev.igor@gmail.com> Mon, 30 Jan 2012 04:16:10 +0000 + +dpkg (1.16.2-2) unstable; urgency=low + + * dpkg-shlibdeps: search for libs in directories listed by crle + (just like /etc/ld.so.conf on Linux) + + -- Igor Pashev <pashev.igor@gmail.com> Tue, 24 Jan 2012 09:02:33 +0300 + +dpkg (1.16.2-1) unstable; urgency=low + + * Ported to Illumos with *-illumos as multiarch. + * Without start-stop-daemon + + -- Igor Pashev <pashev.igor@gmail.com> Sat, 07 Jan 2012 13:04:25 +0400 + dpkg (1.16.2) unstable; urgency=low [ Guillem Jover ] diff --git a/debian/control b/debian/control index d0333d8ea..96a4539c3 100644 --- a/debian/control +++ b/debian/control @@ -41,7 +41,7 @@ Breaks: # Due to --status-fd not duplicating output. libapt-pkg5.0 (<< 1.7~b), # Due to s-s-d requiring secure usage of --pidfile. - lsb-base (<< 10.2019031300), + lsb-base (<< 10.2019031300) [!illumos-any], Description: Debian package management system This package provides the low-level infrastructure for handling the installation and removal of Debian software packages. diff --git a/debian/dpkg.install b/debian/dpkg.install index 108ca54ef..ec89564d2 100644 --- a/debian/dpkg.install +++ b/debian/dpkg.install @@ -2,7 +2,10 @@ etc/dpkg/dpkg.cfg.d etc/alternatives -sbin/start-stop-daemon + +#installed optionally in debian/rules: +#sbin/start-stop-daemon + usr/bin/dpkg usr/bin/dpkg-deb usr/bin/dpkg-divert diff --git a/debian/dpkg.manpages b/debian/dpkg.manpages index 3fb92ab69..7ba43efa9 100644 --- a/debian/dpkg.manpages +++ b/debian/dpkg.manpages @@ -7,5 +7,4 @@ debian/tmp/usr/share/man/*/dpkg-statoverride.1 debian/tmp/usr/share/man/*/dpkg-trigger.1 debian/tmp/usr/share/man/*/dpkg.cfg.5 debian/tmp/usr/share/man/*/dpkg.1 -debian/tmp/usr/share/man/*/start-stop-daemon.8 debian/tmp/usr/share/man/*/update-alternatives.1 diff --git a/debian/rules b/debian/rules index 006d069ce..d79545ec7 100755 --- a/debian/rules +++ b/debian/rules @@ -17,7 +17,6 @@ dpkg_buildflags = \ DEB_CXXFLAGS_MAINT_APPEND="$(WFLAGS)" \ $(CURDIR)/run-script scripts/dpkg-buildflags.pl -DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS) DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) @@ -29,7 +28,14 @@ else confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) endif -# Do not enable everything on all platforms. +# Don't enable everything on all platforms +with_start_stop_daemon := yes +sbindir = /sbin +start-stop-daemon = $(sbindir)/start-stop-daemon +ifeq ($(DEB_HOST_ARCH_OS),illumos) + with_start_stop_daemon := yes + sbindir = /usr/sbin +endif ifeq ($(DEB_HOST_ARCH_OS),linux) confflags += --with-libselinux endif @@ -38,6 +44,10 @@ ifeq (,$(filter terse,$(DEB_BUILD_OPTIONS))) testflags += TESTSUITEFLAGS=--verbose endif +ifeq ($(with_start_stop_daemon),no) + confflags += --disable-start-stop-daemon +endif + # Enable parallel test suite NUMJOBS = 1 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) @@ -59,7 +69,7 @@ build-tree/config.status: --mandir=\$${datadir}/man \ --infodir=\$${datadir}/info \ --sysconfdir=/etc \ - --sbindir=/sbin \ + --sbindir=$(sbindir) \ --localstatedir=/var \ --libexecdir=\$${exec_prefix}/lib \ --with-devlibdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \ @@ -110,6 +120,12 @@ binary-arch: install dh_install -a dh_installcron -a dh_installlogrotate -a + +ifeq ($(with_start_stop_daemon),yes) + dh_install -pdpkg $(start-stop-daemon) + dh_installman -pdpkg debian/tmp/usr/share/man/*/start-stop-daemon.8 +endif + dh_installlogrotate -a --name=alternatives dh_installchangelogs -a ChangeLog* dh_installdocs -a diff --git a/dpkg-deb/build.c b/dpkg-deb/build.c index 3317b517a..b9cc0ad22 100644 --- a/dpkg-deb/build.c +++ b/dpkg-deb/build.c @@ -177,9 +177,14 @@ file_treewalk_feed(const char *dir, int fd_out) fi = file_info_new(nodename); file_info_list_append(&symlist, &symlist_end, fi); } else { - if (fd_write(fd_out, nodename, strlen(nodename) + 1) < 0) - ohshite(_("failed to write filename to tar pipe (%s)"), - _("data member")); + if (strstr(nodename, "/charset.alias") != NULL) { + warning(_("skipping file `%s'."), nodename); + } + else { + if (fd_write(fd_out, nodename, strlen(nodename) + 1) < 0) + ohshite(_("failed to write filename to tar pipe (%s)"), + _("data member")); + } } free(nodename); diff --git a/lib/compat/strsignal.c b/lib/compat/strsignal.c index 66ed0c39d..3cc22f237 100644 --- a/lib/compat/strsignal.c +++ b/lib/compat/strsignal.c @@ -29,6 +29,55 @@ #define _(str) gettext(str) #if !HAVE_DECL_SYS_SIGLIST +# ifdef __sun__ +/* sys/iso/signal_iso.h */ +const char *const sys_siglist[] = { + NULL , /* 0 */ + "SIGHUP" , /* 1 */ + "SIGINT" , /* 2 */ + "SIGQUIT" , /* 3 */ + "SIGILL" , /* 4 */ + "SIGTRAP" , /* 5 */ + "SIGIOT" , /* 6 */ + "SIGABRT" , /* 6 */ + "SIGEMT" , /* 7 */ + "SIGFPE" , /* 8 */ + "SIGKILL" , /* 9 */ + "SIGBUS" , /* 10 */ + "SIGSEGV" , /* 11 */ + "SIGSYS" , /* 12 */ + "SIGPIPE" , /* 13 */ + "SIGALRM" , /* 14 */ + "SIGTERM" , /* 15 */ + "SIGUSR1" , /* 16 */ + "SIGUSR2" , /* 17 */ + "SIGCLD" , /* 18 */ + "SIGCHLD" , /* 18 */ + "SIGPWR" , /* 19 */ + "SIGWINCH" , /* 20 */ + "SIGURG" , /* 21 */ + "SIGPOLL" , /* 22 */ + "SIGSTOP" , /* 23 */ + "SIGTSTP" , /* 24 */ + "SIGCONT" , /* 25 */ + "SIGTTIN" , /* 26 */ + "SIGTTOU" , /* 27 */ + "SIGVTALRM" , /* 28 */ + "SIGPROF" , /* 29 */ + "SIGXCPU" , /* 30 */ + "SIGXFSZ" , /* 31 */ + "SIGWAITING" , /* 32 */ + "SIGLWP" , /* 33 */ + "SIGFREEZE" , /* 34 */ + "SIGTHAW" , /* 35 */ + "SIGCANCEL" , /* 36 */ + "SIGLOST" , /* 37 */ + "SIGXRES" , /* 38 */ + "SIGJVM1" , /* 39 */ + "SIGJVM2" , /* 40 */ + "SIGINFO" /* 41 */ +}; +# else const char *const sys_siglist[] = { NULL, /* 0 */ "SIGHUP", /* 1 */ @@ -54,6 +103,7 @@ const char *const sys_siglist[] = { "SIGTTIN", /* 21 */ "SIGTTOU", /* 22 */ }; +# endif // __sun__ # define COMPAT_NSIGLIST (int)(sizeof(sys_siglist) / sizeof(sys_siglist[0])) #else # ifndef NSIG diff --git a/lib/dpkg/buffer.c b/lib/dpkg/buffer.c index a4d6527d7..9faa12d93 100644 --- a/lib/dpkg/buffer.c +++ b/lib/dpkg/buffer.c @@ -26,7 +26,7 @@ #include <sys/types.h> #include <errno.h> -#include <md5.h> +#include <compat/md5.h> #include <string.h> #include <unistd.h> #include <stdlib.h> diff --git a/lib/dpkg/compress.c b/lib/dpkg/compress.c index 44075cdb6..8958ad3cc 100644 --- a/lib/dpkg/compress.c +++ b/lib/dpkg/compress.c @@ -654,7 +654,7 @@ compress_xz(int fd_in, int fd_out, struct compress_params *params, const char *d static const struct compressor compressor_xz = { .name = "xz", .extension = ".xz", - .default_level = 6, + .default_level = 9, .fixup_params = fixup_none_params, .compress = compress_xz, .decompress = decompress_xz, diff --git a/man/dpkg-deb.man b/man/dpkg-deb.man index aeef82112..f29855cd7 100644 --- a/man/dpkg-deb.man +++ b/man/dpkg-deb.man @@ -231,7 +231,7 @@ The default for this field is “${Package}\\t${Version}\\n”. .TP .BI \-z compress-level Specify which compression level to use on the compressor backend, when -building a package (default is 9 for gzip, 6 for xz). +building a package (default is 9). The accepted values are 0-9 with: 0 being mapped to compressor none for gzip. Before dpkg 1.16.2 level 0 was equivalent to compressor none for all compressors. diff --git a/scripts/Dpkg/Arch.pm b/scripts/Dpkg/Arch.pm index 14709d6cc..531bc118e 100644 --- a/scripts/Dpkg/Arch.pm +++ b/scripts/Dpkg/Arch.pm @@ -395,11 +395,13 @@ sub gnutriplet_to_multiarch($) my $gnu = shift; my ($cpu, $cdr) = split(/-/, $gnu, 2); + if ($cdr =~ /solaris2\.11/) { + $cdr = 'illumos'; + } if ($cpu =~ /^i[4567]86$/) { - return "i386-$cdr"; - } else { - return $gnu; + $cpu = 'i386'; } + return "$cpu-$cdr"; } =item $multiarch = debarch_to_multiarch($arch) diff --git a/scripts/Dpkg/Shlibs.pm b/scripts/Dpkg/Shlibs.pm index 2b19d14a7..bf52cc555 100644 --- a/scripts/Dpkg/Shlibs.pm +++ b/scripts/Dpkg/Shlibs.pm @@ -51,6 +51,32 @@ my @custom_librarypaths; my @system_librarypaths; my $librarypaths_init; +sub parse_crle { + my @CRLE = qw(/sbin/crle /usr/bin/crle /usr/sbin/crle); + foreach my $crle (@CRLE) { + if ( -x $crle) { + parse_crle1($crle); + parse_crle1("$crle -32"); + parse_crle1("$crle -64"); + last; + } + } +} + +sub parse_crle1 { + my ($cmd) = @_; + open my $crle, "$cmd |" or syserr(_g("cannot run %s"), $cmd); + while (<$crle>) { + # Default Library Path (ELF): /lib/x86_64-illumos:/usr/lib/x86_64-illumos:/usr/lib (system default) + if (/Default Library Path \(ELF\):\s+(\S+)\s+[^:]+$/) { + foreach my $L (split(/:/, $1)) { + push @system_librarypaths, $L; + } + } + } + close $crle; +} + sub parse_ldso_conf { my $file = shift; state %visited; @@ -133,6 +159,7 @@ sub setup_library_paths { # Update library paths with ld.so config. parse_ldso_conf('/etc/ld.so.conf') if -e '/etc/ld.so.conf'; + parse_crle(); push @system_librarypaths, DEFAULT_MULTILIB_PATH; diff --git a/scripts/Dpkg/Shlibs/SymbolFile.pm b/scripts/Dpkg/Shlibs/SymbolFile.pm index 4b1c7ef50..28b2111c7 100644 --- a/scripts/Dpkg/Shlibs/SymbolFile.pm +++ b/scripts/Dpkg/Shlibs/SymbolFile.pm @@ -62,6 +62,8 @@ my %blacklist = ( _PROCEDURE_LINKAGE_TABLE_ => 1, # sparc, alpha _SDA2_BASE_ => 1, # powerpc _SDA_BASE_ => 1, # powerpc + '_etext' => 1, # solaris + '_lib_version' => 1, # solaris ); for my $i (14 .. 31) { diff --git a/scripts/t/Dpkg_Arch.t b/scripts/t/Dpkg_Arch.t index a3a9e6fee..705f57910 100644 --- a/scripts/t/Dpkg_Arch.t +++ b/scripts/t/Dpkg_Arch.t @@ -16,7 +16,7 @@ use strict; use warnings; -use Test::More tests => 16836; +use Test::More tests => 16944; use_ok('Dpkg::Arch', qw(debarch_to_debtuple debarch_to_multiarch debarch_eq debarch_is debarch_is_wildcard diff --git a/utils/start-stop-daemon.c b/utils/start-stop-daemon.c index 88c972663..886fb8872 100644 --- a/utils/start-stop-daemon.c +++ b/utils/start-stop-daemon.c @@ -29,6 +29,9 @@ # define OS_Linux #elif defined(__GNU__) # define OS_Hurd +#elif defined(__sun) +# define OS_sunos +# include <procfs.h> #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) # define OS_FreeBSD #elif defined(__NetBSD__) @@ -67,12 +70,14 @@ #ifdef HAVE_SYS_PROC_H #include <sys/proc.h> #endif + #ifdef HAVE_SYS_USER_H #include <sys/user.h> #endif #ifdef HAVE_SYS_PSTAT_H #include <sys/pstat.h> #endif + #include <sys/types.h> #include <sys/time.h> #include <sys/stat.h> @@ -753,7 +758,7 @@ write_pidfile(const char *filename, pid_t pid) if (fp == NULL) fatale("unable to open pidfile '%s' for writing", filename); - fprintf(fp, "%d\n", pid); + fprintf(fp, "%d\n", (int)pid); if (fclose(fp)) fatale("unable to close pidfile '%s'", filename); @@ -1714,6 +1719,31 @@ pid_is_exec(pid_t pid, const struct stat *esb) return (sb.st_dev == esb->st_dev && sb.st_ino == esb->st_ino); } +#elif defined(OS_sunos) +static bool +pid_is_exec(pid_t pid, const struct stat *esb) +{ + DIR *procdir; + struct dirent *entry; + char name[_POSIX_PATH_MAX + 1]; + struct stat sb; + + sprintf(name, "/proc/%d/object", (int)pid); + procdir = opendir(name); + if (!procdir) + return false; + + while ((entry = readdir(procdir)) != NULL) { + sprintf(name, "/proc/%d/object/%s", (int)pid, entry->d_name); + if (stat(name, &sb) != 0) + continue; + if (sb.st_dev == esb->st_dev && sb.st_ino == esb->st_ino) + break; + } + closedir(procdir); + + return (entry != NULL); +} #elif defined(OS_AIX) static bool pid_is_exec(pid_t pid, const struct stat *esb) @@ -1881,6 +1911,24 @@ pid_is_child(pid_t pid, pid_t ppid) return proc_ppid == ppid; } +#elif defined(OS_sunos) +static bool +pid_is_child(pid_t pid, pid_t ppid) +{ + psinfo_t ps; + char buf[32]; + FILE *f; + + sprintf(buf, "/proc/%d/psinfo", (int)pid); + f = fopen(buf, "r"); + if (!f) + return false; + if (fread(&ps, sizeof(ps), 1, f) != 1) + ps.pr_ppid = 0; + fclose(f); + + return ps.pr_ppid == ppid; +} #elif defined(OS_Hurd) static bool pid_is_child(pid_t pid, pid_t ppid) @@ -1996,6 +2044,18 @@ pid_is_user(pid_t pid, uid_t uid) return false; return (sb.st_uid == uid); } +#elif defined(OS_sunos) +static bool +pid_is_user(pid_t pid, uid_t uid) +{ + struct stat sb; + char buf[32]; + + sprintf(buf, "/proc/%d", (int)pid); + if (stat(buf, &sb) != 0) + return false; + return (sb.st_uid == uid); +} #elif defined(OS_Hurd) static bool pid_is_user(pid_t pid, uid_t uid) @@ -2110,6 +2170,25 @@ pid_is_cmd(pid_t pid, const char *name) return strcmp(comm, name) == 0; } +#elif defined(OS_sunos) +static bool +pid_is_cmd(pid_t pid, const char *name) +{ + char buf[34]; + FILE *f; + psinfo_t p; + + sprintf(buf, "/proc/%d/psinfo", pid); + f = fopen(buf, "r"); + if (!f) + return false; + if (1 != fread((void *) &p, sizeof(p), 1, f)) { + fclose(f); + return false; + } + fclose(f); + return !strcmp(p.pr_fname, name); +} #elif defined(OS_Hurd) static bool pid_is_cmd(pid_t pid, const char *name) @@ -2321,7 +2400,7 @@ do_pidfile(const char *name) fatale("unable to open pidfile %s", name); } -#if defined(OS_Linux) || defined(OS_Solaris) || defined(OS_AIX) +#if defined(OS_Linux) || defined(OS_sunos) || defined(OS_AIX) static enum status_code do_procinit(void) { @@ -2339,7 +2418,7 @@ do_procinit(void) while ((entry = readdir(procdir)) != NULL) { enum status_code pid_status; - if (sscanf(entry->d_name, "%d", &pid) != 1) + if (sscanf(entry->d_name, "%d", (int*)&pid) != 1) continue; foundany++; @@ -2651,7 +2730,7 @@ do_stop(int sig_num, int *n_killed, int *n_notkilled) } else { if (sig_num) warning("failed to kill %d: %s\n", - p->pid, strerror(errno)); + (int)p->pid, strerror(errno)); (*n_notkilled)++; } } @@ -2667,7 +2746,7 @@ do_stop_summary(int retry_nr) printf("Stopped %s (pid", what_stop); for (p = killed; p; p = p->next) - printf(" %d", p->pid); + printf(" %d", (int)p->pid); putchar(')'); if (retry_nr > 0) printf(", retry #%d", retry_nr); |