~ubuntu-branches/debian/wheezy/dpkg/wheezy

« back to all changes in this revision

Viewing changes to src/configure.c

  • Committer: Bazaar Package Importer
  • Author(s): Guillem Jover, Guillem Jover, Raphaël Hertzog, Jonathan Nieder, Steve Langasek, Mark Hymers, Updated programs translations, Updated man page translations, Updated scripts translations, Updated dselect translations
  • Date: 2011-04-01 23:56:54 UTC
  • Revision ID: james.westby@ubuntu.com-20110401235654-8y800dtb75skfrh7
Tags: 1.16.0
[ Guillem Jover ]
* Use DPKG_MAINTSCRIPT_PACKAGE environment variable as package name on
  dpkg-divert when no --package or --local options have been specified.
* Do not allow versions starting with non-digit when doing strict parsing,
  warn otherwise.
* Update dpkg(1) to note that --status-fd output does not contain newlines
  in error messages anymore (this was fixed in 1.15.0).
* Add a new --status-logger option to dpkg, similar to --status-fd but
  instead invoke the command ourselves and feed the status information
  to its standard input. Suggested by Raphaël Hertzog.
* Add missing space in update-alternative --set-selections output.
* Add missing options to update-alternative --help output.
* Count “conffile name is duplicated” for dpkg-deb warning count summary.
* Improve and clarify strings for translation. Closes: #604914
* Prefix all fatal error messages with “error: ”.
* Do not check presence of update-rc.d in the PATH in dpkg, as it's not
  a program needed for dpkg correct operation.
* Fix dpkg -GEO options on multiple versions of the same packages.
  Closes: #31141
* Propagate --admindir to programs run from maintainer scritpts.
  Closes: #97076
* Do not fail when trying to remove the root directory. This will only
  happen either on distributions where dpkg is a foreign package manager,
  or on artificial dpkg databases.
* Always warn when parsing any package control data which does not have
  an Architecture field except for status and status log files when
  packages are not-installed or half-installed.
* By default reject installing packages w/o an Architecture field. They
  now need --force-architecture, dpkg will still warn about them though.
* Fix build failure when passing --disable-nls to configure.
* Do not segfault on “dpkg -i --no-act”.
* Add missing semicolon to the vsnprintf() compat declaration.
  Thanks to Robert Millan. Closes: #612203
* On install for Ubuntu adjust the i386 GNU cpu name in cputable.
  Thanks to Colin Watson <cjwatson@ubuntu.com>. Closes: #611741
* Sync the info database directory on unpack instead of the temporary
  control information directory, and print the correct pathname on error
  instead of the last file acted on that directory.
* Document in dpkg-query --help output and man page that --list and --show
  arguments are optional.
* Do not read and write the available file unnecessarily.
  Thanks to Michel Lespinasse <walken@zoy.org>. Closes: #397121
* Fix typo in «dpkg-name --overwrite» argument parsing so that it actually
  works at all. Thanks to Ivan Gagis <igagis@gmail.com>. LP: #728708
* Add armhf support to ostable and triplettable. Closes: #594179
* Set the modification time for unpacked symlinks on supported systems.
* Fix undefined value useage in dpkg-genchanges when adding files w/o a
  matching architecture, because they are not present in debian/control,
  this is most commonly the case due to dpkg-distaddfile.
* Terminate immediately on dpkg-divert rename errors instead of propagating
  up the error codes, this improves error reporting and avoids triggering
  leak detectors. Closes: #620380
* When moving a diverted file across filesystems in dpkg-divert, remove
  the source file.

[ Raphaël Hertzog ]
* Fail properly when debian/source/format is empty. Closes: #600854
* Add new deb-src-control(5) manual page documenting the debian/control
  file contained in source packages.
  - it documents the X[SBC]- prefix. Closes: #476335
  - it documents the VCS-* fields too. Closes: #483119
  Thanks to Oxan van Leeuwen <oxan@oxanvanleeuwen.nl> who wrote it
  as part of the Google Code In program.
