Commit Graph

1185 Commits

Author SHA1 Message Date
Allan McRae 31a55df3d9 makepkg: add LIBRARY variable
This points makepkg to where is library is located.  Can be
overridden by value in the environment.

Signed-off-by: Allan McRae <allan@archlinux.org>
[Ashley: Rebased]
Signed-off-by: Ashley Whetter <ashley@awhetter.co.uk>
2013-10-14 13:01:10 +10:00
Allan McRae c9ab8a7f6c makepkg: run locally with libtool style wrapper
Build makepkg to scripts/.lib/makepkg and add a wrapper script to
call it. This is not useful at the moment, but is the first step
to allowing makepkg to be split into smaller pieces.

Signed-off-by: Allan McRae <allan@archlinux.org>
[Ashley: rebased]
Signed-off-by: Ashley Whetter <ashley@awhetter.co.uk>
2013-10-14 13:01:03 +10:00
Allan McRae 0308df07d3 makepkg: alphabetically order option variables
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-10-14 13:01:01 +10:00
Allan McRae 141d7f234f makepkg: do not refer to src/ or pkg/
Use $srcdir and $pkgdir instead.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-10-14 13:01:01 +10:00
Lukáš Jirkovský 043f250d0e Add a -C, --cleanbuild option to clear the source directory before building a package.
Implements FS#17175.

[Allan: Minor changes to output strings, fix removing of source directory]
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-10-14 13:00:50 +10:00
Allan McRae 2f7e92ad04 Link non-vcs sources into $srcdir during extraction
The separation between downloading and extracting for non-vsc sources
was incomplete due to symlinks being made in $srcdir during the download
stage.  Have download_{local,file} just ensure the presence of the files
in $startdir or $SRCDEST (downloading if needed) and then have
extract_file symlink these files into $srcdir.

Also replace "continue" with "return" in extract_file to make it clearer
what is happening.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-10-14 12:59:49 +10:00
Allan McRae adfab9c899 Remove makepkg license check
There is little reason for this field to be checked over all other
fields.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-10-14 12:59:49 +10:00
Allan McRae 37242ceb30 Use $srcdir/ rather than src/ in makepkg help
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-10-14 12:59:49 +10:00
Xyne 2379eb1fa6 makepkg: redirect downloader output to STDERR
This allows scripts to safely capture the output of "makepkg -g".

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-09-18 14:28:03 +10:00
Xyne 028490ddcf makepkg: include all hash types in integlist
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-09-18 14:28:03 +10:00
Dave Reisner 9388808964 makepkg: use c-style for loops for integrity checks
These loops already maintain an independent loop counter, so cut out
the middle man. While this change doesn't necessarily require that we
drop support for sparse arrays, we do via this patch. A new lint check
is added in check_sanity to abort when a sparse array is encountered.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-09-18 14:28:03 +10:00
Dave Reisner de570d1a65 makepkg: always use read's -r flag with filenames
These are all cases where we're reading filenames -- any backslashes
are intentional and should not be interpreted.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-09-18 14:28:03 +10:00
Dave Reisner 2091f7ab16 makepkg: inline creation of checksum indenting
With some simple math and printf formatting tokens, we can create the
whitespace necessary for this without the need for a loop and string
concatentation.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-09-18 14:28:03 +10:00
Dave Reisner cfbc4fe809 makepkg: cleanup a few format string injections
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-09-18 14:28:02 +10:00
Dave Reisner 4245c6b222 makepkg: add support for sha224 checksums
Implements FS#36776.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-09-04 09:51:20 +10:00
Dave Reisner b370f0ca42 makepkg: unify list of known hash algorithms
Unifying this list makes adding new algorithms easier. There's also
some menial cleanup in this patch to avoid use of eval and properly
treat lists of data as array instead of simple strings.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-09-04 09:51:20 +10:00
Dave Reisner 3d3c7ebb0d makepkg: allow make-style environment var overrides
This allows for VAR=value and VAR+=value variable declarations.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-08-21 11:13:12 +10:00
Allan McRae 247b9af02b Do not refer to FlySpray numbers
These references to bug numbers assume we will forever be using that bug
tracker. It is better to properly comment the code instead (which was
done in almost all cases anyway).

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-08-21 11:12:30 +10:00
Jason St. John 8e533b0363 Fix whitespace in makepkg.sh.in and makepkg-template.pl.in
Replace spaces with tabs in one instance.
Remove extra spaces.

