summaryrefslogtreecommitdiffstats
path: root/scripts/makepkg.sh.in
AgeCommit message (Collapse)AuthorFilesLines
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-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-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-01makepkg: fix bash substitution to work under older versionsDan McGee1-2/+2
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-08-26makepkg : allow to specify a download filenameXavier Chantry1-20/+45
A source entry can now have the following form, to specify a different filename : "filename::http://path/to/file" Of course, the old syntax is still supported : "http://path/to/file" And as before, in the second case, the filename used is simply "file". This fixes FS#11292, because handling multiple source files with the same name is now possible (just choose a different filename). But it will also allow to deal much more nicely with funny url like this by using a sane filename (and unfortunately, there are quite a few) : http://www.vim.org/scripts/download_script.php?src_id=6992 Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-23makepkg : localize the Y/n part of the question.Xavier Chantry1-3/+4
pacman already localizes the yesno stuff, so doing the same in makepkg is more consistent. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-23makepkg: do insensitive comparisons of checksums.Xavier Chantry1-1/+3
This fixes FS#11283 , which was originally reported on the forums : http://bbs.archlinux.org/viewtopic.php?id=53794 Insensitive comparisons were implicitly made before since md5sum --status was used for checking. Now that we use openssl and compare checksums manually in bash, we lost that feature. This can be easily reintroduced using tr '[A-F]' '[a-f]' What convinced me to fix it is that the md5 command line tool generates md5sums in upper case by default : http://www.fourmilab.ch/md5/ And finally, A-F and a-f are the same in hex and both are used. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-14Fix error when sourcing profile scriptAllan McRae1-0/+3
With the "set -e" property set, a failure when sourcing /etc/profile can cause makepkg to exit without error message. The bash-completion package activates this bug. Fixes FS#11179. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-09Fix creation of source package with local source filesAllan McRae1-1/+1
Fixes FS#11149. Signed-off-by: Allan McRae <allan@archlinux.org>
2008-08-04makepkg: fix download functions with weird urls.Xavier Chantry1-12/+14
This fixes FS#11076. 1) quote the url in get_downloadclient 2) only enable nullglob where it is needed You can see in 7fc306cd41 that nullglob was only enabled for one part, and that it already caused other problems, which were fixed in 7ff5a917fd0. Thanks to Henning Garus for pointing out that nullglob was problematic with urls containing expansion char like '?'. 3) change get_downloadcmd which displayed the download command line to download_file which actually executes the download. It seems nicer that way. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-04makepkg: Clarify usage instructions for --allsource/--sourceDan McGee1-1/+2
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-30makepkg: Fix STRIP_DIRS test.Xavier Chantry1-2/+3
Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-30makepkg : use /etc/profileXavier Chantry1-7/+2
This fixes FS#9486. source /etc/profile instead of all individual files in /etc/profile.d/* (which is done by /etc/profile anyway). Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-25makepkg: add packages to pkgdeps list only after successful installAllan McRae1-2/+2
This fixed FS#9403. With this you can use "makepkg -sr", install the dependencies, Ctrl+c during the makedepends installation and have makepkg remove the installed packages on the exit. Previously makepkg tried to also remove the makedepends which were not installed. The deplist="" line in remove_deps is due to an obscure bug where local varaibles from the handle_deps function seem stay in scope because we never formally exited it. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-21Make strip paths configurableAllan McRae1-3/+6
This patch introduces a new STRIP_DIRS makepkg.conf option to change makepkg's search path when stripping binaries. Original work by: Thomas Bächler <thomas@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-19Strip *.a libraries in makepkgAllan McRae1-1/+3
Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-19Use LC_ALL=C everywhereAllan McRae1-2/+2
Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-16Use "pacman -S $dep" in makepkg's dependency resolvingNagy Gabor1-7/+2
This method is equivalent with pacman's resolvedeps. $dep can be any (versioned) dependency. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-16makepkg: speed up svn revision check for large repositoriesDan McGee1-1/+1
Using the suggestion from FS#10905, use 'svn info' rather than 'svn log' to get the current revision number, which is much quicker for large Subversion repositories. Eventually git will rule the world. :) Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-08Merge branch 'maint'Dan McGee1-1/+1
2008-06-27Remove symlinks to libtool filesAllan McRae1-1/+1
This prevents dangling symlinks to removed libtool files when the !libtool option is used. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-23Additional path quoting and srcdir/pkgdir usageAllan McRae1-9/+8
Removes the remaining $startdir/{src,pkg} usage and adds quoting around (hopefully) all remaining path variables Signed-off-by: Allan McRae <mcrae_allan@hotmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-15makepkg: add several quotes needed after nullglob.Xavier Chantry1-6/+6
After the "shopt -s nullglob" change, all regular expressions should be properly quoted. This commit only fixes the ones I found, there are probably others left, so this should be kept in mind for easier future fixing. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-15makepkg: Add missing quotes for the source array.Xavier Chantry1-4/+4
Now makepkg can handle filenames with whitespaces in the source array. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-15Use openssl for checksum verification instead of *sum utilitiesSebastian Nowicki1-7/+7
md5sum, sha1sum, etc, do not exist on BSD systems by default. Openssl is a good portable alternative. This also brings in a dependency for openssl. Closes FS#10530. Signed-off-by: Sebastian Nowicki <sebnow@gmail.com> Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-14Move geninteg block in makepkg before error checkingAllan McRae1-11/+12
This patch moves the generating of integrity checks to before any error checking takes place in the PKGBUILD file. This allows integrity generation to complete when unrelated errors exist in a PKGBUILD file and allows the removal of multiple checks of the GENINTEG variable that would otherwise be needed. In addition a minor fix is made to a comment. Signed-off-by: Allan McRae <mcrae_allan@hotmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-13Merge branch 'maint'Dan McGee1-1/+1
2008-06-13Use shell builtin to list files for package inclusionDan McGee1-1/+5
On BSD systems, as super user, the 'ls' command displays all dot files by default, causing these to get included when not intended. If we use the bash glob operator, we can avoid issues with ls on different platforms; however, we need to turn the nullglob shell option on first to ensure we don't have problems in empty directories. Originally-noticed-by: Sebastian Nowicki <sebnow@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-09makepkg: remove deprecated --usesudo codeDan McGee1-7/+2
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-09makepkg: add --allsource optionAllan McRae1-12/+34
This supplements the --source option and does nearly the same thing, except downloaded source files are included in the archive as well. The sources are now packages with a pkgname/ prefix. Original-work-by: Dan McGee <dan@archlinux.org> Signed-off-by: Allan McRae <mcrae_allan@hotmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-02Don't require --force when using the --nobuild optionAnton Fiuman1-1/+1
makepkg should not abort with error when a user uses the --nobuild option to extract sources if a package has already been built. Signed-off-by: Anton Fiuman <llexiw@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-31makepkg: remove some dead TODO codeDan McGee1-7/+0
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-29makepkg - add check for valid options in PKGBUILDAllan McRae1-20/+21
This patch removes the code block in makepkg that checked for depreciated options in a PKGBUILD and provided a workaround. Unknown and depreciated options are upgraded to error conditions. Also, removed TODO regarding including install script if exists and $install is unset. That should never happen. Signed-off-by: Allan McRae <mcrae_allan@hotmail.com> Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-29No error in makepkg when removing deps failsAllan McRae1-2/+9
Catches error from when pacman is unable to remove dependencies after successfully building package and prints warning. Fixes FS#10039. Signed-off-by: Allan McRae <mcrae_allan at hotmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-29Use chown 0:0 instead of root.rootSebastian Nowicki1-2/+2
On BSD systems using a dot as a separator is not allowed. On Mac OSX it is deprecated. A colon should be used instead. BSD systems also use the "wheel" group instead of "root" to indicate the "super user" group. Both groups use the id of 0. Signed-off-by: Sebastian Nowicki <sebnow@gmail.com> Acked-by: Aaron Griffin <aaronmgriffin@gmail.com> Acked-by: Dan McGee <dan@archlinux.org> Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-29Use "legacy mode" on Mac OSX (for file command)Sebastian Nowicki1-0/+3
For some reason `file` on Mac OSX has different arguments than BSD and Linux; -i no longer prints out the mime strings. With the environment variable COMMAND_MODE set to "legacy", `file` behaves more like it does on Linux and BSD, i.e., `file -i` prints the mime type. Signed-off-by: Sebastian Nowicki <sebnow@gmail.com> Acked-by: Dan McGee <dan@archlinux.org> Acked-by: Aaron Griffin <aaronmgriffin@gmail.com> Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-29Allow an unprivileged user to create packages without fakerootSebastian Nowicki1-2/+2
When fakeroot was not in BUILDENV and the user was not root, makepkg still tried to use fakeroot for building packages. BUILDENV is now checked to see if fakeroot is enabled. If it is not enabled the package can still be built, but root will not have ownership of files. This is useful when users want to make packages for personal use and don't care about ownership. Closes FS#10450. Signed-off-by: Sebastian Nowicki <sebnow@gmail.com> Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-29du -b is not available on BSD, use du -k instead.Xavier Chantry1-1/+1
This fixes FS#10459. There is apparently no portable ways to get the apparent size of a file, like du -b does. So the best compromise seems to get the block size in kB, and then convert that to byte so that we keep compatibility. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-29Replace usage of "cp -s" with the more portable "ln -s"Sebastian Nowicki1-3/+6
The "-s" argument does not exist on BSD, and neither does "--remove-destination". This patch replaces the calls to "cp -s --remove-destination" with the equivalent "rm -f" and "ln -s" calls, in order to increase portability. Signed-off-by: Sebastian Nowicki <sebnow@gmail.com> Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-13Remove --builddeps from makepkgDan McGee1-40/+3
This really should be in an external script, as it is not makepkg's job to rebuild your system. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-10makepkg: Unify start and end messagesDan McGee1-2/+2
I've always found it odd why the package version is shown at the start but not the end of the package build. Fix it, and while we are at it, add the $CARCH variable to the display too. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-30Merge branch 'maint'Dan McGee1-4/+6
2008-04-27makepkg: fix strip section to allow spaces in pathsDaenyth Blank1-4/+6
Inside tidy_install, change the section which strips libraries to use find | while read rather than for foo in `find`. This should allow whitespaces in filenames to still be processed correctly. This fixes FS#10294. Signed-off-by: Daenyth Blank <Daenyth+git@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-16Add zipman makepkg option.Chantry Xavier1-30/+34
All other steps in tidy_install function were already controlled by an option in makepkg.conf, so this patch adds an option for the man page compression step too. This will allow to keep man pages uncompressed, which is required for some special meta man page, like the zshall one (see FS#4580). Ref: http://www.archlinux.org/pipermail/pacman-dev/2008-March/011472.html Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-03-11makepkg: Support for resuming source downloadsRoman Kyrylych1-2/+19
Download to *.part and remove the suffix if successful, thus md5sums will be checked only for complete files, and next time makepkg will resume downloading of partial file instead of complaining about invalid md5sums. Old DLAGENTS format is still supported. Late fix: Do not try to download %u first The output of grep was not suppressed, thus the output of get_downloadcmd was wrong because of extra line at the beginning that contained an unsubstituted (with %o and %u) entry from DLAGENTS. Signed-off-by: Roman Kyrylych <roman@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-27Remove small remnant of old force=y optionDan McGee1-1/+1
Signed-off-by: Dan McGee <dan@archlinux.org>