+Fri Dec 24 15:35:29 CET 1999 Wichert Akkerman <wakkerma@debian.org>
+
+ * debian/control: add Build-Depends
+ * THANKS: new file which lists everyone who contributed to the code
+ * Change `Debian Linux' to `Debian GNU/Linux' in a couple of manpages
+ * main/enquiry.c: modify list1package to use the full width of the tty
+ * Merge patches from Adam Heath:
+ + lib/mlib.c: new function do_fd_copy to read a file into a fd
+ + dpkg-deb/build.c: use do_fd_copy
+ + dpkg-deb/build.c: use dpkg-deb-filelist to reorder files when
+ building a package
+ + dpkg-deb/info.c: use do_fd_copy
+ + lib/showcright.c: use do_fd_copy to read license
+ + scripts/dpkg-safelist.{1,pl}: new script to reorder a filelist to
+ make sure symlinks are listed after their targets.
+ + dpkg-deb/main.c: add -z option to set compression level
+ + dpkg-deb/build.c: pass new -z options to gzip
+ * dpkg-deb/dpkg-deb.1: document new -z option
+
+Wed Dec 22 13:41:41 CET 1999 Wichert Akkerman <wakkerma@debian.org>
+
+ * main/main.c: cleanup printversion
+
Wed Dec 22 12:07:40 CET 1999 Wichert Akkerman <wakkerma@debian.org>
* debian/dpkg-doc.postrm: Use doc-name instead of file-name (probably
--- /dev/null
+Adam Heath <doogie<debian.org>
+Andrew Hobson <ahobson@eng.mindspring.net>
+Ben Collins <bcollins@debian.org>
+Branko Lankester
+Bruce Perens <bruce@pixar.com>
+Carl Streeter <streeter@cae.wisc.edu>
+Charles Briscoe-Smith <cpb4@ukc.ac.uk>
+Charles Briscoe-Smith <cpbs@debian.org>
+Christophe Le Bars <clebars@teaser.fr>
+Colin Plumb
+Dan Gohman <gohmandj@mrs.umn.edu>
+Darren Stalder <torin@daft.com>
+Erick Branderhorst <branderhorst@heel.fgg.eur.nl>
+Galen Hazelwood <galenh@debian.org>
+Guy Maor <maor@debian.org>
+Heiko Schlittermann <heiko@lotte.sax.de>
+Ian Jackson <ian@chiark.chu.cam.ac.uk>
+Ian Murdock <imurdock@debian.org>
+J.H.M. Dassen <jdassen@cistron.nl>
+Jim Pick <jim@jimpick.com>
+Jim Van Zandt <jrv@vanzandt.mv.com>
+Jim Van Zandt <jrv@vanzandt.mv.com>
+Joel Klecker <jk@espy.org>
+Josip Rodin <joy@cibalia.gkvk.hr>
+Juan Cespedes <cespedes@debian.org>
+Juan Cespedes <cespedes@debian.org>
+Juergen Menden <menden@morgana.camelot.de>
+Juho Vuori <javuori@cc.helsinki.fi>
+Kim-Minh Kaplan <kkaplan@cdfhp3.in2p3.fr>
+Klee Dienes <klee@debian.org>
+Marcus Brinkmann <brinkmd@debian.org>
+Masato Taruishi <taru@debian.or.jp>
+Matt Welsh <mdw@sunsite.unc.edu>
+Michael Alan Dorman <mdorman@calder.med.miami.edu>
+Michael Shields <shields@crosslink.net>
+Michael Sobolev <mss@transas.com>
+Miquel van Smoorenburg <miquels@cistron.nl>
+Nicolás Lichtmaier <nick@debian.org>
+Nils Rennebarth <nils@debian.org>
+Peter Karlsson <pk@mds.mdh.se>
+Petr Cech <cech@atrey.karlin.mff.cuni.cz>
+Piotr Roszatycki <dexter@fnet.pl>
+Raphael Hertzog <rhertzog@hrnet.fr>
+Richard Kettlewell <rjk@sfere.greenend.org.uk>
+Roderick Schertler <roderick@argon.org>
+Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de>
+Scott Barker
+Tom Lees <tom@lpsg.demon.co.uk>
+Topi Miettinen <Topi.Miettinen@nic.fi>
+Wichert Akkerman <wakkerma@debian.org>
* Correctly unregister internals manual, Closes: Bug# 53200
* dselect helpessages can be translated now, Closes: Bug# 51381
* dselect UI tweaks, including a new --expert mode
+ * Added build-depends, Closes: Bug# 53394
+ * Added THANKS-file with people who have contributed to the code
+ * Use full width of tty in packagelisting, Closes: Bug# 53395
+ * Add -z option to dpkg-deb to set compressionlevel when building
+ packages, Closes: Bug# 53398
-- Wichert Akkerman <wakkerma@debian.org> UNRELEASED
Priority: required
Maintainer: Wichert Akkerman <wakkerma@debian.org>
Standards-Version: 3.1.0
+Build-Depends: debiandoc-sgml, ncurses-dev
+
Package: dpkg
Architecture: any
set -e ; for i in dpkg dpkg-deb dpkg-split md5sum dselect ; do \
mv $(TMP)/usr/bin/$$i $(TMP_DPKG)/usr/bin/ ; \
done
- set -e ; for i in ChangeLog TODO copyright ; do \
+ set -e ; for i in ChangeLog THANKS TODO copyright ; do \
mv $(TMP)/usr/share/doc/dpkg/$$i $(TMP_DPKG)/usr/share/doc/dpkg/ ; \
done
set -e ; for i in "" ja ; do \
}
if (lseek(gzfd,0,SEEK_SET)) ohshite(_("failed to rewind tmpfile (control)"));
- if (!(c3= m_fork())) {
- m_dup2(gzfd,0); m_dup2(fileno(ar),1);
- execlp(CAT,"cat",(char*)0); ohshite(_("failed to exec cat (control)"));
- }
- waitsubproc(c3,"cat (control)",0);
-
+ do_fd_copy(gzfd, fileno(ar), _("control"));
+
if (!oldformatflag) {
fclose(gz);
if ((gzfd= mkstemp(tfbuf)) == -1) ohshite(_("failed to make tmpfile (data)"));
strcpy(tfbuf,envbuf);
strcat(tfbuf,"/dpkg.XXXXXX");
}
+ m_pipe(p1);
+ if (!(c3= m_fork())) {
+ m_dup2(p1[1],1); close(p1[0]); close(p1[1]);
+ if (chdir(directory)) ohshite(_("failed to chdir to `%.255s'"),directory);
+ execlp(SAFEFILELIST,"dpkg-deb-filelist",(char*)0);
+ ohshite(_("failed to exec dpkg-deb-filelist"));
+ }
+ close(p1[1]);
m_pipe(p2);
if (!(c4= m_fork())) {
- m_dup2(p2[1],1); close(p2[0]); close(p2[1]);
+ m_dup2(p2[1],1); m_dup2(p1[0],0); close(p2[0]); close(p2[1]);
if (chdir(directory)) ohshite(_("failed to chdir to `%.255s'"),directory);
- execlp(TAR,"tar","--exclude",BUILDCONTROLDIR,"-cf","-",".",(char*)0);
+ execlp(TAR,"tar","--no-recursion", "--exclude",BUILDCONTROLDIR,"-T","-","-cf","-",(char*)0);
ohshite(_("failed to exec tar --exclude"));
}
close(p2[1]);
+ close(p1[0]);
if (!(c5= m_fork())) {
+ char *combuf;
m_dup2(p2[0],0); close(p2[0]);
m_dup2(oldformatflag ? fileno(ar) : gzfd,1);
- execlp(GZIP,"gzip","-9c",(char*)0);
+ combuf = strdup("-9c");
+ if(compression != NULL) {
+ if(*compression = '0') {
+ do_fd_copy(0, 1, _("no compression copy loop"));
+ exit(0);
+ }
+ combuf[1] = *compression;
+ }
+ execlp(GZIP,"gzip",combuf,(char*)0);
ohshite(_("failed to exec gzip -9c from tar --exclude"));
}
close(p2[0]);
waitsubproc(c5,"gzip -9c from tar --exclude",0);
waitsubproc(c4,"tar --exclude",0);
+ waitsubproc(c3,"dpkg-deb-filelist",0);
if (!oldformatflag) {
if (fstat(gzfd,&datastab)) ohshite("_(failed to fstat tmpfile (data))");
if (fprintf(ar,
werr(debar);
if (lseek(gzfd,0,SEEK_SET)) ohshite(_("failed to rewind tmpfile (data)"));
- if (!(c3= m_fork())) {
- m_dup2(gzfd,0); m_dup2(fileno(ar),1);
- execlp(CAT,"cat",(char*)0); ohshite(_("failed to exec cat (data)"));
- }
- waitsubproc(c3,"cat (data)",0);
+ do_fd_copy(gzfd, fileno(ar), _("data"));
if (datastab.st_size & 1)
if (putc('\n',ar) == EOF)
the files in it will be put in the binary package's control
information area.
+You can specify the compressionlevel used by adding a
+.B \-z#
+option.
+.B dpkg-deb
+will pass that option on to gzip.
+
Unless you specify
.BR \-\-nocheck ", " dpkg\-deb "
will read
void extracthalf(const char *debar, const char *directory,
const char *taroption, int admininfo);
+extern char *compression;
+
#define DEBMAGIC "!<arch>\ndebian-binary "
#define ADMINMEMBER "control.tar.gz "
#define ADMINMEMBER_COMPAT "control.tar.gz/ "
while ((component= *argv++) != 0) {
co= fopen(component,"r");
if (co) {
- if (!(c1= m_fork())) {
- m_dup2(fileno(co),0);
- execlp(CAT,"cat",(char*)0); ohshite(_("failed to exec cat component"));
- }
- waitsubproc(c1,"cat component",0);
+ do_fd_copy(fileno(co), 1, _("info_spew"));
} else if (errno == ENOENT) {
if (fprintf(stderr, _("dpkg-deb: `%.255s' contains no control component `%.255s'\n"),
debar, component) == EOF) werr("stderr");
<cfield> is the name of a field in the main `control' file.\n\
Options: -D for debugging output; --old or --new controls archive format;\n\
--nocheck to suppress control file check (build bad package).\n\
+ -z# to set the compression when building
\n\
Use `dpkg' to install and remove packages from your system, or\n\
`dselect' for user-friendly package management. Packages unpacked\n\
"Type dpkg --help for help about installing and deinstalling packages.");
int debugflag=0, nocheckflag=0, oldformatflag=BUILDOLDPKGFORMAT;
+const char* compression=NULL;
const struct cmdinfo *cipaction=0;
dofunction *action=0;
{ "old", 0, 0, &oldformatflag, 0, 0, 1 },
{ "debug", 'D', 0, &debugflag, 0, 0, 1 },
{ "nocheck", 0, 0, &nocheckflag, 0, 0, 1 },
+ { "compression", 'z', 1, 0, &compression, 0, 1 },
{ "help", 'h', 0, 0, 0, helponly },
{ "version", 0, 0, 0, 0, versiononly },
{ "licence", 0, 0, 0, 0, showcopyright }, /* UK spelling */
#define DSELECT "dselect"
#define DPKG "dpkg"
+#define SAFEFILELIST "dpkg-safefilelist"
#define TAR "tar"
#define GZIP "gzip"
#define CAT "cat"
void checksubprocerr(int status, const char *description, int sigpipeok);
void waitsubproc(pid_t pid, const char *description, int sigpipeok);
+int do_fd_copy(int fd1, int fd2, char *desc);
+
extern volatile int onerr_abort;
/*** from showcright.c ***/
if (r != pid) { onerr_abort++; ohshite(_("wait for %s failed"),description); }
checksubprocerr(status,description,sigpipeok);
}
+
+int do_fd_copy(int fd1, int fd2, char *desc) {
+ char *buf, *sbuf;
+ int count;
+ char *er_msg_1 = _("failed to allocate buffer for copy (%s)");
+ char *er_msg_2 = _("failed in copy on write (%s)");
+ char *er_msg_3 = _("failed in copy on read (%s)");
+
+ count = strlen(er_msg_1) + strlen(desc) + 1;
+ sbuf = malloc(count);
+ if(sbuf == NULL)
+ ohshite(_("failed to allocate buffer for snprintf 1"));
+ snprintf(sbuf, count, er_msg_1, desc);
+ sbuf[count-1] = 0;
+
+ buf = malloc(32768);
+ if(buf == NULL)
+ ohshite(sbuf);
+ free(sbuf);
+
+ count = strlen(er_msg_2) + strlen(desc) + 1;
+ sbuf = malloc(count);
+ if(sbuf == NULL)
+ ohshite(_("failed to allocate buffer for snprintf 2"));
+ snprintf(sbuf, count, er_msg_2, desc);
+ sbuf[count-1] = 0;
+
+ while((count = read(fd1, buf, 32768)) > 0)
+ if(write(fd2, buf, count) < count)
+ ohshite(sbuf);
+
+ free(sbuf);
+ count = strlen(er_msg_3) + strlen(desc) + 1;
+ sbuf = malloc(count);
+ if(sbuf == NULL)
+ ohshite(_("failed to allocate buffer for snprintf 2"));
+ snprintf(sbuf, count, er_msg_3, desc);
+ sbuf[count-1] = 0;
+
+ if(count < 0)
+ ohshite(_("failed in copy on read (control)"));
+ free(sbuf);
+ free(buf);
+}
int fd;
fd= open(COPYINGFILE,O_RDONLY);
if (fd < 0) ohshite(_("cannot open GPL file " COPYINGFILE));
- m_dup2(fd,0);
- execlp(CAT,CAT,"-",(char*)0);
- ohshite(_("unable to exec cat for displaying GPL file"));
+ do_fd_copy(fd, 1, _("showcopyright"));
}
#include <fnmatch.h>
#include <assert.h>
#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/ioctl.h>
+#include <fcntl.h>
#include <config.h>
#include <dpkg.h>
*pdesc_r=pdesc; *l_r=l;
}
+static int getttywidth() {
+ int fd;
+ int res;
+ struct winsize ws;
+
+ if ((fd=open("/dev/tty",O_RDONLY))!=-1) {
+ if (ioctl(fd, TIOCGWINSZ, &ws)==-1)
+ ws.ws_col=80;
+ close(fd);
+ }
+ return ws.ws_col;
+}
+
static void list1package(struct pkginfo *pkg, int *head) {
- int l;
+ int l,w;
const char *pdesc;
+ char format[80];
+ w=getttywidth()-(3+1+15+1+14+1+44); /* get spare width */
+ w>>=1; /* halve that so we can add that to the both the name and description */
+ sprintf(format,"%%c%%c%%c %%-%d.%ds %%-14.14s %%.*s\n", (14+w), (14+w));
+
if (!*head) {
fputs(_("\
Desired=Unknown/Install/Remove/Purge\n\
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed\n\
-|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)\n\
-||/ Name Version Description\n\
-+++-===============-==============-============================================\n"),
- stdout);
+|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)\n"), stdout);
+ printf(format,'|','|','/', _("Name"), _("Version"), 40, _("Description"));
+ printf("+++-");
+ for (l=0;l<(14+w);l++) printf("="); printf("-");
+ printf("==============-");
+ for (l=0;l<(44+w);l++) printf("=");
+ printf("\n");
*head= 1;
}
-
if (!pkg->installed.valid) blankpackageperfile(&pkg->installed);
- limiteddescription(pkg,44,&pdesc,&l);
- printf("%c%c%c %-15.15s %-14.14s %.*s\n",
+ limiteddescription(pkg,(44+w),&pdesc,&l);
+ printf(format,
"uihrp"[pkg->want],
"nUFiHc"[pkg->status],
" R?#"[pkg->eflag],
#include "main.h"
static void printversion(void) {
- if (fputs(_("Debian Linux `dpkg' package management program version "), stdout) < 0)
- werr("stdout");
+ if (fputs(_("Debian Linux `"), stdout) < 0) werr("stdout");
+ if (fputs(DPKG, stdout) < 0) werr("stdout");
+ if (fputs(_("' package management program version "), stdout) < 0) werr("stdout");
if (fputs( DPKG_VERSION_ARCH ".\n", stdout) < 0) werr("stdout");
- if (fputs(_("Copyright 1994-1996 Ian Jackson, Bruce Perens. This is free software;\n"
- "see the GNU General Public Licence version 2 or later for copying\n"
- "conditions. There is NO warranty. See dpkg --licence for details.\n"),
- stdout) < 0) werr("stdout");
+ if (fputs(_( "This is free software; see the GNU General Public Licence version 2 or\n"
+ "later for copying conditions. There is NO warranty.\n"
+ "See dpkg --licence for copyright and license details.\n"),
+ stdout) < 0) werr("stdout");
}
/*
options that need fixing:
BIN_SCRIPTS = dpkg-name dpkg-source dpkg-genchanges \
dpkg-gencontrol dpkg-shlibdeps dpkg-buildpackage \
dpkg-parsechangelog dpkg-distaddfile 822-date \
- dpkg-scanpackages dpkg-scansources dpkg-architecture
+ dpkg-scanpackages dpkg-scansources dpkg-architecture \
+ dpkg-safefilelist
SBIN_SCRIPTS = update-rc.d update-alternatives install-info \
dpkg-divert cleanup-info
-MAN1PAGES = dpkg-name.1 dpkg-source.1 822-date.1 dpkg-architecture.1
+MAN1PAGES = dpkg-name.1 dpkg-source.1 822-date.1 dpkg-architecture.1 \
+ dpkg-safefilelist.1
MAN8PAGES = update-rc.d.8 update-alternatives.8 install-info.8 \
cleanup-info.8 dpkg-scanpackages.8 dpkg-scansources.8 \
dpkg-divert.8
.\" This is free software; see the GNU General Public Licence version 2
.\" or later for copying conditions. There is NO warranty.
.\" Time-stamp: <96/05/03 14:00:06 root>
-.TH dpkg-name 1 "May 1996" "Debian Project" "Debian Linux"
+.TH dpkg-name 1 "May 1996" "Debian Project" "Debian GNU/Linux"
.SH NAME
dpkg\-name \- rename Debian packages to full package names
.SH SYNOPSIS
.\" You should have received a copy of the GNU General Public
.\" License along with dpkg; if not, write to the Free Software
.\" Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-.TH DPKG-SCANPACKAGES 8 "1996-07-08" "Debian Linux"
+.TH DPKG-SCANPACKAGES 8 "1996-07-08" "Debian GNU/Linux"
.SH NAME
dpkg-scanpackages \- create Packages files
.