From eeb28765a5e09a0e89f8c5a86a1a7a6e41a9ef71 Mon Sep 17 00:00:00 2001 From: Adam Heath Date: Tue, 15 Apr 2003 16:34:28 +0000 Subject: [PATCH] Add netbsd support, and support hypenated values in dpkg-architecture. --- ChangeLog | 6 ++++++ archtable | 1 + debian/changelog | 3 +++ scripts/dpkg-architecture.pl | 20 +++++++++++--------- utils/start-stop-daemon.c | 8 +++++--- 5 files changed, 26 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index fa490c15..c0618eb7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue Apr 15 11:32:22 CDT 2003 Adam Heath + + * archtable, utils/start-stop-daemon.c, scripts/dpkg-architecture.pl: + Add netbsd support. + * scripts/dpkg-architecture.pl: Support hypenated values. + Tue Apr 15 01:05:04 CDT 2003 Adam Heath * config.sub, config.guess: Updated. diff --git a/archtable b/archtable index 571d7094..b3496e19 100644 --- a/archtable +++ b/archtable @@ -48,6 +48,7 @@ hppa1.1-linux-gnu hppa hppa hppa2.0-linux-gnu hppa hppa hppa64-linux-gnu hppa hppa i386-freebsd freebsd-i386 freebsd-i386 +i386-netbsdelf-gnu netbsd-i386 netbsd-i386 s390-linux-gnu s390 s390 s390-ibm-linux-gnu s390 s390 s390-unknown-linux-gnu s390 s390 diff --git a/debian/changelog b/debian/changelog index 43be74a9..ff914aba 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,9 @@ dpkg (1.10.10) unstable; urgency=low * Strip trailing / from the file args in dpkg-statoverride. Closes: #184239. * Modified to use autotools-dev. Closes: #179656. + * Add netbsd support. Closes: #179658, #179659. + * Support hypenated values in dpkg-architeture. Closes: #179661 + -- Adam Heath UNRELEASED diff --git a/scripts/dpkg-architecture.pl b/scripts/dpkg-architecture.pl index 5722ab00..ecf559af 100755 --- a/scripts/dpkg-architecture.pl +++ b/scripts/dpkg-architecture.pl @@ -67,6 +67,7 @@ require 'controllib.pl'; 'ia64', 'ia64-linux', 'openbsd-i386', 'i386-openbsd', 'freebsd-i386', 'i386-freebsd', + 'netbsd-i386', 'i386-netbsdelf-gnu', 'darwin-powerpc', 'powerpc-darwin', 'darwin-i386', 'i386-darwin'); @@ -123,10 +124,9 @@ if ($?>>8) { } chomp $deb_build_arch; $deb_build_gnu_type = $archtable{$deb_build_arch}; -$deb_build_gnu_cpu = $deb_build_gnu_type; -$deb_build_gnu_system = $deb_build_gnu_type; -$deb_build_gnu_cpu =~ s/-.*$//; -$deb_build_gnu_system =~ s/^.*-//; +@deb_build_gnu_triple = split(/-/, $deb_build_gnu_type, 2); +$deb_build_gnu_cpu = $deb_build_gnu_triple[0]; +$deb_build_gnu_system = $deb_build_gnu_triple[1]; # Default host: Current gcc. $gcc = `\${CC:-gcc} --print-libgcc-file-name`; @@ -153,8 +153,9 @@ if ($gcc ne '') { $gcc=$archtable{$list[0]}; $deb_host_arch = $list[0]; $deb_host_gnu_type = $gcc; - ($deb_host_gnu_system = $gcc) =~ s/^.*-//; - ($deb_host_gnu_cpu = $gcc ) =~ s/-.*$//; + @deb_host_gnu_triple = split(/-/, $deb_host_gnu_type, 2); + $deb_host_gnu_cpu = $deb_host_gnu_triple[0]; + $deb_host_gnu_system = $deb_host_gnu_triple[1]; } } if (!defined($deb_host_arch)) { @@ -213,9 +214,10 @@ die "couldn't parse GNU system type $req_host_gnu_type, must be arch-os or arch- $deb_host_arch = $req_host_arch if $req_host_arch ne ''; if ($req_host_gnu_type ne '') { - $deb_host_gnu_cpu = $deb_host_gnu_system = $deb_host_gnu_type = $req_host_gnu_type; - $deb_host_gnu_cpu =~ s/-.*$//; - $deb_host_gnu_system =~ s/^.*-//; + $deb_host_gnu_type = $req_host_gnu_type; + @deb_host_gnu_triple = split(/-/, $deb_host_gnu_type, 2); + $deb_host_gnu_cpu = $deb_host_gnu_triple[0]; + $deb_host_gnu_system = $deb_host_gnu_triple[1]; } #$gcc = `\${CC:-gcc} --print-libgcc-file-name`; diff --git a/utils/start-stop-daemon.c b/utils/start-stop-daemon.c index 9275463a..5ee282b7 100644 --- a/utils/start-stop-daemon.c +++ b/utils/start-stop-daemon.c @@ -34,6 +34,8 @@ # define OShpux #elif defined(__FreeBSD__) # define OSFreeBSD +#elif defined(__NetBSD__) +# define OSNetBSD #else # error Unknown architecture - cannot build start-stop-daemon #endif @@ -45,7 +47,7 @@ # include #endif -#if defined(OSOpenBSD) || defined(OSFreeBSD) +#if defined(OSOpenBSD) || defined(OSFreeBSD) || defined(OSNetBSD) #include #include #include @@ -677,7 +679,7 @@ check(pid_t pid) { #if defined(OSLinux) || defined(OShpux) if (execname && !pid_is_exec(pid, &exec_stat)) -#elif defined(OSHURD) || defined(OSFreeBSD) +#elif defined(OSHURD) || defined(OSFreeBSD) || defined(OSNetBSD) /* I will try this to see if it works */ if (execname && !pid_is_cmd(pid, execname)) #endif @@ -771,7 +773,7 @@ do_procinit(void) #endif /* OSHURD */ -#if defined(OSOpenBSD) || defined(OSFreeBSD) +#if defined(OSOpenBSD) || defined(OSFreeBSD) || defined(OSNetBSD) static int pid_is_cmd(pid_t pid, const char *name) { -- 2.39.5