summaryrefslogtreecommitdiff
path: root/scripts/libmakepkg
AgeCommit message (Collapse)Author
2017-05-08add generated scripts to gitignoreChristian Hesse
These files are generated at build time. Ignore in git. Signed-off-by: Christian Hesse <mail@eworm.de> Signed-off-by: Allan McRae <allan@archlinux.org> (cherry picked from commit fc756c3c70d39fc8c58deb85a0ffd759634cd773)
2017-05-08libmakepkg: generate all scriptsAlad Wenter
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> (cherry picked from commit aca153bfa6b1bcd828f0b35db453bb9fea6a08bf)
2016-05-05libmakepkg: ensure emptydir find command acts on individual directoriesAllan McRae
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> (cherry picked from commit baf1ff64e6ea23e93f307480480d87159cd2e487)
2016-02-26libmakepkg: fix is_array functionAllan McRae
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-20libmakepkg: increase robustness of the detection of array variablesAllan McRae
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-01-25Fix testing of arrays status for arch specific variablesZuyi Hu
Signed-off-by: Allan McRae <allan@archlinux.org>
2016-01-04Update copyright years for 2016Allan McRae
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 Pritz
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-11-23lint_pkgbuild/variable: increase robustnessAllan McRae
Approach the detection of variables of the wrong type using an approach similar to that used for construction of .SRCINFO files. While doing silly things in bash could still result in false negatives, this approach should be very robust to generatinf false positives results. Signed-off-by: Allan McRae <allan@archlinux.org>
2015-11-23lint_pkgbuild: explicitly return valueAllan McRae
Set the return value to be local and always explictly returns it. Signed-off-by: Allan McRae <allan@archlinux.org>
2015-11-05Refactor lint_source to work with earlier versions of BashAaron Campbell
Negative subscripts to indexed arrays are not supported before 4.2. However, since substring expansion works on arrays, we can specify an offset of -1 to be taken relative to one greater than the maximum index of the specified array (see Parameter Expansion section of the bash man page). This works with both Bash 4.1 and 4.2, and 4.1 is already the oldest supported by pacman. Signed-off-by: Aaron Campbell <aaron@monkey.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-10-27libmakepkg: fix pkgver checkingAllan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-10-19libmakepkg: Add check_buildoption for distcc and ccacheJan Alexander Steffens (heftig)
makepkg used to check OPTIONS too, which could override BUILDENV. Implement a new function that handles these options more like OPTIONS. This also reduces code duplication a bit. Signed-off-by: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-10-19Remove space before ellipsesAllan McRae
Makes all use of ellipses consistent... Signed-off-by: Allan McRae <allan@archlinux.org>
2015-09-22libmakepkg: remove declaration of unused local variablesAllan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-09-22libmakepkg: return 1 on error in arch arrayAllan McRae
The return value was being assigned when an error was found in a PKGBUILD's arch array but it never was returned. Also remove error message explaining about adding the arch array to a PKGBUILD. That was added a long time ago when the arch array first became compulsory. Signed-off-by: Allan McRae <allan@archlinux.org>
2015-09-22libmakepkg: update .gitignoreAllan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-09-07libmakepkg: check if PKGBUILD variables are arrays or not as appropriateAllan McRae
When extracting variables from PKGBUILD (e.g. for .SRCINFO creation) we make assumptions about whether variables are arrays or not. This adds a check to the PKGBUILD linter to ensure variables are arrays or not as appropriate. Signed-off-by: Allan McRae <allan@archlinux.org>
2015-09-07libmakepkg: util/pkgbuild.sh needs processing on buildAllan McRae
pkgbuild.sh contained @DEBUGSUFFIX@ and so needs to be run through the sed command on build. Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-20libmakepkg: move color settings to functionAllan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-20libmakepkg: lint_package requires cd_safeAllan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-05-19libmakepkg: extract functions for source download and extractionAllan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-05-19libmakepkg: extract functions for handling source URLsAllan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-05-19libmakepkg: fix test styleAllan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-05-19libmakepkg: move more functions for extracting information from PKGBIULDsAllan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-05-19libmakepkg: extract more utility functionsAllan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-05-16libmakepkg: extract get_full_version and get_pkg_archAllan McRae
These functions group in with other functions that extract PKGBUILD information. Signed-off-by: Allan McRae <allan@archlinux.org>
2015-05-16Simplify libmakepkg .gitignoreAllan McRae
2015-05-16makepkg: put further restrictions on pkgbaseAllan McRae
pkgbase should be subject to the same restrictions as pkgname Signed-off-by: Allan McRae <allan@archlinux.org>
2015-05-16makepkg: merge validate_pkgver into check_pkgverAllan McRae
The check that pkgver is non-empty done in check_pkgver should also be performed after running the pkgver() function. Merge validate_pkgver into check_pkgver and run check_pkgver after updating pkgver. Signed-off-by: Allan McRae <allan@archlinux.org>
2015-05-16libmakepkg: extract PKGBUILD linting functionsAllan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-05-16libmakepkg: extract in_arrayAllan McRae
2015-05-16libmakepkg: move functions for extracting pkgbuild attributesAllan McRae
Also rename some functions for clarity: funcgrep -> grep_function extract_global_var -> extract_global_variable extract_function_var -> extract_function_variable pkgbuild_get_attribute -> get_pkgbuild_attribute Signed-off-by: Allan McRae <allan@archlinux.org>
2015-05-12libmakepkg: fix test bracket styleAllan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-03-15libmakepkg: move helper functions into tidy/stripAllan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-03-03Allow UPX compression for DOS/Win executablesDavid Macek
Hi. This change allows makepkg to UPX-compress executables on Windows, but will probably affect some Linux packages as well (I'm guessing gdbserver, wine, mingw-w64). Signed-off-by: Allan McRae <allan@archlinux.org>
2015-02-12libmakepkg: make package checking functions extendableAllan McRae
To add a new package check, drop a file in libmakepkg/lint and add the function to the "lint_functions" array. Signed-off-by: Allan McRae <allan@archlinux.org>
2015-02-12libmakepkg: make package tidy functions extendableAllan McRae
To add a new packaging option, drop a file into libmakepkg/tidy that contains a 'packaging_options+=('<option>') and a function that implements that option. The function needs added to the 'tidy_remove' array if it removes files or the 'tidy_modify' array otherwise. Signed-off-by: Allan McRae <allan@archlinux.org>
2015-02-12libmakepkg: move package checking out of tidy_installAllan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-02-01makepkg: split package tidying into libmakepkgAllan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-02-01makepkg: split PKGBUILD/makepkg.conf option checking to libmakepkgAllan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-02-01makepkg: split message functions into libmakepkgAllan McRae
This performs all the needed work for libmakepkg to be included in tarballs, installed into the correct place, and read into makepkg. Also change the install root for libmakepkg to an architecture independant location. Signed-off-by: Allan McRae <allan@archlinux.org>