summaryrefslogtreecommitdiff
path: root/scripts/makepkg.sh.in
Commit message (Collapse)AuthorAge
* makepkg: create tar file for bogus PKGEXTlolilolicon2011-10-03
| | | | | | | | | | | | | | | | If PKGEXT is not one of the recognized tar*'s, create_package() would create an empty package file and fail, since bsdtar on the left side of the pipe returns 141 on SIGPIPE (broken pipe). This patch changes the behavior for an invalid PKGEXT. A warning is printed on stderr, and a tar file is created. Also retire the obsolete $EXT variable. Add the obligatory comment why we don't use bsdtar's compression. Finally, fix mixed-tab-space indentation. Signed-off-by: lolilolicon <lolilolicon@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* makepkg: support .tar.Z source packages creationlolilolicon2011-09-30
| | | | | | | SRCEXT should allow whatever PKGEXT does. Also address an uninitialized use of $ret. Signed-off-by: lolilolicon <lolilolicon@gmail.com>
* makepkg: proper quoting in [[ expression ]]lolilolicon2011-09-28
| | | | | | | | | | | Always quote the righthand side of expression when the == or != operator is used, unless intended as a pattern. Quoting bash(1): When the == and != operators are used, the string to the right of the operator is considered a pattern. Any part of the pattern may be quoted to force it to be matched as a string. Signed-off-by: lolilolicon <lolilolicon@gmail.com>
* makepkg: ensure '-' is last in a character globDave Reisner2011-09-27
| | | | | | | If '-' isn't the last item, it's interpreted as a range and not literally, causing problematic behavior in parsing optdepends. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* makepkg: normalize whitespace for optdepends in .PKGINFOAllan McRae2011-09-26
| | | | | | | | | | | Many PKGBUILDs use formatting whitespace when specifying optdepends. This is removed when adding a package to a repo-database so the output of "pacman -Si <package>" and "pacman -Qip <package file>" becomes inconsistent. Instead, do the adjustment when creating the .PKGINFO file. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: allow versioned optdepends with epochAllan McRae2011-09-26
| | | | | | | | | | Allow the specification of versioned optdepends with an epoch. This also (partially) enforces a whitespace between ":" and the description which is required for the future optdepends parsing code. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: fix recreation of hardlinks to .gz manpagesDave Reisner2011-09-14
| | | | | | | | | | | | | | | | | | | | 4ed12ae tightened up the logic to use only find, but ignored the fact that since the manpage hard link names were no longer captured. They were created as separate compressed manpages, rather than as hardlinks. This also introduces a minor efficiency of deleting all hardlinks at once and using proper iteration over an array rather than a string. Note to anyone else touching this code: e2fsprogs and libpcap are useful for testing this. If that changes in the future, you can use the below bash to locate others: IFS=$'\n' read -rd '' -a a < <(find /usr/share/man -type f \! -links 1) pacman -Qqo "${a[@]}" | sort -u I broke it! Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* makepkg: add missing newline on passing gpg sourcecheckDave Reisner2011-09-14
| | | | | | | | When a sourceball passes this check without any warnings, a newline is omitted. Similar to the if clause of this else block, print a single new line at the end of the clause instead of accounting for each output. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* makepkg: check for var existance before file existanceDave Reisner2011-09-12
| | | | | | | This prevents makepkg from aborting with 'file not found' when changelog= or install= are declared in a PKGBUILD, but empty. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* makepkg: unset errexit when sourcing /etc/profileDave Reisner2011-09-11
| | | | | | | | | This is a fix for a bash3 specific bug, where a file sourced by /etc/profile would exit non-zero and make its way back up to makepkg, forcing it to exit after package installation. Along with unsetting the ERR handler, temporarily unset errexit to avoid this. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* makepkg: use more awk'ish syntax in sanity checksDave Reisner2011-09-07
| | | | | | | This simplifies the flow a bit, making the pipeline a little easier to grok. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* makepkg: avoid for loop in deleting manpage hardlinksDave Reisner2011-09-07
| | | | | | find can do this all on its own and remain portable. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* makepkg: act on function return value, not outputDave Reisner2011-09-07
| | | | | | Correcting a typo, as this function will never output anything. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* makepkg: refactor check_pgpsigs outputDave Reisner2011-09-07
| | | | | | | | - display associated warnings on same line as pass/fail msg, to be more consistent with checksum verification output - properly error on a revoked key (matching pacman's behavior) Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* makepkg: use globs in place of regexDave Reisner2011-09-06
| | | | | | | | | | | We seem to enjoy using bash regex capabilities, but never referencing the result with BASH_REMATCH. Replace almost all regexes with equivalent globs which are faster and functionally equivalent in these cases. This enables the extglob shopt. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: unset variables as per !{make,build}flagsDave Reisner2011-09-06
| | | | | | | | | | Don't just set the flag variables to zero length strings, actually unset them from the environment. This fixes issues with broken gnu Makefies that use ?= for assigment, where the presence of a var is enough to make this condition avoid assignment. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: fix overzealous PGP signature file matchingDan McGee2011-09-01
| | | | | | | | The regex wasn't rooted at the end of the filename, nor was it matching a period/dot before the file extension. The end result was this matched a file named '07_all_sig.patch' which is totally broken. Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: fix sanity checking in versioningDave Reisner2011-09-01
| | | | | | | | Read the entire variable, respecting escapes, which are necessary to retain for the successive eval. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: read filenames in a while loopDave Reisner2011-09-01
| | | | | | | | Further improvments on 2ca27ab which will allow the changelog and install script files to contain whitespace. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: fix breakage in eval'ing quoted stringsDave Reisner2011-09-01
| | | | | | | Broken in 2ca27a by me, trying to fix another problem. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: quote re-evaluation of simple varsDave Reisner2011-08-19
| | | | | | | | | | | | | | This is a safety measure to prevent simple code injection. $ i="foo bar" $ eval i="$i" bash: bar: command not found $ eval i=\"$i\" $ echo "|$i|" |foo bar| Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: deal with variable substitution when checking sanityAllan McRae2011-08-18
| | | | | | | | | | | If any of pkgver, pkgrel or epoch contained a variable substitution, then it needed to be evaluated before checking its value conformed to the rules. [Dan: add quotes around RHS] Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Add makepkg -S which is an alias to makepkg --sourceSebastien Luttringer2011-08-18
| | | | | | | | makepkg --source is a often used go make source package like for AUR. Have a -S shortcut will save the world. Signed-off-by: Sebastien Luttringer <seblu@seblu.net> Signed-off-by: Dan McGee <dan@archlinux.org>
* Fix trailing whitespace in whole codebaseDan McGee2011-08-17
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: don't hardcode path to stripDave Reisner2011-08-15
| | | | | Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Update several translation stringsDan McGee2011-08-08
| | | | | | | * Fix typos/capitalization * Make sure large blocks of text are translated in one unit Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: ignore epoch when undeclaredDave Reisner2011-08-08
| | | | | | | | | | | | | | | In this case, we skip the epoch versioning entirely, as if it were declared as 0. Prevents errors such as: /usr/bin/makepkg: line 244: ((: ! : syntax error: operand expected (error token is " ") ==> Finished making: cower-git :20110808-1 (Mon Aug 8 17:17:27 EDT 2011) Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: refactor checking source integrityAllan McRae2011-07-27
| | | | | | | | | Move the source integrity checking into its own function as the code was duplicated and is now more complicated with the separation of the two checks types. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: more control of skipping integrity checksAllan McRae2011-07-27
| | | | | | | | | Allows the skipping of all integrity checks (checksum and PGP) or either the checksum or PGP checks individually. Original-patch-by: Wieland Hoffman <theminew@googlemail.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: Add support for verifying pgp signaturesWieland Hoffmann2011-07-27
| | | | | | | | | | | | | Many projects provide signature files along with the source code archives. It's good to check these, too, when verifying the integrity of source code archives. Not everybody is using gpg so the verification can be disabled with --skippgpcheck. Additionally, only a warning is displayed when the key that signed the source file is unknown. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: get package version with overridesAllan McRae2011-07-27
| | | | | | | | | | | When epoch, pkgver and/or pkgrel were overridden in a split package function, makepkg failed hard finding the real version for checking if packages were already built or trying to install packages. Fix the get_full_version function to deal with overrides and return the actual package version. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: allow epoch to be overriddenAllan McRae2011-07-27
| | | | | | | | We can override pkgver and pkgrel so it is only logical to add epoch to that list Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: check arch overrides for required architectureAllan McRae2011-07-27
| | | | | | | | Check any overrides of the "arch" variable contain the required architecture. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: check overrides for pkgrel and pkgverAllan McRae2011-07-27
| | | | | | | | Enforce syntax checking for pkgrel and pkgver overrides in package functions. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: pkgver and pkgrel can not have whitespaceAllan McRae2011-07-27
| | | | | | | There is always someone who tries to break things (cough *Dave* cough...) Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Merge branch 'maint'Dan McGee2011-07-18
|\
| * makepkg: fix issue with filenames with spaces and noextractAllan McRae2011-07-18
| | | | | | | | | | | | | | | | | | | | | | Specifying a filename with spaces in a PKGBUILDs noextract array fails due to a lack of quoting. Fixes FS#25100. Reported-by: Thomas Weißschuh <thomas_weissschuh@lavabit.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | makepkg: only test for writable PKGDEST when needed.Rogutės Sparnuotos2011-07-18
| | | | | | | | | | | | | | | | | | There is no need for a writable PKGDEST when using the --nobuild or --geninteg flags. Allan: added --geninteg Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | makepkg: remove unused -C option from option listDave Reisner2011-07-14
| | | | | | | | | | | | | | We nuke it from the completion file as well along with its longopt. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | makepkg: skip devel_check when reading from a pipeDave Reisner2011-07-14
| | | | | | | | | | Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | makepkg: Remove pre-optimization from in_array()DJ Mills2011-07-14
| | | | | | | | | | | | | | The '[[ -z' test in in_array() is redundant, so remove it. Signed-off-by: DJ Mills <danielmills1@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* | makepkg: Remove OPT_TEMP hack in parse_options callDJ Mills2011-07-14
| | | | | | | | | | | | | | | | Instead of hacking around the error trap, simply do an explicit test for failure. Signed-off-by: DJ Mills <danielmills1@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* | Add 'compress' compression format as an available optionDan McGee2011-07-14
| | | | | | | | | | | | | | | | This adds the '.tar.Z' option to both repo-add and makepkg for no other reason than "why not", and because bsdtar supports it natively with the '-Z' flag. Also update the documentation accordingly. Signed-off-by: Dan McGee <dan@archlinux.org>
* | fix vim syntax highlighting of .sh filesFlorian Pritz2011-06-30
| | | | | | | | | | | | | | | | | | | | vim recognises what type of shell script it's dealing with by looking at the shebang. If detection fails it falls back to sh which doesn't support some bash features. Adding a normal, possibly broken, shebang which gets fixed by the Makefile allows vim to detect bash syntax. Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge remote-tracking branch 'dave/makepkg'Dan McGee2011-06-30
|\ \
| * | makepkg: simplify SIGNPKG checkDave Reisner2011-06-28
| | | | | | | | | | | | Signed-off-by: Dave Reisner <d@falconindy.com>
| * | makepkg: fix vim syntax highlightingDave Reisner2011-06-28
| | | | | | | | | | | | Signed-off-by: Dave Reisner <d@falconindy.com>
| * | makepkg: remove unneeded echoDave Reisner2011-06-28
| | | | | | | | | | | | Signed-off-by: Dave Reisner <d@falconindy.com>
* | | makepkg: only source user override if using default config fileDan McGee2011-06-30
| | | | | | | | | | | | | | | | | | | | | Otherwise there is no way to easily test or run with a standalone config file without outside interference. Signed-off-by: Dan McGee <dan@archlinux.org>
* | | makepkg: fix typo (missing quotes)Rémy Oudompheng2011-06-30
| | | | | | | | | | | | | | | | | | Signed-off-by: Rémy Oudompheng <remy@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>