summaryrefslogtreecommitdiff
path: root/scripts/makepkg.sh.in
Commit message (Collapse)AuthorAge
* makepkg: save and restore shopts when sourcing /etc/profileAllan McRae2012-04-08
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* makepkg: complain when the buildfile isn't writeableDave Reisner2012-04-08
| | | | | | | | 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>
* makepkg: catch errors sourcing filesDave Reisner2012-04-08
| | | | | | | create source_safe() function which temporarily disables extglob and exits on error. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* makepkg: restrict usage of errexit to user functionsDave Reisner2012-04-08
| | | | | | | | | | | | 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>
* makepkg: treat lib{provides,depends} returns as proper arraysDave Reisner2012-04-08
| | | | | | | | Make these functions more whitespace space by treating newlines as the element delimiter rather than every form of whitespace. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: use proper array addition in libdepsDave Reisner2012-04-08
| | | | | Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: add missing newline from libprovides outputDave Reisner2012-04-08
| | | | | | | | | | | | | This was a small oversight from 1917c845 which causes makepkg to write provides entries to the .PKGINFO file improperly, e.g. provides = systemdlibsystemdudev=999 Add a newline in the printf format to ensure that these are spaced appropriately. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: safely change directoriesAllan McRae2012-04-07
| | | | | | | | | In preparation for the removal of the global error trap we need a way to ensure changing directories succeeds. Add a "cd_safe" wrapper that performs the necessary check. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: use printf rather than echo to output variableAllan McRae2012-04-07
| | | | | | | Also make sure the strings passed to %s in printf are always quoted. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: the rhs in string comparisons should be quotedAllan McRae2012-04-07
| | | | | Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: devel_check(): cleanup for hg versionMatthew Monaco2012-04-07
| | | | Use pushd/popd, quote args, handle some more errors
* makepkg: devel_check(): set newpkgver (cleanup)Matthew Monaco2012-04-07
| | | | | The case structure allows the syntax to focus on what's actually being done here.
* makepkg: devel_check(): consolidate common codeMatthew Monaco2012-04-07
|
* makepkg: devel_check(): determine vcsMatthew Monaco2012-04-07
| | | | | Rather than prioritizing an arbitrary VCS, collect all development directives. If there is more than one, give a warning and abort.
* makepkg: remove unused variableMatthew Monaco2012-04-07
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Merge branch 'maint'Dan McGee2012-04-07
|\ | | | | | | | | | | Conflicts: lib/libalpm/signing.c lib/libalpm/sync.c
| * Revert "parseopts: normalize options into an array"Dave Reisner2012-04-07
| | | | | | | | | | | | | | | | | | | | | | | | This was really only half a fix for FS#28445, as it still doesn't correctly handle the case of filenames with spaces. In the short term, there is no obvious fix for this. In the long term, I believe the correct decision is to rewrite the options parser to be more in line with GNU getopt_long. This reverts commits: ca4142714137b16feabac09c4cda86b0a75036f8. 969dcddbdf9d5dbd91aa414cdd193f3fb26b644b.
| * makepkg: avoid reporting bogus install size on btrfsDave Reisner2012-03-28
| | | | | | | | | | | | | | | | | | | | | | | | delayed allocation hoses us here and causes erroenous install sizes to be reported. Add a short sleep to allow the transaction to be committed to the filesystem and the stat buffers to be updated. This is apparently a "feature", as per to some of the denizens of #btrfs on freenode. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Revert "makepkg: calculate exact total file size"Dan McGee2012-04-07
| | | | | | | | | | | | This reverts commit b264fb9e9ddcc31dc8782390309421965e507383. With our "fix" of sleeping for BTRFS, we can go back to using `du` to calculate total installed size.
* | Merge branch 'maint'Dan McGee2012-03-16
|\| | | | | | | | | Conflicts: lib/libalpm/sync.c
| * makepkg: quote removed filename as it can have spacesAllan McRae2012-03-16
| | | | | | | | | | Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | makepkg: abort when failing to create BUILDDIRAllan McRae2012-03-16
| | | | | | | | | | Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | makepkg: prevent issues with files starting with a hyphenAllan McRae2012-03-16
| | | | | | | | | | | | | | | | | | Most places in makepkg deal with full file paths, but a few use the file name only. Protect from potential issues when a file name starts with a hyphen. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | makepkg: append pkgbase to BUILDDIR if specifiedAllan McRae2012-03-16
| | | | | | | | | | | | | | | | | | This means multiple packages can be build using the same BUILDDIR without their source files all ending up extracted in the same directory. Fixes FS#28417. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2012-03-08
|\| | | | | | | | | Conflicts: lib/libalpm/be_package.c
| * makepkg: exit via default signal handler in trap_exitDave Reisner2012-03-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Similar to how we manage receipt of SIGINT in pacman's internal downloader, catch the signal and invoke our own trap handler before unsetting it and calling the default. This requires a slight modification to the arguments passed to trap_exit so we can pass the raised signal to trap_exit (note that we substitue USR1 for ERR since the latter is unique to bash). Fixes FS#28491. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
| * makepkg: fix false error with multiple libdepsFlorian Pritz2012-03-05
| | | | | | | | | | | | | | | | | | With multiple items in $libdepends this check only worked for the first one, everything after this returned an error. This was probably an issue with \s being treated wrong. Fix-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Florian Pritz <bluewind@xinu.at>
| * makepkg: fix extraction of soname in find_libdependsFlorian Pritz2012-03-05
| | | | | | | | | | | | | | | | | | libperl.so results in soname="libperl.so.so" which is wrong. This returns the correct string: "libperl.so" Fix-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Florian Pritz <bluewind@xinu.at>
* | makepkg: use array instead of stringDave Reisner2012-03-08
| | | | | | | | Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* | makepkg: avoid use of eval in run_pacmanDave Reisner2012-03-08
| | | | | | | | Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* | makepkg: enforce decimal format for pkgrelDave Reisner2012-03-08
| | | | | | | | Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* | makepkg: allow specifying compression optionsChristian Hesse2012-03-08
| | | | | | | | | | | | | | | | | | | | | | Adds the ability to override the commands used to compressing compiled and source packages. This is useful for those wanting to use alternative implementations of the compression tools or non-default compression options. Allan: documented options in man page Signed-off-by: Allan McRae <allan@archlinux.org>
* | Merge branch 'maint'Dan McGee2012-02-20
|\| | | | | | | | | | | Conflicts: contrib/pacsysclean.in src/pacman/conf.h
| * parseopts: normalize options into an arrayDave Reisner2012-02-16
| | | | | | | | | | | | | | | | | | | | Modify parse_options logic to fill an array instead of printing parsed options. Avoid eval like the plague. Because it is the plague. Fixes bugs such as FS#28445. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
| * makepkg: fix syntax error in remove_depsChristoph Vigano2012-02-15
| | | | | | | | | | | | | | | | | | | | | | | | This fixes a problem that occurs if you tell makepkg to remove installed dependencies (just to be sure) but there are none. As the $ was missing in front of deplist, the check never happened and 'pacman -Rn' was called which obviously failed. Dan: later reported as FS#28448. Signed-off-by: Christoph Vigano <mail@cvigano.de> Signed-off-by: Dan McGee <dan@archlinux.org>
| * scripts: unset CDPATH if cd is usedDan McGee2012-02-14
| | | | | | | | | | | | | | | | | | This wonderful/awful little bash shell variable wrecks havoc on `cd` calls in shell scripts. Unset CDPATH in makepkg where we use `cd` quite heavily. In pacman-optimize, we can move the change directory logic into the bsdtar call so we are left with no usages of `cd` in the script. Signed-off-by: Dan McGee <dan@archlinux.org>
* | makepkg: rework libprovidesAllan McRae2012-02-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reworks the implmentation of libprovides for the following benefits: - Moves functionality from write_pkginfo() to find_libprovides() - Only calculates the version for libraries specifically requested and not all libraries. This has the disadvantage of running find over the $pkgdir for as many libraries as needed, but is unlikely to be an issue due to caching. - The order of the provides array in the PKGBUILD is kept in the package - There are more warning messages when things fail and those that were there are no longer errors (as I do not think failure of libprovides should result in complete packaging failure) - It is now modular so can be easy extended to other library types other than ELF *.so. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2012-02-13
|\| | | | | | | | | | | Conflicts: lib/libalpm/sync.c src/util/pactree.c
| * makepkg: disable extglob when sourcing BUILDSCRIPTAllan McRae2012-02-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | PKGBUILDs are advertised as being pure bash so it would be expected that the default bash options are in effect when sourcing it. This inadvertantly "fixes" FS#27780 where enabling extglob causes the bash parser to error on non-valid bash function names like package_libxml++(). Note that these function names are unsupported in bash and could break again even with this "fix" in future bash releases. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
| * makepkg: deal with mercurial exit codesAllan McRae2012-02-11
| | | | | | | | | | | | | | | | | | From mercurial-2.1, "hg pull" returns 1 when there are no updates. Catch the return code and either pull the update or return an error as appropriate. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2012-02-06
|\| | | | | | | | | Conflicts: lib/libalpm/alpm_list.c
| * makepkg.sh.in - if both -r and -i are provided, only remove makedepsAndrew Gregory2012-02-06
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
| * makepkg.sh.in - fix remove_deps test for deps to be removedAndrew Gregory2012-02-06
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
| * makepkg: add forgotten newline in help outputMantas Mikulėnas2012-02-06
| | | | | | | | | | Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
| * makepkg: Fix non-writable SRCPKGDEST error messageAllan McRae2012-01-31
| | | | | | | | | | | | | | | | | | | | Provide a helpful error message for when creating a source tarball and SRCPKGDEST is not writable. Fixes FS#28197. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2012-01-30
|\| | | | | | | | | Conflicts: scripts/makepkg.sh.in
| * scripts: always use printf with embedded gettextDave Reisner2012-01-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This addresses two problems: 1) echo's behavior is inconsistent when dealing with flags, and can potentially be problematic. $ echo -n $ echo -- -n -- -n 2) Always using the end of options markers prevents translated strings from throwing errors, as shown in FS#28069. The remaining "inconsistencies" are because printf is being used in a guaranteed safe manner, e.g. printf '%s\n' "$(gettext "--this can never break")" Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
| * makepkg: workaround for zipman issuesAllan McRae2012-01-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This "fixes" two issues: 1) MAN_DIRS contains a glob by default so should not be quoted. It is not quoted anywhere else so this should not cause breakage... 2) the find statement returns 1 when some of MAN_DIRS are missing. This appears to only be exposed when running makepkg as root (which it appears some wrappers do...). Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | makepkg: check for license when creating srcpackageDave Reisner2012-01-23
| | | | | | | | Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* | makepkg: abstract license check into separate functionDave Reisner2012-01-23
| | | | | | | | Signed-off-by: Dave Reisner <dreisner@archlinux.org>