summaryrefslogtreecommitdiffstats
path: root/scripts/makepkg.sh.in
AgeCommit message (Collapse)AuthorFilesLines
2009-07-22makepkg: add pkgbase to .PKGINFO and database for split packagesAllan McRae1-0/+1
With split packages, the pkgbase variable provides a useful way to find out which packages were build from the same PKGBUILD. Add it to the packages .PKGINFO file and the repo database only when package splitting is used. Original-patch-by: Pierre Schmitz <pierre@archlinux.de> [Allan: restrict to including only with spilt packages and include after pkgname] Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2009-07-12makepkg: clean up BUILDSCRIPT usageAllan McRae1-20/+20
FS#15448 (which is made worse by the "fix" for FS#14727...), highlighted some deficiencies in the usage of the BUILDSCRIPT variable. In particular, only relative paths worked with "-p" and some output was very strange in combination with the "-p" flag or reading from /dev/stdin. e.g. "Please add a license line to your /dev/stdin!". This patch adds a new variable, BUILDFILE, which contains the full path to the BUILDSCRIPT. This defaults to $startdir/$BUILDSCRIPT. Also, fix a missed quoting of $BUILD{SCRIPT->FILE} and remove warning about missing BUILDSCRIPT definition in makepkg.conf as the default BUILDSCRIPT value is now specified during configure. Add check that BUILDFILE is writable before updating VCS PKGBUILDs. When making a source package, the BUILDSCRIPT always gets given the default name, regardless of what it was originally called. Signed-off-by: Allan McRae <allan@archlinux.org>
2009-07-12makepkg: allow spaces in source file namesAllan McRae1-4/+4
The download command failed with sources that contained spaces. Remainder of fix for FS#15323. Signed-off-by: Allan McRae <allan@archlinux.org>
2009-07-12makepkg: fix breakage with '%' in source filenamesDan McGee1-1/+1
Ensure we don't pass a bare filename to printf that might contain a lookalike '%' escape sequence. Fixes part of FS#15323. Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2009-07-12makepkg: quote filenames when extractingDan McGee1-6/+6
We currently fall apart on files with spaces in the names. Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2009-07-10makepkg: check for package functions when package splittingAllan McRae1-3/+11
Makes sure the required package functions are present when using package splitting. Also moves setting of pkgbase variable outside the check_sanity function to somewhere more appropriate. Signed-off-by: Allan McRae <allan@archlinux.org>
2009-07-10makepkg: fix pkgdesc restoration with split packagingAllan McRae1-0/+5
A pkgdesc with spaces in it would get restored to an array and thus only the first word would be restored (FS#15210). Convert that array back to a string. Signed-off-by: Allan McRae <allan@archlinux.org>
2009-07-10makepkg: Exit on failure within build() or package() functionsAllan McRae1-3/+5
Errors in build() functions were only fatal, if "--log" was enabled. Errors in package() functions were never fatal. Piping these functions through "cat -" triggers error trapping. This prevents the need for "|| return 1" usage in PKGBUILDs. Original-patch-by: Juergen Hoetzel <juergen@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2009-07-10makepkg: fix check for previously built packages with package splittingAllan McRae1-9/+38
Checks if some or all packages are built before overwriting/installing. Adds some new strings for translation. Signed-off-by: Allan McRae <allan@archlinux.org>
2009-07-10makepkg: clean up moving PKGINFO creation to a functionAllan McRae1-2/+1
Someone forgot to commit this when pulling in the original patch to his working branch... Signed-off-by: Allan McRae <allan@archlinux.org>
2009-07-01Update copyright headers and messagesDan McGee1-2/+4
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-06-22makepkg: Move .PKGINFO creation into a function.Loui Chang1-16/+20
Signed-off-by: Loui Chang <louipc.ist@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2009-06-21makepkg: Download sources and check checksums for any source package.Loui Chang1-9/+9
It wouldn't be very nice to ship a PKGBUILD with the wrong checksums. Signed-off-by: Loui Chang <louipc.ist@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2009-06-13makepkg: fix variable backup/restore for splitpkgAllan McRae1-2/+2
The backup and restore of variables that can be overridden while making split packages only dealt with the first element, not the whole array (FS#15010). Adjust the bash voodoo to fix it... Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2009-06-13makepkg: fix PKGBUILD sanity checkAllan McRae1-4/+1
If PKGBUILD was good, the "insane" variable was not defined and so the if statement failed. Simplify and fix this check. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2009-06-07makepkg: refactor sanity checking into a functionDan McGee1-66/+76
No new checks, just move it into a function and return 1 rather than exit directly. This also allows the use of local variables. Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2009-05-18Add support for the xz archive formatPierre Schmitz1-0/+5
This simple patch adds support for the xz archive format to makepkg and repo- add. Xz can be used as source, package and package db file type. Signed-off-by: Pierre Schmitz <pierre@archlinux.de> [Dan: fixed a few alignment issues] Signed-off-by: Dan McGee <dan@archlinux.org>
2009-05-16makepkg: fix sourcing BUILDSCRIPT and PATH issuesAllan McRae1-2/+3
The bash source command looks in the users PATH for the file to source before the local directory. This causes issues when someone has a PKGBUILD somewhere in their path (for unknown some reason...). Fixes FS#14727. Signed-off-by: Allan McRae <allan@archlinux.org>
2009-05-14makepkg: Document package splittingAllan McRae1-1/+1
Signed-off-by: Allan McRae <allan@archlinux.org>
2009-05-14makepkg: do not update pkgver when building source packageAllan McRae1-6/+5
When making a source package for a SCM PKGBUILD, makepkg should not update the pkgver/pkgrel. Noted in FS#14456. Signed-off-by: Allan McRae <allan@archlinux.org>
2009-05-11makepkg: several small fixesAllan McRae1-1/+3
1) Do not attempt to strip compressed binaries Original-work-by: Marc - A. Dahlhaus <mad@wol.de> 2) Add "\" in "GPL\'ed" so quote mark does not break source code highlighting 3) Add local to docdir paths in makepkg.conf for consistency 4) Use full path to sed in MacOSX in case users have GNU sed earlier in path Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2009-04-26makepkg: make in-place sed portableAllan McRae1-2/+2
Do a sed replacement in-place is not very portable. On Mac OSX and BSDs, the syntax is "sed -i ''" where as with GNU sed the command is "sed -i''" or just "sed -i". This patch detects which command should be used during configure. Credit to Kevin Barry who researched this issue and provided a patch to work around this using temporary backup files. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2009-04-11Merge branch 'xav/repo-add'Dan McGee1-7/+16
2009-04-11makepkg: fix double check on same pathDan McGee1-1/+1
Commit 142225fd typo-ed this one, as it should look like the rest of the checks similar to it. Signed-off-by: Dan McGee <dan@archlinux.org>
2009-04-11makepkg: Fix integrity check when files are missing.Loui Chang1-8/+11
The index in the for loop wasn't being incremented, so if the first file wasn't found, the second file would be compared to the first checksum, rather than the second. Signed-off-by: Loui Chang <louipc.ist@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2009-03-30makepkg: run tidy_install with no package() functionAllan McRae1-0/+1
After the splitpkg implementation, the tidy_install function was not being called in PKGBUILDs with only the build() function. Signed-off-by: Allan McRae <allan@archlinux.org>
2009-03-29makepkg: do not bail on failure to install built packageAllan McRae1-2/+8
Fixes FS#13417. Do no exit makepkg on a failure to install the built package(s). This allows clean-up to still occur. Signed-off-by: Allan McRae <allan@archlinux.org>
2009-03-26makepkg: adjust log clean-up for new filenamesAllan McRae1-1/+8
The log files now have -build or -package at the end and there are separate log files for each *_package() function. Alter clean_up() to deal with this. Also, move glob outside quotes so this actually works. Signed-off-by: Allan McRae <allan@archlinux.org>
2009-03-25makepkg: adjust install_package for split packagesAllan McRae1-3/+14
Install all created packages when using the install option with package splitting. Signed-off-by: Allan McRae <allan@archlinux.org>
2009-03-16Refactor testing for color message outputAllan McRae1-5/+11
Signed-off-by: Allan McRae <allan@archlinux.org>
2009-03-16makepkg: add pkgbase variableAllan McRae1-21/+23
The pkgbase variable is added to improve informational output and source package naming when using split packages. Defaults to ${pkgname[0]} if not set. Also: - move splitpkg detection to after pkgname presence is verified - add "cd" line to package_foo() functions in splitpkg proto Signed-off-by: Allan McRae <allan@archlinux.org>
2009-03-15Fix several issues with xdeltaXavier Chantry1-7/+16
1) The changes to sync.c look big but there are mostly caused by the indentation. Fix a bug where download_size == 0 because the packages and deltas are already in the cache, but we still need to build the deltas list and apply the deltas to create the final package. 2) Fix the gzip / md5sum issue by switching to xdelta3, disabling external recompression and using gzip -n in pacman, and disable bsdtar compression and using gzip -n in makepkg. Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
2009-03-15Only check checksums if there is a source fileAllan McRae1-0/+2
Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2009-02-28makepkg : remove xdelta supportXavier Chantry1-66/+0
The pkgdelta script can be used instead. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2009-02-23Merge branch 'maint'Dan McGee1-2/+0
2009-02-23makepkg: fix updating pkgrel with pkgver in SCM packagesAllan McRae1-2/+0
Commit 1e656c0a introduced the changing of pkgrel to 1 when the pkgver was updated in SCM PKGBUILDs. However, the output in the "Making package:" was wrong. Attempting to fix that created another bug (FS#13416). Interestingly, pkgver was only ever being updated in the fakeroot stage which caused this problem. Now both pkgver and pkgrel are updated after the first devel_check and devel_update. Enjoy the really long explaination for a two line fix... Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2009-02-08Merge branch 'maint'Dan McGee1-2/+2
2009-02-08makepkg: Make stripping debug symbols cross-platformSebastian Nowicki1-2/+2
The Linux and BSD versions of strip have the --strip-debug option (as well as the -S option), however Mac OS X only has -S. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-18makepkg: test fixes, part 2Dan McGee1-19/+19
The goal of this fix was empty string comparisons: - if [ "$pkgname" != "" ]; then + if [ -n "$pkgname" ]; then Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-18makepkg: clean up test usageDan McGee1-50/+51
In a lot of places, we had the following construct: [ "$foobar" = "0" ] which is better represented by using the integer tests: [ $foobar -eq 0 ] Attempt to unify makepkg to use the latter rather than the former in all places. From here on out we should ensure anything that is set to 0, 1, etc. uses the -eq format rather than =. In addition, fix a few other test anomalies including usage of double equals. Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-17makepkg: repackage rework with package functionsAllan McRae1-20/+28
When using the optional package() function or split packages, the entire packaging step is rerun instead of just final package creation step. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-16makepkg: implement creation of split packagesAllan McRae1-16/+47
Adds the ability to create multiple packages from one PKGBUILD Signed-off-by: Allan McRae <allan@archlinux.org>
2009-01-16makepkg: Optional argument for run_package and create_packageAllan McRae1-6/+20
Generalize run_package to allow the passing of a package name directing the use of an alternative package function. A similar adjustment to create_package to prepare split packages. Signed-off-by: Allan McRae <allan@archlinux.org>
2009-01-16makepkg: hack around tee in run_package functionAllan McRae1-1/+10
Piping the package function through tee to log the outut also clears any variables set in the package function. This is a problem in split packages as package variable overrides are done in the package function. This is fixed by creating a node which the output is piped through and duplicated using the tee function. Signed-off-by: Allan McRae <allan@archlinux.org>
2009-01-16makepkg: add functions for backup and restore of package fieldsAllan McRae1-1/+22
Adds functions for the backup and restoration of package variables that can be over-ridden during package splitting. Variables which can be overridden are given in the splitpkg_overrides variable. Signed-off-by: Allan McRae <allan@archlinux.org>
2009-01-16makepkg: add optional package functionAllan McRae1-2/+55
This patch allows us to split the building and packaging stages of a PKGBUILD and minimize fakeroot usage. This can be done with less code duplication (run_build and run_package look quite similiar) but the run_package function will be where the package splitting logic is implemented in the future. Signed-off-by: Allan McRae <allan@archlinux.org>
2009-01-13makepkg: fix my own stupid mistakeDan McGee1-1/+1
We don't want to bail if a certain integrity check wasn't even provided. Whoops. Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-13makepkg: use INTEGRITY_CHECK only for generation of checksumsAaron Schaefer1-7/+9
Signed-off-by: Aaron Schaefer <aaron@elasticdog.com> [Dan: fail if checksum array is incorrectly sized] Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-12makepkg : fix a lot of breakages caused by AllanXavier Chantry1-15/+5
This patch started as a simple typo fix (pugre instead of purge in two places), as well as a fix of a test which was using PURGE_TARGETS instead of $PURGE_TARGETS. It evolved in a slight handling change of the OPTIONS which have a variable affecting their behavior (strip STRIP_DIRS, docs DOC_DIRS, zipman MAN_DIRS and purge PURGE_TARGETS), as well as a clarification in makepkg.conf. Now when a variable is undefined or empty, the corresponding option will have no effect. It looked weird to have a fallback when a option is defined but empty, it seems more natural to not have any fallbacks. Also re-enable docs by default. It seems arbitrary to delete files from packages by default, and it would be more vanilla and distro agnostic to keep them. docs was also the only negated option. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-03makepkg: Add support for specifying LDFLAGSAllan McRae1-1/+1
Provide support for specifying LDFLAGS within makepkg.conf but leaves this undefined by default. Fixes FS#12542. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>