Signed-off-by: Jason St. John <jstjohn@purdue.edu>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-07-30 13:00:25 +10:00
Ashley Whetter a774e4d5e2 Install makedepends and checkdepends together
Fixes FS#31557

Signed-off-by: Ashley Whetter <awhetter.2011@my.bristol.ac.uk>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-07-22 13:28:52 +10:00
Allan McRae 96a4d1ca04 Update gitignore files for use with autoreconf
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-07-22 13:27:23 +10:00
Allan McRae df9d19ba73 Remove autotools files
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-07-22 13:27:07 +10:00
Allan McRae 93f9052557 Merge branch 'maint' 2013-06-26 15:30:55 +10:00
Andrea Scarpino af1c986383 Respect paths with spaces on --install
makepkg --install doesn't quote the absolute path, so if the path contains
spaces pacman -U fails.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-06-23 15:45:00 +10:00
Allan McRae 71328479f3 Merge branch 'maint' 2013-06-18 13:59:18 +10:00
Allan McRae d985a62172 Pull translation updates
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-06-18 13:17:30 +10:00
Allan McRae 1b08e26846 makepkg: fix typo for distcc test
Introduced in commit 9dd42dc0.  Fixes FS#35741.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-06-16 16:33:39 +10:00
Phillip Smith 58782b1c55 repo-add; add option to remove existing package files from disk
When maintaining a custom repo, often it is undesirable to retain older
versions of packages. This patch adds the --remove option to remove the
current package file and it's signature from disk before adding the new
one to the database. Documentation is also updated. This is an optional
flag and default behaviour (leaving ondisk files alone) is not changed.

Signed-off-by: Phillip Smith <fukawi2@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-06-06 13:47:32 +10:00
Allan McRae 9574bfd6c8 Merge branch 'maint' 2013-06-06 13:47:26 +10:00
Allan McRae 450be928da Pull translation updates and regenerate
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-06-06 13:12:20 +10:00
Dave Reisner d080a469a0 pacman-key: Do not reinterpret keys from revoked keyrings
Given a revoked keyring containing only:

  BC1FBE4D2826A0B51E47ED62E2539214C6C11350

We should only disable this specific keyid. This change enforces that the
contents of the -revoked keyring file are full fingerprints which can uniquely
identify a key.

Before:

  # pacman-key --populate archlinux
  ==> Appending keys from archlinux.gpg...
  ==> Locally signing trusted keys in keyring...
    -> Locally signing key 0E8B644079F599DFC1DDC3973348882F6AC6A4C2...
    -> Locally signing key 684148BB25B49E986A4944C55184252D824B18E8...
    -> Locally signing key 44D4A033AC140143927397D47EFD567D4C7EA887...
    -> Locally signing key 27FFC4769E19F096D41D9265A04F9397CDFD6BB0...
    -> Locally signing key AB19265E5D7D20687D303246BA1DFB64FFF979E7...
  ==> Importing owner trust values...
  ==> Disabling revoked keys in keyring...
    -> Disabling key 1390420191...
    -> Disabling key E2539214C6C11350...
    -> Disabling key 8544EA82113502DE...
  ==> Updating trust database...
  gpg: next trustdb check due at 2014-01-22

After:

  # pacman-key --populate archlinux
  ==> Appending keys from archlinux.gpg...
  ==> Locally signing trusted keys in keyring...
    -> Locally signing key 0E8B644079F599DFC1DDC3973348882F6AC6A4C2...
    -> Locally signing key 684148BB25B49E986A4944C55184252D824B18E8...
    -> Locally signing key 44D4A033AC140143927397D47EFD567D4C7EA887...
    -> Locally signing key 27FFC4769E19F096D41D9265A04F9397CDFD6BB0...
    -> Locally signing key AB19265E5D7D20687D303246BA1DFB64FFF979E7...
  ==> Importing owner trust values...
  ==> Disabling revoked keys in keyring...
    -> Disabling key BC1FBE4D2826A0B51E47ED62E2539214C6C11350...
  ==> Updating trust database...
  gpg: next trustdb check due at 2014-01-22

