From 21a3526cacdc0b7642fe64dba4a4f5a01a1be5f6 Mon Sep 17 00:00:00 2001 From: Ben Collins Date: Mon, 18 Oct 1999 01:59:05 +0000 Subject: [PATCH] * Removed references to dpkg(5) which seems to not exist anymore * Fixed `dpkg-deb --help' and dpkg-deb(1) from reporting --no-check when it's actually --nocheck (went with the hardcoded option, so this is just a documentation fix). * Added better check in disk.setup for a working NFS server. Makes it compatible with other non-Linux servers. * Corrected dpkg(8)'s example of using dpkg -i (showed it used with a .tar.gz instead of a .deb) * Applied patch to correct improper TMPDIR handling in dpkg-deb * When encountering an error in extracting the tar archives in the packages, we should abort the install, not simply give an error and continue. * Make dpkg give the builtin arch if there was an error while exec()'ing the C compiler with --print-architecture. We still fail if the output from gcc was bad in some way, since they may be of importance. --- ChangeLog | 11 +++++++++++ debian/changelog | 13 ++++++++++++- dpkg-deb/build.c | 21 +++++++++++++++++---- dpkg-deb/info.c | 6 ++++-- main/dpkg.8 | 2 +- main/enquiry.c | 12 +++++++++++- main/processarc.c | 4 ++-- methods/disk.setup | 2 +- 8 files changed, 59 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index f8d69f93..63e70c01 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,17 @@ Sun Oct 17 13:40:46 EDT 1999 Ben Collins * Fixed `dpkg-deb --help' and dpkg-deb(1) from reporting --no-check when it's actually --nocheck (went with the hardcoded option, so this is just a documentation fix). + * Added better check in disk.setup for a working NFS server. Makes + it compatible with other non-Linux servers. + * Corrected dpkg(8)'s example of using dpkg -i (showed it used with + a .tar.gz instead of a .deb) + * Applied patch to correct improper TMPDIR handling in dpkg-deb + * When encountering an error in extracting the tar archives in the + packages, we should abort the install, not simply give an error + and continue. + * Make dpkg give the builtin arch if there was an error while exec()'ing + the C compiler with --print-architecture. We still fail if the + output from gcc was bad in some way, since they may be of importance. Sun Oct 17 11:51:36 CEST 1999 Wichert Akkerman diff --git a/debian/changelog b/debian/changelog index c54af137..a63b82f2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,11 +8,22 @@ dpkg (1.4.1.17) unstable; urgency=low * Updated the deb-control(5) man page with all the current fields and uses * Made the large info screen show 5 lines of the pkglist so that - it scrolled properly, and still showed the cursor + it scrolled properly, and still showed the cursor in dselect * Removed references to dpkg(5) which seems to not exist anymore * Fixed `dpkg-deb --help' and dpkg-deb(1) from reporting --no-check when it's actually --nocheck (went with the hardcoded option, so this is just a documentation fix). + * Added better check in disk.setup for a working NFS server. Makes + it compatible with other non-Linux servers. + * Corrected dpkg(8)'s example of using dpkg -i (showed it used with + a .tar.gz instead of a .deb) + * Applied patch to correct improper TMPDIR handling in dpkg-deb + * When encountering an error in extracting the tar archives in the + packages, we should abort the install, not simply give an error + and continue. + * Make dpkg give the builtin arch if there was an error while exec()'ing + the C compiler with --print-architecture. We still fail if the + output from gcc was bad in some way, since they may be of importance. -- Wichert Akkerman UNRELEASED diff --git a/dpkg-deb/build.c b/dpkg-deb/build.c index d02ae0e8..e7d834d3 100644 --- a/dpkg-deb/build.c +++ b/dpkg-deb/build.c @@ -57,13 +57,13 @@ void do_build(const char *const *argv) { PREINSTFILE, POSTINSTFILE, PRERMFILE, POSTRMFILE, 0 }; - char *m; + char *m, *tmpd, *tmpf; const char *debar, *directory, *const *mscriptp, *versionstring, *arch; char *controlfile; struct pkginfo *checkedinfo; struct arbitraryfield *field; FILE *ar, *gz, *cf; - int p1[2],p2[2], warns, errs, n, c, subdir; + int p1[2],p2[2], warns, errs, n, c, subdir, gzfd; pid_t c1,c2,c3,c4,c5; struct stat controlstab, datastab, mscriptstab, debarstab; char conffilename[MAXCONFFILENAME+1]; @@ -209,7 +209,16 @@ void do_build(const char *const *argv) { execlp(TAR,"tar","-cf","-",".",(char*)0); ohshite(_("failed to exec tar -cf")); } close(p1[1]); - if (!(gz= tmpfile())) ohshite(_("failed to make tmpfile (control)")); + + if (!(tmpd = getenv("TMPDIR"))) + tmpd= "/tmp"; + tmpf= malloc(strlen(tmpd) + strlen("/dpkg.XXXXXX")); + strcpy(tmpf, tmpd); + strcat(tmpf, "/dpkg.XXXXXX"); + if (!(gzfd= mkstemp(tmpf)) || !(gz= fdopen(gzfd, "r+"))) + ohshite(_("failed to make tmpfile (control)")); + + if (!(c2= m_fork())) { m_dup2(p1[0],0); m_dup2(fileno(gz),1); close(p1[0]); execlp(GZIP,"gzip","-9c",(char*)0); ohshite(_("failed to exec gzip -9c")); @@ -246,8 +255,12 @@ void do_build(const char *const *argv) { if (!oldformatflag) { fclose(gz); - if (!(gz= tmpfile())) ohshite(_("failed to make tmpfile (data)")); + strcpy(tmpf, tmpd); + strcat(tmpf, "/dpkg.XXXXXX"); + if (!(gzfd= mkstemp(tmpf)) || !(gz= fdopen(gzfd, "r+"))) + ohshite(_("failed to make tmpfile (data)")); } + free(tmpf); m_pipe(p2); if (!(c4= m_fork())) { m_dup2(p2[1],1); close(p2[0]); close(p2[1]); diff --git a/dpkg-deb/info.c b/dpkg-deb/info.c index 438d76fd..f258879c 100644 --- a/dpkg-deb/info.c +++ b/dpkg-deb/info.c @@ -59,12 +59,13 @@ static void info_prepare(const char *const **argvp, const char **debarp, const char **directoryp, int admininfo) { - static char dbuf[L_tmpnam]; + char *dbuf; pid_t c1; *debarp= *(*argvp)++; if (!*debarp) badusage(_("--%s needs a .deb filename argument"),cipaction->olong); - if (!tmpnam(dbuf)) ohshite(_("failed to make temporary filename")); + dbuf = tempnam(NULL, "dpkg"); + if (!dbuf) ohshite(_("failed to make temporary filename")); *directoryp= dbuf; if (!(c1= m_fork())) { @@ -73,6 +74,7 @@ static void info_prepare(const char *const **argvp, waitsubproc(c1,"rm -rf",0); push_cleanup(cu_info_prepare,-1, 0,0, 1, (void*)dbuf); extracthalf(*debarp, dbuf, "mx", admininfo); + free(dbuf); } static int ilist_select(const struct dirent *de) { diff --git a/main/dpkg.8 b/main/dpkg.8 index 2ec6109a..c57a5c9d 100644 --- a/main/dpkg.8 +++ b/main/dpkg.8 @@ -516,7 +516,7 @@ CDROM. The "available" file shows that the vim package is in section "editors": .br \fB cd /cdrom/hamm/hamm/binary/editors\fP -\fB dpkg -i vim_4.5-3.tar.gz\fP +\fB dpkg -i vim_4.5-3.deb\fP .br To make a local copy of the package selection states: diff --git a/main/enquiry.c b/main/enquiry.c index fbe31e09..14989311 100644 --- a/main/enquiry.c +++ b/main/enquiry.c @@ -634,7 +634,17 @@ void printarch(const char *const *argv) { if (!(c1= m_fork())) { m_dup2(p1[1],1); close(p1[0]); close(p1[1]); execlp(ccompiler,ccompiler,"--print-libgcc-file-name",(char*)0); - ohshite(_("failed to exec C compiler `%.250s'"),ccompiler); + /* if we have a problem excuting the C compiler, we don't + * want to fail. If there is a problem with the compiler, + * like not being installed, or CC being set incorrectly, + * then important problems will show up elsewhere, not in + * dpkg. If a C compiler is not important to the reason we + * are being called, then we should just give them the built + * in arch. + */ + if (printf("%s\n",architecture) == EOF) werr("stdout"); + if (fflush(stdout)) werr("stdout"); + exit 0; } close(p1[1]); while ((c= getc(ccpipe)) != EOF) varbufaddc(&vb,c); diff --git a/main/processarc.c b/main/processarc.c index e09c03ad..a5eae590 100644 --- a/main/processarc.c +++ b/main/processarc.c @@ -533,9 +533,9 @@ void process_archive(const char *filename) { ohshite(_("error reading dpkg-deb tar output")); } else if (feof(tc.backendpipe)) { waitsubproc(c1,BACKEND " --fsys-tarfile (EOF)",1); - ohshit(_("unexpected EOF in filesystem tarfile - corrupted package archive")); + ohshite(_("unexpected EOF in filesystem tarfile - corrupted package archive")); } else { - ohshit(_("corrupted filesystem tarfile - corrupted package archive")); + ohshite(_("corrupted filesystem tarfile - corrupted package archive")); } } tmpf= tc.backendpipe; diff --git a/methods/disk.setup b/methods/disk.setup index f7113cd3..0a9638a1 100644 --- a/methods/disk.setup +++ b/methods/disk.setup @@ -236,7 +236,7 @@ then if [ -z "$response" ]; then continue; fi if [ -x /usr/bin/rpcinfo ] then - if rpcinfo -u "$response" mountd >/dev/null + if rpcinfo -u "$response" mountd | grep -q 'ready' then nfsserver="$response" else -- 2.39.5