From c6ea15b9850f26ea3b5a13667396c89e00aa9890 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Mon, 1 Nov 2010 08:18:28 +0100 Subject: Cleanup white spaces Remove trailing spaces. Remove blank lines not separating different code blocks. Remove blank lines at the end of the file. --- ChangeLog.old | 1 - README.translators | 1 - TODO | 1 - debian/usertags | 1 - doc/README.feature-removal-schedule | 1 - doc/triggers.txt | 2 -- dpkg-deb/Makefile.am | 1 - dpkg-deb/build.c | 15 ++++++------ dpkg-deb/extract.c | 19 ++++++--------- dpkg-deb/info.c | 6 ++--- dpkg-split/info.c | 14 +++++------ dpkg-split/join.c | 9 ++++--- dpkg-split/main.c | 2 +- dpkg-split/queue.c | 2 +- dselect/basecmds.cc | 14 +++++------ dselect/baselist.cc | 26 ++++++++++---------- dselect/bindings.cc | 8 +++---- dselect/bindings.h | 12 +++++----- dselect/dselect-curses.h | 1 - dselect/dselect.h | 4 ++-- dselect/main.cc | 5 ++-- dselect/methkeys.cc | 12 +++++----- dselect/methlist.cc | 10 ++++---- dselect/method.cc | 6 ++--- dselect/method.h | 6 ++--- dselect/methods/disk/setup | 2 -- dselect/methods/disk/update | 1 - dselect/methods/ftp/names | 1 - dselect/methparse.cc | 12 +++++----- dselect/pkgcmds.cc | 4 ++-- dselect/pkgdepcon.cc | 34 +++++++++++++------------- dselect/pkgdisplay.cc | 14 +++++------ dselect/pkginfo.cc | 4 ++-- dselect/pkgkeys.cc | 16 ++++++------- dselect/pkglist.cc | 44 ++++++++++++++++------------------ dselect/pkglist.h | 12 +++++----- dselect/pkgsublist.cc | 13 +++++----- dselect/pkgtop.cc | 22 ++++++----------- dselect/po/ChangeLog.old | 1 - dselect/po/POTFILES.in | 1 - get-version | 1 - lib/compat/Makefile.am | 1 - lib/compat/alphasort.c | 1 - lib/compat/compat.h | 1 - lib/compat/scandir.c | 1 - lib/compat/snprintf.c | 1 - lib/compat/strerror.c | 1 - lib/compat/strsignal.c | 1 - lib/compat/unsetenv.c | 1 - lib/compat/vsnprintf.c | 1 - lib/dpkg/buffer.c | 1 - lib/dpkg/cleanup.c | 1 - lib/dpkg/command.c | 1 - lib/dpkg/command.h | 1 - lib/dpkg/database.c | 2 +- lib/dpkg/dbmodify.c | 13 ++++------ lib/dpkg/dpkg-db.h | 3 ++- lib/dpkg/dump.c | 10 ++++---- lib/dpkg/ehandle.c | 12 ++++------ lib/dpkg/fields.c | 11 ++++----- lib/dpkg/file.c | 1 - lib/dpkg/file.h | 1 - lib/dpkg/log.c | 1 - lib/dpkg/macros.h | 1 - lib/dpkg/mlib.c | 7 +++--- lib/dpkg/nfmalloc.c | 2 +- lib/dpkg/parse.c | 7 ++++-- lib/dpkg/parsehelp.c | 7 +++--- lib/dpkg/path.c | 1 - lib/dpkg/path.h | 1 - lib/dpkg/pkg-array.c | 1 - lib/dpkg/pkg-format.c | 1 - lib/dpkg/pkg-list.c | 1 - lib/dpkg/pkg-queue.c | 1 - lib/dpkg/pkg-show.c | 1 - lib/dpkg/pkg.c | 1 - lib/dpkg/progress.c | 1 - lib/dpkg/progress.h | 1 - lib/dpkg/string.c | 1 - lib/dpkg/string.h | 1 - lib/dpkg/subproc.c | 1 - lib/dpkg/subproc.h | 1 - lib/dpkg/tarfn.c | 1 - lib/dpkg/test.h | 1 - lib/dpkg/test/Makefile.am | 1 - lib/dpkg/test/t-buffer.c | 1 - lib/dpkg/test/t-command.c | 1 - lib/dpkg/test/t-macros.c | 1 - lib/dpkg/test/t-path.c | 1 - lib/dpkg/test/t-pkg-list.c | 1 - lib/dpkg/test/t-pkg-queue.c | 1 - lib/dpkg/test/t-pkginfo.c | 1 - lib/dpkg/test/t-string.c | 1 - lib/dpkg/test/t-test.c | 1 - lib/dpkg/test/t-varbuf.c | 1 - lib/dpkg/test/t-version.c | 1 - lib/dpkg/trigdeferred.l | 1 - lib/dpkg/triglib.c | 1 + lib/dpkg/utils.c | 1 - m4/dpkg-compiler.m4 | 1 - m4/dpkg-progs.m4 | 1 - man/po/ChangeLog.old | 1 - po/ChangeLog.old | 1 - scripts/dpkg-distaddfile.pl | 1 - scripts/dpkg-genchanges.pl | 1 - scripts/dpkg-gencontrol.pl | 1 - scripts/dpkg-mergechangelogs.pl | 1 - scripts/dpkg-name.pl | 1 - scripts/dpkg-parsechangelog.pl | 1 - scripts/dpkg-scanpackages.pl | 1 - scripts/dpkg-shlibdeps.pl | 1 - scripts/dpkg-source.pl | 1 - scripts/po/ChangeLog.old | 1 - scripts/t/400_Dpkg_Deps.t | 1 - scripts/t/500_Dpkg_Path.t | 1 - scripts/t/700_Dpkg_Control.t | 1 - scripts/t/850_Dpkg_Compression.t | 2 -- scripts/t/910_merge_changelogs.t | 1 - src/archives.c | 42 +++++++++++++++----------------- src/cleanup.c | 8 +++---- src/depcon.c | 35 +++++++++++++-------------- src/divertdb.c | 1 - src/enquiry.c | 8 +++---- src/errors.c | 4 ++-- src/filesdb.c | 14 +++++------ src/filesdb.h | 2 +- src/help.c | 18 +++++++------- src/main.c | 5 ++-- src/main.h | 2 +- src/packages.c | 10 ++++---- src/processarc.c | 48 +++++++++++++++++++------------------ src/querycmd.c | 15 ++++-------- src/remove.c | 38 ++++++++++++++--------------- src/select.c | 2 +- src/statcmd.c | 1 - src/statdb.c | 1 - src/trigcmd.c | 1 - src/trigproc.c | 1 - src/update.c | 4 ++-- utils/start-stop-daemon.c | 1 - utils/t/100_update_alternatives.t | 1 - 141 files changed, 321 insertions(+), 444 deletions(-) diff --git a/ChangeLog.old b/ChangeLog.old index 21885fc54..ba9d1b371 100644 --- a/ChangeLog.old +++ b/ChangeLog.old @@ -16927,4 +16927,3 @@ Thu Aug 25 11:46:27 1994 Ian Murdock (imurdock@debra.debian.org) link never being removed at all. ChangeLog begins Thu Aug 25 11:46:27 1994 for dpkg 0.93.5. - diff --git a/README.translators b/README.translators index b55d1b9ed..14eed01d0 100644 --- a/README.translators +++ b/README.translators @@ -76,4 +76,3 @@ Update to 1354t. - msgmerge updates your file with the current POT file. - msgfmt checks it for validity. - msgcat may detect encoding problems. - diff --git a/TODO b/TODO index 5027dd374..8055d6412 100644 --- a/TODO +++ b/TODO @@ -182,4 +182,3 @@ other stuff unlikely to get done soon * how to change case of package names * `fake' or `null' packages * dpkg --query | -Q - diff --git a/debian/usertags b/debian/usertags index ef4ff74a8..057e23de6 100644 --- a/debian/usertags +++ b/debian/usertags @@ -166,4 +166,3 @@ usercategory dpkg-maint * severity * classification `--- - diff --git a/doc/README.feature-removal-schedule b/doc/README.feature-removal-schedule index f7d0cc017..2ce6506a2 100644 --- a/doc/README.feature-removal-schedule +++ b/doc/README.feature-removal-schedule @@ -114,4 +114,3 @@ Why: Having two ways to let the administrator get to a shell on conffile prompt is confusing, it also difficults setting up a consistent environment to be used by external programs. - diff --git a/doc/triggers.txt b/doc/triggers.txt index 915e8e744..0b702a555 100644 --- a/doc/triggers.txt +++ b/doc/triggers.txt @@ -817,5 +817,3 @@ are tuples.) (See `Processing' above for discussion of dependency cycles.) -- - - diff --git a/dpkg-deb/Makefile.am b/dpkg-deb/Makefile.am index 36bee16ad..6f118cf2e 100644 --- a/dpkg-deb/Makefile.am +++ b/dpkg-deb/Makefile.am @@ -23,4 +23,3 @@ dpkg_deb_LDADD = \ $(LIBINTL) \ $(ZLIB_LIBS) \ $(BZ2_LIBS) - diff --git a/dpkg-deb/build.c b/dpkg-deb/build.c index e3e22722f..d993bd7f3 100644 --- a/dpkg-deb/build.c +++ b/dpkg-deb/build.c @@ -138,7 +138,7 @@ getfi(const char *root, int fd) fn = m_realloc(fn, fnlen); } i=sprintf(fn,"%s/",root); - + while (1) { int res; if (i>=fnlen) { @@ -186,7 +186,7 @@ add_to_filist(struct file_info **start, struct file_info **end, { if (*start==NULL) *start=*end=fi; - else + else *end=(*end)->next=fi; } @@ -211,7 +211,7 @@ void do_build(const char *const *argv) { static const char *const maintainerscripts[]= { PREINSTFILE, POSTINSTFILE, PRERMFILE, POSTRMFILE, NULL }; - + char *m; const char *debar, *directory, *const *mscriptp, *versionstring, *arch; bool subdir; @@ -250,7 +250,7 @@ void do_build(const char *const *argv) { strcat(m, DEBEXT); debar= m; } - + /* Perform some sanity checks on the to-be-build package. */ if (nocheckflag) { if (subdir) @@ -386,7 +386,7 @@ void do_build(const char *const *argv) { } m_output(stdout, _("")); - + /* Now that we have verified everything its time to actually * build something. Let's start by making the ar-wrapper. */ if (!(ar=fopen(debar,"wb"))) ohshite(_("unable to create `%.255s'"),debar); @@ -445,7 +445,7 @@ void do_build(const char *const *argv) { dpkg_ar_member_put_mem(debar, fileno(ar), DEBMAGIC, deb_magic, strlen(deb_magic)); dpkg_ar_member_put_file(debar, fileno(ar), ADMINMEMBER, gzfd); - } + } /* Control is done, now we need to archive the data. Start by creating * a new temporary file. Immediately unlink the temporary file so others @@ -535,7 +535,6 @@ void do_build(const char *const *argv) { if (fsync(fileno(ar))) ohshite(_("unable to sync file '%s'"), debar); if (fclose(ar)) werr(debar); - + exit(0); } - diff --git a/dpkg-deb/extract.c b/dpkg-deb/extract.c index 47852f7d0..277558bdc 100644 --- a/dpkg-deb/extract.c +++ b/dpkg-deb/extract.c @@ -51,7 +51,7 @@ static void movecontrolfiles(const char *thing) { char buf[200]; pid_t c1; - + sprintf(buf, "mv %s/* . && rmdir %s", thing, thing); c1 = subproc_fork(); if (!c1) { @@ -137,7 +137,7 @@ void extracthalf(const char *debar, const char *directory, int adminmember; bool oldformat, header_done; struct compressor *decompressor = &compressor_gzip; - + arfd = open(debar, O_RDONLY); if (arfd < 0) ohshite(_("failed to read archive `%.255s'"), debar); @@ -268,7 +268,6 @@ void extracthalf(const char *debar, const char *directory, m_output(stdout, _("")); } } else { - if (!strncmp(versionbuf,"!",7)) { fprintf(stderr, _("dpkg-deb: file looks like it might be an archive which has been\n" @@ -276,7 +275,6 @@ void extracthalf(const char *debar, const char *directory, } ohshit(_("`%.255s' is not a debian format archive"),debar); - } m_pipe(p1); @@ -291,7 +289,7 @@ void extracthalf(const char *debar, const char *directory, close(p1[1]); if (taroption) m_pipe(p2); - + c2 = subproc_fork(); if (!c2) { m_dup2(p1[0], 0); @@ -333,7 +331,7 @@ void extracthalf(const char *debar, const char *directory, close(p2[0]); subproc_wait_check(c3, "tar", 0); } - + subproc_wait_check(c2, _(""), PROCPIPE); if (c1 != -1) subproc_wait_check(c1, _("paste"), 0); @@ -350,7 +348,7 @@ static void controlextractvextract(int admin, const char *taroptions, const char *const *argv) { const char *debar, *directory; - + if (!(debar= *argv++)) badusage(_("--%s needs a .deb filename argument"),cipaction->olong); if (!(directory= *argv++)) { @@ -365,17 +363,14 @@ static void controlextractvextract(int admin, void do_fsystarfile(const char *const *argv) { const char *debar; - + if (!(debar= *argv++)) badusage(_("--%s needs a .deb filename argument"),cipaction->olong); if (*argv) badusage(_("--%s takes only one argument (.deb filename)"),cipaction->olong); extracthalf(debar, NULL, NULL, 0); } - + void do_control(const char *const *argv) { controlextractvextract(1, "x", argv); } void do_extract(const char *const *argv) { controlextractvextract(0, "xp", argv); } void do_vextract(const char *const *argv) { controlextractvextract(0, "xpv", argv); } - - - diff --git a/dpkg-deb/info.c b/dpkg-deb/info.c index 8485d0778..bde85cd95 100644 --- a/dpkg-deb/info.c +++ b/dpkg-deb/info.c @@ -63,14 +63,14 @@ static void cu_info_prepare(int argc, void **argv) { ohshite(_("unable to execute %s (%s)"), _("rm command for cleanup"), RM); } subproc_wait_check(c1, _("rm command for cleanup"), 0); -} +} static void info_prepare(const char *const **argvp, const char **debarp, const char **directoryp, int admininfo) { char *dbuf; - + *debarp= *(*argvp)++; if (!*debarp) badusage(_("--%s needs a .deb filename argument"),cipaction->olong); @@ -289,7 +289,7 @@ void do_field(const char *const *argv) { void do_contents(const char *const *argv) { const char *debar; - + if (!(debar= *argv++) || *argv) badusage(_("--contents takes exactly one argument")); extracthalf(debar, NULL, "tv", 0); } diff --git a/dpkg-split/info.c b/dpkg-split/info.c index 527f1d917..57a55617e 100644 --- a/dpkg-split/info.c +++ b/dpkg-split/info.c @@ -93,13 +93,13 @@ struct partinfo *read_info(FILE *partfile, const char *fn, struct partinfo *ir) struct ar_hdr arh; int c; struct stat stab; - + if (fread(magicbuf, 1, sizeof(magicbuf), partfile) != sizeof(magicbuf)) { if (ferror(partfile)) rerr(fn); else return NULL; } if (memcmp(magicbuf, DPKG_AR_MAGIC, sizeof(magicbuf))) return NULL; - + if (fread(&arh,1,sizeof(arh),partfile) != sizeof(arh)) rerreof(partfile,fn); dpkg_ar_normalize_name(&arh); @@ -143,7 +143,7 @@ struct partinfo *read_info(FILE *partfile, const char *fn, struct partinfo *ir) fn, _("archive total size")); ir->maxpartlen = unsignedlong(nextline(&rip, fn, _("archive part offset")), fn, _("archive part offset")); - + partnums = nextline(&rip, fn, _("archive part numbers")); slash= strchr(partnums,'/'); if (!slash) @@ -193,13 +193,13 @@ struct partinfo *read_info(FILE *partfile, const char *fn, struct partinfo *ir) ir->headerlen = strlen(DPKG_AR_MAGIC) + sizeof(arh) + thisilen + (thisilen & 1) + sizeof(arh); - + return ir; -} +} void mustgetpartinfo(const char *filename, struct partinfo *ri) { FILE *part; - + part= fopen(filename,"r"); if (!part) ohshite(_("cannot open archive part file `%.250s'"),filename); if (!read_info(part,filename,ri)) @@ -241,7 +241,7 @@ void do_info(const char *const *argv) { if (!*argv) badusage(_("--%s requires one or more part file arguments"), cipaction->olong); - + while ((thisarg= *argv++)) { part= fopen(thisarg,"r"); if (!part) ohshite(_("cannot open archive part file `%.250s'"),thisarg); diff --git a/dpkg-split/join.c b/dpkg-split/join.c index ff38e88d7..e6106ea37 100644 --- a/dpkg-split/join.c +++ b/dpkg-split/join.c @@ -46,7 +46,7 @@ void reassemble(struct partinfo **partlist, const char *outputfile) { "Putting package %s together from %d parts: ", partlist[0]->maxpartn), partlist[0]->package,partlist[0]->maxpartn); - + buffersize= partlist[0]->maxpartlen; for (i=0; imaxpartn; i++) if (partlist[0]->headerlen > buffersize) buffersize= partlist[0]->headerlen; @@ -84,7 +84,7 @@ void reassemble(struct partinfo **partlist, const char *outputfile) { void addtopartlist(struct partinfo **partlist, struct partinfo *pi, struct partinfo *refi) { int i; - + if (strcmp(pi->package,refi->package) || strcmp(pi->version,refi->version) || strcmp(pi->md5sum,refi->md5sum) || @@ -109,7 +109,7 @@ void do_join(const char *const *argv) { struct partqueue *pq; struct partinfo *refi, *pi, **partlist; unsigned int i; - + assert(!queue); if (!*argv) badusage(_("--%s requires one or more part file arguments"), @@ -118,8 +118,7 @@ void do_join(const char *const *argv) { pq= nfmalloc(sizeof(struct partqueue)); mustgetpartinfo(thisarg,&pq->info); - - + pq->nextinqueue= queue; queue= pq; } diff --git a/dpkg-split/main.c b/dpkg-split/main.c index 9901263be..c56367e00 100644 --- a/dpkg-split/main.c +++ b/dpkg-split/main.c @@ -174,7 +174,7 @@ int main(int argc, const char *const *argv) { action(argv); m_output(stderr, _("")); - + standard_shutdown(); exit(0); } diff --git a/dpkg-split/queue.c b/dpkg-split/queue.c index 97865daf6..c7e042f11 100644 --- a/dpkg-split/queue.c +++ b/dpkg-split/queue.c @@ -238,7 +238,7 @@ void do_queue(const char *const *argv) { } } if (!*head) putchar('\n'); - + head= N_("Packages not yet reassembled:\n"); for (pq= queue; pq; pq= pq->nextinqueue) { if (!pq->info.md5sum) continue; diff --git a/dselect/basecmds.cc b/dselect/basecmds.cc index c11c99463..f14e38c71 100644 --- a/dselect/basecmds.cc +++ b/dselect/basecmds.cc @@ -78,10 +78,10 @@ void baselist::kd_bottom() { void baselist::kd_redraw() { //#define RFSH(x) werase(x); redrawwin(x) // RFSH(listpad); -// RFSH(infopad); -// RFSH(colheadspad); -// RFSH(thisstatepad); -// RFSH(titlewin); +// RFSH(infopad); +// RFSH(colheadspad); +// RFSH(thisstatepad); +// RFSH(titlewin); // RFSH(whatinfowin); /* FIXME: why does ncurses need this? */ clearok(curscr,TRUE); redrawall(); @@ -160,7 +160,7 @@ void baselist::displayerror(const char* str) { void baselist::displayhelp(const struct helpmenuentry *helpmenu, int key) { int maxx, maxy, i, y, x, nextkey; - + getmaxyx(stdscr,maxy,maxx); wbkgdset(stdscr, ' ' | helpscreen_attr); clearok(stdscr,TRUE); @@ -219,7 +219,7 @@ _("Press ? for help menu, . for next topic, to exit help.")); redrawthisstate(); refreshinfo(); wnoutrefresh(whatinfowin); -} +} void baselist::kd_help() { displayhelp(helpmenulist(),0); @@ -251,7 +251,7 @@ void baselist::kd_down() { if (cursorline+1 < nitems) ncursor++; setcursor(ncursor); } - + void baselist::kd_up() { int ncursor= cursorline; // scroll by one line if there are any lines not shown yet diff --git a/dselect/baselist.cc b/dselect/baselist.cc index 68904fcc3..e833f7be7 100644 --- a/dselect/baselist.cc +++ b/dselect/baselist.cc @@ -63,17 +63,17 @@ void baselist::sigwinchhandler(int) { static void cu_sigwinch(int, void **argv) { struct sigaction *osigactp= (struct sigaction*)argv[0]; sigset_t *oblockedp= (sigset_t*)argv[1]; - + if (sigaction(SIGWINCH,osigactp,0)) ohshite(_("failed to restore old SIGWINCH sigact")); delete osigactp; if (sigprocmask(SIG_SETMASK,oblockedp,0)) ohshite(_("failed to restore old signal mask")); delete oblockedp; -} +} void baselist::setupsigwinch() { sigemptyset(&sigwinchset); sigaddset(&sigwinchset,SIGWINCH); - + osigactp= new(struct sigaction); oblockedp= new(sigset_t); if (sigprocmask(0,0,oblockedp)) ohshite(_("failed to get old signal mask")); @@ -162,22 +162,22 @@ void baselist::startdisplay() { setheights(); setwidths(); - + titlewin= newwin(1,xmax, 0,0); if (!titlewin) ohshite(_("failed to create title window")); wattrset(titlewin,title_attr); - + whatinfowin= newwin(1,xmax, whatinfo_row,0); if (!whatinfowin) ohshite(_("failed to create whatinfo window")); wattrset(whatinfowin,whatinfo_attr); - + listpad = newpad(ymax, total_width); if (!listpad) ohshite(_("failed to create baselist pad")); - + colheadspad= newpad(1, total_width); if (!colheadspad) ohshite(_("failed to create heading pad")); wattrset(colheadspad,colheads_attr); - + thisstatepad= newpad(1, total_width); if (!thisstatepad) ohshite(_("failed to create thisstate pad")); wattrset(thisstatepad,thisstate_attr); @@ -218,8 +218,8 @@ void baselist::startdisplay() { void baselist::enddisplay() { delwin(titlewin); delwin(whatinfowin); - delwin(listpad); - delwin(colheadspad); + delwin(listpad); + delwin(colheadspad); delwin(thisstatepad); delwin(infopad); wmove(stdscr,ymax,0); wclrtoeol(stdscr); @@ -254,11 +254,11 @@ baselist::baselist(keybindings *kb) { showinfo= 1; searchstring[0]= 0; -} +} void baselist::itd_keys() { whatinfovb(_("Keybindings")); - + const int givek= xmax/3; bindings->describestart(); const char **ta; @@ -300,7 +300,7 @@ void baselist::refreshinfo() { pnoutrefresh(infopad, infotopofscreen,leftofscreen, info_row,0, min(info_row + info_height - 1, info_row + MAX_DISPLAY_INFO - 1), min(total_width - leftofscreen - 1, xmax - 1)); - + if (whatinfo_height) { mywerase(whatinfowin); mvwaddstr(whatinfowin,0,0, whatinfovb.string()); diff --git a/dselect/bindings.cc b/dselect/bindings.cc index 1fbccc756..b544e2936 100644 --- a/dselect/bindings.cc +++ b/dselect/bindings.cc @@ -44,13 +44,13 @@ keybindings::bind(int key, const char *action) { if (key == -1) return false; - + const interpretation *interp = interps; while (interp->action && strcmp(interp->action, action)) interp++; if (!interp->action) return false; - + const description *desc = descriptions; while (desc->action && strcmp(desc->action, action)) desc++; @@ -58,7 +58,7 @@ keybindings::bind(int key, const char *action) binding *b = bindings; while (b && b->key != key) b = b->next; - + if (!b) { b = new binding; b->key = key; @@ -169,7 +169,7 @@ const keybindings::description keybindings::descriptions[]= { { "revertsuggest", N_("Revert to suggested state for all packages") }, { "revertdirect", N_("Revert to directly requested state for all packages") }, { "revertinstalled", N_("Revert to currently installed state for all packages") }, - + // Actions which apply only to lists of methods. { "select-and-quit", N_("Select currently-highlighted access method") }, { "abort", N_("Quit without changing selected access method") }, diff --git a/dselect/bindings.h b/dselect/bindings.h index 53d714c5a..7a7fe6f23 100644 --- a/dselect/bindings.h +++ b/dselect/bindings.h @@ -28,12 +28,12 @@ struct keybindings { int key; const char *action; }; - + struct keyname { int key; const char *kname; }; - + struct description { const char *action, *desc; }; @@ -44,7 +44,7 @@ struct keybindings { const struct interpretation *interp; const char *desc; }; - + private: static const keyname keynames[]; static const description descriptions[]; @@ -52,13 +52,13 @@ struct keybindings { binding *bindings; const description *iterate; const interpretation *interps; - + bool bind(int key, const char *action); - + public: int name2key(const char *name); const char *key2name(int key); - + bool bind(const char *name, const char *action) { return bind(name2key(name), action); } const interpretation *operator()(int key); diff --git a/dselect/dselect-curses.h b/dselect/dselect-curses.h index b0ea98262..f670d277c 100644 --- a/dselect/dselect-curses.h +++ b/dselect/dselect-curses.h @@ -36,4 +36,3 @@ #endif #endif /* DSELECT_CURSES_H */ - diff --git a/dselect/dselect.h b/dselect/dselect.h index 1a2a68414..e4434e6c1 100644 --- a/dselect/dselect.h +++ b/dselect/dselect.h @@ -57,7 +57,7 @@ protected: int helpscreen_attr; int total_width; - + // (n)curses stuff WINDOW *listpad, *infopad, *colheadspad, *thisstatepad; WINDOW *titlewin, *whatinfowin, *querywin; @@ -106,7 +106,7 @@ protected: virtual bool checksearch(char *str); virtual bool matchsearch(int index); void wordwrapinfo(int offset, const char *string); - + public: keybindings *bindings; diff --git a/dselect/main.cc b/dselect/main.cc index 73ede2bcb..9697e80b6 100644 --- a/dselect/main.cc +++ b/dselect/main.cc @@ -378,7 +378,7 @@ dme(int i, int so) so ? '*' : ' ', i, gettext(me->option), gettext(me->menuent)); - + int y,x; getmaxyx(stdscr,y,x); @@ -446,7 +446,7 @@ urqresult urq_menu(void) { if(errno != 0) ohshite(_("failed to getch in main menu")); else { - clearok(stdscr,TRUE); clear(); refreshmenu(); dme(cursor,1); + clearok(stdscr,TRUE); clear(); refreshmenu(); dme(cursor,1); } } @@ -534,4 +534,3 @@ main(int, const char *const *argv) standard_shutdown(); return(0); } - diff --git a/dselect/methkeys.cc b/dselect/methkeys.cc index 0b1a078d6..85e096bbc 100644 --- a/dselect/methkeys.cc +++ b/dselect/methkeys.cc @@ -61,7 +61,7 @@ const keybindings::orgbinding methodlist_korgbindings[]= { { 'k', "up" }, // vi style //{ 'p', "up" }, // no style { KEY_UP, "up" }, - + { C('f'), "scrollon" }, // vi style { 'N', "scrollon" }, { KEY_NPAGE, "scrollon" }, @@ -74,25 +74,25 @@ const keybindings::orgbinding methodlist_korgbindings[]= { { C('h'), "scrollback" }, { C('n'), "scrollon1" }, { C('p'), "scrollback1" }, - + { 't', "top" }, { KEY_HOME, "top" }, { 'e', "bottom" }, { KEY_LL, "bottom" }, { KEY_END, "bottom" }, - + { 'u', "iscrollback" }, { 'd', "iscrollon" }, { C('u'), "iscrollback1" }, { C('d'), "iscrollon1" }, - + { 'B', "panback" }, { KEY_LEFT, "panback" }, { 'F', "panon" }, { KEY_RIGHT, "panon" }, { C('b'), "panback1" }, { C('f'), "panon1" }, - + { '?', "help" }, { KEY_HELP, "help" }, { KEY_F(1), "help" }, @@ -106,6 +106,6 @@ const keybindings::orgbinding methodlist_korgbindings[]= { { 'x', "abort" }, { 'X', "abort" }, { 'Q', "abort" }, - + { -1, 0 } }; diff --git a/dselect/methlist.cc b/dselect/methlist.cc index e83ff9486..7096be9f3 100644 --- a/dselect/methlist.cc +++ b/dselect/methlist.cc @@ -99,7 +99,7 @@ void methodlist::redraw1itemsel(int index, int selected) { wattrset(listpad, selected ? listsel_attr : list_attr); mvwprintw(listpad,index,name_column-1, " %-*.*s ", name_width, name_width, table[index]->name); - + i= description_width; p= table[index]->summary ? table[index]->summary : ""; while (i>0 && *p && *p != '\n') { @@ -125,7 +125,7 @@ void methodlist::redrawcolheads() { methodlist::methodlist() : baselist(&methodlistbindings) { int newcursor= -1; - + if (debug) fprintf(debug,"methodlist[%p]::methodlist()\n",this); @@ -158,7 +158,7 @@ quitaction methodlist::display() { setupsigwinch(); startdisplay(); - + if (debug) fprintf(debug,"methodlist[%p]::display() entering loop\n",this); for (;;) { if (whatinfo_height) wcursyncup(whatinfowin); @@ -180,7 +180,7 @@ quitaction methodlist::display() { } pop_cleanup(ehflag_normaltidy); // unset the SIGWINCH handler enddisplay(); - + if (debug) fprintf(debug,"methodlist[%p]::display() done\n",this); return interp->qa; @@ -205,7 +205,7 @@ void methodlist::redrawinfo() { if (!info_height) return; whatinfovb.reset(); werase(infopad); wmove(infopad,0,0); - + if (debug) fprintf(debug,"methodlist[%p]::redrawinfo()\n", this); itd_description(); diff --git a/dselect/method.cc b/dselect/method.cc index e2e60f783..a2107ed7f 100644 --- a/dselect/method.cc +++ b/dselect/method.cc @@ -52,7 +52,7 @@ static const char *const methoddirectories[]= { LIBDIR "/" METHODSDIR, LOCALLIBDIR "/" METHODSDIR, 0 -}; +}; static char *methodlockfile= 0; static int methlockfd= -1; @@ -141,7 +141,7 @@ falliblesubprocess(struct command *cmd) { pid_t c1; int status, i, c; - + cursesoff(); subproc_signals_setup(cmd->name); @@ -270,7 +270,7 @@ urqresult urq_setup(void) { } else { ur= urqr_fail; } - + pop_cleanup(ehflag_normaltidy); return ur; } diff --git a/dselect/method.h b/dselect/method.h index 6c6b895b9..a963780b5 100644 --- a/dselect/method.h +++ b/dselect/method.h @@ -59,10 +59,10 @@ protected: // Misc. char searchstring[50]; - + // Information displays void itd_description(); - + // Define these virtuals void redraw1itemsel(int index, int selected); void redrawcolheads(); @@ -78,7 +78,7 @@ protected: // Keybinding functions */ void kd_quit(); void kd_abort(); - + methodlist(); quitaction display(); ~methodlist(); diff --git a/dselect/methods/disk/setup b/dselect/methods/disk/setup index 6c7e3c6c4..ca1f0ccd6 100755 --- a/dselect/methods/disk/setup +++ b/dselect/methods/disk/setup @@ -577,5 +577,3 @@ outputparam p_lcl_binary "$lcl_binary" mv shvar.$option.new shvar.$option xit=0 - - diff --git a/dselect/methods/disk/update b/dselect/methods/disk/update index 0c7d2477e..0c9d4a6b0 100755 --- a/dselect/methods/disk/update +++ b/dselect/methods/disk/update @@ -87,4 +87,3 @@ echo -n 'Update OK. Hit RETURN. ' read response xit=0 - diff --git a/dselect/methods/ftp/names b/dselect/methods/ftp/names index 1f83e62bc..649927909 100644 --- a/dselect/methods/ftp/names +++ b/dselect/methods/ftp/names @@ -1,2 +1 @@ 60 ftp Install using ftp. - diff --git a/dselect/methparse.cc b/dselect/methparse.cc index 553869d5c..1c128beb7 100644 --- a/dselect/methparse.cc +++ b/dselect/methparse.cc @@ -91,7 +91,7 @@ void readmethods(const char *pathbase, dselect_option **optionspp, int *nread) { } if (debug) fprintf(debug,"readmethods(`%s',...) directory open\n", pathbase); - + while ((dent= readdir(dir)) != 0) { c= dent->d_name[0]; if (debug) fprintf(debug,"readmethods(`%s',...) considering `%s' ...\n", @@ -106,7 +106,7 @@ void readmethods(const char *pathbase, dselect_option **optionspp, int *nread) { ohshit(_("method `%.250s' has name that is too long (%d > %d characters)"), dent->d_name, methodlen, IMETHODMAXLEN); /* Check if there is a localized version of this method */ - + strcpy(pathmeth, dent->d_name); strcpy(pathmeth+methodlen, "/"); pathinmeth= pathmeth+methodlen+1; @@ -137,7 +137,7 @@ void readmethods(const char *pathbase, dselect_option **optionspp, int *nread) { if (debug) fprintf(debug," readmethods(`%s',...) new method" " name=`%s' path=`%s' pathinmeth=`%s'\n", pathbase, meth->name, meth->path, meth->pathinmeth); - + while ((c= fgetc(names)) != EOF) { if (isspace(c)) continue; opt= new dselect_option; @@ -181,7 +181,7 @@ void readmethods(const char *pathbase, dselect_option **optionspp, int *nread) { } while (c != '\n'); opt->summary= new char[strlen(vb.string())+1]; strcpy(opt->summary,vb.string()); - + strcpy(pathinmeth,OPTIONSDESCPFX); strcpy(pathinmeth+sizeof(OPTIONSDESCPFX)-1,opt->name); descfile= fopen(pathbuf,"r"); @@ -202,7 +202,7 @@ void readmethods(const char *pathbase, dselect_option **optionspp, int *nread) { fclose(descfile); } strcpy(pathinmeth,METHODOPTIONSFILE); - + if (debug) fprintf(debug," readmethods(`%s',...) new option" " index=`%s' name=`%s' summary=`%.20s'" " strlen(description=%s)=%ld" @@ -237,7 +237,7 @@ void getcurrentopt() { int l; int admindirlen; char *p; - + if (!methoptfile) { admindirlen= strlen(admindir); methoptfile= new char[admindirlen + sizeof(CMETHOPTFILE) + 2]; diff --git a/dselect/pkgcmds.cc b/dselect/pkgcmds.cc index 59475ca47..adb700c5e 100644 --- a/dselect/pkgcmds.cc +++ b/dselect/pkgcmds.cc @@ -145,7 +145,7 @@ int would_like_to_install(pkginfo::pkgwant wantvalue, pkginfo *pkg) { /* Returns: 1 for yes, 0 for no, -1 for if they want to preserve an error condition. */ if (debug) fprintf(debug,"would_like_to_install(%d, %s) status %d\n", wantvalue,pkg->name,pkg->status); - + if (wantvalue == pkginfo::want_install) return 1; if (wantvalue != pkginfo::want_hold) return 0; if (pkg->status == pkginfo::stat_installed) return 1; @@ -153,7 +153,7 @@ int would_like_to_install(pkginfo::pkgwant wantvalue, pkginfo *pkg) { pkg->status == pkginfo::stat_configfiles) return 0; return -1; } - + const char *packagelist::itemname(int index) { return table[index]->pkg->name; } diff --git a/dselect/pkgdepcon.cc b/dselect/pkgdepcon.cc index 267dfaada..4cebbe664 100644 --- a/dselect/pkgdepcon.cc +++ b/dselect/pkgdepcon.cc @@ -56,10 +56,10 @@ pkginfoperfile *packagelist::findinfo(pkginfo *pkg) { return r; } - + int packagelist::checkdependers(pkginfo *pkg, int changemade) { struct deppossi *possi; - + for (possi = pkg->available.depended; possi; possi = possi->rev_next) { if (!useavailable(possi->up->up)) continue; @@ -119,7 +119,7 @@ int packagelist::resolvesuggest() { static int dep_update_best_to_change_stop(perpackagestate *& best, pkginfo *trythis) { // There's no point trying to select a pure virtual package. if (!trythis->clientdata) return 0; - + if (depdebug && debug) fprintf(debug,"update_best_to_change(best=%s{%d}, test=%s{%d});\n", best ? best->pkg->name : "", best ? (int)best->spriority : -1, @@ -139,7 +139,7 @@ static int dep_update_best_to_change_stop(perpackagestate *& best, pkginfo *tryt if (pkg_is_informative(trythis, &trythis->available) && !pkg_is_informative(best->pkg, &best->pkg->available)) goto yes; - + // Select the package with the lowest priority (ie, the one of whom // we were least sure we wanted it deselected). if (trythis->clientdata->spriority > best->spriority) return 0; @@ -151,7 +151,7 @@ static int dep_update_best_to_change_stop(perpackagestate *& best, pkginfo *tryt // If we're still unsure we'll change the first one in the list. return 0; - + yes: if (depdebug && debug) fprintf(debug,"update_best_to_change(); yes\n"); @@ -166,16 +166,16 @@ packagelist::deselect_one_of(pkginfo *per, pkginfo *ped, dependency *dep) if (!er || !would_like_to_install(er->selected,per) || !ed || !would_like_to_install(ed->selected,ped)) return 0; - + add(dep, dp_must); er= per->clientdata; // these can be changed by add ed= ped->clientdata; - + if (depdebug && debug) fprintf(debug,"packagelist[%p]::deselect_one_of(): er %s{%d} ed %s{%d} [%p]\n", this, er->pkg->name, er->spriority, ed->pkg->name, ed->spriority, dep); - + perpackagestate *best; // Try not keep packages needing reinstallation. @@ -221,7 +221,7 @@ int packagelist::resolvedepcon(dependency *depends) { ? wantstrings[depends->up->clientdata->suggested] : "(no clientdata)"); } - + if (!depends->up->clientdata) return 0; switch (depends->type) { @@ -239,7 +239,7 @@ int packagelist::resolvedepcon(dependency *depends) { return 0; fixbyupgrade= 0; - + possi = depends->list; while (possi && !deppossatisfied(possi, &fixbyupgrade)) possi = possi->next; @@ -255,7 +255,7 @@ int packagelist::resolvedepcon(dependency *depends) { case dep_suggests: r= add(depends, dp_may); return r; - case dep_recommends: + case dep_recommends: r= add(depends, dp_should); break; default: @@ -300,7 +300,7 @@ int packagelist::resolvedepcon(dependency *depends) { best->spriority= sp_selecting; } return r ? 2 : 0; - + mustdeselect: best= depends->up->clientdata; if (depdebug && debug) @@ -316,14 +316,14 @@ int packagelist::resolvedepcon(dependency *depends) { best->spriority= sp_deselecting; } return r ? 2 : 0; - + case dep_conflicts: case dep_breaks: if (depdebug && debug) fprintf(debug,"packagelist[%p]::resolvedepcon([%p]): conflict\n", this,depends); - + if (would_like_to_install(depends->up->clientdata->selected,depends->up) == 0) return 0; @@ -350,7 +350,7 @@ int packagelist::resolvedepcon(dependency *depends) { if (depdebug && debug) fprintf(debug,"packagelist[%p]::resolvedepcon([%p]): no desel\n", this,depends); return 0; - + default: internerr("unknown deptype"); } @@ -365,14 +365,14 @@ packagelist::deppossatisfied(deppossi *possi, perpackagestate **fixbyupgrade) // restriction is violated ie that the target package is wanted int would; pkginfo::pkgwant want= pkginfo::want_purge; - + if (possi->ed->clientdata) { want= possi->ed->clientdata->selected; would= would_like_to_install(want,possi->ed); } else { would= 0; } - + if ((possi->up->type == dep_conflicts || possi->up->type == dep_breaks) ? possi->up->up != possi->ed && would != 0 : would > 0) { diff --git a/dselect/pkgdisplay.cc b/dselect/pkgdisplay.cc index 06512d17c..fa45dc5ed 100644 --- a/dselect/pkgdisplay.cc +++ b/dselect/pkgdisplay.cc @@ -33,10 +33,10 @@ /* These MUST be in the same order as the corresponding enums in dpkg-db.h */ const char - *const wantstrings[]= { N_("new package"), + *const wantstrings[]= { N_("new package"), N_("install"), N_("hold"), - N_("remove"), + N_("remove"), N_("purge"), 0 }, @@ -44,8 +44,8 @@ const char * the empty string to store information about the translation. DO NOT * CHANGE THAT IN A TRANSLATION! The code really relies on that being * a single space. */ - *const eflagstrings[]= { N_(" "), - N_("REINSTALL"), + *const eflagstrings[]= { N_(" "), + N_("REINSTALL"), 0 }, *const statusstrings[]= { N_("not installed"), @@ -159,7 +159,7 @@ void packagelist::setwidths() { } int versiondescriptioncolumn= package_column + package_width + gap_width; - + switch (versiondisplayopt) { case vdo_none: versioninstalled_column= versioninstalled_width= 0; @@ -182,7 +182,7 @@ void packagelist::setwidths() { default: internerr("unknown versiondisplayopt in setwidths"); } - + total_width= TOTAL_LIST_WIDTH; if (total_width < COLS) total_width= COLS; @@ -191,7 +191,7 @@ void packagelist::setwidths() { void packagelist::redrawtitle() { int x,y; - + if (title_height) { mywerase(titlewin); mvwaddnstr(titlewin,0,0, diff --git a/dselect/pkginfo.cc b/dselect/pkginfo.cc index 8ce15d9c0..cfa335455 100644 --- a/dselect/pkginfo.cc +++ b/dselect/pkginfo.cc @@ -168,11 +168,11 @@ void packagelist::redrawinfo() { if (!info_height) return; whatinfovb.reset(); werase(infopad); wmove(infopad,0,0); - + if (debug) fprintf(debug,"packagelist[%p]::redrawinfo(); #=%d\n", this, (int)(currentinfo - baseinfo)); - + (this->*currentinfo->display)(); whatinfovb.terminate(); int y,x; diff --git a/dselect/pkgkeys.cc b/dselect/pkgkeys.cc index 6a8351dd5..35f547332 100644 --- a/dselect/pkgkeys.cc +++ b/dselect/pkgkeys.cc @@ -77,7 +77,7 @@ const keybindings::orgbinding packagelist_korgbindings[]= { { 'k', "up" }, // vi style { 'p', "up" }, { KEY_UP, "up" }, - + { 'N', "scrollon" }, { KEY_NPAGE, "scrollon" }, { ' ', "scrollon" }, @@ -88,25 +88,25 @@ const keybindings::orgbinding packagelist_korgbindings[]= { { C('h'), "scrollback" }, { C('n'), "scrollon1" }, { C('p'), "scrollback1" }, - + { 't', "top" }, { KEY_HOME, "top" }, { 'e', "bottom" }, { KEY_LL, "bottom" }, { KEY_END, "bottom" }, - + { 'u', "iscrollback" }, { 'd', "iscrollon" }, { C('u'), "iscrollback1" }, { C('d'), "iscrollon1" }, - + { 'B', "panback" }, { KEY_LEFT, "panback" }, { 'F', "panon" }, { KEY_RIGHT, "panon" }, { C('b'), "panback1" }, { C('f'), "panon1" }, - + { '+', "install" }, { KEY_IC, "install" }, { '-', "remove" }, @@ -115,7 +115,7 @@ const keybindings::orgbinding packagelist_korgbindings[]= { { 'H', "hold" }, { '=', "hold" }, { 'G', "unhold" }, - + { '?', "help" }, { KEY_HELP, "help" }, { KEY_F(1), "help" }, @@ -129,7 +129,7 @@ const keybindings::orgbinding packagelist_korgbindings[]= { { '/', "search" }, { 'n', "searchagain" }, { '\\', "searchagain" }, - + { KEY_ENTER, "quitcheck" }, { '\r', "quitcheck" }, { 'Q', "quitnocheck" }, @@ -139,6 +139,6 @@ const keybindings::orgbinding packagelist_korgbindings[]= { { 'U', "revertsuggest" }, { 'D', "revertdirect" }, { 'C', "revertinstalled" }, - + { -1, 0 } }; diff --git a/dselect/pkglist.cc b/dselect/pkglist.cc index ed25ac405..f3d21aac5 100644 --- a/dselect/pkglist.cc +++ b/dselect/pkglist.cc @@ -117,7 +117,7 @@ void packagelist::addheading(enum ssavailval ssavail, delete[] table; table= newtable; } - + if (debug) fprintf(debug,"packagelist[%p]::addheading(%d,%d,%d,%s,%s)\n", this,ssavail,ssstate,priority, otherpriority ? otherpriority : "", @@ -136,7 +136,7 @@ void packagelist::addheading(enum ssavailval ssavail, newstate->ssavail= ssavail; newstate->ssstate= ssstate; newhead->clientdata= newstate; - + table[nitems++]= newstate; } @@ -159,10 +159,10 @@ void packagelist::ensurestatsortinfo() { const struct versionrevision *vera; struct pkginfo *pkg; int index; - + if (debug) fprintf(debug,"packagelist[%p]::ensurestatsortinfos() " "sortorder=%d nitems=%d\n",this,statsortorder,nitems); - + switch (statsortorder) { case sso_unsorted: if (debug) fprintf(debug,"packagelist[%p]::ensurestatsortinfos() unsorted\n",this); @@ -215,7 +215,6 @@ void packagelist::ensurestatsortinfo() { if (debug) fprintf(debug,"packagelist[%p]::ensurestatsortinfos() i=%d ssavail=%d\n", this,index,table[index]->ssavail); - } calcssadone= 1; break; @@ -250,7 +249,6 @@ void packagelist::ensurestatsortinfo() { if (debug) fprintf(debug,"packagelist[%p]::ensurestatsortinfos() i=%d ssstate=%d\n", this,index,table[index]->ssstate); - } calcsssdone= 1; break; @@ -267,7 +265,7 @@ void packagelist::sortmakeheads() { if (debug) fprintf(debug,"packagelist[%p]::sortmakeheads() " "sortorder=%d statsortorder=%d\n",this,sortorder,statsortorder); - + int nrealitems= nitems; addheading(ssa_none,sss_none,pkginfo::pri_unset,0,0); @@ -276,7 +274,7 @@ void packagelist::sortmakeheads() { // Important: do not save pointers into table in this function, because // addheading may need to reallocate table to make it larger ! - + struct pkginfo *lastpkg; struct pkginfo *thispkg; lastpkg= 0; @@ -301,7 +299,7 @@ void packagelist::sortmakeheads() { default: internerr("unknown statsortorder in sortmakeheads"); } - + int prioritydiff= (!lastpkg || thispkg->priority != lastpkg->priority || (thispkg->priority == pkginfo::pri_other && @@ -328,27 +326,27 @@ void packagelist::sortmakeheads() { if (ssdiff) addheading(ssavail,ssstate, pkginfo::pri_unset,0, 0); - + if (sortorder == so_section && sectiondiff) addheading(ssavail,ssstate, pkginfo::pri_unset,0, thispkg->section ? thispkg->section : ""); - + if (sortorder == so_priority && prioritydiff) addheading(ssavail,ssstate, thispkg->priority,thispkg->otherpriority, 0); - + if (sortorder != so_alpha && (prioritydiff || sectiondiff)) addheading(ssavail,ssstate, thispkg->priority,thispkg->otherpriority, thispkg->section ? thispkg->section : ""); - + lastpkg= thispkg; } if (listpad) { werase(listpad); } - + sortinplace(); } @@ -384,7 +382,7 @@ packagelist::packagelist(keybindings *kb) : baselist(kb) { initialsetup(); struct pkgiterator *iter; struct pkginfo *pkg; - + nitems = 0; iter = pkg_db_iter_new(); @@ -431,14 +429,14 @@ packagelist::packagelist(keybindings *kb) : baselist(kb) { packagelist::packagelist(keybindings *kb, pkginfo **pkgltab) : baselist(kb) { // takes over responsibility for pkgltab (recursive) initialsetup(); - + recursive= 1; nitems= 0; if (pkgltab) { add(pkgltab); delete[] pkgltab; } - + sortorder= so_unsorted; statsortorder= sso_unsorted; versiondisplayopt= vdo_none; @@ -472,19 +470,19 @@ packagelist::~packagelist() { regfree(&searchfsm); discardheadings(); - + int index; for (index=0; indexfree(recursive); delete[] table; delete[] datatable; if (debug) fprintf(debug,"packagelist[%p]::~packagelist() tables freed\n",this); - + doneent *search, *next; for (search=depsdone; search; search=next) { next= search->next; delete search; } - + if (debug) fprintf(debug,"packagelist[%p]::~packagelist() done\n",this); } @@ -527,7 +525,7 @@ packagelist::checksearch(char *rx) displayerror(_("error in regular expression")); return false; } - + return true; } @@ -596,12 +594,12 @@ pkginfo **packagelist::display() { } pop_cleanup(ehflag_normaltidy); // unset the SIGWINCH handler enddisplay(); - + if (interp->qa == qa_quitnochecksave || !readwrite) { if (debug) fprintf(debug,"packagelist[%p]::display() done - quitNOcheck\n",this); return 0; } - + if (recursive) { retl= new pkginfo*[nitems+1]; for (index=0; indexpkg; diff --git a/dselect/pkglist.h b/dselect/pkglist.h index f2b7b6c70..edbcc599f 100644 --- a/dselect/pkglist.h +++ b/dselect/pkglist.h @@ -128,14 +128,14 @@ protected: void itd_description(); void itd_statuscontrol(); void itd_availablecontrol(); - + // Dependency and sublist processing struct doneent { doneent *next; void *dep; } *depsdone, *unavdone; bool alreadydone(doneent **, void *); int resolvedepcon(dependency*); int checkdependers(pkginfo*, int changemade); // returns new changemade int deselect_one_of(pkginfo *er, pkginfo *ed, dependency *dep); - + // Define these virtuals bool checksearch(char *str); bool matchsearch(int index); @@ -149,7 +149,7 @@ protected: const struct helpmenuentry *helpmenulist(); // Miscellaneous internal routines - + void redraw1package(int index, int selected); int compareentries(const struct perpackagestate *a, const struct perpackagestate *b); friend int qsort_compareentries(const void *a, const void *b); @@ -174,14 +174,14 @@ protected: void affectedrange(int *startp, int *endp); void setwant(pkginfo::pkgwant nw); void sethold(int hold); - + public: // Keybinding functions */ void kd_quit_noop(); void kd_revert_abort(); void kd_revertsuggest(); - void kd_revertdirect(); + void kd_revertdirect(); void kd_revertinstalled(); void kd_morespecific(); void kd_lessspecific(); @@ -196,7 +196,7 @@ protected: void kd_toggleinfo(); void kd_verbose(); void kd_versiondisplay(); - + packagelist(keybindings *kb); // nonrecursive packagelist(keybindings *kb, pkginfo **pkgltab); // recursive void add(pkginfo **arry) { while (*arry) add(*arry++); } diff --git a/dselect/pkgsublist.cc b/dselect/pkgsublist.cc index 9405695a7..d1a5f6e2d 100644 --- a/dselect/pkgsublist.cc +++ b/dselect/pkgsublist.cc @@ -49,7 +49,7 @@ void packagelist::add(pkginfo *pkg) { pkg->clientdata= state; table[nitems]= state; nitems++; -} +} void packagelist::add(pkginfo *pkg, pkginfo::pkgwant nw) { if (debug) fprintf(debug,"packagelist[%p]::add(pkginfo %s, %s)\n", @@ -63,8 +63,7 @@ void packagelist::add(pkginfo *pkg, pkginfo::pkgwant nw) { this, pkg->name, wantstrings[nw]); pkg->clientdata->suggested= pkg->clientdata->selected= nw; pkg->clientdata->spriority= np; - -} +} void packagelist::add(pkginfo *pkg, const char *extrainfo, showpriority showimp) { if (debug) @@ -74,13 +73,13 @@ void packagelist::add(pkginfo *pkg, const char *extrainfo, showpriority showimp) if (pkg->clientdata->dpriority < showimp) pkg->clientdata->dpriority= showimp; pkg->clientdata->relations(extrainfo); pkg->clientdata->relations.terminate(); -} +} bool packagelist::alreadydone(doneent **done, void *check) { doneent *search = *done; - + while (search && search->dep != check) search = search->next; if (search) @@ -115,7 +114,7 @@ packagelist::add(dependency *depends, showpriority displayimportance) if (alreadydone(&depsdone, depends)) return false; - + const char *comma= ""; varbuf info; info(depends->up->name); @@ -166,7 +165,7 @@ void repeatedlydisplay(packagelist *sub, packagelist *unredisplay) { pkginfo **newl; keybindings *kb; - + if (debug) fprintf(debug,"repeatedlydisplay(packagelist[%p])\n",sub); if (sub->resolvesuggest() != 0 && sub->deletelessimp_anyleft(initial)) { if (debug) fprintf(debug,"repeatedlydisplay(packagelist[%p]) once\n",sub); diff --git a/dselect/pkgtop.cc b/dselect/pkgtop.cc index 89b70bd80..42acb4ae4 100644 --- a/dselect/pkgtop.cc +++ b/dselect/pkgtop.cc @@ -73,7 +73,7 @@ int packagelist::describemany(char buf[], const char *prioritystring, default: internerr("unknown statsortrder in describemany all"); } - + if (!prioritystring) { if (!section) { strcpy(buf, ssostring ? gettext(ssostring) : _("All packages")); @@ -112,7 +112,7 @@ void packagelist::redrawthisstate() { strlen(table[cursorline]->pkg->name) : 0), (section ? strlen(section) : 0) + (priority ? strlen(priority) : 0))]; - + if (table[cursorline]->pkg->name) { sprintf(buf, _("%-*s %s%s%s; %s (was: %s). %s"), @@ -145,9 +145,7 @@ void packagelist::redraw1itemsel(int index, int selected) { wattrset(listpad, selected ? listsel_attr : list_attr); if (pkg->name) { - if (verbose) { - mvwprintw(listpad, screenline, 0, "%-*.*s ", status_hold_width, status_hold_width, gettext(eflagstrings[pkg->eflag])); @@ -165,25 +163,23 @@ void packagelist::redraw1itemsel(int index, int selected) { gettext(wantstrings[table[index]->selected])); wattrset(listpad, selected ? listsel_attr : list_attr); waddch(listpad, ' '); - + mvwprintw(listpad, screenline, priority_column - 1, " %-*.*s", priority_width, priority_width, pkg->priority == pkginfo::pri_other ? pkg->otherpriority : gettext(prioritystrings[pkg->priority])); - } else { - mvwaddch(listpad, screenline, 0, eflagchars[pkg->eflag]); waddch(listpad, statuschars[pkg->status]); waddch(listpad, /* FIXME: keep this feature? */ /*table[index]->original == table[index]->selected ? ' ' : */wantchars[table[index]->original]); - + wattrset(listpad, selected ? selstatesel_attr : selstate_attr); waddch(listpad, wantchars[table[index]->selected]); wattrset(listpad, selected ? listsel_attr : list_attr); - + wmove(listpad, screenline, priority_column - 1); waddch(listpad, ' '); if (pkg->priority == pkginfo::pri_other) { @@ -196,13 +192,12 @@ void packagelist::redraw1itemsel(int index, int selected) { wprintw(listpad, "%-*.*s", priority_width, priority_width, gettext(priorityabbrevs[pkg->priority])); } - } mvwprintw(listpad, screenline, section_column - 1, " %-*.*s", section_width, section_width, pkg->section ? pkg->section : "?"); - + mvwprintw(listpad, screenline, package_column - 1, " %-*.*s ", package_width, package_width, pkg->name); @@ -225,16 +220,14 @@ void packagelist::redraw1itemsel(int index, int selected) { p= info->description ? info->description : pkg->installed.description ? pkg->installed.description : ""; while (i>0 && *p && *p != '\n') { waddnstr(listpad,p,1); i--; p++; } - } else { - const char *section= pkg->section; const char *priority= pkgprioritystring(pkg); char *buf= new char[500+ (section ? strlen(section) : 0) + (priority ? strlen(priority) : 0)]; - + indent= describemany(buf,priority,section,pkg->clientdata); mvwaddstr(listpad, screenline, 0, " "); @@ -253,7 +246,6 @@ void packagelist::redraw1itemsel(int index, int selected) { while (j-- >0) { waddch(listpad,ACS_HLINE); i--; } delete[] buf; - } while (i>0) { waddch(listpad,' '); i--; } diff --git a/dselect/po/ChangeLog.old b/dselect/po/ChangeLog.old index fa14d7b6e..fcc99d1a4 100644 --- a/dselect/po/ChangeLog.old +++ b/dselect/po/ChangeLog.old @@ -370,4 +370,3 @@ * vi.po: Likewise. * zh_CN.po: Likewise. * zh_TW.po: Likewise. - diff --git a/dselect/po/POTFILES.in b/dselect/po/POTFILES.in index b18588568..7e3e7a00a 100644 --- a/dselect/po/POTFILES.in +++ b/dselect/po/POTFILES.in @@ -19,4 +19,3 @@ dselect/pkgkeys.cc dselect/pkglist.cc dselect/pkgsublist.cc dselect/pkgtop.cc - diff --git a/get-version b/get-version index 257bdbd86..ed7e624f4 100755 --- a/get-version +++ b/get-version @@ -38,4 +38,3 @@ fi # Use printf to avoid the trailing new line that m4_esyscmd would not handle. printf "$version" - diff --git a/lib/compat/Makefile.am b/lib/compat/Makefile.am index d71b6ead9..cb3224a32 100644 --- a/lib/compat/Makefile.am +++ b/lib/compat/Makefile.am @@ -55,4 +55,3 @@ endif if !HAVE_UNSETENV libcompat_a_SOURCES += unsetenv.c endif - diff --git a/lib/compat/alphasort.c b/lib/compat/alphasort.c index c30c632b5..f307ef20a 100644 --- a/lib/compat/alphasort.c +++ b/lib/compat/alphasort.c @@ -31,4 +31,3 @@ alphasort(const void *a, const void *b) } #endif - diff --git a/lib/compat/compat.h b/lib/compat/compat.h index 80de53ebd..4fe776105 100644 --- a/lib/compat/compat.h +++ b/lib/compat/compat.h @@ -92,4 +92,3 @@ int unsetenv(const char *x); #endif #endif /* COMPAT_H */ - diff --git a/lib/compat/scandir.c b/lib/compat/scandir.c index 6eac2512c..4faece49e 100644 --- a/lib/compat/scandir.c +++ b/lib/compat/scandir.c @@ -98,4 +98,3 @@ scandir(const char *dir, struct dirent ***namelist, return used; } #endif - diff --git a/lib/compat/snprintf.c b/lib/compat/snprintf.c index b28932cb1..5dd6705e6 100644 --- a/lib/compat/snprintf.c +++ b/lib/compat/snprintf.c @@ -38,4 +38,3 @@ snprintf(char *str, size_t n, char const *fmt, ...) return i; } #endif - diff --git a/lib/compat/strerror.c b/lib/compat/strerror.c index aec27a196..ea8f1d7ec 100644 --- a/lib/compat/strerror.c +++ b/lib/compat/strerror.c @@ -41,4 +41,3 @@ strerror(int e) return buf; } #endif - diff --git a/lib/compat/strsignal.c b/lib/compat/strsignal.c index ebd36d946..b4e3dbef6 100644 --- a/lib/compat/strsignal.c +++ b/lib/compat/strsignal.c @@ -70,4 +70,3 @@ strsignal(int s) return buf; } #endif - diff --git a/lib/compat/unsetenv.c b/lib/compat/unsetenv.c index 6c191d32d..7551629e1 100644 --- a/lib/compat/unsetenv.c +++ b/lib/compat/unsetenv.c @@ -37,4 +37,3 @@ unsetenv(const char *p) return putenv(q); } #endif - diff --git a/lib/compat/vsnprintf.c b/lib/compat/vsnprintf.c index 85496e37c..6e08cefa7 100644 --- a/lib/compat/vsnprintf.c +++ b/lib/compat/vsnprintf.c @@ -69,4 +69,3 @@ vsnprintf(char *buf, size_t maxsize, const char *fmt, va_list args) return total; } #endif - diff --git a/lib/dpkg/buffer.c b/lib/dpkg/buffer.c index 40af5be5d..31c2b3cc8 100644 --- a/lib/dpkg/buffer.c +++ b/lib/dpkg/buffer.c @@ -246,4 +246,3 @@ buffer_copy(struct buffer_data *read_data, struct buffer_data *write_data, return totalread; } - diff --git a/lib/dpkg/cleanup.c b/lib/dpkg/cleanup.c index b94a5045c..98bf1004f 100644 --- a/lib/dpkg/cleanup.c +++ b/lib/dpkg/cleanup.c @@ -59,4 +59,3 @@ cu_closefd(int argc, void **argv) close(ip); } - diff --git a/lib/dpkg/command.c b/lib/dpkg/command.c index f98a0eeba..a16d5d607 100644 --- a/lib/dpkg/command.c +++ b/lib/dpkg/command.c @@ -181,4 +181,3 @@ command_exec(struct command *cmd) execvp(cmd->filename, (char * const *)cmd->argv); ohshite(_("unable to execute %s (%s)"), cmd->name, cmd->filename); } - diff --git a/lib/dpkg/command.h b/lib/dpkg/command.h index 15e2d5873..25e509f17 100644 --- a/lib/dpkg/command.h +++ b/lib/dpkg/command.h @@ -51,4 +51,3 @@ void command_exec(struct command *cmd) DPKG_ATTR_NORET; DPKG_END_DECLS #endif /* LIBDPKG_COMMAND_H */ - diff --git a/lib/dpkg/database.c b/lib/dpkg/database.c index c1009f932..e80e61dc7 100644 --- a/lib/dpkg/database.c +++ b/lib/dpkg/database.c @@ -134,7 +134,7 @@ pkg_db_find(const char *inname) p= name; while(*p) { *p= tolower(*p); p++; } - + pointerp= bins + (hash(name) % (BINS)); while (*pointerp && strcasecmp((*pointerp)->name,name)) pointerp= &(*pointerp)->next; diff --git a/lib/dpkg/dbmodify.c b/lib/dpkg/dbmodify.c index b51816133..81be02d8f 100644 --- a/lib/dpkg/dbmodify.c +++ b/lib/dpkg/dbmodify.c @@ -83,7 +83,6 @@ static void cleanupdates(void) { if (cdn == -1) ohshite(_("cannot scan updates directory `%.255s'"),updatefnbuf); if (cdn) { - for (i=0; id_name); parsedb(updatefnbuf, pdb_lax_parser | pdb_weakclassification, @@ -93,7 +92,7 @@ static void cleanupdates(void) { if (cstatus >= msdbrw_write) { writedb(statusfile,0,1); - + for (i=0; id_name); if (unlink(updatefnbuf)) @@ -103,7 +102,6 @@ static void cleanupdates(void) { dir_sync_path(updatesdir); } - } free(cdlist); @@ -112,9 +110,9 @@ static void cleanupdates(void) { static void createimptmp(void) { int i; - + onerr_abort++; - + importanttmp= fopen(importanttmpfile,"w"); if (!importanttmp) ohshite(_("unable to create `%.255s'"), importanttmpfile); @@ -209,7 +207,7 @@ enum modstatdb_rw modstatdb_init(const char *admindir, enum modstatdb_rw readwritereq) { const struct fni *fnip; - + for (fnip=fnis; fnip->suffix; fnip++) { free(*fnip->store); *fnip->store = m_malloc(strlen(admindir) + strlen(fnip->suffix) + 2); @@ -273,7 +271,7 @@ void modstatdb_checkpoint(void) { assert(cstatus >= msdbrw_write); writedb(statusfile,0,1); - + for (i=0; iavailable) return; fdp= pigp->files; if (!fdp || !FILEFFIELD(fdp,fip->integer,const char*)) return; @@ -146,7 +146,7 @@ void w_booleandefno(struct varbuf *vb, } if (!value) return; assert(value == true); - varbufaddstr(vb,fip->name); varbufaddstr(vb, ": yes\n"); + varbufaddstr(vb,fip->name); varbufaddstr(vb, ": yes\n"); } void w_priority(struct varbuf *vb, @@ -357,7 +357,7 @@ void writedb(const char *filename, bool available, bool mustsync) { static char writebuf[8192]; - + struct pkgiterator *it; struct pkginfo *pigp; struct pkginfoperfile *pifp; @@ -378,7 +378,7 @@ writedb(const char *filename, bool available, bool mustsync) umask(old_umask); if (!file) ohshite(_("failed to open '%s' for writing %s database"), filename, which); - + if (setvbuf(file,writebuf,_IOFBF,sizeof(writebuf))) ohshite(_("unable to set buffering on %s database file"), which); @@ -393,7 +393,7 @@ writedb(const char *filename, bool available, bool mustsync) if (fputs(vb.buf,file) < 0) ohshite(_("failed to write %s database record about '%.50s' to '%.250s'"), which, pigp->name, filename); - varbufreset(&vb); + varbufreset(&vb); } pkg_db_iter_free(it); varbuf_destroy(&vb); diff --git a/lib/dpkg/ehandle.c b/lib/dpkg/ehandle.c index ad425da5e..8faea8f88 100644 --- a/lib/dpkg/ehandle.c +++ b/lib/dpkg/ehandle.c @@ -58,7 +58,7 @@ struct cleanup_entry { int cpmask, cpvalue; int argc; void *argv[1]; -}; +}; struct error_context { struct error_context *next; @@ -196,7 +196,7 @@ run_cleanups(struct error_context *econ, int flagsetin) volatile int i, flagset; if (econ->printerror) econ->printerror(errmsg,econ->contextstring); - + if (++preventrecurse > 3) { onerr_abort++; fprintf(stderr, _("%s: too many nested errors during error recovery!!\n"), @@ -262,7 +262,7 @@ pop_error_context(int flagset) void push_checkpoint(int mask, int value) { struct cleanup_entry *cep; int i; - + cep = malloc(sizeof(struct cleanup_entry) + sizeof(char *)); if (cep == NULL) { onerr_abort++; @@ -285,7 +285,7 @@ void push_cleanup(void (*call1)(int argc, void **argv), int mask1, va_list args; onerr_abort++; - + cep = malloc(sizeof(struct cleanup_entry) + sizeof(char *) * (nargs + 1)); if (!cep) { if (nargs > array_count(emergency.args)) @@ -374,7 +374,7 @@ void ohshite(const char *fmt, ...) { va_end(args); snprintf(errmsgbuf,sizeof(errmsgbuf),"%s: %s",buf,strerror(e)); - errmsg= errmsgbuf; + errmsg= errmsgbuf; run_error_handler(); } @@ -417,5 +417,3 @@ do_internerr(const char *file, int line, const char *fmt, ...) abort(); } - - diff --git a/lib/dpkg/fields.c b/lib/dpkg/fields.c index 74e085360..89f055580 100644 --- a/lib/dpkg/fields.c +++ b/lib/dpkg/fields.c @@ -161,7 +161,7 @@ void f_status(struct pkginfo *pigp, struct pkginfoperfile *pifp, _("value for `status' field not allowed in this context")); if (ps->flags & pdb_recordavailable) return; - + pigp->want = convert_string(ps, pigp, _("first (want) word in `status' field"), wantinfos, value, &ep, -1); @@ -178,7 +178,7 @@ void f_version(struct pkginfo *pigp, struct pkginfoperfile *pifp, const char *value, const struct fieldinfo *fip) { parse_db_version(ps, pigp, &pifp->version, value, _("error in Version string '%.250s'"), value); -} +} void f_revision(struct pkginfo *pigp, struct pkginfoperfile *pifp, struct parsedb_state *ps, @@ -194,7 +194,7 @@ void f_revision(struct pkginfo *pigp, struct pkginfoperfile *pifp, pifp->version.version= newversion; } pifp->version.revision= nfstrsave(value); -} +} void f_configversion(struct pkginfo *pigp, struct pkginfoperfile *pifp, struct parsedb_state *ps, @@ -221,7 +221,7 @@ static void conffvalue_lastword(const char *value, const char *from, struct pkginfo *pigp) { const char *lastspc; - + if (from <= value+1) goto malformed; for (lastspc= from-1; *lastspc != ' '; lastspc--); if (lastspc <= value+1 || lastspc >= endent-1) goto malformed; @@ -245,7 +245,7 @@ void f_conffiles(struct pkginfo *pigp, struct pkginfoperfile *pifp, const char *endent, *endfn, *hashstart; int c, namelen, hashlen, obsolete; char *newptr; - + lastp= &pifp->conffiles; while (*value) { c= *value++; @@ -542,4 +542,3 @@ f_trigaw(struct pkginfo *aw, struct pkginfoperfile *pifp, trig_enqueue_awaited_pend(pend); } } - diff --git a/lib/dpkg/file.c b/lib/dpkg/file.c index 424e9326b..874cbbf02 100644 --- a/lib/dpkg/file.c +++ b/lib/dpkg/file.c @@ -149,4 +149,3 @@ file_lock(int *lockfd, enum file_lock_flags flags, const char *filename, push_cleanup(file_unlock_cleanup, ~0, NULL, 0, 2, lockfd, desc); } - diff --git a/lib/dpkg/file.h b/lib/dpkg/file.h index 2ffa84ddc..5ea084999 100644 --- a/lib/dpkg/file.h +++ b/lib/dpkg/file.h @@ -51,4 +51,3 @@ void file_unlock(void); DPKG_END_DECLS #endif /* LIBDPKG_FILE_H */ - diff --git a/lib/dpkg/log.c b/lib/dpkg/log.c index 94c570948..8efb7bc41 100644 --- a/lib/dpkg/log.c +++ b/lib/dpkg/log.c @@ -103,4 +103,3 @@ statusfd_send(const char *fmt, ...) } } } - diff --git a/lib/dpkg/macros.h b/lib/dpkg/macros.h index a9f861267..642558cbd 100644 --- a/lib/dpkg/macros.h +++ b/lib/dpkg/macros.h @@ -84,4 +84,3 @@ #endif #endif /* LIBDPKG_MACROS_H */ - diff --git a/lib/dpkg/mlib.c b/lib/dpkg/mlib.c index f8e9c58a3..bd242f447 100644 --- a/lib/dpkg/mlib.c +++ b/lib/dpkg/mlib.c @@ -38,12 +38,12 @@ void *m_malloc(size_t amount) { unsigned short *r2, x; #endif void *r; - + onerr_abort++; r= malloc(amount); if (!r) ohshite(_("malloc failed (%ld bytes)"),(long)amount); onerr_abort--; - + #ifdef MDEBUG r2= r; x= (unsigned short)amount ^ 0xf000; while (amount >= 2) { *r2++= x; amount -= 2; } @@ -76,7 +76,7 @@ m_strdup(const char *str) void m_dup2(int oldfd, int newfd) { const char *const stdstrings[]= { "in", "out", "err" }; - + if (dup2(oldfd,newfd) == newfd) return; onerr_abort++; @@ -106,4 +106,3 @@ void setcloexec(int fd, const char* fn) { if (fcntl(fd, F_SETFD, (f|FD_CLOEXEC))==-1) ohshite(_("unable to set close-on-exec flag for %.250s"),fn); } - diff --git a/lib/dpkg/nfmalloc.c b/lib/dpkg/nfmalloc.c index 98a06ff75..e528ef05d 100644 --- a/lib/dpkg/nfmalloc.c +++ b/lib/dpkg/nfmalloc.c @@ -45,7 +45,7 @@ static void nfobstack_init(void) { dbobs_init = true; obstack_chunk_size(&db_obs) = CHUNK_SIZE; } - + void * nfmalloc(size_t size) { diff --git a/lib/dpkg/parse.c b/lib/dpkg/parse.c index cc65601bc..16793e467 100644 --- a/lib/dpkg/parse.c +++ b/lib/dpkg/parse.c @@ -250,9 +250,11 @@ int parsedb(const char *filename, enum parsedbflags flags, } if (EOF_mmap(dataptr, endptr) || c == '\n' || c == MSDOS_EOF_CHAR) break; } /* Loop per field. */ + if (pdone && donep) parse_error(&ps, &newpig, _("several package info entries found, only one allowed")); + parse_must_have_field(&ps, &newpig, newpig.name, "package name"); /* XXX: We need to check for status != stat_halfinstalled as while * unpacking a deselected package, it will not have yet all data in @@ -379,7 +381,6 @@ int parsedb(const char *filename, enum parsedbflags flags, /* ->othertrigaw_head is updated by trig_note_aw in *(pkg_db_find()) * rather than in newpig. */ } - } else if (!(flags & pdb_ignorefiles)) { pigp->files= newpig.files; } @@ -439,7 +440,7 @@ void copy_dependency_links(struct pkginfo *pkg, struct dependency *dyp; struct deppossi *dop; struct pkginfoperfile *addtopifp; - + /* Delete ‘backward’ (‘depended’) links from other packages to * dependencies listed in old version of this one. We do this by * going through all the dependencies in the old version of this @@ -458,6 +459,7 @@ void copy_dependency_links(struct pkginfo *pkg, dop->rev_next->rev_prev = dop->rev_prev; } } + /* Now fill in new ‘ed’ links from other packages to dependencies * listed in new version of this one, and set our uplinks correctly. */ for (dyp= newdepends; dyp; dyp= dyp->next) { @@ -471,6 +473,7 @@ void copy_dependency_links(struct pkginfo *pkg, addtopifp->depended= dop; } } + /* Finally, we fill in the new value. */ *updateme= newdepends; } diff --git a/lib/dpkg/parsehelp.c b/lib/dpkg/parsehelp.c index c28db87e4..8f18367db 100644 --- a/lib/dpkg/parsehelp.c +++ b/lib/dpkg/parsehelp.c @@ -129,7 +129,7 @@ pkg_name_is_illegal(const char *p, const char **ep) static const char alsoallowed[] = "-+._"; static char buf[150]; int c; - + if (!*p) return _("may not be empty string"); if (!isalnum(*p)) return _("must start with an alphanumeric"); while ((c = *p++) != '\0') @@ -166,7 +166,7 @@ informativeversion(const struct versionrevision *version) void varbufversion (struct varbuf *vb, const struct versionrevision *version, - enum versiondisplayepochwhen vdew) + enum versiondisplayepochwhen vdew) { switch (vdew) { case vdew_never: @@ -197,7 +197,7 @@ const char *versiondescribe static int bufnum=0; struct varbuf *vb; - + if (!informativeversion(version)) return _(""); vb= &bufs[bufnum]; bufnum++; if (bufnum == 10) bufnum= 0; @@ -358,4 +358,3 @@ parse_ensure_have_field(struct parsedb_state *ps, parse_warn(ps, pigp, _("empty value for %s"), what); } } - diff --git a/lib/dpkg/path.c b/lib/dpkg/path.c index c6caf15af..1dd736bc9 100644 --- a/lib/dpkg/path.c +++ b/lib/dpkg/path.c @@ -156,4 +156,3 @@ path_quote_filename(char *dst, const char *src, size_t n) return r; } - diff --git a/lib/dpkg/path.h b/lib/dpkg/path.h index 60685563a..354354121 100644 --- a/lib/dpkg/path.h +++ b/lib/dpkg/path.h @@ -36,4 +36,3 @@ char *path_make_temp_template(const char *suffix); DPKG_END_DECLS #endif /* LIBDPKG_PATH_H */ - diff --git a/lib/dpkg/pkg-array.c b/lib/dpkg/pkg-array.c index 19e95b8cf..0f1d9bf03 100644 --- a/lib/dpkg/pkg-array.c +++ b/lib/dpkg/pkg-array.c @@ -79,4 +79,3 @@ pkg_array_destroy(struct pkg_array *a) free(a->pkgs); a->pkgs = NULL; } - diff --git a/lib/dpkg/pkg-format.c b/lib/dpkg/pkg-format.c index 4c44acc30..d5f8a3f02 100644 --- a/lib/dpkg/pkg-format.c +++ b/lib/dpkg/pkg-format.c @@ -267,4 +267,3 @@ pkg_format_show(const struct pkg_format_node *head, varbuf_destroy(&fb); varbuf_destroy(&vb); } - diff --git a/lib/dpkg/pkg-list.c b/lib/dpkg/pkg-list.c index 685946856..70baa0821 100644 --- a/lib/dpkg/pkg-list.c +++ b/lib/dpkg/pkg-list.c @@ -76,4 +76,3 @@ pkg_list_prepend(struct pkg_list **head, struct pkginfo *pkg) { *head = pkg_list_new(pkg, *head); } - diff --git a/lib/dpkg/pkg-queue.c b/lib/dpkg/pkg-queue.c index 0e1c3e11f..9d7079d5a 100644 --- a/lib/dpkg/pkg-queue.c +++ b/lib/dpkg/pkg-queue.c @@ -124,4 +124,3 @@ pkg_queue_pop(struct pkg_queue *queue) return pkg; } - diff --git a/lib/dpkg/pkg-show.c b/lib/dpkg/pkg-show.c index 3510b8b6a..88f129691 100644 --- a/lib/dpkg/pkg-show.c +++ b/lib/dpkg/pkg-show.c @@ -47,4 +47,3 @@ pkg_summary(const struct pkginfo *pkg, int *len_ret) return pdesc; } - diff --git a/lib/dpkg/pkg.c b/lib/dpkg/pkg.c index 7598860b0..c7b0d72a0 100644 --- a/lib/dpkg/pkg.c +++ b/lib/dpkg/pkg.c @@ -46,4 +46,3 @@ pkg_sorter_by_name(const void *a, const void *b) return strcmp(pa->name, pb->name); } - diff --git a/lib/dpkg/progress.c b/lib/dpkg/progress.c index 0fb547050..849393dbe 100644 --- a/lib/dpkg/progress.c +++ b/lib/dpkg/progress.c @@ -69,4 +69,3 @@ progress_done(struct progress *progress) if (progress->on_tty) printf("\r%s", progress->text); } - diff --git a/lib/dpkg/progress.h b/lib/dpkg/progress.h index 496846701..9bc490601 100644 --- a/lib/dpkg/progress.h +++ b/lib/dpkg/progress.h @@ -44,4 +44,3 @@ void progress_done(struct progress *progress); DPKG_END_DECLS #endif - diff --git a/lib/dpkg/string.c b/lib/dpkg/string.c index e3b8ed302..20cec1ea0 100644 --- a/lib/dpkg/string.c +++ b/lib/dpkg/string.c @@ -83,4 +83,3 @@ str_strip_quotes(char *str) return str; } - diff --git a/lib/dpkg/string.h b/lib/dpkg/string.h index af879e85c..c65b880d8 100644 --- a/lib/dpkg/string.h +++ b/lib/dpkg/string.h @@ -31,4 +31,3 @@ char *str_strip_quotes(char *str); DPKG_END_DECLS #endif /* LIBDPKG_STRING_H */ - diff --git a/lib/dpkg/subproc.c b/lib/dpkg/subproc.c index 7a4897976..b82248e27 100644 --- a/lib/dpkg/subproc.c +++ b/lib/dpkg/subproc.c @@ -161,4 +161,3 @@ subproc_wait_check(pid_t pid, const char *desc, int flags) return subproc_check(status, desc, flags); } - diff --git a/lib/dpkg/subproc.h b/lib/dpkg/subproc.h index 0a0236545..81fb12239 100644 --- a/lib/dpkg/subproc.h +++ b/lib/dpkg/subproc.h @@ -42,4 +42,3 @@ int subproc_wait_check(pid_t pid, const char *desc, int flags); DPKG_END_DECLS #endif /* LIBDPKG_SUBPROC_H */ - diff --git a/lib/dpkg/tarfn.c b/lib/dpkg/tarfn.c index 8172052cd..0817c88b6 100644 --- a/lib/dpkg/tarfn.c +++ b/lib/dpkg/tarfn.c @@ -402,4 +402,3 @@ tar_extractor(void *ctx, const struct tar_operations *ops) return status; } } - diff --git a/lib/dpkg/test.h b/lib/dpkg/test.h index 664e4aefc..4e7dc318f 100644 --- a/lib/dpkg/test.h +++ b/lib/dpkg/test.h @@ -54,4 +54,3 @@ main(int argc, char **argv) #endif #endif - diff --git a/lib/dpkg/test/Makefile.am b/lib/dpkg/test/Makefile.am index 610ca27fc..b747f1e30 100644 --- a/lib/dpkg/test/Makefile.am +++ b/lib/dpkg/test/Makefile.am @@ -37,4 +37,3 @@ t_varbuf_LDADD = $(CHECK_LDADD) t_version_LDADD = $(CHECK_LDADD) TESTS = $(check_PROGRAMS) - diff --git a/lib/dpkg/test/t-buffer.c b/lib/dpkg/test/t-buffer.c index 5063483d4..f90167d8f 100644 --- a/lib/dpkg/test/t-buffer.c +++ b/lib/dpkg/test/t-buffer.c @@ -46,4 +46,3 @@ test(void) { test_buffer_hash(); } - diff --git a/lib/dpkg/test/t-command.c b/lib/dpkg/test/t-command.c index 881cab79c..a1b543c70 100644 --- a/lib/dpkg/test/t-command.c +++ b/lib/dpkg/test/t-command.c @@ -161,4 +161,3 @@ test(void) test_command_add_args(); test_command_exec(); } - diff --git a/lib/dpkg/test/t-macros.c b/lib/dpkg/test/t-macros.c index 1616a9edc..2b19775b0 100644 --- a/lib/dpkg/test/t-macros.c +++ b/lib/dpkg/test/t-macros.c @@ -37,4 +37,3 @@ test(void) test_pass(max(0, 10) == 10); test_pass(max(-10, 0) == 0); } - diff --git a/lib/dpkg/test/t-path.c b/lib/dpkg/test/t-path.c index d59288a1a..a3bf78436 100644 --- a/lib/dpkg/test/t-path.c +++ b/lib/dpkg/test/t-path.c @@ -165,4 +165,3 @@ test(void) test_path_temp(); test_path_quote(); } - diff --git a/lib/dpkg/test/t-pkg-list.c b/lib/dpkg/test/t-pkg-list.c index e7fa22a12..9a446e370 100644 --- a/lib/dpkg/test/t-pkg-list.c +++ b/lib/dpkg/test/t-pkg-list.c @@ -87,4 +87,3 @@ test(void) test_pkg_list_new(); test_pkg_list_prepend(); } - diff --git a/lib/dpkg/test/t-pkg-queue.c b/lib/dpkg/test/t-pkg-queue.c index 9a05d7cc9..967a1be0d 100644 --- a/lib/dpkg/test/t-pkg-queue.c +++ b/lib/dpkg/test/t-pkg-queue.c @@ -115,4 +115,3 @@ test(void) test_pkg_queue_init(); test_pkg_queue_push_pop(); } - diff --git a/lib/dpkg/test/t-pkginfo.c b/lib/dpkg/test/t-pkginfo.c index 7fe6100c6..b1df8f8d2 100644 --- a/lib/dpkg/test/t-pkginfo.c +++ b/lib/dpkg/test/t-pkginfo.c @@ -49,4 +49,3 @@ test(void) /* FIXME: Complete. */ } - diff --git a/lib/dpkg/test/t-string.c b/lib/dpkg/test/t-string.c index 689f387e6..9f5fd7d60 100644 --- a/lib/dpkg/test/t-string.c +++ b/lib/dpkg/test/t-string.c @@ -111,4 +111,3 @@ test(void) test_str_escape_fmt(); test_str_strip_quotes(); } - diff --git a/lib/dpkg/test/t-test.c b/lib/dpkg/test/t-test.c index 5b87fcd09..b73a389b7 100644 --- a/lib/dpkg/test/t-test.c +++ b/lib/dpkg/test/t-test.c @@ -44,4 +44,3 @@ test(void) test_mem("ababcd", ==, "ababff", 4); test_mem("ababcd", !=, "ababff", 6); } - diff --git a/lib/dpkg/test/t-varbuf.c b/lib/dpkg/test/t-varbuf.c index 637c6cc56..e6242e695 100644 --- a/lib/dpkg/test/t-varbuf.c +++ b/lib/dpkg/test/t-varbuf.c @@ -283,4 +283,3 @@ test(void) /* FIXME: Complete. */ } - diff --git a/lib/dpkg/test/t-version.c b/lib/dpkg/test/t-version.c index 3c37bf44f..deb088329 100644 --- a/lib/dpkg/test/t-version.c +++ b/lib/dpkg/test/t-version.c @@ -152,4 +152,3 @@ test(void) test_version_compare(); test_version_parse(); } - diff --git a/lib/dpkg/trigdeferred.l b/lib/dpkg/trigdeferred.l index 0a9f05e50..a3a10b833 100644 --- a/lib/dpkg/trigdeferred.l +++ b/lib/dpkg/trigdeferred.l @@ -237,4 +237,3 @@ trigdef_process_done(void) /* Unlock. */ pop_cleanup(ehflag_normaltidy); } - diff --git a/lib/dpkg/triglib.c b/lib/dpkg/triglib.c index bbae7d759..df48cea9c 100644 --- a/lib/dpkg/triglib.c +++ b/lib/dpkg/triglib.c @@ -857,6 +857,7 @@ th_simple_nn_find(const char *name, bool nonew) for (search = trigger_files; search; search = search->next) if (!strcmp(search->name, name)) return search; + /* Not found. */ if (nonew) return NULL; diff --git a/lib/dpkg/utils.c b/lib/dpkg/utils.c index 3953f96aa..0eb764594 100644 --- a/lib/dpkg/utils.c +++ b/lib/dpkg/utils.c @@ -76,4 +76,3 @@ fgets_must(char *buf, size_t bufsz, FILE *f, const char *fn) return l; } - diff --git a/m4/dpkg-compiler.m4 b/m4/dpkg-compiler.m4 index 65ed76863..5fa00df21 100644 --- a/m4/dpkg-compiler.m4 +++ b/m4/dpkg-compiler.m4 @@ -99,4 +99,3 @@ AS_IF([test "x$dpkg_cv_c99" = "xyes"], AC_DEFINE([HAVE_C99], 1)], [AC_MSG_ERROR([unsupported required C99 extensions])])])[]dnl ])# DPKG_C_C99 - diff --git a/m4/dpkg-progs.m4 b/m4/dpkg-progs.m4 index 2c26acadb..c71a412fd 100644 --- a/m4/dpkg-progs.m4 +++ b/m4/dpkg-progs.m4 @@ -33,4 +33,3 @@ AC_DEFUN([DPKG_PROG_POD2MAN], [ AC_CHECK_PROGS([POD2MAN], [pod2man]) AM_CONDITIONAL(BUILD_POD_DOC, [test "x$POD2MAN" != "x"]) ])# DPKG_PROG_POD2MAN - diff --git a/man/po/ChangeLog.old b/man/po/ChangeLog.old index c0f2f9765..70395ec27 100644 --- a/man/po/ChangeLog.old +++ b/man/po/ChangeLog.old @@ -1183,5 +1183,4 @@ * man/fr/update-alternatives.8.fr.po: Updated translation. * man/fr/update-alternatives.8.fr.po.addendum: New file. - Older changes are documented in the top-level ChangeLog diff --git a/po/ChangeLog.old b/po/ChangeLog.old index 9d1f75080..fa8784eda 100644 --- a/po/ChangeLog.old +++ b/po/ChangeLog.old @@ -1832,5 +1832,4 @@ * Makevars: Updated against current gettext template, with copyright changed to SPI and bugs address retained from previous version. - Older changes are documented in the top-level ChangeLog diff --git a/scripts/dpkg-distaddfile.pl b/scripts/dpkg-distaddfile.pl index 920b03593..566698eec 100755 --- a/scripts/dpkg-distaddfile.pl +++ b/scripts/dpkg-distaddfile.pl @@ -91,4 +91,3 @@ print(Y "$file $section $priority\n") close(Y) || syserr(_g("close new files list file")); rename("$fileslistfile.new", $fileslistfile) || syserr(_g("install new files list file")); - diff --git a/scripts/dpkg-genchanges.pl b/scripts/dpkg-genchanges.pl index 70898a41a..861a6068a 100755 --- a/scripts/dpkg-genchanges.pl +++ b/scripts/dpkg-genchanges.pl @@ -505,4 +505,3 @@ for my $f (keys %remove) { } $fields->output(\*STDOUT); # Note: no substitution of variables - diff --git a/scripts/dpkg-gencontrol.pl b/scripts/dpkg-gencontrol.pl index 0b89479a8..224d57bd1 100755 --- a/scripts/dpkg-gencontrol.pl +++ b/scripts/dpkg-gencontrol.pl @@ -380,4 +380,3 @@ if (!$stdout) { } $substvars->warn_about_unused(); - diff --git a/scripts/dpkg-mergechangelogs.pl b/scripts/dpkg-mergechangelogs.pl index 3ef5e96d8..cea758410 100755 --- a/scripts/dpkg-mergechangelogs.pl +++ b/scripts/dpkg-mergechangelogs.pl @@ -288,4 +288,3 @@ sub get_conflict_block($$) { @b = @{$b} if ref($b) eq "ARRAY"; return ("<<<<<<", @a, "======", @b, ">>>>>>"); } - diff --git a/scripts/dpkg-name.pl b/scripts/dpkg-name.pl index 6745ac182..ee7baefcf 100755 --- a/scripts/dpkg-name.pl +++ b/scripts/dpkg-name.pl @@ -249,4 +249,3 @@ while (@ARGV) { } 0; - diff --git a/scripts/dpkg-parsechangelog.pl b/scripts/dpkg-parsechangelog.pl index 2bf965ea6..34bf3fb11 100755 --- a/scripts/dpkg-parsechangelog.pl +++ b/scripts/dpkg-parsechangelog.pl @@ -122,4 +122,3 @@ foreach my $f (@fields) { print "\n" if $count++; print $f->output(); } - diff --git a/scripts/dpkg-scanpackages.pl b/scripts/dpkg-scanpackages.pl index 8eab042de..df900a034 100755 --- a/scripts/dpkg-scanpackages.pl +++ b/scripts/dpkg-scanpackages.pl @@ -276,4 +276,3 @@ if (@spuriousover) { } info(_g("Wrote %s entries to output Packages file."), $records_written); - diff --git a/scripts/dpkg-shlibdeps.pl b/scripts/dpkg-shlibdeps.pl index b82ec2077..91ea4e57a 100755 --- a/scripts/dpkg-shlibdeps.pl +++ b/scripts/dpkg-shlibdeps.pl @@ -842,4 +842,3 @@ sub find_packages { close(DPKG); return $pkgmatch; } - diff --git a/scripts/dpkg-source.pl b/scripts/dpkg-source.pl index cca5430a2..5d4c1de6e 100755 --- a/scripts/dpkg-source.pl +++ b/scripts/dpkg-source.pl @@ -475,4 +475,3 @@ See dpkg-source(1) for more info.") . "\n", join(" ", compression_get_list()), compression_get_default_level(); } - diff --git a/scripts/po/ChangeLog.old b/scripts/po/ChangeLog.old index 3b49b1539..9c02bd20f 100644 --- a/scripts/po/ChangeLog.old +++ b/scripts/po/ChangeLog.old @@ -446,4 +446,3 @@ * Makevars: Likewise. * remove-potcdate.sin: Likewise. * dpkg-dev.pot: Likewise. - diff --git a/scripts/t/400_Dpkg_Deps.t b/scripts/t/400_Dpkg_Deps.t index 25c98791b..08a44b994 100644 --- a/scripts/t/400_Dpkg_Deps.t +++ b/scripts/t/400_Dpkg_Deps.t @@ -81,4 +81,3 @@ $SIG{'__WARN__'} = sub {}; my $dep_bad_multiline = deps_parse("a, foo\nbar, c"); ok(!defined($dep_bad_multiline), "invalid dependency split over multiple line"); delete $SIG{'__WARN__'}; - diff --git a/scripts/t/500_Dpkg_Path.t b/scripts/t/500_Dpkg_Path.t index cda17f761..70c1a749e 100644 --- a/scripts/t/500_Dpkg_Path.t +++ b/scripts/t/500_Dpkg_Path.t @@ -58,4 +58,3 @@ chdir($tmpdir); ok(!defined(get_pkg_root_dir("debian/a/b/c")), "get_pkg_root_dir undef"); ok(!defined(relative_to_pkg_root("debian/a/b/c")), "relative_to_pkg_root"); is(guess_pkg_root_dir("debian/a/b/c"), "debian/a", "guess_pkg_root_dir fallback"); - diff --git a/scripts/t/700_Dpkg_Control.t b/scripts/t/700_Dpkg_Control.t index 03e903c68..09dcffc5f 100644 --- a/scripts/t/700_Dpkg_Control.t +++ b/scripts/t/700_Dpkg_Control.t @@ -82,4 +82,3 @@ is(${$io->string_ref()}, 'Package: mypackage2 Depends: hello ', "Dump of second binary package of $datadir/control-1"); - diff --git a/scripts/t/850_Dpkg_Compression.t b/scripts/t/850_Dpkg_Compression.t index 800a363e7..b7929057b 100644 --- a/scripts/t/850_Dpkg_Compression.t +++ b/scripts/t/850_Dpkg_Compression.t @@ -95,5 +95,3 @@ test_read("$tmpdir/myfile"); # Test read on compressed file test_read("$tmpdir/myfile.gz"); - - diff --git a/scripts/t/910_merge_changelogs.t b/scripts/t/910_merge_changelogs.t index 0ca01af96..a3c0509b2 100644 --- a/scripts/t/910_merge_changelogs.t +++ b/scripts/t/910_merge_changelogs.t @@ -55,4 +55,3 @@ if ($has_alg_merge) { test_merge("$datadir/ch-merged-basic", @input); test_merge("$datadir/ch-merged-pr-basic", "-m", @input); } - diff --git a/src/archives.c b/src/archives.c index 045d2773f..49c7c7eaa 100644 --- a/src/archives.c +++ b/src/archives.c @@ -125,7 +125,7 @@ filesavespackage(struct fileinlist *file, { struct filepackages_iterator *iter; struct pkginfo *divpkg, *thirdpkg; - + debug(dbg_eachfiledetail,"filesavespackage file `%s' package %s", file->namenode->name,pkgtobesaved->name); @@ -178,7 +178,7 @@ filesavespackage(struct fileinlist *file, void cu_pathname(int argc, void **argv) { ensure_pathname_nonexisting((char*)(argv[0])); -} +} int tarfileread(void *ud, char *buf, int len) { struct tarcontext *tc= (struct tarcontext*)ud; @@ -222,7 +222,7 @@ does_replace(struct pkginfo *newpigp, struct pkginfoperfile *newpifp, struct pkginfo *oldpigp, struct pkginfoperfile *oldpifp) { struct dependency *dep; - + debug(dbg_depcon,"does_replace new=%s old=%s (%s)",newpigp->name, oldpigp->name, versiondescribe(&oldpifp->version, vdew_always)); for (dep= newpifp->depends; dep; dep= dep->next) { @@ -329,19 +329,19 @@ int secure_remove(const char *filename) { int r, e; - + if (!rmdir(filename)) { debug(dbg_eachfiledetail, "secure_remove '%s' rmdir OK", filename); return 0; } - + if (errno != ENOTDIR) { e= errno; debug(dbg_eachfiledetail, "secure_remove '%s' rmdir %s", filename, strerror(e)); errno= e; return -1; } - + r = secure_unlink(filename); e = errno; debug(dbg_eachfiledetail, "secure_remove '%s' unlink %s", @@ -352,7 +352,7 @@ secure_remove(const char *filename) struct fileinlist *addfiletolist(struct tarcontext *tc, struct filenamenode *namenode) { struct fileinlist *nifd; - + nifd= obstack_alloc(&tar_obs, sizeof(struct fileinlist)); nifd->namenode= namenode; nifd->next = NULL; @@ -491,7 +491,7 @@ tarobject(void *ctx, struct tar_entry *ti) usename= conffderefn.buf; debug(dbg_conff,"tarobject fnnf_new_conff deref=`%s'",usename); } - + setupfnamevbs(usename); statr= lstat(fnamevb.buf,&stab); @@ -703,7 +703,7 @@ tarobject(void *ctx, struct tar_entry *ti) if (r > 0) if (safe_read(tc->backendpipe, databuf, TARBLKSZ - r) == -1) ohshite(_("error reading from dpkg-deb pipe")); - if (nifd->namenode->statoverride) + if (nifd->namenode->statoverride) debug(dbg_eachfile, "tarobject ... stat override, uid=%d, gid=%d, mode=%04o", nifd->namenode->statoverride->uid, nifd->namenode->statoverride->gid, @@ -732,13 +732,13 @@ tarobject(void *ctx, struct tar_entry *ti) ohshite(_("error creating device `%.255s'"), ti->name); debug(dbg_eachfiledetail, "tarobject chardev"); newtarobject_allmodes(fnamenewvb.buf, st); - break; + break; case tar_filetype_blockdev: if (mknod(fnamenewvb.buf, S_IFBLK, ti->dev)) ohshite(_("error creating device `%.255s'"), ti->name); debug(dbg_eachfiledetail, "tarobject blockdev"); newtarobject_allmodes(fnamenewvb.buf, st); - break; + break; case tar_filetype_hardlink: varbufreset(&hardlinkfn); varbufaddstr(&hardlinkfn,instdir); varbufaddc(&hardlinkfn,'/'); @@ -942,7 +942,7 @@ try_deconfigure_can(bool (*force_p)(struct deppossi *), struct pkginfo *pkg, struct pkginfo *removal, const char *why) { struct pkg_deconf_list *newdeconf; - + if (force_p && force_p(pdep)) { warning(_("ignoring dependency problem with %s:\n%s"), action, why); return 2; @@ -1141,7 +1141,7 @@ void check_conflict(struct dependency *dep, struct pkginfo *pkg, ohshit(_("conflicting packages - not installing %.250s"),pkg->name); warning(_("ignoring conflict, may proceed anyway!")); varbuf_destroy(&conflictwhy); - + return; } @@ -1150,11 +1150,11 @@ void cu_cidir(int argc, void **argv) { char *cidirrest= (char*)argv[1]; cidirrest[-1] = '\0'; ensure_pathname_nonexisting(cidir); -} +} void cu_fileslist(int argc, void **argv) { destroyobstack(); -} +} void archivefiles(const char *const *argv) { const char *volatile thisarg; @@ -1176,12 +1176,11 @@ void archivefiles(const char *const *argv) { checkpath(); log_message("startup archives %s", cipaction->olong); - + if (f_recursive) { - if (!*argv) badusage(_("--%s --recursive needs at least one path argument"),cipaction->olong); - + m_pipe(pi); fc = subproc_fork(); if (!fc) { @@ -1229,7 +1228,7 @@ void archivefiles(const char *const *argv) { varbufaddc(&findoutput,0); varbufaddc(&findoutput,0); - + arglist= m_malloc(sizeof(char*)*(nfiles+1)); p= findoutput.buf; i=0; while (*p) { @@ -1238,13 +1237,10 @@ void archivefiles(const char *const *argv) { } arglist[i] = NULL; argp= arglist; - } else { - if (!*argv) badusage(_("--%s needs at least one package archive file argument"), cipaction->olong); argp= argv; - } currenttime = time(NULL); @@ -1262,7 +1258,7 @@ void archivefiles(const char *const *argv) { ensure_diversions(); ensure_statoverrides(); - + while ((thisarg = *argp++) != NULL) { if (setjmp(ejbuf)) { pop_error_context(ehflag_bombout); diff --git a/src/cleanup.c b/src/cleanup.c index fa9b056e8..b6c462bac 100644 --- a/src/cleanup.c +++ b/src/cleanup.c @@ -70,12 +70,12 @@ void cu_installnew(int argc, void **argv) { struct stat stab; cleanup_pkg_failed++; cleanup_conflictor_failed++; - + namenode= nifd->namenode; debug(dbg_eachfile,"cu_installnew `%s' flags=%o",namenode->name,namenode->flags); - + setupfnamevbs(namenode->name); - + if (!(namenode->flags & fnnf_new_conff) && !lstat(fnametmpvb.buf,&stab)) { /* OK, .dpkg-tmp exists. Remove and * restore .dpkg-tmp ... */ @@ -130,7 +130,7 @@ void cu_prermupgrade(int argc, void **argv) { */ void ok_prermdeconfigure(int argc, void **argv) { struct pkginfo *deconf= (struct pkginfo*)argv[0]; - + if (cipaction->arg == act_install) add_to_queue(deconf); } diff --git a/src/depcon.c b/src/depcon.c index 41032f7f0..b692218e0 100644 --- a/src/depcon.c +++ b/src/depcon.c @@ -53,6 +53,7 @@ foundcyclebroken(struct cyclesofarlink *thislink, struct cyclesofarlink *sofar, if(!possi) return false; + /* We're investigating the dependency ‘possi’ to see if it * is part of a loop. To this end we look to see whether the * depended-on package is already one of the packages whose @@ -62,7 +63,7 @@ foundcyclebroken(struct cyclesofarlink *thislink, struct cyclesofarlink *sofar, /* If not, we do a recursive search on it to see what we find. */ if (!sol) return findbreakcyclerecursive(dependedon, thislink); - + debug(dbg_depcon,"found cycle"); /* Right, we now break one of the links. We prefer to break * a dependency of a package without a postinst script, as @@ -80,11 +81,14 @@ foundcyclebroken(struct cyclesofarlink *thislink, struct cyclesofarlink *sofar, ohshite(_("unable to check for existence of `%.250s'"),postinstfilename); } } + /* Now we have either a package with no postinst, or the other * occurrence of the current package in the list. */ sol->possi->cyclebreak = true; + debug(dbg_depcon, "cycle broken at %s -> %s", sol->possi->up->up->name, sol->possi->ed->name); + return true; } @@ -105,7 +109,7 @@ findbreakcyclerecursive(struct pkginfo *pkg, struct cyclesofarlink *sofar) if (pkg->clientdata->color == black) return false; pkg->clientdata->color = gray; - + if (f_debug & dbg_depcondetail) { struct varbuf str_pkgs = VARBUF_INIT; @@ -153,7 +157,7 @@ findbreakcycle(struct pkginfo *pkg) { struct pkgiterator *iter; struct pkginfo *tpkg; - + /* Clear the visited flag of all packages before we traverse them. */ iter = pkg_db_iter_new(); while ((tpkg = pkg_db_iter_next(iter))) { @@ -200,7 +204,7 @@ void describedepcon(struct varbuf *addto, struct dependency *dep) { varbufprintf(addto, fmt, dep->up->name, depstr.buf); varbuf_destroy(&depstr); } - + /* * *whynot must already have been initialized; it need not be * empty though - it will be reset before use. @@ -237,7 +241,7 @@ depisok(struct dependency *dep, struct varbuf *whynot, dep->type == dep_breaks || dep->type == dep_conflicts || dep->type == dep_recommends || dep->type == dep_suggests || dep->type == dep_enhances); - + if (canfixbyremove) *canfixbyremove = NULL; @@ -271,11 +275,10 @@ depisok(struct dependency *dep, struct varbuf *whynot, varbufaddc(whynot, ' '); describedepcon(whynot, dep); varbufaddc(whynot,'\n'); - + /* TODO: Check dep_enhances as well. */ if (dep->type == dep_depends || dep->type == dep_predepends || dep->type == dep_recommends || dep->type == dep_suggests ) { - /* Go through the alternatives. As soon as we find one that * we like, we return ‘true’ straight away. Otherwise, when we get to * the end we'll have accumulated all the reasons in whynot and @@ -349,7 +352,6 @@ depisok(struct dependency *dep, struct varbuf *whynot, /* If there was no version specified we try looking for Providers. */ if (possi->verrel == dvr_none) { - /* See if the package we're about to install Provides it. */ for (provider= possi->ed->available.depended; provider; @@ -364,14 +366,14 @@ depisok(struct dependency *dep, struct varbuf *whynot, provider; provider = provider->rev_next) { if (provider->up->type != dep_provides) continue; - + switch (provider->up->up->clientdata->istobe) { case itb_installnew: /* Don't pay any attention to the Provides field of the * currently-installed version of the package we're trying * to install. We dealt with that by using the available * information above. */ - continue; + continue; case itb_remove: sprintf(linebuf, _(" %.250s provides %.250s but is to be removed.\n"), provider->up->up->name, possi->ed->name); @@ -393,7 +395,7 @@ depisok(struct dependency *dep, struct varbuf *whynot, } varbufaddstr(whynot, linebuf); } - + if (!*linebuf) { /* If the package wasn't installed at all, and we haven't said * yet why this isn't satisfied, we should say so now. */ @@ -404,9 +406,7 @@ depisok(struct dependency *dep, struct varbuf *whynot, } return false; - } else { - /* It's conflicts or breaks. There's only one main alternative, * but we also have to consider Providers. We return ‘false’ as soon * as we find something that matches the conflict, and only describe @@ -421,7 +421,7 @@ depisok(struct dependency *dep, struct varbuf *whynot, * other packages which provide the same virtual name. We * therefore don't look at the real package and go on to the * virtual ones. */ - + switch (possi->ed->clientdata->istobe) { case itb_remove: break; @@ -471,7 +471,6 @@ depisok(struct dependency *dep, struct varbuf *whynot, /* If there was no version specified we try looking for Providers. */ if (possi->verrel == dvr_none) { - /* See if the package we're about to install Provides it. */ for (provider= possi->ed->available.depended; provider; @@ -494,17 +493,17 @@ depisok(struct dependency *dep, struct varbuf *whynot, provider; provider = provider->rev_next) { if (provider->up->type != dep_provides) continue; - + if (provider->up->up == dep->up) continue; /* Conflicts and provides the same. */ - + switch (provider->up->up->clientdata->istobe) { case itb_installnew: /* Don't pay any attention to the Provides field of the * currently-installed version of the package we're trying * to install. We dealt with that package by using the * available information above. */ - continue; + continue; case itb_remove: continue; case itb_deconfigure: diff --git a/src/divertdb.c b/src/divertdb.c index 1449c64ee..a83f75ca2 100644 --- a/src/divertdb.c +++ b/src/divertdb.c @@ -124,4 +124,3 @@ ensure_diversions(void) onerr_abort--; } - diff --git a/src/enquiry.c b/src/enquiry.c index a130f838c..16deb18ce 100644 --- a/src/enquiry.c +++ b/src/enquiry.c @@ -199,7 +199,7 @@ void unpackchk(const char *const *argv) { const char *thissect; char buf[20]; int width; - + if (*argv) badusage(_("--%s takes no arguments"), cipaction->olong); @@ -228,7 +228,7 @@ void unpackchk(const char *const *argv) { pkg_db_iter_free(it); if (totalcount == 0) exit(0); - + if (totalcount <= 12) { it = pkg_db_iter_new(); while ((pkg = pkg_db_iter_next(it))) { @@ -338,7 +338,7 @@ void assertmulticonrep(const char *const *argv) { */ void predeppackage(const char *const *argv) { static struct varbuf vb; - + struct pkgiterator *it; struct pkginfo *pkg = NULL, *startpkg, *trypkg; struct dependency *dep; @@ -481,7 +481,7 @@ void cmpversions(const char *const *argv) { const char *emsg; struct versionrevision a, b; int r; - + if (!argv[0] || !argv[1] || !argv[2] || argv[3]) badusage(_("--compare-versions takes three arguments:" " ")); diff --git a/src/errors.c b/src/errors.c index 3b4ceac53..b00da578a 100644 --- a/src/errors.c +++ b/src/errors.c @@ -56,7 +56,7 @@ static struct error_report emergency; void print_error_perpackage(const char *emsg, const char *arg) { struct error_report *nr; - + fprintf(stderr, _("%s: error processing %s (--%s):\n %s\n"), thisname, arg, cipaction->olong, emsg); @@ -74,7 +74,7 @@ void print_error_perpackage(const char *emsg, const char *arg) { nr->next = NULL; *lastreport= nr; lastreport= &nr->next; - + if (nerrs++ < errabort) return; fprintf(stderr, _("%s: too many errors, stopping\n"), thisname); abort_processing = true; diff --git a/src/filesdb.c b/src/filesdb.c index db929c47a..64c2a9dd5 100644 --- a/src/filesdb.c +++ b/src/filesdb.c @@ -260,7 +260,7 @@ ensure_packagefiles_available(struct pkginfo *pkg) filelistfile= pkgadminfile(pkg,LISTFILE); onerr_abort++; - + fd= open(filelistfile,O_RDONLY); if (fd==-1) { @@ -278,7 +278,7 @@ ensure_packagefiles_available(struct pkginfo *pkg) } push_cleanup(cu_closefd, ehflag_bombout, NULL, 0, 1, &fd); - + if(fstat(fd, &stat_buf)) ohshite(_("unable to stat files list file for package '%.250s'"), pkg->name); @@ -286,13 +286,13 @@ ensure_packagefiles_available(struct pkginfo *pkg) if (stat_buf.st_size) { loaded_list = nfmalloc(stat_buf.st_size); loaded_list_end = loaded_list + stat_buf.st_size; - + fd_buf_copy(fd, loaded_list, stat_buf.st_size, _("files list for package `%.250s'"), pkg->name); - + lendp= &pkg->clientdata->files; thisline = loaded_list; while (thisline < loaded_list_end) { - if (!(ptr = memchr(thisline, '\n', loaded_list_end - thisline))) + if (!(ptr = memchr(thisline, '\n', loaded_list_end - thisline))) ohshit(_("files list file for package '%.250s' is missing final newline"), pkg->name); /* Where to start next time around. */ @@ -473,7 +473,7 @@ write_filelist_except(struct pkginfo *pkg, struct fileinlist *list, varbufaddstr(&newvb,vb.buf); varbufaddstr(&newvb,NEWDBEXT); varbufaddc(&newvb,0); - + file= fopen(newvb.buf,"w+"); if (!file) ohshite(_("unable to create updated files list file for package %s"),pkg->name); @@ -512,7 +512,7 @@ write_filelist_except(struct pkginfo *pkg, struct fileinlist *list, void reversefilelist_init(struct reversefilelistiter *iterptr, struct fileinlist *files) { struct fileinlist *newent; - + iterptr->todo = NULL; while (files) { newent= m_malloc(sizeof(struct fileinlist)); diff --git a/src/filesdb.h b/src/filesdb.h index c3879c4f2..95605bfd0 100644 --- a/src/filesdb.h +++ b/src/filesdb.h @@ -100,7 +100,7 @@ struct filenamenode { struct stat *filestat; struct trigfileint *trig_interested; }; - + struct fileinlist { struct fileinlist *next; struct filenamenode *namenode; diff --git a/src/help.c b/src/help.c index 0778975b5..82d9cd0e5 100644 --- a/src/help.c +++ b/src/help.c @@ -57,19 +57,19 @@ const char *const statusstrings[]= { struct filenamenode *namenodetouse(struct filenamenode *namenode, struct pkginfo *pkg) { struct filenamenode *r; - + if (!namenode->divert) { r = namenode; return r; } - + debug(dbg_eachfile,"namenodetouse namenode=`%s' pkg=%s", namenode->name,pkg->name); - + r= (namenode->divert->useinstead && namenode->divert->pkg != pkg) ? namenode->divert->useinstead : namenode; - + debug(dbg_eachfile, "namenodetouse ... useinstead=%s camefrom=%s pkg=%s return %s", namenode->divert->useinstead ? namenode->divert->useinstead->name : "", @@ -93,7 +93,7 @@ void checkpath(void) { "ldconfig", #if WITH_START_STOP_DAEMON "start-stop-daemon", -#endif +#endif "update-rc.d", NULL }; @@ -209,7 +209,7 @@ preexecscript(struct command *cmd) return cmd->filename; assert(strlen(cmd->filename) >= instdirl); return cmd->filename + instdirl; -} +} void post_postinst_tasks(struct pkginfo *pkg, enum pkgstatus new_status) @@ -359,7 +359,7 @@ maintainer_script_new(struct pkginfo *pkg, struct stat stab; va_list args; char buf[100]; - + strcpy(cidirrest, scriptname); sprintf(buf, _("new %s script"), desc); @@ -503,7 +503,7 @@ isdirectoryinuse(struct filenamenode *file, struct pkginfo *pkg) { struct filepackages_iterator *iter; struct pkginfo *other_pkg; - + debug(dbg_veryverbose, "isdirectoryinuse `%s' (except %s)", file->name, pkg ? pkg->name : ""); @@ -523,7 +523,7 @@ isdirectoryinuse(struct filenamenode *file, struct pkginfo *pkg) void oldconffsetflags(const struct conffile *searchconff) { struct filenamenode *namenode; - + while (searchconff) { namenode= findnamenode(searchconff->name, 0); /* XXX */ namenode->flags |= fnnf_old_conff; diff --git a/src/main.c b/src/main.c index 99423b9ea..9df3e75cb 100644 --- a/src/main.c +++ b/src/main.c @@ -247,7 +247,7 @@ static void setdebug(const struct cmdinfo *cpi, const char *value) { m_output(stdout, _("")); exit(0); } - + f_debug= strtoul(value,&endp,8); if (value == endp || *endp) badusage(_("--debug requires an octal argument")); } @@ -489,7 +489,7 @@ static const struct cmdinfo cmdinfos[]= { /* ACTION( "command-fd", 'c', act_commandfd, commandfd ), */ - + { "pre-invoke", 0, 1, NULL, NULL, set_invoke_hook, 0, &pre_invoke_hooks_tail }, { "post-invoke", 0, 1, NULL, NULL, set_invoke_hook, 0, &post_invoke_hooks_tail }, { "path-exclude", 0, 1, NULL, NULL, setfilter, 0 }, @@ -662,7 +662,6 @@ void commandfd(const char *const *argv) { } } - int main(int argc, const char *const *argv) { void (*actionfunction)(const char *const *argv); diff --git a/src/main.h b/src/main.h index 38cc5386c..5a3558750 100644 --- a/src/main.h +++ b/src/main.h @@ -261,7 +261,7 @@ enum debugflags { dbg_triggersdetail = 020000, dbg_triggersstupid = 040000, }; - + void debug(int which, const char *fmt, ...) DPKG_ATTR_PRINTF(2); void log_action(const char *action, struct pkginfo *pkg); diff --git a/src/packages.c b/src/packages.c index 2a912ac9c..1bb5f8af3 100644 --- a/src/packages.c +++ b/src/packages.c @@ -155,7 +155,7 @@ void process_queue(void) { volatile enum action action_todo; jmp_buf ejbuf; enum istobes istobe= itb_normal; - + if (abort_processing) return; @@ -191,7 +191,7 @@ void process_queue(void) { rundown->pkg->clientdata->istobe= istobe; } } - + while (!pkg_queue_is_empty(&queue)) { pkg = pkg_queue_pop(&queue); if (!pkg) @@ -256,7 +256,7 @@ void process_queue(void) { pop_error_context(ehflag_normaltidy); } assert(!queue.length); -} +} /*** Dependency processing - common to --configure and --remove. ***/ @@ -316,7 +316,7 @@ static int deppossi_ok_found(struct pkginfo *possdependee, int *interestingwarnings, struct varbuf *oemsgs) { int thisf; - + if (ignore_depends(possdependee)) { debug(dbg_depcondetail," ignoring depended package so ok and found"); return 3; @@ -609,7 +609,7 @@ int dependencies_ok(struct pkginfo *pkg, struct pkginfo *removing, ok= 1; if (!anycannotfixbytrig && canfixbytrig) progress_bytrigproc = canfixbytrig; - + varbuf_destroy(&oemsgs); debug(dbg_depcon,"ok %d msgs >>%.*s<<", ok, (int)aemsgs->used, aemsgs->buf); return ok; diff --git a/src/processarc.c b/src/processarc.c index eb07b44d6..e5ec4aa6a 100644 --- a/src/processarc.c +++ b/src/processarc.c @@ -100,7 +100,7 @@ void process_archive(const char *filename) { static enum pkgstatus oldversionstatus; static struct varbuf infofnvb, fnvb, depprobwhy; static struct tarcontext tc; - + int c1, r, admindirlen, i, infodirlen, infodirbaseused; struct pkgiterator *it; struct pkginfo *pkg, *otherpkg, *divpkg; @@ -122,7 +122,7 @@ void process_archive(const char *filename) { struct stat stab, oldfs; struct pkg_deconf_list *deconpil, *deconpiltemp; struct rename_list *rename_head = NULL, *rename_node = NULL; - + cleanup_pkg_failed= cleanup_conflictor_failed= 0; admindirlen= strlen(admindir); @@ -167,7 +167,7 @@ void process_archive(const char *filename) { subproc_check(status, SPLITTER, 0); } } - + /* Verify the package. */ if (!f_nodebsig && (stat(DEBSIGVERIFY, &stab)==0)) { printf(_("Authenticating %s ...\n"), filename); @@ -192,7 +192,7 @@ void process_archive(const char *filename) { } } } - + if (f_noact) { if (!cidirbuf) @@ -219,7 +219,7 @@ void process_archive(const char *filename) { ensure_pathname_nonexisting(cidir); cidirrest[-1] = '/'; } - + push_cleanup(cu_cidir, ~0, NULL, 0, 2, (void *)cidir, (void *)cidirrest); c1 = subproc_fork(); if (!c1) { @@ -326,7 +326,7 @@ void process_archive(const char *filename) { if (psearch->up->type != dep_conflicts) continue; check_conflict(psearch->up, pkg, pfilename); } - + ensure_allinstfiles_available(); filesdbinit(); trig_file_interests_ensure(); @@ -377,7 +377,7 @@ void process_archive(const char *filename) { namenode= findnamenode(conffilenamebuf, 0); namenode->oldhash= NEWCONFFILEFLAG; newconff= newconff_append(&newconffileslastp, namenode); - + /* Let's see if any packages have this file. If they do we * check to see if they listed it as a conffile, and if they did * we copy the hash across. Since (for plain file conffiles, @@ -435,13 +435,13 @@ void process_archive(const char *filename) { for (i = 0 ; i < cflict_index ; i++) { oldconffsetflags(conflictor[i]->installed.conffiles); } - + oldversionstatus= pkg->status; assert(oldversionstatus <= stat_installed); debug(dbg_general,"process_archive oldversionstatus=%s", statusstrings[oldversionstatus]); - + if (oldversionstatus == stat_halfconfigured || oldversionstatus == stat_triggersawaited || oldversionstatus == stat_triggerspending || @@ -540,7 +540,7 @@ void process_archive(const char *filename) { NULL); printf(_("Unpacking replacement %.250s ...\n"),pkg->name); } - + /* * Now we unpack the archive, backing things up as we go. * For each file, we check to see if it already exists. @@ -579,7 +579,7 @@ void process_archive(const char *filename) { * B: ordinary backup * R: later remove from other packages' lists * -: do nothing - * + * * After we've done this we go through the remaining things in the * lists of packages we're trying to remove (including the old * version of the current package). This happens in reverse order, @@ -674,7 +674,7 @@ void process_archive(const char *filename) { * conflicting package's file list, which will have been updated to * remove any files in this package. */ push_checkpoint(~ehflag_bombout, ehflag_normaltidy); - + /* Now we delete all the files that were in the old version of * the package only, except (old or new) conffiles, which we leave * alone. */ @@ -802,7 +802,7 @@ void process_archive(const char *filename) { } continue; } - + if (sameas) continue; @@ -851,6 +851,7 @@ void process_archive(const char *filename) { continue; if (strlen(pkg->name) != (size_t)(p-de->d_name) || strncmp(de->d_name,pkg->name,p-de->d_name)) continue; + debug(dbg_stupidlyverbose, "process_archive info this pkg"); /* Right, do we have one? */ @@ -866,6 +867,7 @@ void process_archive(const char *filename) { varbufaddstr(&infofnvb,de->d_name); varbufaddc(&infofnvb,0); strcpy(cidirrest,p); + /* We keep files to rename in a list as doing the rename immediately * might influence the current readdir(), the just renamed file might * be returned a second time as it's actually a new file from the @@ -897,7 +899,7 @@ void process_archive(const char *filename) { free(rename_node->dst); free(rename_node); } - + /* The directory itself. */ *cidirrest = '\0'; dsd= opendir(cidir); @@ -1003,8 +1005,8 @@ void process_archive(const char *filename) { pkg->installed.architecture= pkg->available.architecture; pkg->installed.installedsize= pkg->available.installedsize; pkg->installed.version= pkg->available.version; - pkg->installed.origin = pkg->available.origin; - pkg->installed.bugs = pkg->available.bugs; + pkg->installed.origin = pkg->available.origin; + pkg->installed.bugs = pkg->available.bugs; /* We have to generate our own conffiles structure. */ pkg->installed.conffiles = NULL; @@ -1056,7 +1058,7 @@ void process_archive(const char *filename) { if (cfile) continue; /* So dependency things will give right answers ... */ - otherpkg->clientdata->istobe= itb_remove; + otherpkg->clientdata->istobe= itb_remove; debug(dbg_veryverbose, "process_archive disappear checking dependencies"); for (pdep= otherpkg->installed.depended; pdep; @@ -1104,7 +1106,7 @@ void process_archive(const char *filename) { trig_activate_packageprocessing(otherpkg); maintainer_script_installed(otherpkg, POSTRMFILE, "post-removal script (for disappearance)", - "disappear", pkg->name, + "disappear", pkg->name, versiondescribe(&pkg->available.version, vdew_nonambig), NULL); @@ -1118,7 +1120,7 @@ void process_archive(const char *filename) { push_cleanup(cu_closedir, ~0, NULL, 0, 1, (void *)dsd); debug(dbg_general, "process_archive disappear cleaning info directory"); - + while ((de = readdir(dsd)) != NULL) { debug(dbg_veryverbose, "process_archive info file `%s'", de->d_name); if (de->d_name[0] == '.') continue; @@ -1138,7 +1140,7 @@ void process_archive(const char *filename) { dir_sync(dsd, fnvb.buf); pop_cleanup(ehflag_normaltidy); /* closedir */ - + otherpkg->status= stat_notinstalled; otherpkg->want = want_unknown; otherpkg->eflag = eflag_ok; @@ -1152,7 +1154,7 @@ void process_archive(const char *filename) { } /* while (otherpkg= ... */ pkg_db_iter_free(it); - + /* Delete files from any other packages' lists. * We have to do this before we claim this package is in any * sane kind of state, as otherwise we might delete by mistake @@ -1175,7 +1177,7 @@ void process_archive(const char *filename) { debug(dbg_eachfile, "process_archive looking for overwriting `%s' (overridden by %s)", cfile->namenode->name, divpkg ? divpkg->name : ""); - } + } } else { divpkg = NULL; debug(dbg_eachfile, "process_archive looking for overwriting `%s'", @@ -1209,7 +1211,7 @@ void process_archive(const char *filename) { * it happens (we leave the reinstall required flag, of course). */ pkg->status= stat_unpacked; modstatdb_note(pkg); - + /* Now we delete all the backup files that we made when * extracting the archive - except for files listed as conffiles * in the new package. diff --git a/src/querycmd.c b/src/querycmd.c index eecd0566c..74bdabbe5 100644 --- a/src/querycmd.c +++ b/src/querycmd.c @@ -80,7 +80,7 @@ list1package(struct pkginfo *pkg, bool *head, struct pkg_array *array) static int nw,vw,dw; const char *pdesc; static char format[80] = ""; - + if (format[0] == '\0') { w=getwidth(); if (w == -1) { @@ -264,7 +264,7 @@ searchfiles(const char *const *argv) int failures = 0; struct varbuf path = VARBUF_INIT; static struct varbuf vb; - + if (!*argv) badusage(_("--search needs at least one file name pattern argument")); @@ -330,20 +330,19 @@ enqperpackage(const char *const *argv) struct pkginfo *pkg; struct filenamenode *namenode; int failures = 0; - + if (!*argv) badusage(_("--%s needs at least one package name argument"), cipaction->olong); if (cipaction->arg==act_listfiles) modstatdb_init(admindir,msdbrw_readonly|msdbrw_noavail); - else + else modstatdb_init(admindir,msdbrw_readonly); while ((thisarg = *argv++) != NULL) { pkg = pkg_db_find(thisarg); switch (cipaction->arg) { - case act_status: if (pkg->status == stat_notinstalled && pkg->priority == pri_unknown && @@ -357,7 +356,6 @@ enqperpackage(const char *const *argv) writerecord(stdout, _(""), pkg, &pkg->installed); } break; - case act_printavail: if (!pkg_is_informative(pkg, &pkg->available)) { fprintf(stderr,_("Package `%s' is not available.\n"),pkg->name); @@ -366,14 +364,12 @@ enqperpackage(const char *const *argv) writerecord(stdout, _(""), pkg, &pkg->available); } break; - case act_listfiles: switch (pkg->status) { - case stat_notinstalled: + case stat_notinstalled: fprintf(stderr,_("Package `%s' is not installed.\n"),pkg->name); failures++; break; - default: ensure_packagefiles_available(pkg); ensure_diversions(); @@ -402,7 +398,6 @@ enqperpackage(const char *const *argv) break; } break; - default: internerr("unknown action '%d'", cipaction->arg); } diff --git a/src/remove.c b/src/remove.c index 7f629b2c2..fedc78f0f 100644 --- a/src/remove.c +++ b/src/remove.c @@ -52,7 +52,7 @@ static void checkforremoval(struct pkginfo *pkgtoremove, struct deppossi *possi; struct pkginfo *depender; int before, ok; - + for (possi = pkgdepcheck->installed.depended; possi; possi = possi->rev_next) { if (possi->up->type != dep_depends && possi->up->type != dep_predepends) continue; depender= possi->up->up; @@ -82,7 +82,7 @@ void deferred_remove(struct pkginfo *pkg) { struct dependency *dep; debug(dbg_general,"deferred_remove package %s",pkg->name); - + if (pkg->status == stat_notinstalled) { warning(_("ignoring request to remove %.250s which isn't installed."), pkg->name); @@ -152,7 +152,7 @@ void deferred_remove(struct pkginfo *pkg) { } oldconffsetflags(pkg->installed.conffiles); - + printf(_("Removing %s ...\n"),pkg->name); log_action("remove", pkg); trig_activate_packageprocessing(pkg); @@ -184,7 +184,7 @@ static void push_leftover(struct fileinlist **leftoverp, } static void removal_bulk_remove_files( - struct pkginfo *pkg, + struct pkginfo *pkg, bool *out_foundpostrm) { int before; @@ -196,7 +196,7 @@ static void removal_bulk_remove_files( DIR *dsd; struct dirent *de; struct stat stab; - + pkg->status= stat_halfinstalled; modstatdb_note(pkg); push_checkpoint(~ehflag_bombout, ehflag_normaltidy); @@ -220,19 +220,19 @@ static void removal_bulk_remove_files( varbufaddstr(&fnvb,instdir); varbufaddstr(&fnvb, usenode->name); before= fnvb.used; - + varbufaddstr(&fnvb,DPKGTEMPEXT); varbufaddc(&fnvb,0); debug(dbg_eachfiledetail, "removal_bulk cleaning temp `%s'", fnvb.buf); - + ensure_pathname_nonexisting(fnvb.buf); - + varbuf_trunc(&fnvb, before); varbufaddstr(&fnvb,DPKGNEWEXT); varbufaddc(&fnvb,0); debug(dbg_eachfiledetail, "removal_bulk cleaning new `%s'", fnvb.buf); ensure_pathname_nonexisting(fnvb.buf); - + varbuf_trunc(&fnvb, before); varbufaddc(&fnvb,0); if (!stat(fnvb.buf,&stab) && S_ISDIR(stab.st_mode)) { @@ -306,7 +306,7 @@ static void removal_bulk_remove_files( dir_sync(dsd, fnvb.buf); pop_cleanup(ehflag_normaltidy); /* closedir */ - + pkg->status= stat_configfiles; pkg->installed.essential = false; modstatdb_note(pkg); @@ -403,7 +403,7 @@ static void removal_bulk_remove_configfiles(struct pkginfo *pkg) { * about which version it was ... */ blankversion(&pkg->configversion); modstatdb_note(pkg); - + /* Remove from our list any conffiles that aren't ours any more or * are involved in diversions, except if we are the package doing the * diverting. */ @@ -428,7 +428,7 @@ static void removal_bulk_remove_configfiles(struct pkginfo *pkg) { } } modstatdb_note(pkg); - + for (conff= pkg->installed.conffiles; conff; conff= conff->next) { static struct varbuf fnvb, removevb; if (conff->obsolete) { @@ -496,12 +496,11 @@ static void removal_bulk_remove_configfiles(struct pkginfo *pkg) { removevb.buf, conff->name); } pop_cleanup(ehflag_normaltidy); /* closedir */ - } - + pkg->installed.conffiles = NULL; modstatdb_note(pkg); - + maintainer_script_installed(pkg, POSTRMFILE, "post-removal", "purge", NULL); } @@ -535,7 +534,7 @@ void removal_bulk(struct pkginfo *pkg) { } debug(dbg_general, "removal_bulk purging? foundpostrm=%d",foundpostrm); - + if (!foundpostrm && !pkg->installed.conffiles) { /* If there are no config files and no postrm script then we * go straight into ‘purge’. */ @@ -560,12 +559,12 @@ void removal_bulk(struct pkginfo *pkg) { varbufaddstr(&fnvb, pkgadmindir()); varbufaddstr(&fnvb,pkg->name); pkgnameused= fnvb.used; - + varbufaddstr(&fnvb,"." LISTFILE); varbufaddc(&fnvb,0); debug(dbg_general, "removal_bulk purge done, removing list `%s'",fnvb.buf); if (unlink(fnvb.buf) && errno != ENOENT) ohshite(_("cannot remove old files list")); - + varbuf_trunc(&fnvb, pkgnameused); varbufaddstr(&fnvb,"." POSTRMFILE); varbufaddc(&fnvb,0); @@ -579,10 +578,9 @@ void removal_bulk(struct pkginfo *pkg) { * we won't go back because pkg->status is stat_notinstalled. */ pkg_perfile_blank(&pkg->installed); } - + pkg->eflag = eflag_ok; modstatdb_note(pkg); debug(dbg_general, "removal done"); } - diff --git a/src/select.c b/src/select.c index 51496a86b..0d2610dee 100644 --- a/src/select.c +++ b/src/select.c @@ -42,7 +42,7 @@ static void getsel1package(struct pkginfo *pkg) { if (pkg->want == want_unknown) return; l= strlen(pkg->name); l >>= 3; l= 6-l; if (l<1) l=1; printf("%s%.*s%s\n",pkg->name,l,"\t\t\t\t\t\t",wantinfos[pkg->want].name); -} +} void getselections(const char *const *argv) { struct pkg_array array; diff --git a/src/statcmd.c b/src/statcmd.c index 43a10988e..aed928fb3 100644 --- a/src/statcmd.c +++ b/src/statcmd.c @@ -397,4 +397,3 @@ main(int argc, const char *const *argv) return ret; } - diff --git a/src/statdb.c b/src/statdb.c index adeaef0ed..ff738756c 100644 --- a/src/statdb.c +++ b/src/statdb.c @@ -223,4 +223,3 @@ ensure_statoverrides(void) onerr_abort--; } - diff --git a/src/trigcmd.c b/src/trigcmd.c index 0366ec4d6..482d2e30f 100644 --- a/src/trigcmd.c +++ b/src/trigcmd.c @@ -237,4 +237,3 @@ main(int argc, const char *const *argv) return 0; } - diff --git a/src/trigproc.c b/src/trigproc.c index 568cdd1a7..bb69c7c20 100644 --- a/src/trigproc.c +++ b/src/trigproc.c @@ -419,4 +419,3 @@ trigproc_install_hooks(void) { trig_override_hooks(&trig_our_hooks); } - diff --git a/src/update.c b/src/update.c index 1cb354ce7..ffdce3dc4 100644 --- a/src/update.c +++ b/src/update.c @@ -50,7 +50,7 @@ void updateavailable(const char *const *argv) { default: internerr("unknown action '%d'", cipaction->arg); } - + if (!f_noact) { if (access(admindir,W_OK)) { if (errno != EACCES) @@ -60,7 +60,7 @@ void updateavailable(const char *const *argv) { } modstatdb_lock(admindir); } - + switch (cipaction->arg) { case act_avreplace: printf(_("Replacing available packages info, using %s.\n"),sourcefile); diff --git a/utils/start-stop-daemon.c b/utils/start-stop-daemon.c index 4c4b6c1e2..cc57a71f8 100644 --- a/utils/start-stop-daemon.c +++ b/utils/start-stop-daemon.c @@ -1662,4 +1662,3 @@ main(int argc, char **argv) execv(startas, argv); fatal("unable to start %s", startas); } - diff --git a/utils/t/100_update_alternatives.t b/utils/t/100_update_alternatives.t index 88ba04063..667bcd096 100644 --- a/utils/t/100_update_alternatives.t +++ b/utils/t/100_update_alternatives.t @@ -439,4 +439,3 @@ ok(-f $main_link, "removal keeps real file installed as master link"); ok(-f "$bindir/slave1", "removal keeps real files installed as slave links"); install_choice(0, params => ["--force"]); check_choice(0, "auto", "install --force replaces files with links"); - -- cgit v1.2.3