summaryrefslogtreecommitdiff
path: root/scripts
Commit message (Collapse)AuthorAge
* Use automake verbose helpers in custom make rulesDan McGee2011-12-08
| | | | | | | | | | | | | | | | | | This converts our script generation to use the built-in AM_V_GEN macro, which honors the V= setting passed to make and allows one to see the full command if they truly desire. The AM_V_at macro is also used in place of an explicit @ so verbose-mode compiles show all commands being run. We can also use these two macros in doc generation to quiet it down to the level we expect. Other minor changes: * a pointless test call is removed in test/pacman/tests/ * sed is used instead of dos2unix as we depend on it anyway * consecutive chmod calls are reduced to a single call (e.g., '+x,a-x') Signed-off-by: Dan McGee <dan@archlinux.org>
* scripts/*: Declare several constant variables read-onlyLukas Fleischer2011-12-07
| | | | | | | | Be more semantically accurate and avoid accidental overwriting of some configuration variables that are considered to be constant. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> Signed-off-by: Dan McGee <dan@archlinux.org>
* Merge branch 'maint'Dan McGee2011-12-07
|\
| * repo-add: enforce maximum .sig file sizeDan McGee2011-12-05
| | | | | | | | | | | | | | | | | | | | | | | | | | This prevents user error in adding a file generated via `gpg --sign` rather than `--detach-sign`, for example. The same 16KiB limit is used we use in our pacman download code. The section is moved above the checksum generation to avoid presenting info messages to the user if the signature isn't valid. Addresses a shortcoming pointed out in FS#27453. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2011-11-30
|\|
| * makepkg: avoid using comm for diff'ing package listsDave Reisner2011-11-30
| | | | | | | | | | | | | | | | | | | | | | | | Whereas comm will check inputs to see if they're sorted (and warn when they aren't), grep doesn't even care about ordering. In this particular instance -- neither do we. We're only interested that the two lists are equivalent. Fixes FS#26580. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
| * Miscellaneous post-4.0.1 updatesDan McGee2011-11-30
| | | | | | | | | | | | | | Some late-arriving translation updates and add the correct dates to the index.txt releases table. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2011-11-20
|\|
| * Final changes before 4.0.1 releaseDan McGee2011-11-20
| | | | | | | | | | | | | | | | * Add last-minute changes to NEWS * Don't treat '_' or '_n' special in scripts when finding translatable strings; this breaks with one use of `read` and a dummy _ variable Signed-off-by: Dan McGee <dan@archlinux.org>
| * makepkg: trim trailing space from whitespace sensitive varsDave Reisner2011-11-20
| | | | | | | | | | | | | | | | | | | | | | | | This applies to pkgver, pkgrel, and epoch and ensures that any trailing whitespace outside of the context of the variable declaration itself is properly trimmed. The Bash parser will ignore this, and so should we. We don't need to worry about leading space because it would force a syntax error, or fail validation. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | makepkg: add support for PACKAGER environment varPhillip Smith2011-11-20
| | | | | | | | | | | | | | | | Add support for overriding configuration in /etc/makepkg.conf and ~/.makepkg.conf by setting the environment variable PACKAGER similar to how SRCDEST and PKGDEST behave. Signed-off-by: Allan McRae <allan@archlinux.org>
* | repo-add: Remove .tmp. prefix from outputAllan McRae2011-11-20
| | | | | | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* | repo-add: ensure database and signature files are always viewed in wholeDan McGee2011-11-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This addresses a short but sweet race condition currently existing in repo-add and repo-remove. We do the smart thing and zip the database to a location in a temporary directory and not over the original database directly. However, we then proceed to move this file directly from the temporary directory to our final location, which is more than likely a cross-filesystem move (/tmp on tmpfs) and thus non-atomic. Instead, zip the file to the same directory, prefixing the filename with '.tmp.'. We then move the file into place. This move is guaranteed to be atomic, so any reader of the database file will get either the old version, the new version, or ENOENT. We also perform a hardlink if possible instead of a move when shifting the old database out of the way to '.old'; this ensures there is no chance of a database file not existing during the whole process. Only one small race condition should now be present- when the database has been fully moved into place and the signature has not, you may see a mismatch. There seems to be no good way to address this, and it existed before this patch. A final note- if someone had locked-down permissions on the directory that the database files are in (e.g., could only write to foo.db.tar.gz, foo.db, foo.db.tar.gz.old, foo.db.old, and the lock file), this would break. Signed-off-by: Dan McGee <dan@archlinux.org>
* | repo-add: ensure path to LOCKFILE is always absoluteDan McGee2011-11-20
| | | | | | | | | | | | | | | | Given our semi-frequent use of pushd/popd, if we are in any directory but the original and the database path given was relative, we won't unlock the database file when cleaning up after an error. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2011-11-16
|\|
| * Update translations from TransifexDan McGee2011-11-16
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
| * Update translations from TransifexDan McGee2011-11-13
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
| * Updates in preparation for 4.0.1 releaseDan McGee2011-11-13
| | | | | | | | | | | | | | Bump the version, update the translation template files, and fill in NEWS with relevant commits and changes since 4.0.0. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2011-11-13
|\|
| * makepkg: check for value before using eval'd varDave Reisner2011-11-10
| | | | | | | | | | | | | | | | This prevent bsdtar from exploding when install= or changelog= are present without a value. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2011-11-07
|\|
| * makepkg: handle pgp signatures with .sign extensionAllan McRae2011-11-07
| | | | | | | | | | | | | | Detached sgnature files with extension .sign are accepted by gnupg. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2011-10-21
|\| | | | | | | | | | | | | Conflicts: src/pacman/package.c Signed-off-by: Dan McGee <dan@archlinux.org>
| * pacman-key: add a default keyserver timeout value on --initDan McGee2011-10-17
| | | | | | | | | | | | | | | | | | The default is supposidely 30 seconds from the gpg manpage, but that sure wasn't what I was seeing- it was somewhere closer to two minutes of silence. Add a more reasonable 10 second timeout value which should be good enough for any keyserver that doesn't totally stink at it's job. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2011-10-14
|\|
| * makepkg: don't attach traps until after argument parsingDan McGee2011-10-14
| | | | | | | | | | | | | | Nothing we do in our traps is necessary this early in the script. This fixes FS#26196. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2011-10-13
|\| | | | | | | | | Conflicts: src/pacman/util.c
| * scripts/*.sh.in: Fix signal handler error messagesLukas Fleischer2011-10-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This includes some fixes to the messages that are displayed when a signal is caught in makepkg or repo-add: * Instead of always showing "==> ERROR: TERM signal caught. Exiting...", replace "TERM" by whatever signal is actually caught. * Fix a typo in the SIGERR error message in repo-add ("occurred" instead of "occured"). Francois already fixed this for makepkg in 1e51b81c. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> Signed-off-by: Dan McGee <dan@archlinux.org>
| * repo-add: Avoid race condition in signal handlersLukas Fleischer2011-10-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a small chance that a user sends SIGINT (or any other signal that is trapped) when we're already in clean_up() which used to lead to trap_exit() being executed and the remaining code in clean_up() being skipped due to the bash signal/trap handler blocking EXIT (since its handler is already being executed, even if it's interrupted). In practice, this behaviour caused unexpected results (primarily because pressing ^C at the wrong time left a lock file behind): $ ./repo-add extra.db.tar.gz foobar ==> Extracting database to a temporary location... ^C ==> ERROR: Aborted by user! Exiting... $ ./repo-add extra.db.tar.gz foobar ==> Extracting database to a temporary location... ==> ERROR: File 'foobar' not found. ==> No packages modified, nothing to do. ^C ==> ERROR: Aborted by user! Exiting... $ ./repo-add extra.db.tar.gz foobar ==> ERROR: Failed to acquire lockfile: extra.db.tar.gz.lck. ==> ERROR: Held by process 18522 Fix this and reduce the chance of race conditions in signal handlers by: * Unhooking all traps in both clean_up() and trap_exit(). * Call clean_up() explicitly in trap_exit() to make sure we remove the lock file and the temporary directory even if we send SIGINT when clean_up() is already being executed but didn't reach the unhook code yet. Also, add an optional parameter to clean_up() to allow for setting an explicit exit code when we call clean_up() from trap_exit(). Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> Signed-off-by: Dan McGee <dan@archlinux.org>
* | scripts/*.sh.in: Honor TMPDIR environment variableLukas Fleischer2011-10-13
|/ | | | | | | | | | | | Replace "/tmp" with "${TMPDIR:-/tmp}" to allow for overriding the hardcoded path. Since we only use "/tmp" in conjunction with mktemp(1), we could also have used "--tmpdir", which is GNU-ish, however (and the BSD counterpart "-t" has been deprecated in GNU mktemp). Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> Signed-off-by: Dan McGee <dan@archlinux.org>
* Final Transifex update before 4.0Dan McGee2011-10-12
| | | | | | | | We have a few incomplete translations, but these should be addressable before the 4.0.1 maint release that is surely not that far in the future. Signed-off-by: Dan McGee <dan@archlinux.org>
* pacman-key: don't escape single quote in usage messageDan McGee2011-10-11
| | | | | | | This screws up gettext and causes the message to display always untranslated. Signed-off-by: Dan McGee <dan@archlinux.org>
* Update translations from TransifexDan McGee2011-10-11
| | | | | | In prep for the 4.0.0 release. Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: strip comments after pkgver/pkgrel when checking valueAllan McRae2011-10-10
| | | | | | | | Inline comments after pkgver or pkgrel would cause the sanity checks to fail so remove them before checking the value. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Update translation message catalogs in prep for 4.0 releaseDan McGee2011-10-05
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Update translations from TransifexDan McGee2011-10-05
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* pacman-key: treat foo-trusted as an ownertrust export fileDan McGee2011-10-05
| | | | | | | | | This allows it to serve double-duty. In order to allow users to base verification decisions off of both a valid signature and a trusted signature, we need to assign some level of owner trust to the keys we designate as trusted on import. Signed-off-by: Dan McGee <dan@archlinux.org>
* pacman-key: refine and clarify import/import-trustdb behaviorDan McGee2011-10-05
| | | | | | | | | | | | * --import now only imports keys from pubkey.gpg and does not import owner trust; if you want to have both simply run the operations in sequence. * --import-trustdb has been simplified; it will overwrite existing values in the trust database as before, but there is no need to export it first as those values are safe if left untouched. * Fix the manpage referring to a non-existent option. Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: create tar file for bogus PKGEXTlolilolicon2011-10-03
| | | | | | | | | | | | | | | | If PKGEXT is not one of the recognized tar*'s, create_package() would create an empty package file and fail, since bsdtar on the left side of the pipe returns 141 on SIGPIPE (broken pipe). This patch changes the behavior for an invalid PKGEXT. A warning is printed on stderr, and a tar file is created. Also retire the obsolete $EXT variable. Add the obligatory comment why we don't use bsdtar's compression. Finally, fix mixed-tab-space indentation. Signed-off-by: lolilolicon <lolilolicon@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* makepkg: support .tar.Z source packages creationlolilolicon2011-09-30
| | | | | | | SRCEXT should allow whatever PKGEXT does. Also address an uninitialized use of $ret. Signed-off-by: lolilolicon <lolilolicon@gmail.com>
* pacman-key: remove errexit flag from shebangDave Reisner2011-09-30
| | | | | | | | | | | We're ill equipped to be using this flag as we don't trap and respond to the ERR signal. The result is that if is ever tripped, pacman-key will instantly exit with no indication of why. At the same time, we're already fairly good about doing our own error checking and verbalizing it before dying. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* pacman-key: return 0 from get_from if default value usedAllan McRae2011-09-30
| | | | | | | | This prevents the error trap being set off when GPGDir is commented in pacman.conf. Bug introduced in 507b01b9. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* pkgdelta: proper quoting in [[ expression ]]lolilolicon2011-09-28
| | | | | | | Always quote the right-hand side of expression when the == or != operator is used, unless intended as a pattern. Signed-off-by: lolilolicon <lolilolicon@gmail.com>
* makepkg: proper quoting in [[ expression ]]lolilolicon2011-09-28
| | | | | | | | | | | Always quote the righthand side of expression when the == or != operator is used, unless intended as a pattern. Quoting bash(1): When the == and != operators are used, the string to the right of the operator is considered a pattern. Any part of the pattern may be quoted to force it to be matched as a string. Signed-off-by: lolilolicon <lolilolicon@gmail.com>
* makepkg: ensure '-' is last in a character globDave Reisner2011-09-27
| | | | | | | If '-' isn't the last item, it's interpreted as a range and not literally, causing problematic behavior in parsing optdepends. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* pacman-key: use consistent punctuation in error messagesDan McGee2011-09-27
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* pacman-key: allow get_from to return a default valueDave Reisner2011-09-26
| | | | | | | | Keep the non-zero return val to let the caller know that the key wasn't found. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* pacman-key: simplify writing to config fileDave Reisner2011-09-26
| | | | | Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: normalize whitespace for optdepends in .PKGINFOAllan McRae2011-09-26
| | | | | | | | | | | Many PKGBUILDs use formatting whitespace when specifying optdepends. This is removed when adding a package to a repo-database so the output of "pacman -Si <package>" and "pacman -Qip <package file>" becomes inconsistent. Instead, do the adjustment when creating the .PKGINFO file. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: allow versioned optdepends with epochAllan McRae2011-09-26
| | | | | | | | | | Allow the specification of versioned optdepends with an epoch. This also (partially) enforces a whitespace between ":" and the description which is required for the future optdepends parsing code. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>