summaryrefslogtreecommitdiff
path: root/scripts
AgeCommit message (Collapse)Author
2010-09-07Remove quotes in remaining bash regexesDan McGee
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>
2010-08-27Use pipe to create compressed package instead of an intermediate tar fileJürgen Hötzel
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>
2010-08-27makepkg: remove trailing quote mark in regexDan McGee
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>
2010-08-23Merge branch 'maint'Dan McGee
2010-08-23makepkg: error out on empty optdepends entriesAllan McRae
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>
2010-08-23makepkg: use less local variables in check_sanityAllan McRae
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>
2010-08-23makepkg: remove unnecessary variable presence checkAllan McRae
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>
2010-08-23makepkg: clarify invalid backup entry errorsAllan McRae
"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>
2010-08-23makepkg: less code duplication in create_packageAndres P
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>
2010-08-23makepkg: use regex to match options for privilege escalationAllan McRae
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>
2010-08-18repo-add: create relative DB symlinksDan McGee
As noted in FS#20498, if an absolute path is used for specifying the database when invoking repo-add, the symlink generated will point to the absolute path instead of being relative to the directory. Fix this for the two linking cases, but leave the copy untouched so that will still work. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-08-18makepkg: add file to the list of needed utilitiesAllan McRae
Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2010-08-18makepkg: check tput support before usingAllan McRae
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>
2010-08-08makepkg: Allow creation of uncompressed packagesThomas Bächler
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>
2010-07-27Merge branch 'maint'Dan McGee
2010-07-27Always treat PKGLIST as an array.Dave Reisner
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>
2010-07-07Remove DBEXT usageAllan McRae
With commit 5dffef78, the repo database always has a symlink of the form reponame.db. Use that filename and let libarchive determine the compression type. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-02Merge branch 'maint'Dan McGee
Conflicts: scripts/makepkg.sh.in
2010-07-02makepkg: undeclared local variablesAndres P
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>
2010-07-01makepkg: fix sudo/su calling of pacmanAllan McRae
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>
2010-06-30Merge branch 'maint'Dan McGee
2010-06-30makepkg: clarify aborting on packaging failureAllan McRae
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>
2010-06-30makepkg: try standard paths for coreutils duAllan McRae
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>
2010-06-30makepkg: remove bash4-only parameter expansion in check_sanityAndres P
Signed-off-by: Andres P <aepd87@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2010-06-30makepkg: Only check regular files in $srcdir checkThomas Bächler
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>
2010-06-24repo-add: try symlink, then hardlink, then copy for DB fileDan McGee
We were seeing some issues when trying to create our new database alias using symlinks on certain filesystems (see FS#19907). Have a fallback method in place where we first try a symlink, then a hard link, then just copy the database if all else fails. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-24Merge branch 'maint'Dan McGee
2010-06-24makepkg: Place source packages symlinks in build dir when SRCPKGDEST is usedEric Bélanger
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>
2010-06-24makepkg: fix regression in split package function checkingAndres P
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>
2010-06-23makepkg: prevent error trap activation in bash-3.2Allan McRae
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>
2010-06-23rankmirrors: pipe errors to stderrAndres P
If this is to be scripted with AIF or another tool, it needs to respect stderr. Signed-off-by: Andres P <aepd87@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2010-06-23rankmirrors: fix bogus pacman configuration parsingAndres P
Valid pacman configuration files do not have to start with a hash for that line to be a comment, neither do directives need to be in column 0. Signed-off-by: Andres P <aepd87@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2010-06-23rankmirrors: fix bogus variable assignmentAndres P
$replacedurl was being built from an expansion of itself. But at the time it happened, it was empty. Fixes FS#19911 Signed-off-by: Andres P <aepd87@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2010-06-20Merge branch 'maint'Dan McGee
2010-06-20makepkg: revert bash4-ismAllan McRae
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>
2010-06-21makepkg: remove unnecessary use of sortAndres P
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>
2010-06-21makepkg: use parameter expansion instead of basenameAndres P
Signed-off-by: Andres P <aepd87@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2010-06-21makepkg: fix inconsistent output when checking dependenciesAndres P
Instead of writing: ==> Checking Runtime Dependencies... ==> Checking Buildtime Dependencies... ==> Installing missing dependencies... Just make it homogeneous: ==> Checking runtime dependencies... ==> Checking buildtime dependencies... ==> Installing missing dependencies... Signed-off-by: Andres P <aepd87@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2010-06-21makepkg: merge in-line splitpkg handling logicAndres P
Ease maintainace; the two parts that have been combined into a function were identical. Signed-off-by: Andres P <aepd87@gmail.com> [Allan: rename function] Signed-off-by: Allan McRae <allan@archlinux.org>
2010-06-21makepkg: add to variables without expanding themAndres P
Use foo+=" bar" instead of foo="${foo} bar" Signed-off-by: Andres P <aepd87@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2010-06-21makepkg: less code repetition for empty variable checkingAndres P
Signed-off-by: Andres P <aepd87@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2010-06-21makepkg: use "declare -f" to test for function presenceAndres P
Signed-off-by: Andres P <aepd87@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2010-06-21makepkg: fix variable checks when writing pkginfoAndres P
Regression caused by c71fe7db. Was checking for "optdepend" and "conflict" rather than "optdepends" and "conflicts" when populating .PKGINFO. Signed-off-by: Andres P <aepd87@gmail.com> [Allan: adjust commit message] Signed-off-by: Allan McRae <allan@archlinux.org>
2010-06-16makepkg: fallback to sane defaults for library strippingAllan McRae
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>
2010-06-17makepkg: Extract from any file bsdtar can recognizeNezmer
If "file -bizL" does not return a supported type, check if the file is recognized by bsdtar and if yes extract from it. Dan: use '-q' option to prevent needing to seek the entire archive. Signed-off-by: Nezmer <git@nezmer.info> Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2010-06-17makepkg: use printf when writing pkginfoAndres P
Signed-off-by: Andres P <aepd87@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2010-06-17makepkg: use single redirection when writing PKGINFOAndres P
Instead of specifying the output file on every echo, leave it to the caller of write_pkginfo to specify the target. Signed-off-by: Andres P <aepd87@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2010-06-17makepkg: use double bracketsAndres P
Change all instances of the (test) [ builtin to the [[ keyword. Signed-off-by: Andres P <aepd87@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2010-06-17makepkg: use type -p's return value for PATH checksAndres P
Rely on type -p's return value instead of a string check. And gettext was previously being checked with type -t, which was inconsistent with the rest of the tests pertaining commands that aren't expected to be functions nor builtins. Signed-off-by: Andres P <aepd87@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2010-06-17makepkg: fallback to sane defaults for library strippingAllan McRae
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>