* Enhance dpkg-shlibdeps to not fail immediatly when a library is not found.
  Instead continue and fail after all problems have been reported. Thanks
  to Chris Baines <cbaines8@gmail.com> for the patch. Closes: #596841
* Fix dpkg-source to not list Debian packaging files as modified
  upstream files in Format "1.0" when unpacking to a non-standard
  directory.
* Apply patch from Colin Watson to let dpkg-buildflags return -O3
  instead of -O2 when building ppc64 packages on Ubuntu. Closes: #612472
* Add new function get_control_path() to Dpkg::Path, it wraps dpkg-query
  --control-path.
* Update dpkg-shlibdeps to be multiarch-ready:
  - use get_control_path() to find symbols/shlibs files
  - parse correctly the output of dpkg --search
* Small fix to support files >2GB in .deb on 64-bit systems. Closes: #616502
  Thanks to Martin Dorey <mdorey@bluearc.com> for the patch.
* dpkg-source now keeps the file ordering in the autogenerated patch when
  regenerating it. Closes: #606080
  Thanks to Colin Watson for the patch.
* dpkg-source now uses a timestamp retrieved from the filesystem when
  resetting the timestamp of patched files so that a time skew when using
  NFS doesn't introduce any inconsistency. Closes: #613023
  Thanks to Jonathan Nieder <jrnieder@gmail.com> for the patch and the
  diagnosis.
* dpkg-source will now remove quilt's .pc directory when --unapply-patches
  is in use. Closes: #591858
* dpkg-source is now a bit less strict when parsing patches:
  - it accepts seeing the same file twice; Closes: #608829
  - it doesn't match on the English text "No newline at end of file" as it
    might be translated in some cases. Closes: #612465
* Improve parser in Dpkg::Control::Hash to not require an empty line
  before the PGP signature. Closes: #617923
  Thanks to Roger Leigh for the initial patch.
* Fix a regression in dpkg-divert where using --rename led to a failure when
  the rename implies crossing file systems. Thanks to Durk Strooisma for
  spotting it.
* Use the correct mtime when installing a file with statoverrides.
  Regression introduced in 1.16.0. LP: #739179
* Remove duplicate word in german translation of dpkg(1). Closes: #616096
* Strip repeated non-significant spaces before and after newlines
  in Uploaders. Closes: #598922
* Ignore whitespaces after options in headers of changelog entries.
  Closes: #605719
* Fix dpkg-source's regression with empty patches (introduced while fixing
  #613023). Closes: #619541

[ Jonathan Nieder ]
* Remove support for use of synchronous sync(2), due to its pernicious
  side-effects and to ease maintenance.
* Clarify that an up-to-date dpkg only needs to be unpacked for
  dpkg-maintscript-helper to work.

[ Steve Langasek ]
* Add new variables to dpkg-architecture, DEB_HOST_MULTIARCH and
  DEB_BUILD_MULTIARCH, that return the "ideal" GNU triplet for each
  architecture which should be used as the path component for library
  installation.

[ Mark Hymers ]
* Add support for Built-Using field. Closes: #619311

[ Updated programs translations ]
* German (Sven Joachim).
* Portuguese (Miguel Figueiredo).
* Spanish (Javier Fernandez-Sanguino).
* Swedish (Peter Krefting).

[ Updated man page translations ]
* German (Helge Kreutzmann).
* Swedish (Peter Krefting).

[ Updated scripts translations ]
* German (Helge Kreutzmann).
* Swedish (Peter Krefting).

[ Updated dselect translations ]
* Spanish (Javier Fernandez-Sanguino).

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
#include <dpkg/buffer.h>
46
46
#include <dpkg/file.h>
47
47
#include <dpkg/subproc.h>
 
48
#include <dpkg/command.h>
48
49
#include <dpkg/triglib.h>
49
50
 
50
51
#include "filesdb.h"
85
86
        }
