summaryrefslogtreecommitdiff
path: root/scripts/makepkg.sh.in
Commit message (Collapse)AuthorAge
* Update copyright years for 2011Allan McRae2011-01-07
| | | | | Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: add option to clear buildflagsAllan McRae2010-12-29
| | | | | | | | | | Add the "buildflags" option, which is useful in its negative form for disabling CFLAGS, CXXFLAGS and LDFLAGS when building a package. This is useful when determining of one of these flags is causing an issue with a package. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: Add check() function for running test suitesAllan McRae2010-12-29
| | | | | | | | | | | | | | A PKGBUILD can have an option check() function for running test suites between the build() and package() stages. This function is run by default but can be disabled globally in with "!check" in BUILDENV in makepkg.conf. This setting can be controlled on an individual package basis using makepkg's --check and --nocheck flags. Addition dependencies needed for running the test suite can be specified in the checkdepends array and are only checked when running the check() function. Original-work-by: Jeff C <jeff@kcaccess.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: escape closing bash array paren for awkDave Reisner2010-12-29
| | | | | | | | | | | The closing parenthesis of bash arrays needs to be escaped in the ending address of awk expressions in order to play nicely with implementations of awk other than gawk. This change provides compatibility with gawk, nawk and mawk. Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: allow pkgname usage in split package functionsAllan McRae2010-12-29
| | | | | | | | | | | | Currently, using $pkgname in a split package package_*() function always returns the first value in the pkgname array rather than the name of tha package being packaged. Fix this so $pkgname gives the expected value. Fixes FS#22174 Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: remove last inappropriate PKGBUILD usageAllan McRae2010-12-20
| | | | | | | | We should always use $BUILDSCRIPT instead of PKGBUILD. The only remaining uses of PKGBUILD in makekg are in comments. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: perform sanity checks on variables in package functionsAllan McRae2010-12-12
| | | | | | | Check the over-ridden entries for provides, backup, optdepends and options for illegal entries. Partially fixes FS#16004. Signed-off-by: Allan McRae <allan@archlinux.org>
* makepkg: remove dead code from handle_depsAndres P2010-12-12
| | | | | | | | | | The error message that has been removed never gets to print because, given the same condition, handle_deps throws the same error and then immediately exits makepkg. Signed-off-by: Andres P <aepd87@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: do not ignore errors from pacman when checking depsAndres P2010-12-12
| | | | | | | | | | | | As check_deps is run in a subshell, exit had the same meaning as return. Since the intention is to halt makepkg when pacman throws an error other than 127, the enclosing function has to handle error control instead. Fixes FS#19840 Signed-off-by: Andres P <aepd87@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: use portable escape sequence for terminal escapesCarlos Diaz2010-12-12
| | | | | | | | | | | | The escape string isn't necesarily \033; it's determined by what the particular termcap/info entry for that terminal contains. Bash uses ncurses functions to expand \e to the _correct_ terminal escape. Signed-off-by: Carlos Diaz <839273@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Add epoch verification to makepkgDan McGee2010-10-13
| | | | | | If defined, it must be an integer. Signed-off-by: Dan McGee <dan@archlinux.org>
* Make repo-add and makepkg epoch-awareDan McGee2010-10-13
| | | | | | | | | | Allow it to be a variable in the PKGBUILD as well as propagating it through to the built package and the package database. We leave some backward compatibility in place by placing the '%FORCE%' option in the database if the package contains an epoch; this will be used by older versions of pacman and more or less ignored by versions that use epoch. Signed-off-by: Dan McGee <dan@archlinux.org>
* Fix bash shell location checkDan McGee2010-10-13
| | | | | | | | | | BASH is defined when you are actually using bash during configure, which sucks because it ends up being '/bin/sh', messing up all of our scripts. Change the name of the variable we use in configure, and also ensure we get a full path to the executable by using AC_PATH_PROGS rather than AC_CHECK_PROGS. Finally, change the variable name everywhere we use it. Signed-off-by: Dan McGee <dan@archlinux.org>
* Use sysconfdir, localstatedir, BASH instead of hardcoded valuesNezmer2010-10-11
| | | | | | | | | This applies to contrib/ files, our scripts, and the documentation. Dan: fix 'make clean' in contrib/ directory. Signed-off-by: Nezmer <git@nezmer.info> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: Use mkfifo instead of GNU-only 'mknod <file> p'Nezmer2010-10-11
| | | | | | | | | | 'mknod <file> p' is apparently GNU-only. Looking at coreutils' source code, It just calls mkfifo. This one line patch should fix makepkg logging in non-GNU systems. Signed-off-by: Nezmer <git@nezmer.info> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: canonicalize paths from environmental variablesAllan McRae2010-10-05
| | | | | | | | | | This prevents circular symlinks and weird final package locations when using commands like 'PKGDEST="." makepkg'. Fixes FS#20922. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: compare paths using bash testAllan McRae2010-10-05
| | | | | | | | | Compare paths using bash's "-ef" rather than by string tests as this takes symlinks into account. This will prevent issues similar to those in FS#20922 if (e.g.) $PKGDEST is a symlink to $startdir. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: improve srcdir check and add pkgdirAllan McRae2010-10-05
| | | | | | | | | | | | | The checking of the package for $srcdir references was overly sensitive and gave a lot of what appear to be false positives with binary files (in particular with debugging symbols kept). Restrict the search for $srcdir to non-binary files as this should still catch the majority of configuration issues the check was initially designed to catch. Also, add a similar check for $pkgdir. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: remove STRIP_DIRSAllan McRae2010-10-05
| | | | | | | | | | | | | | | For binary packages, the majority of the time used in the debugs symbol stripping process is the actual stripping of the binaries/libraries and not the testing of which files to strip. This allows more complete stripping of packages that install to "non-standard" paths that would not be generally included in makepkg.conf. Any performance hit that may be apparent for (_large_) "arch=('any')" packages can readily be avoided by disabling stripping in the PKGBUILD options array. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove quotes in remaining bash regexesDan McGee2010-09-07
| | | | | | | | After a8dcfeccfc, Allan noted that one more regular exprssion inside makepkg also contained quotes; these should not be there for the same reason as that commit. Signed-off-by: Dan McGee <dan@archlinux.org>
* Use pipe to create compressed package instead of an intermediate tar fileJürgen Hötzel2010-08-27
| | | | | | | | | | | A pipe between tar and compression command is used. This improves performance by running tar and the compression command simultaneously. Using a pipe also reduces IO by not writing an intermediate tar file to disk. Signed-off-by: Juergen Hoetzel <juergen@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: remove trailing quote mark in regexDan McGee2010-08-27
| | | | | | | Regular expressions in bash should not be quoted. Glad this was in the documentation and I didn't have to go to #bash to ask... Signed-off-by: Dan McGee <dan@archlinux.org>
* Merge branch 'maint'Dan McGee2010-08-23
|\
| * makepkg: add file to the list of needed utilitiesAllan McRae2010-08-18
| | | | | | | | | | Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
| * makepkg: check tput support before usingAllan McRae2010-08-18
| | | | | | | | | | | | | | | | Prevent makepkg aborting whe colors are enabled and the terminal does not support setting colors by tput. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | makepkg: error out on empty optdepends entriesAllan McRae2010-08-23
| | | | | | | | | | | | | | | | | | | | If optdepends was defined with empty members, then makepkg would abort late in the package building process. Detect such cases in the check_sanity() function. Fix-provided-by: Andres P <aepd87@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | makepkg: use less local variables in check_sanityAllan McRae2010-08-23
| | | | | | | | | | | | | | Instead of declaring a new local variable for each loop in the check_sanity() function, just reuse $i. Signed-off-by: Allan McRae <allan@archlinux.org>
* | makepkg: remove unnecessary variable presence checkAllan McRae2010-08-23
| | | | | | | | | | | | | | | | | | It is unnecessary to check for a variables existence before looping over it. Extracted from patch supplied by Andres P <aepd87@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* | makepkg: clarify invalid backup entry errorsAllan McRae2010-08-23
| | | | | | | | | | | | | | | | "Invalid backup entry" was not a particular helpful error message, especially when it was due to the file not being in the final package. Clarify these two messages. Signed-off-by: Allan McRae <allan@archlinux.org>
* | makepkg: less code duplication in create_packageAndres P2010-08-23
| | | | | | | | | | | | | | Combine changelog and install file creation in create_package(). Signed-off-by: Andres P <aepd87@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* | makepkg: use regex to match options for privilege escalationAllan McRae2010-08-23
| | | | | | | | | | | | | | | | Eases maintanence if we need to add further options in the future. Extracted from a patch supplied by Andres P <aepd87@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* | makepkg: Allow creation of uncompressed packagesThomas Bächler2010-08-08
| | | | | | | | | | | | | | When performing local testing, it may be useful to add PKGEXT='.pkg.tar' to the PKGBUILD to save time, especially with big packages. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2010-07-27
|\|
| * Always treat PKGLIST as an array.Dave Reisner2010-07-27
| | | | | | | | | | | | | | | | | | Fixes repackaging issues when multiple package names are passed to the --pkg option. Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2010-07-02
|\| | | | | | | | | Conflicts: scripts/makepkg.sh.in
| * makepkg: fix sudo/su calling of pacmanAllan McRae2010-07-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes two issues: 1) using "sudo -l" results in excess password asking under certian configurations. Revert to the pre 3.4 behaviour of always using sudo if it is installed. 2) Properly escape the command so that that versioned dependencies, such as "foo>4", do not get treated as output redirection when using su. This also unifies the generation of the pacman line and its privilege escalation. Based on patches supplied by Andres P <aepd87@gmail.com> with minor adjustments for suitability for the maint branch. Original-work-by: Andres P <aepd87@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* | makepkg: undeclared local variablesAndres P2010-07-02
| | | | | | | | | | | | | | | | | | | | | | Variables that are only meaningful within the function they are declared in are now prefixed by "local". Signed-off-by: Andres P <aepd87@gmail.com> [Allan: fix whitespace] Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2010-06-30
|\|
| * makepkg: try standard paths for coreutils duAllan McRae2010-06-30
| | | | | | | | | | | | | | | | | | Attempt to find "du" from coreutils in the standard paths and if not revert to the version in the users PATH. Using the full path prevents issues such as FS#19932, where a different and incompatible version of du is put earlier in the users path. Signed-off-by: Allan McRae <allan@archlinux.org>
| * makepkg: remove bash4-only parameter expansion in check_sanityAndres P2010-06-30
| | | | | | | | | | Signed-off-by: Andres P <aepd87@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
| * makepkg: Only check regular files in $srcdir checkThomas Bächler2010-06-30
| | | | | | | | | | | | | | | | | | | | | | The 'grep -R' in the $srcdir check would not only grep regular files, but also devices, symlinks (that might potentially point outside of $pkgdir), pipes and so on. Use find to ensure only regular files are examined. This should fix https://bugs.archlinux.org/task/19975 Signed-off-by: Allan McRae <allan@archlinux.org>
* | makepkg: clarify aborting on packaging failureAllan McRae2010-06-30
| | | | | | | | | | | | | | | | | | When makepkg catches a command failure it currently prints "Aborting..." and exits. Clarify the reason for aborting from packaging is a failure during one of the PKGBUILDs functions. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2010-06-24
|\|
| * makepkg: prevent error trap activation in bash-3.2Allan McRae2010-06-23
| | | | | | | | | | | | | | | | | | Running "pacman -T foo" is expected to return a non-zero value when "foo" is not installed. This sets of the error trap in bash-3.2 but not bash 4.x. Work around this by disabling the error trap around this pacman call as we are manually checking the return value anyway. Signed-off-by: Allan McRae <allan@archlinux.org>
* | makepkg: Place source packages symlinks in build dir when SRCPKGDEST is usedEric Bélanger2010-06-24
| | | | | | | | | | | | Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | makepkg: fix regression in split package function checkingAndres P2010-06-24
| | | | | | | | | | | | | | | | | | Commit 13748ca0529 inversed the nature of one test wherein the if clause would throw a fatal error if a legitimate package function was defined in PKGBUILD. Signed-off-by: Andres P <aepd87@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2010-06-20
|\|
| * makepkg: revert bash4-ismAllan McRae2010-06-20
| | | | | | | | | | | | | | | | | | Commit 3d67d9b1 introduced multiple bash4 string manipulations. Revert those in order retain compatibility with bash-3.2 which is still widely used. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
| * makepkg: fallback to sane defaults for library strippingAllan McRae2010-06-16
| | | | | | | | | | | | | | | | | | If the library stripping variables are not defined in makepkg.conf, libraries will be fully stripped and become broken. Fallback to a sane default stripping level. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | makepkg: remove unnecessary use of sortAndres P2010-06-21
| | | | | | | | | | | | | | | | | | pacman -Qq output is sorted according to the users LC_COLLATE setting as is needed for comm. Signed-off-by: Andres P <aepd87@gmail.com> [Allan: adjust commit message] Signed-off-by: Allan McRae <allan@archlinux.org>