summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2012-04-24paccache: adopt parseopts for options parsingDave Reisner
Add longopts and update usage. This removes the TODO item and incorporates --help/--version into the standard option set. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-24configure: require bash >= 4.1 at compile timeDave Reisner
We've unofficially agreed to raise our minimum supported bash version to 4.1, and since added features that require it. Additionally, an earlier commit adds a syntax check to the builds of scripts/ and contrib/ which could conceivably fail with an earlier shell. Therefore, make this a hard requirement of the build process. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-24validate bash scripts with 'bash -n' during build.Dave Reisner
Use the no-exec mode of $(BASH_SHELL) to check for syntax errors in shell scripts. Since we use the extglob feature in various places, this requires that we pass -O extglob to the shell as well, to ensure that the parser is armed to handle this syntax. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-24contrib: rename bash scripts: .in -> .sh.inDave Reisner
For consistency with the scripts/ directory, ensure that all bash scripts use the same pre-build suffix. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-24contrib: use a separate build rule for bash scriptsDave Reisner
Treat bash scripts separately from the others to allow for a different build rule, which is reused from the scripts/ subdir. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-24pacman-key: lookup keys before receivingDave Reisner
Perform a search for keys that clearly aren't key IDs. This allows receiving keys by name or email address, but only if the key resolves unambiguously. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-24Merge branch 'maint'Dan McGee
Conflicts: scripts/repo-add.sh.in
2012-04-24Merge branch 'parse-opts'Dan McGee
2012-04-24makepkg.8: remove bold from --pkg's optargDave Reisner
Keep this in line with the rest of the manpages. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-24pacman-key: allow verification of multiple sig filesDave Reisner
Loop through arguments passed to verify_sig and treat each as a signature to be verified against a source file. Output each file as its checked to avoid ambiguity. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-24scripts/library: remove parse_optionsDave Reisner
This is retired, as the two consumers of this function are now using the new parseopts instead. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-24bash_completion: update for changes to pacman-keyDave Reisner
- only do file completion for options which expect files - add completion for possible key ids when a relevant operation is in COMPWORDS. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-24scripts: avoid dumping usage on parser failDave Reisner
Avoid letting the error message from parseopts get lost in the usage output from pacman-key and makepkg (which is already verbose).
2012-04-24pacman-key: adopt parseopts for option parsingDave Reisner
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>
2012-04-24makepkg: allow specifying --pkg multiple timesDave Reisner
Make this option additive, so that the following two operations are equivalent: makepkg --pkg foo --pkg bar makepkg --pkg foo,bar
2012-04-24makepkg: adopt parseopts for option parsingDave Reisner
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-24scripts/library: introduce parseoptsDave Reisner
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>
2012-04-24configure: avoid linking against libsslDave Reisner
We're not linking to libssl, only libcrypto. -Wl,--as-needed will get rid of this, but there's no sense in checking for and linking against a library we don't need. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-20makepkg: restrict allowed characters in pkgnameDave Reisner
Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-20pkgdelta/repo-add: quoting fixesFlorian Pritz
This removes some unnecessary quotes and adds quotes in a few places to hopefully work correctly if the tempdir has spaces. Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-20pkgdelta: implement requirments for delta generationFlorian Pritz
Big deltas or deltas for very small packages are not needed so we should check that and not generate any. Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-20pkgdelta: rework option/argument parserFlorian Pritz
Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-19contrib: remove pactree make ruleDave Reisner
This is a vestige leftover from the rewrite over a year ago in 622e7fdd4. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-19contrib: remove wget-xdelta from gitignoreDave Reisner
I removed this in ff713a51 over a year ago. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-12Merge branch 'maint'Dan McGee
2012-04-12Remove SyncFirst optionDan McGee
This has outlived its usefulness and causes more problems than it solves. It has historically only ever been used to install pacman first. That should not be needed given we provide the vercmp utility (which has no library dependencies) and so calling pacman in install scripts is a sign of poor packaging. Work-duplicated-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-09Fix issues with unintialized variable value usageDan McGee
Detected by clang scan-build static code analyzer. * Don't attempt to free an uninitialized gpgme key variable * Initialize answer variable before asking frontend a question * Pass by reference instead of value if uninitialized fields are possible in download signal handler code * Ensure we never call strlen() on NULL payload->remote_name value Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-09Add more warning flagsAllan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-04-08Fix a signed overflow error on i686 with GCC 4.7.0Dan McGee
Not sure why this one wasn't showing up on x86_64, but this fixes the compile on i686. diskspace.c: In function 'calculate_removed_size': diskspace.c:247:4: error: assuming signed overflow does not occur when negating a division [-Werror=strict-overflow] cc1: all warnings being treated as errors Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-08Merge remote-tracking branch 'dave/buildsys'Dan McGee
Oh god, what are we thinking thinking merging this. Hopefully this works with only a few follow-up patches necessary.
2012-04-08makepkg: save and restore shopts when sourcing /etc/profileAllan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-04-08makepkg: complain when the buildfile isn't writeableDave Reisner
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>
2012-04-08makepkg: catch errors sourcing filesDave Reisner
create source_safe() function which temporarily disables extglob and exits on error. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-08makepkg: restrict usage of errexit to user functionsDave Reisner
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>
2012-04-08Merge branch 'maint'Dan McGee
2012-04-08pacman-key: avoid use of tempfile in verify_sigDave Reisner
Use --status-fd rather than --status-file to keep this contained in a pipeline. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-08Add a new configure option for excessive compiler warning flagsDan McGee
This adds a bunch of warning flags to the list used when compiling. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-08Various tweaks to support building with excessive GCC warning flagsDan McGee
This fixes a bunch of small issues in order to enable a clean successful build with a crazy number of GCC warning flags. A lot of these changes are covered by -Wshadow, -Wformat-security, and -Wstrict-overflow=5. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-08autoclean.sh: abide by POSIX shebangDave Reisner
Avoid non-POSIX brace expansion and rely on find to locate and destroy files outside the root. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-08buildsys: move autotools bloat to build-auxDave Reisner
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-08buildsys: move acinclude.m4 to m4/Dave Reisner
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-08buildsys: cleanup libtool and autoconf initializationDave Reisner
- Use LT_INIT over AC_PROG_LIBTOOL, as the latter is a deprecated alias for the former. - Remove redundant macros which are called implicitly by LT_INIT. - Remove unneeded AC_PROG_CXX call (we don't use c++ anywhere) - Add AC_CONFIG_MACRO_DIR([m4]) -- not strictly necessary, but added for consistency with autogen.sh and Makefile.am ref: http://www.gnu.org/software/libtool/manual/html_node/LT_005fINIT.html Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-08buildsys: define warning CFLAGS in separate varDave Reisner
Continue the trend of not touching the environment CFLAGS, ensuring that the user always has the final say. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-08buildsys: use AC_DEFINE for CYGWIN macroDave Reisner
Instead of directly modifying CFLAGS, use config.h for its intended purpose. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-08buildsys: cleanup gpgme compile time checkDave Reisner
- handle gpgme libs and cflags separately rather than appending to CFLAGS and LDFLAGS - be consistent in AC_LINK_IFELSE check for gpgme 1.3.0 (though this is irrelephant since we don't actually run) - be consistent with usage of "have" and "with" variables (this actually ends up reducing SLOC) - when voluntary detection fails, unset GPGME_CFLAGS and GPGME_LIBS - when requested support fails the version check, complain about the min version. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-08buildsys: use pkg-config for libcurl detectionDave Reisner
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-08buildsys: use pkg-config for libarchive detectionDave Reisner
This also introduces a versioned dependency of >=2.8.0. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-08buildsys: use pkg-config for openssl detectionDave Reisner
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-08buildsys: add pkg-config m4 macrosDave Reisner
We'll need these for a small revamp to library detection. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-08pacman-key: verify TRUST_ULTIMATE keys as goodDave Reisner
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>