summaryrefslogtreecommitdiff
path: root/utils
AgeCommit message (Collapse)AuthorFilesLines
2013-10-16u-a: Add new function to return a descriptive alternative status stringGuillem Jover1-6/+11
2013-10-16u-a: When changing slave links do not warn that the link group is brokenGuillem Jover1-17/+50
When new slave links are added or the targets for existing ones are changed, we should not give bogus and confusing warnings as if the link group was broken on disk and needs to be updated. Instead detect these cases and give an informative message noting that the link group needs to be updated due to the slave links changes. But still warn in case any of the slaves is not being updated and is trully broken.
2013-10-16u-a: Refactor alternative_copy_slave() out from alternative_evolve()Guillem Jover1-1/+7
The new function adds a struct slave to a struct alternative, taking care of allocating the slave strings as copies.
2013-10-15u-a: Refactor alternative_has_broken_slave() out from alternative_is_broken()Guillem Jover1-37/+47
2013-10-15u-a: Refactor alternative_evolve_slave() out of alternative_evolve()Guillem Jover1-41/+45
2013-10-15s-s-d: Recognize -C as documentedGuillem Jover1-1/+1
Closes: #719746 Spotted-by: "Brian S. Julin" <bri@abrij.org>
2013-10-14Use <termios.h> instead of deprecated <sys/termios.h>Guillem Jover1-1/+1
2013-08-10u-a: Fix use after free in alternative_parse_fileset()Guillem Jover1-3/+1
Reported-by: Pedro Ribeiro <pedrib@gmail.com>
2013-07-28s-s-d: Remove space between function name and '('Guillem Jover1-2/+2
2013-07-24Merge git://git.debian.org/git/dpkg/dpkgIgor Pashev6-490/+443
Conflicts: debian/changelog dpkg-deb/main.c scripts/Dpkg/Shlibs/SymbolFile.pm
2013-07-08Switch usage errors to not print entire --help outputGuillem Jover1-1/+3
Just print a reference to use --help for further details. Which stops annoying experienced users, or users that made a typo on the command-line, by not overwhelming them with screenfuls of help output. Closes: #681371
2013-05-31Remove install-info wrapperGuillem Jover3-82/+0
The dpkg implementation was replaced by the GNU texinfo implementation some time ago, through a wrapper used to ease the transition. Now long complete, it's time to clean up.
2013-05-08perl: Use the .. operator instead of C-style for loopsGuillem Jover1-2/+2
Fixes ControlStructures::ProhibitCStyleForLoops. Warned-by: perlcritic
2013-05-04Do not use double-quotes on strings that do not need interpolationGuillem Jover1-141/+141
Using double-quotes imposes a small performance penalty as the perl parser needs to check if any interpolation is needed. Use double-quotes only when the string contains single-quotes. Ideally we'd use double-quotes too for escaped meta-characters that might otherwise be confusing to immediately see if they need interpolation or not, but the policy does not (currently) allow to ignore these. Fixes ValuesAndExpressions::ProhibitInterpolationOfLiterals. Warned-by: perlcritic
2013-04-30Do not quote simple identifier hash keys in element accessesGuillem Jover1-17/+17
Addresses ValuesAndExpressions::ProhibitInterpolationOfLiterals. Warned-by: perlcritic
2013-04-30Do not quote simple identifier hash keys in initializationsGuillem Jover1-6/+6
Do not quote the keys for any hash which will always use simple identifiers, as that is taken care of by the => operator. So this does not apply to overload pragmas, version operators, field names, substvars, command line options or filenames. Addresses ValuesAndExpressions::ProhibitInterpolationOfLiterals. Warned-by: perlcritic
2013-04-29scripts: Do not use sort directly on the return keywordGuillem Jover1-1/+3
Fixes Subroutines::ProhibitReturnSort. Warned-by: perlcritic
2013-04-28Use proper variables instead of barewords for filehandlesGuillem Jover1-3/+3
Fixes InputOutput::ProhibitBarewordFileHandles. Warned-by: perlcritic
2013-04-19test: Add a correct shebang to all test scriptsGuillem Jover1-0/+1
This marks all these files as script files, so that tools like perlcritic do not misrecognize them as modules.
2013-04-19build: Set a default TEST_VERBOSE to 0Guillem Jover1-1/+0
2013-04-19Remove Emacs and vim modelinesGuillem Jover1-1/+0
These just clutter the code base, as adding modelines for each possible editor out there does not scale, and they are currently not exhaustive anyway.
2013-03-19u-a: Mark struct altdb_context bad_format() member as not returningGuillem Jover1-2/+2
2013-03-19u-a: Use the current alternative link as the first best valueGuillem Jover1-1/+11
This makes sure that if there are several alternatives with the same priority, the current one will always be preferred, regardless of how they sort alphabetically. Closes: #699807
2013-03-19u-a: Move alternative_get_best() after alternative_get_current()Guillem Jover1-12/+12
We'll make alternative_get_current() use alternative_get_best(), so to avoid a forward declaration let's move it afterwards.
2013-03-19u-a: Cache current alternativeGuillem Jover1-21/+35
This will allow to call alternative_get_current() multiple times w/o needing to perform useless work. It also gets rid of some annoying resource handling.
2013-03-19u-a: Change spawn to get a correct argv0Guillem Jover1-13/+4
This turns spawn() into a simpler wrapper around execvp(), and gets rid of the code needed to generate the new argv.
2013-03-19u-a: Remove explicit size from array initializerGuillem Jover1-1/+1
2013-03-19u-a: Use alternative_get_fileset() instead of open-coding itGuillem Jover1-12/+9
2013-03-19s-s-d: Move setsid() alternative code into a replacement setsid() functionGuillem Jover1-5/+9
2013-03-19s-s-d: Refactor option setup off main() into new setup_options() functionGuillem Jover1-57/+65
2013-03-19s-s-d: Refactor start action off main() into a new do_start() functionGuillem Jover1-107/+120
2013-03-19s-s-d: Group macro definitions after header inclusionsGuillem Jover1-7/+7
2013-03-18u-a: Switch back to a fatal error on out of range priority on --installGuillem Jover1-7/+2
This reverts 18d9373b27effd533d386fdf7bfde6e6b3782101.
2013-02-17Merge git://anonscm.debian.org/dpkg/dpkgIgor Pashev2-18/+23
Conflicts: debian/changelog
2012-09-27u-a: Fix segfault when using --slave without any actionGuillem Jover1-1/+2
The case of --slave with a non-install action was already handled, but not the case of missing action. LP: #1037431
2012-09-27u-a: Do not leak subcall command argumentsGuillem Jover1-0/+1
2012-09-27build: Fix u-a test suite to behave correctly on non-Debian binary pathsGuillem Jover1-17/+20
The test suite got fixed to not hardcode binary paths, so that it can work on other systems than Debian, where those binaries might be located in a different place. Dynamically generate the expected database file to match the file system layout. Known to be affecting Gentoo and Mac OS X.
2012-07-06Merge git://git.debian.org/git/dpkg/dpkgIgor Pashev3-366/+491
Conflicts: debian/changelog
2012-06-30Avoid full stop and double newline at the end of errors and warningsJonathan Nieder1-31/+31
Error messages like "couldn't parse control information from foo.deb" are not full sentences, so don't punctuate them like one. The main purpose of this patch is stylistic consistency, but perhaps it can also make copy-and-paste from messages like dpkg-query: no path found matching pattern /usr/bin/agrep. a little easier. Most actual full sentences should remain untouched. A few full sentences are error messages at heart, so this patch converts those to lower-case sentence fragment form, too. [guillem@debian.org: - Add missed strings. - Minor tweaks to strings. ] Closes: #624000 Requested-by: Jari Aalto <jari.aalto@cante.net> Signed-off-by: Guillem Jover <guillem@debian.org>
2012-06-30u-a: Print master and slave link namesGuillem Jover1-3/+9
Change --query output to print the master and slave link names. This implies switching the Link field to print the alternative link instead of the alternative name which was passed already as an argument. Add a new Name field to print the alternative name. Although, strictly speaking, this is an interface change, the previous Link field value was wrong and not really useful, because it's already known by the caller. A check of the whole archive does not reveal any user of that field, so it seems pretty safe to do this change. This also modifies the --config output when thre's a single alternative to print the alternative link. Closes: #679010
2012-06-30s-s-d: Add new --no-close option to disable closing fds on --backgroundGuillem Jover1-7/+16
This enabled the caller to see process messages for debugging purposes, or to be able to redirect file descriptors to log files, syslog or similar. Closes: #627333, #646425
2012-06-17u-a: Only warn for now on out of range priorities on --installGuillem Jover1-2/+7
There seems to be packages using priorities > INT_MAX, which although bogus as they were previously overflowing the int used to store them, that would cause installation failures when upgrading from squeeze. Turn this into a warning for now and clamp the values, which will be switched back to an error after wheezy, in dpkg 1.17.x. Closes: #676874
2012-06-06u-a: Remove unreachable code at the end of alternative_select_choice()Guillem Jover1-2/+0
The function contains an infinite loop that does not break out.
2012-06-06s-s-d: Do not follow symlinks when creating pidfilesCarsten Hey1-1/+7
[guillem@debian.org: - Change mode to 0666. ] Closes: #675918 Signed-off-by: Guillem Jover <guillem@debian.org>
2012-05-23s-s-d: Refactor parse_umask() and parse_integer() into parse_unsigned()Guillem Jover1-21/+7
The only fundamental difference between these two functions is the base, one being decimal and the other being zero. Change the code to call parse_unsigned() with an explicit base.
2012-05-23Check parsed integers for out of range errorsGuillem Jover2-8/+26
Verify that the numbers are not out of the range; i.e. that no negative values are allowed if not appropriate, and that no overflows occur. Closes: #580038
2012-05-23Check parsed integers for invalid or no digit errorsGuillem Jover2-4/+6
Verify that the string is not empty or does not contain trailing junk.
2012-05-23u-a: Rename and unify variable names for priority parsing codeGuillem Jover1-13/+16
2012-05-04build: Use MKDIR_P instead of obsolete mkdir_pGuillem Jover1-2/+2
Autoconf provides an AC_PROG_MKDIR_P macro defining MKDIR_P which is called by AM_INIT_AUTOMAKE; the obsolete mkdir_p, currently aliased to MKDIR_P will disappear with automake 1.13.
2012-05-04s-s-d: Refactor pidfile writing into a new write_pidfile() functionGuillem Jover1-10/+17