Partially addresses FS#35478. This does nothing to confirm whether or not the
key was successfully disabled -- a ridiculously simple request which appears to
be far too difficult for gpg to manage.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-06-04 14:01:41 +10:00
Allan McRae fe794ccb25 Restrict pkgname from starting with a dot.
Adding this restriction means we can filter any FILENAME entry from
starting with a "/" or a ".".  Use the term "dot" as it is more
computing relevant compared to "full stop" or "period" which vary
depending on English locale.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-06-04 13:38:48 +10:00
Florian Pritz 477fd794a0 makepkg-template: add --version and some license info
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-05-30 13:11:02 +10:00
Florian Pritz a36d4b2831 makepkg-template: Stop using given/when
given/when has been marked experimental in perl 5.18 because it will
change it 5.20. if/else is ugly, but hiding the generated warning is no
good solution either, so we us if/else for now.

Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-05-29 14:17:21 +10:00
Florian Pritz cbc25c22fc makepkg-template: Add gettext support
This also slighty changes the word order in the description for
--newest.

Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-05-29 14:17:21 +10:00
Florian Pritz ce3125196d Add makepkg-template
This allows for somewhat easy templating for PKGBUILDs.

Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-05-29 14:17:21 +10:00
Phillip Smith 5bcc058d42 makepkg: add support for CARCH environment var
Add support for overriding configuration in /etc/makepkg.conf and
~/.makepkg.conf by setting the environment variable CARCH similar to
how SRCDEST and PKGDEST behave.

Fixes FS#35030.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-05-29 14:08:03 +10:00
Allan McRae dece66ac18 makepkg: remove support for PKGBUILDs without a package() function
Not having a package() function means all building occurs as root
and repackaging can lose permissions.  Given the use of package()
functions has been around for years and we deprecated not having
one in pacman-4.1, we can remove support for PKGBUILDs without
package() functions altogether. However, keep PKGBUILDs that have
neither a build() or package() function working.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-05-29 14:08:02 +10:00
Allan McRae 3b4e74cb3b makepkg: Add helper to test for functions in build script
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-05-29 14:08:02 +10:00
Allan McRae 28dd29dedb makepkg: remove sourcing PKGBUILD from stdin
Using PKGBUILDs from stdin means that we can not use pkgver() in
packages.  Given we have the "-p" option to pass any file to
makepkg and passing a PKGBUILD in the form "cat foo | makepkg"
does not work, this feature is unneeded.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-05-29 14:08:02 +10:00
Allan McRae 84ac55b052 Merge branch 'maint' 2013-05-29 14:02:56 +10:00
Allan McRae 8335e169a6 makepkg: Use LOGDEST for logpipe
If LOGDEST is set, we may not check that $startdir is writable. Store
the log pipe in LOGDEST instead.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-05-18 23:14:21 +10:00
Dave Reisner 72c6d19d64 makepkg: fixup broken revision and repo references
bzr support "worked", but didn't handle any of the actual features we
wanted with makepkg. This moves the revision specification to the proper
place (extraction, rather than download), and fixes an additional broken
reference to $repo which was never set.

Fixes FS#35281.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-05-18 10:42:30 +10:00
Allan McRae 0f988beff8 Merge branch 'maint' 2013-05-07 12:59:44 +10:00
Allan McRae 35289bc17e More translation updates
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-05-07 12:53:23 +10:00
Allan McRae 0aa9628560 Pull translation updates from transifex
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-04-30 21:18:42 +10:00
Eric Bélanger 9de33488bf Add --noprepare option to makepkg
This new option disables the prepare function. Useful in combination
with -o to get an unpatched copy of the sources for testing purpose.

Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-04-30 21:04:21 +10:00
Eric Bélanger 91b9ea922a Add -V/--version option to makepkg's usage function and man page
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-04-30 21:01:38 +10:00
Dave Reisner c5a4b35528 makepkg: avoid redirecting stdout
If stdout is already redirected, redirecting stderr to stdout can lead
to undesirable results.

Fixes FS#34974.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-04-28 23:11:37 +10:00
Anatol Pomozov 769facca22 Fix spelling errors using 'codespell' tool
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-04-18 13:20:13 +10:00