From: Ian Jackson Date: Tue, 30 Apr 1996 23:47:22 +0000 (+0100) Subject: dpkg (1.1.6); priority=MEDIUM X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=258ed6ae6ff639a76b534353fcc502d4ca97ca8c;p=dpkg dpkg (1.1.6); priority=MEDIUM * Check virtual dependencies when removing (ouch! - thanks SDE.) * Fixed bug in internal database validity management that could make dselect and dpkg dump core. (Bug#2613.) * Fixed two coredumping bugs when using local diversions. (Bug#2804.) * Fixed disappearance of overwritten packages. (Bug#2696.) * install-info won't modify dir file before start of menu. * install-info will create Miscellaneous heading if no sections yet. * Only alphanums and +-. allowed in package names - enforced by dpkg-deb --build and documented in Guidelines. * dselect doesn't display packages unless they are installed, selected or available. * dselect doesn't show spurious section and priority headings. * dselect has a few extra keybindings (from Lee Olds). * --force message changed to `--force enabled' so that default is OK. * dpkg-name now includes architecture component in .deb filename, and translates - in package name to _. * .deb file has architecture component in filename. * Guidelines changed to say Pre-Depends is for experts only. * Guidelines say to provide a unidiff (-u) rather than an old context diff. * Guidelines say 755 root.root for shared libraries. -- Ian Jackson Wed, 1 May 1996 00:47:22 +0100 --- diff --git a/TODO b/TODO index 33418687..47165981 100644 --- a/TODO +++ b/TODO @@ -1,17 +1,9 @@ Here are some currently-known inadequacies: urgent - * Pre-Depends installation ordering - -done - * a.out version - * uncomment ELF preinst modification - * Replaces (auto-deselect for conflicts) - * Replaces (don't overwrite otherwise) - * compile with ELF GCC out of the box - * dpkg --print-architecture - * Architecture field check - * symlink rename change + * Conflicts << installation ordering + * Version numbers in pre-depends stuff + * Search for all pre-depends things at once, bomb out if any not found bugs that need to be fixed quickly * version numbers not starting digit early. @@ -32,9 +24,11 @@ bugs that need to be fixed quickly * remove old docs from /usr/doc/dpkg. other stuff unlikely to get done soon + * md5sum component in new .deb files + * version number comparison option + * diversions list as control archive entry * single maintainer script, and new package getting there first * dpkg -s show something for virtual packages - * dpkg --listfiles should do better for multi-package files (pkg, pkg: ...) * settable defaults for update-rc.d * local conffiles * hooks @@ -55,3 +49,15 @@ other stuff unlikely to get done soon * `fake' or `null' packages * --purge remove empty directories which used too contain conffiles * conffiles handling options, including `replace removed files' + +done + * Pre-Depends installation ordering + * a.out version + * uncomment ELF preinst modification + * Replaces (auto-deselect for conflicts) + * Replaces (don't overwrite otherwise) + * compile with ELF GCC out of the box + * dpkg --print-architecture + * Architecture field check + * symlink rename change + * dpkg --listfiles should do better for multi-package files (pkg, pkg: ...) diff --git a/debian.Changelog b/debian.Changelog index f024177a..4985617e 100644 --- a/debian.Changelog +++ b/debian.Changelog @@ -1,8 +1,37 @@ +dpkg (1.1.6); priority=MEDIUM + + * Check virtual dependencies when removing (ouch! - thanks SDE.) + * Fixed bug in internal database validity management that could + make dselect and dpkg dump core. (Bug#2613.) + * Fixed two coredumping bugs when using local diversions. (Bug#2804.) + * Fixed disappearance of overwritten packages. (Bug#2696.) + * install-info won't modify dir file before start of menu. + * install-info will create Miscellaneous heading if no sections yet. + + * Only alphanums and +-. allowed in package names - enforced by + dpkg-deb --build and documented in Guidelines. + * dselect doesn't display packages unless they are installed, selected + or available. + * dselect doesn't show spurious section and priority headings. + * dselect has a few extra keybindings (from Lee Olds). + * --force message changed to `--force enabled' so that default is OK. + + * dpkg-name now includes architecture component in .deb filename, + and translates - in package name to _. + * .deb file has architecture component in filename. + + * Guidelines changed to say Pre-Depends is for experts only. + * Guidelines say to provide a unidiff (-u) rather than an old context diff. + * Guidelines say 755 root.root for shared libraries. + + -- Ian Jackson Wed, 1 May 1996 00:47:22 +0100 + dpkg (1.1.5); priority=MEDIUM (HIGH for diversions users) * Fixed coredump when using diversions. (Bug#2603.) * Fixed typo in dpkg-divert which could lose diversions. (Bug#2662.) + * --force-overwrite is the default. * diversions.text provides better examples. -- Ian Jackson Wed, 10 Apr 1996 13:59:30 +0100 diff --git a/debian.rules b/debian.rules index 49ffb089..4b671c06 100755 --- a/debian.rules +++ b/debian.rules @@ -1,7 +1,7 @@ #!/usr/bin/make -f package=dpkg -version=1.1.5 +version=1.1.6 archi=$(shell dpkg --print-architecture) DIR:=$(shell pwd) @@ -58,11 +58,11 @@ binary: rm debian-tmp/var/lib/dpkg/{status,available} dpkg --build debian-tmp if file main/dpkg | grep -q ELF; then \ - mv debian-tmp.deb ../dpkg-$(version)elf.deb ; \ + mv debian-tmp.deb ../dpkg-$(version)elf.$(archi).deb ; \ mv ../dpkg-$(version).nondebbin.tar.gz \ ../dpkg-$(version)elf.nondebbin.tar.gz ; \ else \ - mv debian-tmp.deb ../dpkg-$(version).deb ; \ + mv debian-tmp.deb ../dpkg-$(version).$(archi).deb ; \ fi define checkdir diff --git a/doc/guidelines.info-1 b/doc/guidelines.info-1 index ac917144..c69a3348 100644 --- a/doc/guidelines.info-1 +++ b/doc/guidelines.info-1 @@ -218,8 +218,9 @@ the guidelines below. course, owned by the appropriate group. * Library files should generally be mode 644 and owned by - `root.root'. If the package requires different permissions or - ownerships to function correctly, they should be used instead. + `root.root'; shared libraries should be mode 755. If the package + requires different permissions or ownerships to function + correctly, they should be used instead. * Manual pages should be mode 644 and owned by `root.root'. The `nroff' source must be installed. You should *not* install a @@ -471,8 +472,8 @@ for the existence of a file in the source directory. `-' (again, see the section below on version numbering). - * Create the context diff against the original package using `diff - -cNr', and use `gzip -9' to compress it. Context diffs should be + * Create the unified context diff against the original package using + `diff -uNr', and use `gzip -9' to compress it. Diffs should be named in the form -.diff.gz--for example, `fileutils-3.9-3.diff.gz'. @@ -628,9 +629,9 @@ installation tools. The value of `Package' should be the name of the package. Package names must start with an alphanumeric, must be at least two characters, -and may contain only alphanumerics and the characters - + . @ : = % _ -(that is, hyphen, plus, stop, at, colon, equals, percent and -underscore). They are not case sensitive. +and may contain only alphanumerics and the characters - + . (that is, +hyphen, plus, stop) (1). They are sort of case sensitive - please try +to get the case right first time. The `Maintainer' field should be in the form @@ -694,7 +695,8 @@ reluctant to downgrade packages. `Pre-Depends' Used by base packages to ensure that (for example) shared - libraries are present befoore they are upgraded. + libraries are present before they are upgraded. This feature is + for expert use only. `Source' Gives the name of the source package when several binary packages @@ -732,6 +734,12 @@ the reasons described in `dependency-ordering.txt', and the others because older versions of those packages do not have the appropriate `Provides' field. + ---------- Footnotes ---------- + + (1) The characters @ : = % _ (at, colon, equals, percent and +underscore) used to be legal and are still accepted when found in a +package file, but may not be used in new packages +  File: guidelines.info, Node: conffiles, Next: Installation and Removal Scripts, Prev: control, Up: Control Files diff --git a/doc/guidelines.texi b/doc/guidelines.texi index 78662e4d..21c5d9f5 100644 --- a/doc/guidelines.texi +++ b/doc/guidelines.texi @@ -234,8 +234,9 @@ owned by the appropriate group. @item Library files should generally be mode 644 and owned by -@code{root.root}. If the package requires different permissions -or ownerships to function correctly, they should be used instead. +@code{root.root}; shared libraries should be mode 755. If the package +requires different permissions or ownerships to function correctly, they +should be used instead. @item Manual pages should be mode 644 and owned by @code{root.root}. The @@ -529,9 +530,9 @@ but the tarfile should unpack into a directory named below on version numbering). @item -Create the context diff against the original package using @file{diff --cNr}, and use @file{gzip -9} to compress it. Context diffs should be -named in the form <@i{package}>-<@i{version}>.diff.gz---for example, +Create the unified context diff against the original package using +@file{diff -uNr}, and use @file{gzip -9} to compress it. Diffs should +be named in the form <@i{package}>-<@i{version}>.diff.gz---for example, @file{fileutils-3.9-3.diff.gz}. @end itemize @@ -684,11 +685,14 @@ The version number in the format Each field has a particular format and meaning for the package installation tools. -The value of @file{Package} should be the name of the package. -Package names must start with an alphanumeric, must be at least two -characters, and may contain only alphanumerics and the characters -- + . @@ : = % _ (that is, hyphen, plus, stop, at, colon, equals, -percent and underscore). They are not case sensitive. +The value of @file{Package} should be the name of the package. Package +names must start with an alphanumeric, must be at least two characters, +and may contain only alphanumerics and the characters - + . (that is, +hyphen, plus, stop) @footnote{The characters @@ : = % _ (at, colon, +equals, percent and underscore) used to be legal and are still accepted +when found in a package file, but may not be used in new packages}. +They are sort of case sensitive - please try to get the case right first +time. The @code{Maintainer} field should be in the form @@ -752,7 +756,7 @@ used as a location for the package in the distribution. A boolean field used by the base packages. @item Pre-Depends Used by base packages to ensure that (for example) shared libraries are -present befoore they are upgraded. +present before they are upgraded. This feature is for expert use only. @item Source Gives the name of the source package when several binary packages are generated from a single source tree. diff --git a/dpkg-deb/build.c b/dpkg-deb/build.c index 79e9f364..7be355a8 100644 --- a/dpkg-deb/build.c +++ b/dpkg-deb/build.c @@ -93,6 +93,10 @@ void do_build(const char *const *argv) { parsedb(controlfile, pdb_recordavailable|pdb_rejectstatus, &checkedinfo, stderr, &warns); assert(checkedinfo->available.valid); + if (strspn(checkedinfo->name, + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-.") + != strlen(checkedinfo->name)) + ohshit("package name has characters that aren't alphanums or `-+.'"); if (checkedinfo->priority == pri_other) { fprintf(stderr, "warning, `%s' contains user-defined Priority value `%s'\n", controlfile, checkedinfo->otherpriority); diff --git a/dselect/helpmsgs.src b/dselect/helpmsgs.src index db0fd6a7..2bcf1494 100644 --- a/dselect/helpmsgs.src +++ b/dselect/helpmsgs.src @@ -1,7 +1,7 @@ @@@ listkeys Keystrokes Motion keys: Next/Previous, Top/End, Up/Down, Backwards/Forwards: - n, Down-arrow p, Up-arrow move highlight + n, Down-arrow, j p, Up-arrow, k move highlight N, Page-down, Space P, Page-up, Backspace scroll list by 1 page ^n ^p scroll list by 1 line t, Home e, End jump to top/end of list @@ -18,7 +18,7 @@ Package states - selection: Package states - hold flag: Quit, exit, overwrite (note capitals!): ? request help (also Help, F1) Return Confirm and quit (check dependencies) i toggle/cycle info displays Q Confirm and quit (override dep.s) o cycle through sort orders - X eXit, abandoning any changes made v toggle verbose status display + X, Esc eXit, abandoning any changes made v toggle verbose status display R Revert to state before this list ^l redraw display U set all to sUggested state / search (hit Return to cancel) D set all to Directly selected state \\ repeat last search diff --git a/dselect/methkeys.cc b/dselect/methkeys.cc index eef8104b..c62947cb 100644 --- a/dselect/methkeys.cc +++ b/dselect/methkeys.cc @@ -62,14 +62,18 @@ const keybindings::interpretation methodlist_kinterps[] = { #define C(x) ((x)-'a'+1) const keybindings::orgbinding methodlist_korgbindings[]= { + { 'j', "down" }, // vi style { 'n', "down" }, { KEY_DOWN, "down" }, + { 'k', "up" }, // vi style { 'p', "up" }, { KEY_UP, "up" }, + { C('f'), "scrollon" }, // vi style { 'N', "scrollon" }, { KEY_NPAGE, "scrollon" }, { ' ', "scrollon" }, + { C('b'), "scrollback" }, // vi style { 'P', "scrollback" }, { KEY_PPAGE, "scrollback" }, { KEY_BACKSPACE, "scrollback" }, @@ -105,6 +109,7 @@ const keybindings::orgbinding methodlist_korgbindings[]= { { KEY_ENTER, "select-and-quit" }, { '\r', "select-and-quit" }, + { 27, "abort" }, // esc { 'x', "abort" }, { 'X', "abort" }, diff --git a/dselect/pkgkeys.cc b/dselect/pkgkeys.cc index 5e47a931..41a9bfb4 100644 --- a/dselect/pkgkeys.cc +++ b/dselect/pkgkeys.cc @@ -75,8 +75,10 @@ const keybindings::interpretation packagelist_kinterps[] = { #define C(x) ((x)-'a'+1) const keybindings::orgbinding packagelist_korgbindings[]= { + { 'j', "down" }, // vi style { 'n', "down" }, { KEY_DOWN, "down" }, + { 'k', "up" }, // vi style { 'p', "up" }, { KEY_UP, "up" }, @@ -86,7 +88,7 @@ const keybindings::orgbinding packagelist_korgbindings[]= { { 'P', "scrollback" }, { KEY_PPAGE, "scrollback" }, { KEY_BACKSPACE, "scrollback" }, - { 0177,/*DEL*/ "scrollback" }, + { 0177, "scrollback" }, // ASCII DEL { C('h'), "scrollback" }, { C('n'), "scrollon1" }, { C('p'), "scrollback1" }, @@ -130,6 +132,8 @@ const keybindings::orgbinding packagelist_korgbindings[]= { { KEY_ENTER, "quitcheck" }, { '\r', "quitcheck" }, { 'Q', "quitnocheck" }, + { 27, "abortnocheck" }, // esc + { 'x', "abortnocheck" }, { 'X', "abortnocheck" }, { 'R', "revert" }, { 'U', "revertsuggest" }, diff --git a/dselect/pkglist.cc b/dselect/pkglist.cc index f619a75e..f995e96c 100644 --- a/dselect/pkglist.cc +++ b/dselect/pkglist.cc @@ -43,7 +43,7 @@ int packagelist::compareentries(struct perpackagestate *a, !asection || !bsection ? (!bsection) - (!asection) : !*asection || !*bsection ? - (!asection) - (!bsection) : + (!*asection) - (!*bsection) : strcasecmp(asection,bsection); int c_priority= a->pkg->priority - b->pkg->priority; @@ -95,6 +95,7 @@ void packagelist::addheading(pkginfo::pkgpriority priority, nallocated += nallocated+50; struct perpackagestate **newtable= new struct perpackagestate*[nallocated]; memcpy(newtable,table,nallocated*sizeof(struct perpackagestate*)); + delete[] table; table= newtable; } @@ -233,10 +234,7 @@ packagelist::packagelist(keybindings *kb) : baselist(kb) { ) { struct perpackagestate *state= &datatable[nitems]; state->pkg= pkg; - if (!informativeperfile(&pkg->available) && - pkg->status == pkginfo::stat_notinstalled && - pkg->priority == pkginfo::pri_unknown && - !(pkg->section && *pkg->section) && + if (pkg->status == pkginfo::stat_notinstalled && !pkg->files && pkg->want != pkginfo::want_install) { pkg->clientdata= 0; continue; diff --git a/include/dpkg-db.h b/include/dpkg-db.h index 59188588..202c07fc 100644 --- a/include/dpkg-db.h +++ b/include/dpkg-db.h @@ -150,8 +150,7 @@ extern char *statusfile, *availablefile; /* initialised by modstatdb_init */ struct pkginfo *findpackage(const char *name); void blankpackage(struct pkginfo *pp); void blankpackageperfile(struct pkginfoperfile *pifp); -int informative(struct pkginfo *info); -int informativeperfile(struct pkginfoperfile *info); +int informative(struct pkginfo *pkg, struct pkginfoperfile *info); int countpackages(void); void resetpackages(void); diff --git a/lib/database.c b/lib/database.c index 9561a0fd..71250e7e 100644 --- a/lib/database.c +++ b/lib/database.c @@ -132,8 +132,20 @@ void blankpackageperfile(struct pkginfoperfile *pifp) { static int nes(const char *s) { return s && *s; } -int informativeperfile(struct pkginfoperfile *info) { - /* Used by dselect as an aid to decide whether to display things. */ +int informative(struct pkginfo *pkg, struct pkginfoperfile *info) { + /* Used by dselect and dpkg query options as an aid to decide + * whether to display things, and by dump to decide whether to write them + * out. + */ + if (info == &pkg->installed ? + ((pkg->want != want_unknown && pkg->want != want_purge) || + pkg->eflag != eflagv_ok || + pkg->status != stat_notinstalled || + pkg->files) + : + (nes(pkg->section) || + pkg->priority != pri_unknown)) + return 1; if (!info->valid) return 0; if (info->depends || nes(info->description) || @@ -147,15 +159,6 @@ int informativeperfile(struct pkginfoperfile *info) { return 0; } -int informative(struct pkginfo *pkg) { - return ((pkg->want != want_unknown && pkg->want != want_purge) || - pkg->eflag != eflagv_ok || - pkg->status != stat_notinstalled || - nes(pkg->section) || - pkg->files || - pkg->priority != pri_unknown); -} - struct pkginfo *findpackage(const char *name) { struct pkginfo **pointerp, *newpkg; diff --git a/lib/dump.c b/lib/dump.c index 97d5c430..fb9aa765 100644 --- a/lib/dump.c +++ b/lib/dump.c @@ -238,6 +238,7 @@ void writedb(const char *filename, int available, int mustsync) { struct pkgiterator *it; struct pkginfo *pigp; + struct pkginfoperfile *pifp; char *oldfn, *newfn; const char *which; FILE *file; @@ -258,12 +259,11 @@ void writedb(const char *filename, int available, int mustsync) { it= iterpkgstart(); while ((pigp= iterpkgnext(it)) != 0) { - if (!(informative(pigp) || - informativeperfile(&pigp->available) || - informativeperfile(&pigp->installed))) - /* Don't dump records which have no useful content. */ - continue; - varbufrecord(&vb, pigp, available ? &pigp->available : &pigp->installed); + pifp= available ? &pigp->available : &pigp->installed; + /* Don't dump records which have no useful content. */ + if (!informative(pigp,pifp)) continue; + if (!pifp->valid) blankpackageperfile(pifp); + varbufrecord(&vb,pigp,pifp); varbufaddc(&vb,'\n'); varbufaddc(&vb,0); if (!fputs(vb.buf,file)) ohshite("failed to write %s record about `%.50s' to `%.250s'", diff --git a/main/archives.c b/main/archives.c index bfe8de48..7b17e208 100644 --- a/main/archives.c +++ b/main/archives.c @@ -41,6 +41,70 @@ #include "main.h" #include "archives.h" +int filesavespackage(struct fileinlist *file, struct pkginfo *pkgtobesaved, + struct pkginfo *pkgbeinginstalled) { + struct pkginfo *divpkg, *thirdpkg; + struct filepackages *packageslump; + int i; + + debug(dbg_eachfiledetail,"filesavespackage file `%s' package %s", + file->namenode->name,pkgtobesaved->name); + /* A package can only be saved by a file or directory which is part + * only of itself - it must be neither part of the new package being + * installed nor part of any 3rd package (this is important so that + * shared directories don't stop packages from disappearing). + */ + /* Is the file in the package being installed ? If so then it can't save. + */ + if (file->namenode->flags & fnnf_new_inarchive) { + debug(dbg_eachfiledetail,"filesavespackage ... in new archive -- no save"); + return 0; + } + /* If the file is a contended one and it's overridden by either + * the package we're considering disappearing or the package + * we're installing then they're not actually the same file, so + * we can't disappear the package - it is saved by this file. + */ + if (file->namenode->divert && file->namenode->divert->useinstead) { + divpkg= file->namenode->divert->pkg; + if (divpkg == pkgtobesaved || divpkg == pkgbeinginstalled) { + debug(dbg_eachfiledetail,"filesavespackage ... diverted -- save!"); + return 1; + } + } + /* Look for a 3rd package which can take over the file (in case + * it's a directory which is shared by many packages. + */ + for (packageslump= file->namenode->packages; + packageslump; + packageslump= packageslump->more) { + for (i=0; i < PERFILEPACKAGESLUMP && packageslump->pkgs[i]; i++) { + thirdpkg= packageslump->pkgs[i]; + debug(dbg_eachfiledetail, "filesavespackage ... also in %s", + thirdpkg->name); + /* Is this not the package being installed or the one being + * checked for disappearance ? + */ + if (thirdpkg == pkgbeinginstalled || thirdpkg == pkgtobesaved) continue; + /* If !fileslistvalid then we've already disappeared this one, so + * we shouldn't try to make it take over this shared directory. + */ + debug(dbg_eachfiledetail,"filesavespackage ... is 3rd package"); + + if (!thirdpkg->clientdata->fileslistvalid) { + debug(dbg_eachfiledetail, + "process_archive ... already disappeared !"); + continue; + } + /* We've found a package that can take this file. */ + debug(dbg_eachfiledetail, "filesavespackage ... taken -- no save"); + return 0; + } + } + debug(dbg_eachfiledetail, "filesavespackage ... not taken -- save !"); + return 1; +} + void cu_pathname(int argc, void **argv) { ensure_pathname_nonexisting((char*)(argv[0])); } @@ -269,7 +333,8 @@ int tarobject(struct TarInfo *ti) { * check for both being the diverting package, obviously). */ divpkg= nifd->namenode->divert->pkg; - debug(dbg_eachfile, "tarobject ... diverted, divpkg=%s\n",divpkg->name); + debug(dbg_eachfile, "tarobject ... diverted, divpkg=%s", + divpkg ? divpkg->name : ""); if (otherpkg == divpkg || tc->pkg == divpkg) continue; } /* Nope ? Hmm, file conflict, perhaps. Check Replaces. */ diff --git a/main/archives.h b/main/archives.h index 00babbee..90f028c1 100644 --- a/main/archives.h +++ b/main/archives.h @@ -57,6 +57,9 @@ int unlinkorrmdir(const char *filename); int tarobject(struct TarInfo *ti); int tarfileread(void *ud, char *buf, int len); +int filesavespackage(struct fileinlist*, struct pkginfo*, + struct pkginfo *pkgbeinginstalled); + void check_conflict(struct dependency *dep, struct pkginfo *pkg, const char *pfilename, struct pkginfo **conflictorp); diff --git a/main/enquiry.c b/main/enquiry.c index 43302bf8..c49e9a42 100644 --- a/main/enquiry.c +++ b/main/enquiry.c @@ -385,7 +385,7 @@ void enqperpackage(const char *const *argv) { !(pkg->section && *pkg->section) && !pkg->files && pkg->want == want_unknown && - !informativeperfile(&pkg->installed)) { + !informative(pkg,&pkg->installed)) { printf("Package `%s' is not installed and no info is available.\n",pkg->name); failures++; } else { diff --git a/main/errors.c b/main/errors.c index b4064b2d..797c8a84 100644 --- a/main/errors.c +++ b/main/errors.c @@ -101,7 +101,7 @@ void forcibleerr(int forceflag, const char *fmt, ...) { va_list al; va_start(al,fmt); if (forceflag) { - fputs(DPKG " - warning, overriding problem because you used --force:\n ",stderr); + fputs(DPKG " - warning, overriding problem because --force enabled:\n ",stderr); vfprintf(stderr,fmt,al); fputc('\n',stderr); } else { diff --git a/main/packages.c b/main/packages.c index 1db2db03..c4954712 100644 --- a/main/packages.c +++ b/main/packages.c @@ -246,6 +246,7 @@ void process_queue(void) { static int deppossi_ok_found(struct pkginfo *possdependee, struct pkginfo *requiredby, struct pkginfo *removing, + struct pkginfo *providing, int *matched, struct deppossi *checkversion, int *interestingwarnings, @@ -260,6 +261,10 @@ static int deppossi_ok_found(struct pkginfo *possdependee, if (possdependee == removing) { varbufaddstr(oemsgs," Package "); varbufaddstr(oemsgs,possdependee->name); + if (providing) { + varbufaddstr(oemsgs," which provides "); + varbufaddstr(oemsgs,providing->name); + } varbufaddstr(oemsgs," is to be removed.\n"); *matched= 1; if (fc_depends) thisf= (dependtry >= 4) ? 2 : 1; @@ -300,6 +305,10 @@ static int deppossi_ok_found(struct pkginfo *possdependee, } else { varbufaddstr(oemsgs," Package "); varbufaddstr(oemsgs,possdependee->name); + if (providing) { + varbufaddstr(oemsgs," which provides "); + varbufaddstr(oemsgs,providing->name); + } varbufaddstr(oemsgs," is not configured yet.\n"); if (fc_depends) thisf= (dependtry >= 4) ? 2 : 1; debug(dbg_depcondetail," not configured/able - returning %d",thisf); @@ -309,6 +318,10 @@ static int deppossi_ok_found(struct pkginfo *possdependee, default: varbufaddstr(oemsgs," Package "); varbufaddstr(oemsgs,possdependee->name); + if (providing) { + varbufaddstr(oemsgs," which provides "); + varbufaddstr(oemsgs,providing->name); + } varbufaddstr(oemsgs," is not installed.\n"); if (fc_depends) thisf= (dependtry >= 4) ? 2 : 1; debug(dbg_depcondetail," not installed - returning %d",thisf); @@ -341,7 +354,7 @@ int dependencies_ok(struct pkginfo *pkg, struct pkginfo *removing, debug(dbg_depcondetail," break cycle so ok and found"); found= 3; break; } - thisf= deppossi_ok_found(possi->ed,pkg,removing, + thisf= deppossi_ok_found(possi->ed,pkg,removing,0, &matched,possi,&interestingwarnings,&oemsgs); if (thisf > found) found= thisf; if (found != 3 && possi->verrel == dvr_none) { @@ -351,7 +364,7 @@ int dependencies_ok(struct pkginfo *pkg, struct pkginfo *removing, provider= provider->nextrev) { if (provider->up->type != dep_provides) continue; debug(dbg_depcondetail," checking provider %s",provider->up->up->name); - thisf= deppossi_ok_found(provider->up->up,pkg,removing, + thisf= deppossi_ok_found(provider->up->up,pkg,removing,possi->ed, &matched,0,&interestingwarnings,&oemsgs); if (thisf > found) found= thisf; } diff --git a/main/processarc.c b/main/processarc.c index 2df3d0d6..4df46c31 100644 --- a/main/processarc.c +++ b/main/processarc.c @@ -793,22 +793,9 @@ void process_archive(const char *filename) { continue; } for (cfile= otherpkg->clientdata->files; - cfile; - cfile= cfile->next) { - if (!(cfile->namenode->flags & fnnf_new_inarchive)) break; - if (cfile->namenode->divert && cfile->namenode->divert->useinstead) { - /* If the file is a contended one and it's overridden by either the package - * we're considering disappearing or the package we're installing then - * they're not actually the same file, so we can't disappear the package. - */ - divpkg= cfile->namenode->divert->pkg; - if (divpkg == pkg || divpkg == otherpkg) break; - } - } - if (cfile) { - debug(dbg_stupidlyverbose, "process_archive saved by `%s'",cfile->namenode->name); - continue; - } + cfile && !filesavespackage(cfile,otherpkg,pkg); + cfile= cfile->next); + if (cfile) continue; /* So dependency things will give right answers ... */ otherpkg->clientdata->istobe= itb_remove; @@ -924,7 +911,7 @@ void process_archive(const char *filename) { } else { debug(dbg_eachfile, "process_archive looking for overwriting `%s' (overridden by %s)", - cfile->namenode->name, divpkg->name); + cfile->namenode->name, divpkg ? divpkg->name : ""); } } else { divpkg= 0; diff --git a/main/remove.c b/main/remove.c index 94199da8..87cfbecc 100644 --- a/main/remove.c +++ b/main/remove.c @@ -40,11 +40,35 @@ #include "filesdb.h" #include "main.h" +static void checkforremoval(struct pkginfo *pkgtoremove, + struct pkginfo *pkgdepcheck, /* may be virtual pkg */ + int *rokp, struct varbuf *raemsgs) { + struct deppossi *possi; + struct pkginfo *depender; + int before, ok; + + for (possi= pkgdepcheck->installed.depended; possi; possi= possi->nextrev) { + if (possi->up->type != dep_depends && possi->up->type != dep_predepends) continue; + depender= possi->up->up; + debug(dbg_depcon,"checking depending package `%s'",depender->name); + if (depender->status != stat_installed) continue; + if (ignore_depends(depender)) { + debug(dbg_depcon,"ignoring depending package `%s'\n",depender->name); + continue; + } + if (dependtry > 1) { if (findbreakcycle(pkgdepcheck,0)) sincenothing= 0; } + before= raemsgs->used; + ok= dependencies_ok(depender,pkgtoremove,raemsgs); + if (ok == 0 && depender->clientdata->istobe == itb_remove) ok= 1; + if (ok == 1) raemsgs->used= before; /* Don't burble about reasons for deferral */ + if (ok < *rokp) *rokp= ok; + } +} + void deferred_remove(struct pkginfo *pkg) { struct varbuf raemsgs; - int rok, before, ok; - struct deppossi *dep; - struct pkginfo *depender; + int rok; + struct dependency *dep; debug(dbg_general,"deferred_remove package %s",pkg->name); @@ -77,22 +101,13 @@ void deferred_remove(struct pkginfo *pkg) { debug(dbg_general,"checking dependencies for remove `%s'",pkg->name); varbufinit(&raemsgs); rok= 2; - for (dep= pkg->installed.depended; dep; dep= dep->nextrev) { - if (dep->up->type != dep_depends && dep->up->type != dep_predepends) continue; - depender= dep->up->up; - debug(dbg_depcon,"checking depending package `%s'",depender->name); - if (depender->status != stat_installed) continue; - if (ignore_depends(depender)) { - debug(dbg_depcon,"ignoring depending package `%s'\n",depender->name); - continue; - } - if (dependtry > 1) { if (findbreakcycle(pkg,0)) sincenothing= 0; } - before= raemsgs.used; - ok= dependencies_ok(depender,pkg,&raemsgs); - if (ok == 0 && depender->clientdata->istobe == itb_remove) ok= 1; - if (ok == 1) raemsgs.used= before; /* Don't burble about reasons for deferral */ - if (ok < rok) rok= ok; + checkforremoval(pkg,pkg,&rok,&raemsgs); + for (dep= pkg->installed.depends; dep; dep= dep->next) { + if (dep->type != dep_provides) continue; + debug(dbg_depcon,"checking virtual package `%s'",dep->list->ed->name); + checkforremoval(pkg,dep->list->ed,&rok,&raemsgs); } + if (rok == 1) { varbuffree(&raemsgs); pkg->clientdata->istobe= itb_remove; diff --git a/scripts/dpkg-name.1 b/scripts/dpkg-name.1 index b474feb8..f052b281 100644 --- a/scripts/dpkg-name.1 +++ b/scripts/dpkg-name.1 @@ -3,11 +3,11 @@ .\" .\" This is free software; see the GNU General Public Licence version 2 .\" or later for copying conditions. There is NO warranty. -.TH dpkg-name 1 "January 1996" "Debian Project" "Debian GNU/Linux" +.TH dpkg-name 1 "April 1996" "Debian Project" "Debian Linux" .SH NAME dpkg\-name \- rename Debian packages to full package names .SH SYNOPSIS -.B dpkg\-name [\-h|\-\-help] [\-V|\-\-version] [\-L|\-\-license] [--] [files] +.B dpkg\-name [\-h|\-\-help] [\-v|\-\-version] [\-l|\-\-license] [--] [files] .SH DESCRIPTION .PP This manual page documents the @@ -15,12 +15,13 @@ This manual page documents the sh script which provides an easy way to rename .B Debian packages into their full package names. A full package name consists -of -[-].deb as specified in the control -file of the package. +of -..deb as specified in the control +file of the package ( is +-). .SH EXAMPLES .TP .B dpkg-name toedeledokie -The file `toedeledokie' will be renamed to emacs-19.29-4.deb or +The file `toedeledokie' will be renamed to emacs-19.29-4.i386.deb or something similar (depending on whatever information is in the control part of `toedeledokie'). .TP @@ -40,9 +41,9 @@ Print copyright information and (a reference to GNU) license information and exit successfully. .SH BUGS? Successfully tested on -.B Debian GNU/Linux +.B Debian Linux systems only. Some packages don't follow the name structure --[-].deb. Packages renamed by dpkg-name +-..deb. Packages renamed by dpkg-name will follow this structure. Generally this will have no impact on how packages are installed by dselect/dpkg. .SH SEE ALSO diff --git a/scripts/dpkg-name.sh b/scripts/dpkg-name.sh index 294010aa..660d0c0f 100755 --- a/scripts/dpkg-name.sh +++ b/scripts/dpkg-name.sh @@ -3,12 +3,12 @@ set -e prog="`basename \"${0}\"`" -version="0.11"; # This line modified by Makefile +version="1.1.5"; # This line modified by Makefile purpose="rename Debian packages to full package names" license () { echo "# ${prog} ${version} -- ${purpose} -# Copyright (C) 1995,1996 Erick Branderhorst . +# Copyright (C) 1995,1996 Erick Branderhorst . # This is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the @@ -32,7 +32,7 @@ show_version () { usage () { echo "Usage: ${prog} file[s] ${purpose} - file.deb changes to -[-].deb + file.deb changes to -..deb -h|--help|-v|--version|-l|--license Show help/version/license" } @@ -51,8 +51,14 @@ rename () { then p=$p-$r; fi - p=`echo $p|sed 's/ //g'` - p=`dirname "$1"`"/"$p.deb + a=`dpkg-deb -f -- "$1" architecture`; + if [ -z "$a" ]; + then + a=`dpkg --print-architecture`; + stderr "assuming "$a" architecture for \`"$1"'"; + fi + p=`echo \"$p\"|tr -ds -- '- ' _` + p=`dirname "$1"`"/"$p.$a.deb if [ $p -ef "$1" ]; # same device and inode numbers then stderr "skipping \`"$1"'"; @@ -91,4 +97,3 @@ exit 0; # Local variables: # tab-width: 2 # End: - diff --git a/scripts/install-info.8 b/scripts/install-info.8 index 2d881798..2b976f4f 100644 --- a/scripts/install-info.8 +++ b/scripts/install-info.8 @@ -118,6 +118,12 @@ replaced in situ with the new entry. If a section is specified when removing an entry the section is ignored and a warning is issued. + +If a section is requested when adding an entry but the file contains +no section headings at all then +.B install-info +will create both the requested section and a Miscellaneous section at +the end of the file. .TP .BI \-\-infodir= infodir Specifies that the diff --git a/scripts/install-info.pl b/scripts/install-info.pl index 0455ab1a..6ca15669 100755 --- a/scripts/install-info.pl +++ b/scripts/install-info.pl @@ -216,6 +216,12 @@ eof(OLD) || &ulquit("$name: read $infodir/dir: $!\n"); close(OLD) || &ulquit("$name: close $infodir/dir after read: $!\n"); while ($work[$#work] !~ m/\S/) { $#work--; } +do { + last if !@work; + $_= shift(@work); + push(@head,$_); +} until (m/^\*\s*Menu:/i); + if (!$remove) { for ($i=0; $i<=$#work; $i++) { @@ -249,9 +255,15 @@ if (!$remove) { if ($mss < 0) { print "$name: creating new section \`$sectiontitle'\n" unless $quiet; for ($i= $#work; $i>=0 && $work[$i] =~ m/\S/; $i--) { } - $i >= 0 || &ulquit("$name: nowhere to create new section - giving up\n"); - @work= (@work[0..$i], "$sectiontitle\n", "\n", @work[$i+1..$#work]); - $mss= $i+1; + if ($i <= 0) { # We ran off the top, make this section and Misc. + print "$name: no sections yet, creating Miscellaneous section too.\n" + unless $quiet; + @work= ("\n", "$sectiontitle\n", "\n", "Miscellaneous:", @work); + $mss= 1; + } else { + @work= (@work[0..$i], "$sectiontitle\n", "\n", @work[$i+1..$#work]); + $mss= $i+1; + } } while ($mss <= $#work) { $work[$mss] =~ m/\S/ || last; @@ -316,7 +328,7 @@ END if (!$nowrite) { open(NEW,"> $infodir/dir.new") || &ulquit("$name: create $infodir/dir.new: $!\n"); - print(NEW @work) || &ulquit("$name: write $infodir/dir.new: $!\n"); + print(NEW @head,@work) || &ulquit("$name: write $infodir/dir.new: $!\n"); close(NEW) || &ulquit("$name: close $infodir/dir.new: $!\n"); unlink("$infodir/dir.old"); diff --git a/version.h b/version.h index 8c7a769d..f3d8a840 100644 --- a/version.h +++ b/version.h @@ -1 +1 @@ -#define DPKG_VERSION "1.1.5" /* This line modified by Makefile */ +#define DPKG_VERSION "1.1.6" /* This line modified by Makefile */