summaryrefslogtreecommitdiffstats
path: root/scripts
AgeCommit message (Collapse)AuthorFilesLines
2009-02-24makepkg: 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-20repo-add : remove realpath usageXavier Chantry1-24/+19
Rework slightly db_write_entry so that $pkgfile is no longer referenced from the temporary dir. This means $pkgfile can be a relative path and does not need to be converted with realpath anymore. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2009-02-20repo-add : remove the need of realpath for REPO_DB_FILEXavier Chantry1-17/+16
REPO_DB_FILE does not need to be an absolute path anymore so no need to call realpath. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2009-02-19Merge branch 'maint'Dan McGee1-13/+16
2009-02-19repo-add : remove useless test_repo_db_file functionXavier Chantry1-10/+1
This function was used only once, was basically just one line, and was also called with an unused argument. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2009-02-16repo-add: fix eval and quote issuesDan McGee1-13/+16
eval was ugly and dirty, and bit us here. Instead, use a safer form of variable declaration to ensure quotes don't foil us in pkgdesc or any other fields. This fixes FS#10837. 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-17Merge branch 'am/splitpkg'Dan McGee1-13/+141
* am/splitpkg: makepkg: implement creation of split packages makepkg: Optional argument for run_package and create_package makepkg: hack around tee in run_package function makepkg: add functions for backup and restore of package fields makepkg: add optional package function makepkg: Add PKGBUILD-split.proto
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-15Make the repo-add quiet flag less quietAaron Griffin1-3/+2
Considering one can easily run: repo-add .... >/dev/null to get only warnings and errors, the -q flag is mostly useless. Make the -q flag silence only level 2 messages. Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-14makepkg: 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-14makepkg: 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-13makepkg : 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>
2009-01-03makepkg: move BUILDSCRIPT from makepkg.confAllan McRae2-0/+2
Commit 4b183bf9 moved makepkg.conf sourcing to after the parsing of options, breaking the -p option and --help output. The solution is to move BUILDSCRIPT out of makepkg.conf. This patch moves the definition BUILDSCRIPT back to makepkg itself and adds configure option to allow easy changing of this value during build time. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-03makepkg: Introduce purge optionAllan McRae1-2/+13
The purge option, combined with the PURGE_TARGETS variable, allows makepkg to automatically remove commonly confliting or removed files (e.g. /usr/share/info/dir, *.pod). Original work: Tim Yang Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-03makepkg: Add used options to PKGINFO fileAllan McRae1-3/+14
Adds defined options to the PKGINFO file in the form of "makepkgopt =". It may be useful to be able to add these to the pacman DB at some point as that would allow (e.g.) checking which packages have had their docs striped (FS#7092). Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-03makepkg: add fallback for when MAN_DIRS is unsetAllan McRae1-0/+4
This prevents makepkg compressing every file when MAN_DIRS is not supplied in makepkg.conf Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-03makepkg: provide MAN_DIRS configuration variableAllan McRae1-5/+4
Provides a MAN_DIRS variable in makepkg.conf which can be used to specify folders to look for manual (man and info) pages to be compressed. Useful for packages that install to /opt. Also clarifies that "zipman" means "zip manuals" and covers both man and info pages. Original work by: Tiago Pierezan Camargo <tcamargo at gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-03Merge branch 'maint'Dan McGee2-15/+111
Conflicts: lib/libalpm/dload.c po/it.po scripts/makepkg.sh.in
2009-01-03Small makefile updateDan McGee1-1/+2
Use the proper call for symlink creation Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-03makepkg: detect incorrect usage of provides arrayAllan McRae1-2/+10
Using > or < in the provides array is wrong so make it cause an error. Fixes FS#12540. Also, use bash substitution rather than spawning new processes where possible in the error checking. Move split package detection to a better position. Signed-off-by: Allan McRae <allan@archlinux.org> [Dan: backport to maint] Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-03makepkg: tidy version package testsAllan McRae1-6/+6
The use if "! -z" to check if a string is not null is not good practice so replace with the "-n" option. Also use the AND comparison within one test rather than on two separate tests. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-03makepkg: quote all uses of BUILDSCRIPTAllan McRae1-4/+4
Allows specifying alternative build script with spaces in name Signed-off-by: Allan McRae <allan@archlinux.org> [Dan: backport some of the fixes to maint] Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-03makepkg: Replace getopt with internal functionAllan McRae1-2/+89
This will allow makepkg to work on systems like Mac OS X where the default getopt is too old to properly handle long options. The new parse_options function should replicate getopt's behaviour completely. Original work: Yun Zheng Hu <yunzheng.hu@gmail.com> [Allan: Rewrite and bug fixes] Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-12-08Merge branch 'maint'Dan McGee1-0/+4
2008-12-08makepkg: ensure PKGBUILD does not contain CRLF charactersDan McGee1-0/+6
Do a simple check before sourcing the file to ensure we are a valid bash script. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-12-08makepkg: several small bits of tidyingAllan McRae1-22/+9
1. Do not warn people about missing arch if they are using --ignorearch. 2. Remove unneed reference to bug report about using fakeroot as little as possible. We want to do that, bug report of not. 3. Removes superfluous warning given when building as root. The user has already used the "--asroot" flag. 4. Move comment about skipping warning message to above where it occurs 5. Do not warn about skipping source retreval, integrety checks and extraction when using --repackage 6. Do not warn about skipping build when using --repackage 7. Move comment about fakeroot usage to above test condition Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-12-08makepkg: save and restore shell options before and after build()Dan McGee1-0/+4
Fix the issue uncovered by FS#12344. In this instance, the dotglob shopt was being set in the build() function but never cleared, causing issues in the remaining parts of the makepkg script. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-12-03Merge branch 'maint'Dan McGee1-1/+1
Conflicts: lib/libalpm/dload.c
2008-11-30Simplify mercurial revision commandDan McGee1-1/+1
Not only does this require less sed-magic, it also fixes FS#12286 where fetching the revision number fails if mercurial is in compact mode. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-11-01Merge branch 'maint'Dan McGee1-2/+2
2008-11-01makepkg: actually fix passing PKGBUILD from pipeAllan McRae1-2/+7
If PKGBUILD (BUILDSCRIPT) is not found, test for information from a pipe and use that. Fixes FS#9187. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-11-01makepkg: fix bash substitution to work under older versionsDan McGee1-2/+2
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-10-29makepkg: enable passing PKGBUILD from pipeAllan McRae1-3/+9
Do not attemp to update pkgver/pkgrel when reading a SCM based PKGBUILD from a pipe. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-10-29Merge branch 'maint'Dan McGee3-24/+39
2008-10-29Give pacman-optimize a refresherDan McGee1-21/+34
This patch addresses quite a few lingering issues in the pacman-optimize script. FS#11767 provoked this look-over and the following issues were noticed and fixed: * If an alternate dbroot was specified, then the lockfile location was never updated to reflect it. The lockfile location is now set after all dbpath initialization. * The inclusion of a trailing slash on dbroot was problematic and led to the following command being executed: bsdtar -xpf /tmp/pacman-optimize.p12Q4vAUWY/pacman-db.tar.gz \ -C /var/lib/pacman/.new/ It is doubtful we meant to create a hidden directory like this below our database root, only to go and delete it a second later and then re-extract. Fix the whole thing by ensuring our dbpath has its trailing slash stripped and then appending it when necessary. * The DB extraction was performed twice for no real apparent reason. This opens the door for extraction problems the second time around, leaving you with no original database to fall back to. Change the behavior so we only extract once, and then perform a directory shuffle once we verify the checksums are correct. * Perform an explicit sync after we drop the new database on the disk. It should work better this way. * Tighten up our check for a pacman lockfile and the time we create one. There is still a possible race condition but the window is shorter. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-10-29makepkg: fix updating PKGBUILD when building SCM packagesAllan McRae1-1/+3
Fixes a bug and resets pkgrel to 1 when bumping pkgver Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-10-19repo-add: Use openssl instead of md5sumDan McGee1-2/+2
This is similar to the change we made in makepkg so it is cross-platform compatible and doesn't require coreutils. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-10-13makepkg: allow compression type to be autodetectedDan McGee1-2/+18
Inspired by commit 7e8f1469c4168875b54956d63884b8583ce99e38, use our given PKGEXT or SRCEXT to determine what method of compression to use on the package we create. If the extension is invalid, this should fall back to creating a non-compressed tar file. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-10-13Quiet up the make process a bitDan McGee1-7/+8
When we do our sed edits, we really don't need every command printed out to the terminal. Now with "make -s", the output is quite palatable. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-27Merge branch 'maint'Dan McGee1-20/+45