summaryrefslogtreecommitdiff
path: root/scripts
Commit message (Collapse)AuthorAge
* scripts: avoid dumping usage on parser failDave Reisner2012-04-24
| | | | | Avoid letting the error message from parseopts get lost in the usage output from pacman-key and makepkg (which is already verbose).
* pacman-key: adopt parseopts for option parsingDave Reisner2012-04-24
| | | | | | | | | | | | | | | | | | | | | This requires an ugly amount of reworking of how pacman-key handles options. The change simply to avoid passing keys, files, and directories as arguments to options, but to leave them as arguments to the overall program. This is reasonable since pacman-key limits the user to essentially one operation per invocation (like pacman). Since we now pass around the positional parameters to the various operations, we can add some better sanity checking. Each operation is responsible for testing input and making sure it can operate properly, otherwise it throws an error and exits. The doc is updated to reflect this, and uses similar verbiage as pacman, describing the non-option arguments now passed to pacman-key as targets. Similar to the doc, --help is reorganized to separate operations and options and remove argument tokens from operations. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* makepkg: allow specifying --pkg multiple timesDave Reisner2012-04-24
| | | | | | | | Make this option additive, so that the following two operations are equivalent: makepkg --pkg foo --pkg bar makepkg --pkg foo,bar
* makepkg: adopt parseopts for option parsingDave Reisner2012-04-24
| | | | Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* scripts/library: introduce parseoptsDave Reisner2012-04-24
| | | | | | | | | | | | | | | | | | This will replace our current options parser used in pacman-key, makepkg, and ideally elsewhere. It follows heuristics closer to that of GNU getopt long (and thus pacman itself), with the exception that it does not allow for options with optional arguments. Due to the way this parser will be used, this sort of functionality will not be needed. Instead of relying on eval+set, options are normalized into an array, OPTRET, which callers should expect to be populated after returning from parseopts. This avoids problems with quotes and spaces in arguments, assuming that the user quotes properly when passing into the application. A new test harness for parseopts is added in test/scripts. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* makepkg: save and restore shopts when sourcing /etc/profileAllan McRae2012-04-08
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* makepkg: complain when the buildfile isn't writeableDave Reisner2012-04-08
| | | | | | | | If the PKGBUILD isn't writeable for devel_update, throw a warning instead of silently ignoring it. Some logical reordering is present in this patch to reduce the number of nested if's. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* makepkg: catch errors sourcing filesDave Reisner2012-04-08
| | | | | | | create source_safe() function which temporarily disables extglob and exits on error. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* makepkg: restrict usage of errexit to user functionsDave Reisner2012-04-08
| | | | | | | | | | | | It's expected that this will lead to unwanted behavior, and needs widespread testing. It's desirable to commit this for a few reasons: - there's no reason we can't do our own error checking for code that we write. - it avoids the need for ||true hacks scattered about in the code. - it makes us immune to upstream changes in exit codes (FS#28248) Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* Merge branch 'maint'Dan McGee2012-04-08
|\
| * pacman-key: avoid use of tempfile in verify_sigDave Reisner2012-04-08
| | | | | | | | | | | | | | Use --status-fd rather than --status-file to keep this contained in a pipeline. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
| * pacman-key: verify TRUST_ULTIMATE keys as goodDave Reisner2012-04-08
| | | | | | | | | | | | | | | | Extend our grep pattern to match TRUST_ULTIMATE, not just TRUST_FULLY, as these keys are to be trusted as well. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | makepkg: treat lib{provides,depends} returns as proper arraysDave Reisner2012-04-08
| | | | | | | | | | | | | | | | Make these functions more whitespace space by treating newlines as the element delimiter rather than every form of whitespace. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | makepkg: use proper array addition in libdepsDave Reisner2012-04-08
| | | | | | | | | | Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | makepkg: add missing newline from libprovides outputDave Reisner2012-04-08
| | | | | | | | | | | | | | | | | | | | | | | | | | This was a small oversight from 1917c845 which causes makepkg to write provides entries to the .PKGINFO file improperly, e.g. provides = systemdlibsystemdudev=999 Add a newline in the printf format to ensure that these are spaced appropriately. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | repo-remove: remove deltas file if it becomes emptyFlorian Pritz2012-04-07
| | | | | | | | | | Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Dan McGee <dan@archlinux.org>
* | makepkg: safely change directoriesAllan McRae2012-04-07
| | | | | | | | | | | | | | | | | | In preparation for the removal of the global error trap we need a way to ensure changing directories succeeds. Add a "cd_safe" wrapper that performs the necessary check. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | makepkg: use printf rather than echo to output variableAllan McRae2012-04-07
| | | | | | | | | | | | | | Also make sure the strings passed to %s in printf are always quoted. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | makepkg: the rhs in string comparisons should be quotedAllan McRae2012-04-07
| | | | | | | | | | Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | makepkg: devel_check(): cleanup for hg versionMatthew Monaco2012-04-07
| | | | | | | | Use pushd/popd, quote args, handle some more errors
* | makepkg: devel_check(): set newpkgver (cleanup)Matthew Monaco2012-04-07
| | | | | | | | | | The case structure allows the syntax to focus on what's actually being done here.
* | makepkg: devel_check(): consolidate common codeMatthew Monaco2012-04-07
| |
* | makepkg: devel_check(): determine vcsMatthew Monaco2012-04-07
| | | | | | | | | | Rather than prioritizing an arbitrary VCS, collect all development directives. If there is more than one, give a warning and abort.
* | makepkg: remove unused variableMatthew Monaco2012-04-07
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2012-04-07
|\| | | | | | | | | | | Conflicts: lib/libalpm/signing.c lib/libalpm/sync.c
| * Revert "parseopts: normalize options into an array"Dave Reisner2012-04-07
| | | | | | | | | | | | | | | | | | | | | | | | This was really only half a fix for FS#28445, as it still doesn't correctly handle the case of filenames with spaces. In the short term, there is no obvious fix for this. In the long term, I believe the correct decision is to rewrite the options parser to be more in line with GNU getopt_long. This reverts commits: ca4142714137b16feabac09c4cda86b0a75036f8. 969dcddbdf9d5dbd91aa414cdd193f3fb26b644b.
| * pkgdelta: exit 1 upon errorFlorian Pritz2012-04-07
| | | | | | | | | | | | | | | | This has been 0 since 9fa18d9a4b4ce5217842c71d8a45676e3fb9d3f4, but it doesn't makes sense because we are raising an error. Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Dan McGee <dan@archlinux.org>
| * pacman-key: Actually verify signatures and exit with correct codesPierre Schmitz2012-04-07
| | | | | | | | | | | | | | | | | | | | | | We cannot rely on gpg's exit code. Instead we have to check the status-fd to figure out whether a signature is valid or not. In addition to this pacman-key --verify can now be used in scripts as it will return an exit code of 1 if the signature is invalid. Signed-off-by: Pierre Schmitz <pierre@archlinux.de> Signed-off-by: Dan McGee <dan@archlinux.org>
| * pkgdelta: use bsdtar -q optionDan McGee2012-04-07
| | | | | | | | | | | | | | | | | | This matches the optimization made to repo-add in commit 8bbaf045b9ce way back in 2009. We don't need to read the whole package file to ensure multiple .PKGINFO entries don't exist, as well-formed packages should have this file first in the archive. Signed-off-by: Dan McGee <dan@archlinux.org>
| * parse_options: initialize unused_options as arrayDave Reisner2012-04-07
| | | | | | | | | | | | | | | | | | | | | | Since we treat this as an array, we need to initialize it as one. This avoids addition of an empty element to the option string when we set the option array from the calling program, e.g. +/usr/bin/makepkg[2033]: set -- -i --pkg vim -- '' Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
| * Updates from TransifexDan McGee2012-04-07
| | | | | | | | | | | | | | This encompasses a few languages that have had changes since 4.0.2 available on Transifex. Signed-off-by: Dan McGee <dan@archlinux.org>
| * pacman-key: change to more reliable default keyserverAllan McRae2012-03-29
| | | | | | | | | | | | | | | | User reports indicate that the SKS keyservers are more reliable than both the gnupg.net and mit.edu ones. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
| * pacman-key: make the -e option work as advertisedAllan McRae2012-03-29
| | | | | | | | | | | | | | | | Using -e without arguments failed to export all keys. Using --export worked as expected. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
| * Update all translation filesDan McGee2012-03-28
| | | | | | | | | | | | | | Pull updates from transifex, run update-po on all files, fix a few errors, and push them back to Transifex. Signed-off-by: Dan McGee <dan@archlinux.org>
| * makepkg: avoid reporting bogus install size on btrfsDave Reisner2012-03-28
| | | | | | | | | | | | | | | | | | | | | | | | delayed allocation hoses us here and causes erroenous install sizes to be reported. Add a short sleep to allow the transaction to be committed to the filesystem and the stat buffers to be updated. This is apparently a "feature", as per to some of the denizens of #btrfs on freenode. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Revert "makepkg: calculate exact total file size"Dan McGee2012-04-07
| | | | | | | | | | | | This reverts commit b264fb9e9ddcc31dc8782390309421965e507383. With our "fix" of sleeping for BTRFS, we can go back to using `du` to calculate total installed size.
* | Merge branch 'maint'Dan McGee2012-03-16
|\| | | | | | | | | Conflicts: lib/libalpm/sync.c
| * makepkg: quote removed filename as it can have spacesAllan McRae2012-03-16
| | | | | | | | | | Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | makepkg: abort when failing to create BUILDDIRAllan McRae2012-03-16
| | | | | | | | | | Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | makepkg: prevent issues with files starting with a hyphenAllan McRae2012-03-16
| | | | | | | | | | | | | | | | | | Most places in makepkg deal with full file paths, but a few use the file name only. Protect from potential issues when a file name starts with a hyphen. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | makepkg: append pkgbase to BUILDDIR if specifiedAllan McRae2012-03-16
| | | | | | | | | | | | | | | | | | This means multiple packages can be build using the same BUILDDIR without their source files all ending up extracted in the same directory. Fixes FS#28417. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2012-03-08
|\| | | | | | | | | Conflicts: lib/libalpm/be_package.c
| * makepkg: exit via default signal handler in trap_exitDave Reisner2012-03-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Similar to how we manage receipt of SIGINT in pacman's internal downloader, catch the signal and invoke our own trap handler before unsetting it and calling the default. This requires a slight modification to the arguments passed to trap_exit so we can pass the raised signal to trap_exit (note that we substitue USR1 for ERR since the latter is unique to bash). Fixes FS#28491. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
| * pacman-key: Remove useless signature verification in --populate commandPierre Schmitz2012-03-05
| | | | | | | | | | | | | | | | Verifing the keyring at this point is useless as a malicious package is already installed and as such has several options to bypass this check anyway. Signed-off-by: Pierre Schmitz <pierre@archlinux.de> Signed-off-by: Dan McGee <dan@archlinux.org>
| * Translation updates from TransifexDan McGee2012-03-05
| | | | | | | | | | | | | | | | * it updates to all translations * minor fr, pt_BR, de, lt, sk and uk updates * add new strings in pacman translation catalog Signed-off-by: Dan McGee <dan@archlinux.org>
| * Do not dereference symlinks when calculating sizeAllan McRae2012-03-05
| | | | | | | | | | | | | | | | | | | | Passing the "-L" flag to stat means we get the size of the file being pointed to for symlinks instead of the size of the symlink. Keep "-L" usage in repo-add as we want the actual size of the package/delta/signature there. Signed-off-by: Allan McRae <allan@archlinux.org>
| * makepkg: fix false error with multiple libdepsFlorian Pritz2012-03-05
| | | | | | | | | | | | | | | | | | With multiple items in $libdepends this check only worked for the first one, everything after this returned an error. This was probably an issue with \s being treated wrong. Fix-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Florian Pritz <bluewind@xinu.at>
| * makepkg: fix extraction of soname in find_libdependsFlorian Pritz2012-03-05
| | | | | | | | | | | | | | | | | | libperl.so results in soname="libperl.so.so" which is wrong. This returns the correct string: "libperl.so" Fix-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Florian Pritz <bluewind@xinu.at>
* | makepkg: use array instead of stringDave Reisner2012-03-08
| | | | | | | | Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* | makepkg: avoid use of eval in run_pacmanDave Reisner2012-03-08
| | | | | | | | Signed-off-by: Dave Reisner <dreisner@archlinux.org>