86
87
        md5hash(pkg, currenthash, cdr.buf);
87
88
 
88
 
        varbufreset(&cdr2);
89
 
        varbufaddstr(&cdr2, cdr.buf);
90
 
        varbufaddc(&cdr2, 0);
 
89
        varbuf_reset(&cdr2);
 
90
        varbuf_add_str(&cdr2, cdr.buf);
 
91
        varbuf_end_str(&cdr2);
91
92
        /* XXX: Make sure there's enough room for extensions. */
92
93
        varbuf_grow(&cdr2, 50);
93
94
        cdr2rest = cdr2.buf + strlen(cdr.buf);
164
165
                if (unlink(cdr2.buf) && errno != ENOENT)
165
166
                        warning(_("%s: failed to remove old backup '%.250s': %s"),
166
167
                                pkg->name, cdr2.buf, strerror(errno));
167
 
                cdr.used--;
168
 
                varbufaddstr(&cdr, DPKGDISTEXT);
169
 
                varbufaddc(&cdr, 0);
 
168
 
 
169
                varbuf_add_str(&cdr, DPKGDISTEXT);
 
170
                varbuf_end_str(&cdr);
170
171
                strcpy(cdr2rest, DPKGNEWEXT);
171
172
                trig_file_activate(usenode, pkg);
172
173
                if (rename(cdr2.buf, cdr.buf))
275
276
 
276
277
        trigproc_reset_cycle();
277
278
 
278
 
        /* At this point removal from the queue is confirmed. This
 
279
        /*
 
280
         * At this point removal from the queue is confirmed. This
279
281
         * represents irreversible progress wrt trigger cycles. Only
280
282
         * packages in stat_unpacked are automatically added to the
281
283
         * configuration queue, and during configuration and trigger
282
 
         * processing new packages can't enter into unpacked. */
 
284
         * processing new packages can't enter into unpacked.
 
285
         */
283
286
 
284
287
        ok = breakses_ok(pkg, &aemsgs) ? ok : 0;
285
288
        if (ok == 0) {
286
289
                sincenothing = 0;
287
 
                varbufaddc(&aemsgs, 0);
 
290
                varbuf_end_str(&aemsgs);
288
291
                fprintf(stderr,
289
292
                        _("dpkg: dependency problems prevent configuration of %s:\n%s"),
290
293
                        pkg->name, aemsgs.buf);
291
294
                varbuf_destroy(&aemsgs);
292
295
                ohshit(_("dependency problems - leaving unconfigured"));
293
296
        } else if (aemsgs.used) {
294
 
                varbufaddc(&aemsgs, 0);
 
297
                varbuf_end_str(&aemsgs);
295
298
                fprintf(stderr,
296
299
                        _("dpkg: %s: dependency problems, but configuring anyway as you requested:\n%s"),
297
300
                        pkg->name, aemsgs.buf);
373
376
        int r;
374
377
        int loopprotect;
375
378
 
376
 
        varbufreset(result);
377
 
        varbufaddstr(result, instdir);
 
379
        varbuf_reset(result);
 
380
        varbuf_add_str(result, instdir);
378
381
        if (*in != '/')
379
 
                varbufaddc(result, '/');
380
 
        varbufaddstr(result, in);
381
 
        varbufaddc(result, 0);
 
382
                varbuf_add_char(result, '/');
 
383
        varbuf_add_str(result, in);
 
384
        varbuf_end_str(result);
382
385
 
383
386
        loopprotect = 0;
384
387
 
405
408
                                return -1;
406
409
                        }
407
410
 
408
 
                        varbufreset(&target);
 
411
                        varbuf_reset(&target);
409
412
                        varbuf_grow(&target, stab.st_size + 1);
410
413
                        r = readlink(result->buf, target.buf, target.size);
411
414
                        if (r < 0) {
416
419
                        }
417
420
                        assert(r == stab.st_size); /* XXX: debug */
