summaryrefslogtreecommitdiffstats
path: root/scripts
AgeCommit message (Collapse)AuthorFilesLines
2016-12-05makepkg: fix find_lib{depends, provides} resultsAndrew Gregory1-3/+3
Neither function was checking for the existence of actual results before calling printf, resulting in them returning a list with a single empty value if there were no depends/provides. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2016-12-05makepkg: unset potentially architecture-specific varsDave Reisner1-1/+5
I'm not convinced this is a worthwhile goal, but let's follow suit. Since we can't know the names of all the vars that might exist, unset them by pattern.
2016-12-05makepkg: fix quoting in calls to dependency checkingDave Reisner1-4/+4
2016-12-05makepkg: fix quoting in calls to check_depsDave Reisner1-3/+3
The inside needs quoting, and this is separate from the declartion, which does not (in these cases).
2016-12-05makepkg: make run_function_safe more robustDave Reisner1-8/+11
Use shopt to set/reset errexit and errtrace, which lets us: 1) be more vigilant, resetting anything the user might do to us in PKGBUILD functions. 2) use human-readable words (errexit vs. -e) On top of this, introduce a new save/restore for the shell's other shopts. A user should not have any expectations that what happens in one function is available in another function, if it isn't explicitly defined in the PKGBUILD. While this change does not make that assertion, it gets us closer. We also replace a variable which comes from out of nowhere (pkgfunc) with the positional parameter containing the same value. Quoting is adjusted to make the expansion happen at the time the trap is set, rather than later on.
2016-12-05makepkg: remove vestiges of global errexitDave Reisner1-3/+3
These 'set +E' diversions haven't been needed since global errexit was disabled in dca10b062f2 (January 2012).
2016-12-05Make sure all proper scripts are installed instead of the wrappersJohannes Löthberg1-3/+2
After 1f8f0bd9ac4c11cdc1b9506f9f64d8192ecad4ee all scripts that were changed to using the wrapper for in-tree use have the wrappers installed to the system instead of the actual script, so change the install command to support all wrapped scripts instead of just makepkg. Signed-off-by: Johannes Löthberg <johannes@kyriasis.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2016-12-05Revert "[RFC] Provide source files for useful debug packages"Allan McRae1-19/+1
This reverts commit a79c0038ae84c38fe063bd7426a839f3c01c10e8. I merged the wrong branch into master...
2016-11-02[RFC] Provide source files for useful debug packagesAllan McRae1-1/+19
Debug packages are fairly useless currently because the soucre files needed for stepping through code etc are not packaged with them. This patch adds the needed source files to the debug package and adjusts the debug info to look at the /usr/src/debug/ directory for them rather than the build location. This requires using the "debugedit" program which is provided as part of the RPM sources. Signed-off-by: Allan McRae <allan@archlinux.org>
2016-10-22makepkg: print files with refs to $srcdir/$pkgdirIvy Foster1-7/+9
Since rewriting build_references() anyway, tweaked quoting. Implements FS#31558. Signed-off-by: Ivy Foster <ivy.foster@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2016-10-22Use coreutils binaries for checking/generating checksumsAllan McRae4-26/+27
If pacman is build against a crypto library other than openssl, it makes no sense to require makepkg to use it. The only currently considered alternative to openssl is nettle, which has no binary for base64 encode/decode. This means that we could replace the hashing cacluations with nettle-hash, but would require base64 from coreutils. Given makepkg already relies heavily on coreutils, we might as well use all the coreutils hashing binaries too. This patch also improves the checking of required binaries for hashing operations. Signed-off-by: Allan McRae <allan@archlinux.org>
2016-10-22makepkg: Move parseopts from library to libmakepkgAlad Wenter9-42/+67
parseopts is used in makepkg and other scripts such as pacman-key as a getopt replacement. Instead of including it in those scripts via a macro, move it to libmakepkg/util/parseopts.sh and have scripts source this file where appropriate. To keep the parseopts test, a new variable was introduced: PM_LIBMAKEPKG_DIR Signed-off-by: Alad Wenter <alad@archlinux.info> Signed-off-by: Allan McRae <allan@archlinux.org>
2016-10-22Generalise makepkg-wrapper to handle any script using libmakepkgAllan McRae2-13/+20
Signed-off-by: Allan McRae <allan@archlinux.org>
2016-10-22libmakepkg: generate all scriptsAlad Wenter5-9/+10
In order for the scripts to be used in testsuites, it is easiest to generate all of them so they are found in the build directory (which may be different to the source directory). Signed-off-by: Alad Wenter <alad@archlinux.info> Signed-off-by: Allan McRae <allan@archlinux.org>
2016-10-11Ensure makepkg-wrapper is built after makepkgAllan McRae1-5/+2
makepkg-wrapper did not get rebuilt if makepkg was regenerated due to library changes. Ensure makepkg-wrapper is always generated and linked any time makepkg changes. Signed-off-by: Allan McRae <allan@archlinux.org>
2016-10-10lint_pkgbuild/pkgname: pkgname is not allowed to be emptyChristian Hesse1-0/+5
We checked for empty array elements, but did not catch empty array. Add a check for that case as well. Signed-off-by: Christian Hesse <mail@eworm.de> Signed-off-by: Allan McRae <allan@archlinux.org>
2016-10-10Move bash/zsh completion out of contribAllan McRae4-1/+909
Signed-off-by: Allan McRae <allan@archlinux.org>
2016-10-10Remove pacman-optimizeAllan McRae4-197/+0
The people who believe that pacman-optimize is actually doing something useful are the same people who are voting for Trump. Signed-off-by: Allan McRae <allan@archlinux.org>
2016-10-10fix --printsrcinfo unify arch and non-arch specific variablesLevente Polyak1-1/+1
This fixes the issue with --printsrcinfo that all arch specific variants of a variable get merged into their non arch specific variant. The .SRCINFO file ends up having $depends containing $depends_x86_64 and omitting the latter. Signed-off-by: Allan McRae <allan@archlinux.org>
2016-09-09repo-add: fix error in directories with a space in their nameFabio Castell1-1/+1
Fixes FS#50285 Signed-off-by: Allan McRae <allan@archlinux.org>
2016-09-02Fix typo in pacman-db-upgrade usage messageAllan McRae1-1/+1
Signed-off-by: Allan McRae <allan@archlinux.org>
2016-08-30Fix file name in scripts potfileAllan McRae1-5/+5
2016-08-30libmakepkg: look for architecture-specific hashes in get_integlistJack O'Connor1-0/+11
`makepkg -g` looks for existing checksums in the PKGBUILD file, so that it can generate new sums of the same type. Previously it only checked variables of the form "sha256sums", and not "sha256sums_x86_64". That meant it would always fall back to MD5 for packages with only architecture-specific sources. This change makes it look at architecture-specific checksums too to determine the type. Signed-off-by: Jack O'Connor <oconnor663@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2016-08-30pacman-key: reject armored signaturesAllan McRae1-0/+4
pacman expects an unarmored signature. makepkg forces the generation of unarmored signatures, and repo-add will reject any armored signature. For consistency pacman-key should also reject armored signatures. Signed-off-by: Allan McRae <allan@archlinux.org>
2016-05-18libmakepkg: extract functions for integrity checkingAshley Whetter10-429/+579
Signed-off-by: Ashley Whetter <ashley@awhetter.co.uk> Signed-off-by: Allan McRae <allan@archlinux.org>
2016-05-18Use a more generic regexp when parsing output of gpg(1) in signature ↵Leonid Isaev1-1/+1
verification. The current way of extracting key trust from output of gpg --verify is not very robust against changes in the format of said output. As a result, pacman-key can return an error even if the signature is actuall good. This change relaxes the regexp when parsing output of gpg. Signed-off-by: Leonid Isaev <leonid.isaev@jila.colorado.edu> Signed-off-by: Allan McRae <allan@archlinux.org>
2016-05-18makepkg: ignore the architecture for --printsrcinfoAlastair Hughes1-1/+1
Signed-off-by: Alastair Hughes <hobbitalastair@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2016-05-18makepkg: move build enviroment set-up to functionAllan McRae1-36/+43
This is a requirement to split the preparation of the build environment into libmakepkg, which will allow dropping in extensions (e.g. to allow PGO). After this patch, disabling buildflags or makeflags and enabling debug CFLAGS will only effect the build(), check() and package() functions. The relevant variables are no longer exported for the prepare() function. This should have zero impact for the prepare() function of a properly written PKGBUILD, as no building/linking is done there... Signed-off-by: Allan McRae <allan@archlinux.org>
2016-03-28libmakepkg: extract functions for writing .SRCINFO filesAshley Whetter4-101/+129
Signed-off-by: Ashley Whetter <ashley@awhetter.co.uk> Signed-off-by: Allan McRae <allan@archlinux.org>
2016-03-21libmakepkg: ensure emptydir find command acts on individual directoriesAllan McRae1-1/+2
Using "-exec command {} +" systax exits on any error. Such errors occur when running rmdir on a non-empty directory. Switch to "{} ;" syntax instead which avoids exiting before the find command is completed. Fixes FS#48515. Note, we can not use "-empty" in the find command because it is not supported by Busybox find, and the "--ignore-fail-on-non-empty" flag for rmdir is not available on BSD rmdir variants. Signed-off-by: Allan McRae <allan@archlinux.org>
2016-02-26repo-add: do not alter the database if only verifying signatureAllan McRae1-0/+11
Fixes FS#48085. Signed-off-by: Allan McRae <allan@archlinux.org>
2016-02-26makepkg: Turn PACMAN_OPTS into an arrayXyne1-5/+5
Avoid potential word expansion with future inclusions Signed-off-by: Allan McRae <allan@archlinux.org>
2016-02-26makepkg: Remove upx and optipng supportAllan McRae5-110/+0
These options were added before libmakepkg allowed passes like this to be dropped in. I prefer only real core packaging tasks to be included in makepkg and additional things like this to be dropped in by a user or distribution that wants to support them. Signed-off-by: Allan McRae <allan@archlinux.org>
2016-02-26libmakepkg: fix is_array functionAllan McRae1-1/+1
This happened to work for the majority of cases because the only calling function used a variable named "i" that was related to the variable being passed to the function. Fixes FS#48340. Signed-off-by: Allan McRae <allan@archlinux.org>
2016-02-23Regenerate translations for 5.0.1Allan McRae42-9318/+12487
2016-02-23Pull translation updates from TransifexAllan McRae45-7497/+4402
Signed-off-by: Allan McRae <allan@archlinux.org>
2016-02-23makepkg: do not run prepare() with --noextractEvangelos Foutras1-3/+3
This is partial revert of 8454daa7feef (makepkg: run pkgver() and prepare() with --noextract). Reasoning for the reversion (copied from FS#43498): Running prepare() when --noextract is used no longer allows running 'makepkg -o && makepkg -e' with any PKGBUILD that applies patches in prepare(). [1] Sure there's --noprepare which restores the old behavior, but that's a lot of extra typing for what I believe is a much more common use of --noextract. For OP's use case of doing git bisects, you can specify the commit in the source array and thus skip --noextract since makepkg will checkout the correct commit each time. [1] I often extract the sources using 'makepkg -o', manually edit some source files, and then use 'makepkg -e' to package it (while possibly repeating the edit/package steps). Signed-off-by: Allan McRae <allan@archlinux.org>
2016-02-21only include .SRCINFO comments in source tarballDominik Fischer1-4/+11
This avoids introducing unnecessary changes to the time stamp into package repositories that regularly use --printsrcinfo to update the .SRCINFO file. Signed-off-by: Allan McRae <allan@archlinux.org>
2016-02-20makepkg: remove pkg from OPT_LONG arrayAllan McRae1-1/+1
Signed-off-by: Allan McRae <allan@archlinux.org>
2016-02-20Revert "makepkg: Empty/create only $pkgdir's relevant to current PKGBUILD"Allan McRae1-5/+2
This reverts commit f9423cfa5d5b9f2041b70676438082faad1cd1ee. This created issue when building packages with debug info multiple times. It could be fixed, but it confirmed my initial opinion that keeping other directories in $pkgdirbase was wrong. Use different BUILDDIRs if you want to build different things from a single PKGBUILD.
2016-02-20Make "makepkg -g" ignore the current architecture.Alastair Hughes1-1/+2
Commit 663c74150ab4ba6d3adc55b0e3f539557a16e352 (makepkg: merge arch dependent variables after PKGBUILD linting) broke "makepkg -g" on a PKGBUILD which did not include the current architecture, by moving the lint_pkgbuild call before GENINTEG was processed. Fix that by setting IGNOREARCH for the "-g" option. Signed-off-by: Allan McRae <allan@archlinux.org>
2016-02-20libmakepkg: increase robustness of the detection of array variablesAllan McRae2-3/+20
Extract array detection into its own utility function that ensures extglob is enabled. Suggested-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2016-02-20repo-remove: fix checking for non-existent .db databaseAllan McRae1-1/+1
Signed-off-by: Allan McRae <allan@archlinux.org>
2016-01-30Update translationsAllan McRae47-1030/+2578
Signed-off-by: Allan McRae <allan@archlinux.org>
2016-01-25makepkg: do not run prepare() and pkgver() with --repackageAllan McRae1-19/+21
Bug introduced with commit 8454daa7. Reported-by: Zuyi Hu <hzy068808@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2016-01-25Fix testing of arrays status for arch specific variablesZuyi Hu1-1/+1
Signed-off-by: Allan McRae <allan@archlinux.org>
2016-01-17Pull translations updates from TransifexAllan McRae45-5376/+4361
Signed-off-by: Allan McRae <allan@archlinux.org>
2016-01-04Update copyright years for 2016Allan McRae51-57/+57
make update-copyright OLD=2015 NEW=2016 Signed-off-by: Allan McRae <allan@archlinux.org>
2015-12-15makepkg: Output full URL in case of download failureFlorian Pritz1-1/+1
Most entries in $sources contain variables so finding out why a URL fails to download is hard because one has to manually replace the variables when looking at the PKGBUILD. Simply output the full URL here so that it can be easily seen what is wrong. Old: ==> ERROR: Failure while downloading example-1.2.4.tar.gz New: ==> ERROR: Failure while downloading http://example.org/releases/1.1/example-1.2.4.tar.gz With the new format it is much more obvious that the directory name is the culprint (1.1 vs 1.2) while the old one would not display that information. Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-12-15makepkg: run pkgver() and prepare() with --noextractAllan McRae1-8/+9
Modifications made to the source before running with --noextract may alter the version string returned by pkgver(). Always run this function if present and check build status before proceeding. Fixes FS#46800. Also run prepare() when --noextract is used (unless --noprepare is specified). Signed-off-by: Allan McRae <allan@archlinux.org>