418
421
                        varbuf_trunc(&target, r);
419
 
                        varbufaddc(&target, '\0');
 
422
                        varbuf_end_str(&target);
420
423
 
421
424
                        debug(dbg_conffdetail,
422
425
                              "conffderef readlink gave %d, '%s'",
423
426
                              r, target.buf);
424
427
 
425
428
                        if (target.buf[0] == '/') {
426
 
                                varbufreset(result);
427
 
                                varbufaddstr(result, instdir);
 
429
                                varbuf_reset(result);
 
430
                                varbuf_add_str(result, instdir);
428
431
                                debug(dbg_conffdetail,
429
432
                                      "conffderef readlink absolute");
430
433
                        } else {
431
 
                                for (r = result->used - 2; r > 0 && result->buf[r] != '/'; r--)
 
434
                                for (r = result->used - 1; r > 0 && result->buf[r] != '/'; r--)
432
435
                                        ;
433
436
                                if (r < 0) {
434
437
                                        warning(_("%s: conffile '%.250s' resolves to degenerate filename\n"
444
447
                                      "conffderef readlink relative to '%.*s'",
445
448
                                      (int)result->used, result->buf);
446
449
                        }
447
 
                        varbufaddbuf(result, target.buf, target.used);
448
 
                        varbufaddc(result, 0);
 
450
                        varbuf_add_buf(result, target.buf, target.used);
 
451
                        varbuf_end_str(result);
449
452
                } else {
450
453
                        warning(_("%s: conffile '%.250s' is not a plain file or symlink (= '%s')"),
451
454
                                pkg->name, in, result->buf);
500
503
        if (!pid) {
501
504
                /* Child process. */
502
505
                const char *pager;
503
 
                const char *shell;
504
 
                char cmdbuf[1024];      /* command to run */
 
506
                char cmdbuf[1024];
505
507
 
506
 
                pager = getenv(PAGERENV);
 
508
                pager = getenv("PAGER");
507
509
                if (!pager || !*pager)
508
510
                        pager = DEFAULTPAGER;
509
511
 
510
512
                sprintf(cmdbuf, DIFF " -Nu %.250s %.250s | %.250s",
511
513
                        old, new, pager);
512
514
 
513
 
                shell = getenv(SHELLENV);
514
 
                if (!shell || !*shell)
515
 
                        shell = DEFAULTSHELL;
516
 
 
517
 
                execlp(shell, shell, "-c", cmdbuf, NULL);
518
 
                ohshite(_("failed to run %s (%.250s)"), DIFF, cmdbuf);
 
515
                command_shell(cmdbuf, _("conffile difference visualizer"));
519
516
        }
520
517
 
521
518
        /* Parent process. */
522
 
        subproc_wait(pid, "shell");
 
519
        subproc_wait(pid, _("conffile difference visualizer"));
523
520
}
524
521
 
525
522
/**
540
537
 
541
538
        pid = subproc_fork();
542
539
        if (!pid) {
543
 
                /* Child process */
544
 
                const char *shell;
545
 
 
546
 
                shell = getenv(SHELLENV);
547
 
                if (!shell || !*shell)
548
 
                        shell = DEFAULTSHELL;
549
 
 
550
540
                /* Set useful variables for the user. */
551
541
                setenv("DPKG_SHELL_REASON", "conffile-prompt", 1);
552
542
                setenv("DPKG_CONFFILE_OLD", confold, 1);
553
543
                setenv("DPKG_CONFFILE_NEW", confnew, 1);
554
544
 
555
 
                execlp(shell, shell, "-i", NULL);
556
 
                ohshite(_("failed to exec shell (%.250s)"), shell);
 
545
                command_shell(NULL, _("conffile shell"));
557
546
        }
558
547
 
559
548
        /* Parent process. */
560
 
        subproc_wait(pid, "shell");
 
549
        subproc_wait(pid, _("conffile shell"));
561
550
}
562
551
 
563
552
/**