Commit Graph

732 Commits

Author SHA1 Message Date
Dave Reisner cb9489119e makepkg: abort if we can't add install/changelog to package 2014-09-30 12:56:57 +10:00
Dave Reisner 963f7fe02f PKGBUILD: add support for arch-specific sources
This implements support for declarations such as:

  arch=('i686' 'x86_64')
  ...

  source=("somescript.sh")
  source_i686=("http://evilmonster.com/i686/ponies-9001-1.i686.bin")
  source_x86_64=("http://evilmonster.com/i686/ponies-9001-1.x86_64.bin")

  md5sums=('d41d8cd98f00b204e9800998ecf8427e')
  md5sums_i686=('e4ca381035a34b7a852184cc0dd89baa')
  md5sums_x86_64=('4019740e6998f30a3c534bac6a83f582')

Just the same as the "untagged" sources, multiple integrity algorithms
are supported. The manpage is updated to reflect support for these
suffices.

This commit also refactors download_sources slightly:

1) to use the otherwise preferred convention of lowercase local variable
names, and to make the handling of $1 more clear.
2) rename the "fast" parameter to "novcs", to make it more clear what
this token does.
3) add a new possible token "allarch" to ensure that download_sources
will fetch all sources, for all architectures.
2014-09-30 12:56:21 +10:00
Dave Reisner 51353edc61 makepkg: break out checksum generation to its own function
This also fixes a "bug" in which a PKGBUILD without any source array
would generate "md5sums=()". While not technically wrong, we can easily
do better and emit nothing at all.
2014-09-30 12:56:21 +10:00
Dave Reisner a3d7230e4d makepkg: break out check_checksums to reasonably sized functions 2014-09-30 12:56:21 +10:00
Dave Reisner 9c066dff43 makepkg: disallow values of 'arch' which might be problematic
We rely on values in the arch array to be valid as part of variable
names, so extend the arch lint check to catch this.

This also cleans up lint_arch to restrict the use of "lint" only to the
package-specific architecture checks. It previously had an odd
declaration with a conditional expansion that would never be true.
2014-09-23 21:43:16 +10:00
Dave Reisner 85c055da73 makepkg: let --source imply --ignorearch
Since source package creation is architecture independent, we should
ignore architecture-dependent behaviors such as the lint check which
will halt execution when the host machine is not a supported arch.

https://github.com/falconindy/pkgbuild-introspection/issues/15
2014-09-23 21:43:16 +10:00
Dave Reisner e1f6fe652d makepkg: use correct terminology
unix has no "folders".
2014-09-23 21:43:16 +10:00
lolilolicon ee207d7c7b makepkg: do not eval dlcmd
This eval enables the following in a PKGBUILD to "just work":

  source=('$pkgname-$pkgver.tar.gz'::'https://host/$pkgver.tar.gz')

This has at least two problems:

- It violated the principle of least surprise.
- It could be a security issue since URLs are arbitrary input.

Instead, expand the dlagent command line into an array, replace the %o,
%u place holders, and run the resultant command line as is.

Embedded spaces in the DLAGENTS entry can be escaped with a backslash.

Fixes FS#41682

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-09-15 09:32:29 +10:00
William Giokas 95e1a1ef82 makepkg: Allow using sources with :: in them
Git has the ability to use helper applications for interfacing with hg,
and from what we had before, the following url::

  foo::git+hg::http://foo.bar/foobar

would get converted to something along the lines of:

  filename: foo
  URL: http://foo.bar/foobar

and the 'git+hg' part would essentially be ignored when it's getting set
up in the 'get_protocol' and 'get_downloadclient' functions. With this
patch it is possible to have a source link with '::' in it, however it
is not possible to have a filename with '::', which is the current
behavior.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-09-15 09:30:54 +10:00
Dave Reisner 17ed9eb734 makepkg: replace bare eval with var extraction functions 2014-08-08 13:44:40 +10:00
Dave Reisner 2b556d89de PKGBUILD: handle arch specific attributes
This introduces support for architecture-specific conflicts, depends,
optdepends, makedepends, replaces, and conflicts by appending "_$CARCH"
to the array name. For example, in the global section:

  arch=('i686' 'x86_64')
  depends=('foo')
  depends_x86_64=('bar')

This will generate depends of 'foo' and 'bar' on x86_64, but only 'foo'
on i686. Moreover, this is supported in the package functions with the
same heuristics as the generic names, e.g.

  ...
  arch=('i686' 'x86_64')
  depends=('foo')
  ...

  package_somepkg() {
    depends_x86_64=('bar')

    ...
  }

Again, will cause x86_64 to have depends of 'foo' and 'bar', but only
'foo' for i686.
2014-08-08 13:44:25 +10:00
Dave Reisner cbd6c300b5 makepkg: refactor check_sanity, give it some sanity of its own
Break apart each of the blocks into their own separate functions. And,
instead of the hand crafted eval statements, reuse the logic from
pkgbuild-introspection[0] to abstract away the complexities of parsing
bash.

This commit fixes at least 3 bugs in check_sanity:

1) The wrong variable is shown for the error which would be thrown
when, e.g.  pkgname=('foopkg' 'bar^pkg')
2) The "arch" variable is not sanity checked when the PKGBUILD has
an arch override, but only one output package.
3) https://bugs.archlinux.org/task/40361

Lastly, there's some string changes here which should help to clarify
a few errors emitted in the linting process.

[0] https://github.com/falconindy/pkgbuild-introspection
2014-08-08 13:44:00 +10:00
Dave Reisner 8a02abcf19 makepkg: disallow pkgver/pkgrel/epoch overrides in packages
This is a confusing feature, and no one uses it.
2014-08-08 13:40:00 +10:00
Allan McRae dce82f9d19 makepkg: skip dependency checking with --verifysource
Dependencies are now handled with --nobuild unless specificially skipped.
Using --verifysource will skip dependency checks unless --syncdeps is
specified.

Fixes FS#35057 and FS#36999.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-04 14:23:58 +10:00
Allan McRae 7e87614665 makepkg: ensure vcs download tool are installed when required
Add an array VCSCLIENTS to makepkg.conf that matches vcs source protocols
to the package containing the software needed for handling the source.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-04 14:23:56 +10:00
Dave Reisner fbb0945bfb makepkg: improve check and error message for buildfile location
The documentation very clearly states that the buildfile has to be in
$PWD, but the error thrown by makepkg reference some mysterious "build
directory". Simplify this check so that we more directly check that the
file being referred to is in fact in our $PWD. Revise the error message
when the check fails to more plainly point out the problem.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-03 18:46:32 +10:00
Johannes Löthberg 80eca94c8e makepkg: Respect XDG_CONFIG_HOME
Add support for following the XDG Base Directory Specification when
reading the user-specific configuration file.

If no $XDG_CONFIG_HOME/pacman/makepkg.conf file exists we fall back to
sourcing $HOME/.makepkg.conf

Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>

[Allan] Note XDG_CONFIG_HOME takes priority.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-03 18:46:31 +10:00
Allan McRae 7305768d54 makepkg: handle "epoch=" in PKGBUILD with pkgver function
After resourcing the PKGBUILD in update_pkgver(), set the epoch to 0
if it is empty.  Also adjust the get_full_version function to be more
robust if epoch somehow still is empty.

Fixes FS#41022.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-06-29 17:15:23 +10:00
Allan McRae 537a335cc7 Use C locale for bsdtar calls during package creation
This ensures packages build on a UTF-8 locale system with non-ASCII character
names can be installed on non-UTF-8 systems.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-06-12 12:50:15 +10:00
Johannes Löthberg 9ff6dc93af makepkg: Remove redundant sig generation comment
Remove the comment above the signature generation command as the command
is self explanatory and no longer does what the comment says.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-06-10 14:27:27 +10:00
Andrew DeMaria 235ce32563 makepkg: pass "--nocolor" to pacman
FS#39982.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-05-25 14:06:58 +10:00
Allan McRae 2401468f51 makepkg: Force buildscripts to be in startdir
We expect all source file to lie in $startdir. However, using
"makepkg -p <buildscript>" can currently allows people to specify buildscripts
in other directories. This results in confusion about where other sources
should lie (in startdir or in the directory that the buildscript is in).
Explicitly disable using -p for files in other directories to avoid this issue.

Fixes FS#40293.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-05-25 13:53:19 +10:00
Thomas Bächler d39d3b3a09 makepkg: Introduce validpgpkeys array
If validpgpkeys is set in the PKGBUILD, signature checking fails if
the fingerprint of the key used to create the signature is not listed
in the array.

The key's trust value is ignored.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-05-23 15:31:00 +10:00
Thomas Bächler d174cc8943 makepkg: Treat a signature from an untrusted key as an error
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-05-23 15:31:00 +10:00
Thomas Bächler 34ae6ce4e5 makepkg: Use read to parse status file during signature verification.
Instead of invoking grep multiple times, parse the status file once.

This refactoring also changes the behvaiour when signature verification
fails due to a missing public key: It is now an error instead of a
warning.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-05-23 15:30:54 +10:00
Steven Noonan 6103183253 makepkg: use dash instead of underscore in /usr/lib/debug/.build-id
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-04-21 20:25:02 +10:00
Allan McRae ee72c016ab Always supply base name and version info in .PKGFILE if needed
Provide pkgbase information for non-split packages with pkgbase set.
Also record the version of the "base" package.  This is useful for
matching package files to source packages.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-03-27 15:24:22 +10:00
Allan McRae d8f0c3e5b9 makepkg: sign source packages with --sign
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-03-27 15:24:11 +10:00
Pierre Neidhardt 912ea363de makepkg: Reorder some entries in usage() and getopts
Signed-off-by: Pierre Neidhardt <ambrevar@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-03-13 15:45:04 +10:00
Allan McRae d8ee8d0c99 makepkg: enforce fakeroot usage
Packaging outside of fakeroot can result in incorrect permissions for
package files.  It has been years since fakeroot issues during packaging
were common, so it is safe to enforce fakeroot usage.  If using fakeroot
is impossible for some reason, a two line wrapper script will suffice to
fool makepkg.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-03-12 13:13:49 +10:00
Allan McRae 61ba5c961e makepkg: Remove --asroot option
The days of fakeroot being error ridden are long gone, so there is no
valid reason to run makepkg as root.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-03-12 13:13:49 +10:00
Pierre Neidhardt ce3fbcb18d makepkg: Add a --noarchive option to inhibit archive creation
1. Packagers who want to test the package() function, i.e. to check the content
of the pkg/ folder.

2. Developers who want to check how the packaged version of a program looks, in
other words how the pkg/ folder looks.

3. For users of systems with no port tree, makepkg can ease package creation.
However the resulting archive of the whole makepkg process is often useless.

For all situations, makepkg will usually be called several times. But no archive
(the final package) is needed in any cases. The archive creation ends up being a
waste of time and resource, especially for big applications and slow machines.

Since this option aborts the process prematurely, it behaves like the
-o,--nobuild option, i.e. any other option acting on later stages in the process
will be automatically discarded. For --noarchive, it means that in

  $ makepkg --noarchive --install

the '--install' option does not do anything.

Signed-off-by: Pierre Neidhardt <ambrevar@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-03-12 13:13:49 +10:00
Pierre Neidhardt 2041586829 makepkg: Comment on install_package() return code
Previously, install_package() return code was either used as exit code or
ignored. This was rather confusing. The return code is now always ignored and a
comment on install_package() has been added.

Signed-off-by: Pierre Neidhardt <ambrevar@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-03-12 13:13:48 +10:00
Thomas Bächler 620d2d9d58 makepkg: Support kernel.org's PGP signature scheme
Files hosted on kernel.org only provide signatures for the uncompressed tarball.
Support this scheme by transparently uncompressing the archives and piping
the data into gpg.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-03-03 11:25:55 +10:00
Steven Noonan bf79c02440 makepkg: implement support for stripping kernel modules
I noticed when I built a kernel package with options 'strip' and 'debug' that
the debug package was missing the debug information for the kernel modules.
This patch adds kernel modules to the targets for 'strip' and is compatible
with the split-out debug information packages.

v2: Correct logic error -- did a 'continue' after the 2nd-level case statement
    instead of in the default case.
v3: Oops, forgot to terminate outer case. Ran this version through the test
    suite and all tests passed.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-03-03 11:25:54 +10:00
Allan McRae 8014dc648f makepkg: remove unneeded "|| true"
makepkg only aborts on errors during PKGBUILD functions so the remaining
"|| true" statements are unneeded.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-02-02 17:37:58 +10:00
Allan McRae b449878fea makepkg: Fix typo in variable name
It turns out that you should refer to variables by their actual name...
Introduced in commit a521cea9.

FS#38414.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-02-02 17:31:51 +10:00
Lars Gustäbel 47a4741a3c Prevent makepkg creating armored signatures
If the user has "armor" in thier gpg.conf, makepkg will create an
ascii-armored signature. Use --no-armor in the gpg call to avoid.

FS#38503.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-02-02 16:30:59 +10:00
Florian Pritz cd2370754a Remove ts and sw from vim modeline when noet is set
Forcing vim users to view files with a tabstop of 2 seems really
unnecessary when noet is set. I find it much easier to read code with
ts=4 and I dislike having to override the modeline by hand.

Command run:
find . -type f -exec sed -i '/vim.* noet/s# ts=2 sw=2##' {} +

Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-28 20:19:25 +10:00
Allan McRae 3bb3b1555a Update copyright years for 2014
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-06 14:38:50 +10:00
Maxime Arthaud 50e9543908 makepkg: fix check for distcc
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-12-21 10:12:53 +10:00
Sébastien Luttringer 76a05e94c1 makepkg: fix consistency of downloaded sources permissions
Running 'makepkg -g' or 'makepkg' to download source files results in
different permissions on the files if the user has a non-default umask.

Put the umask definition at the "beginning" of the makepkg script to
ensure all files generated by makepkg have a 0022 umask.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-12-15 20:09:37 +10:00
Jason St. John a15fd48016 Improve --help switch output for pacman contrib and pacman scripts
Unify the formatting of the --help switch for pacman utils, if it exists.
All of the pacman utils will now output help text using the following
format:

  util-name (pacman) v<pacman version>

  one line description of util's purpose

  Usage: util-name [options]

    -b, --bar      whatever --bar does
    -f, --foo      whatever --foo does
    -h, --help     display this help message

Reported-by: Karol Błażewicz <karol.blazewicz at gmail.com>
Signed-off-by: Jason St. John <jstjohn@purdue.edu>
2013-11-15 11:02:27 +10:00
Jason St. John 230bd5c2fd Fix whitespace and other formatting issues
This commit:
-- replaces space-based indents with tabs per the coding standards
-- removes extraneous whitespace (e.g. extra spaces between function args)
-- adds missing braces for a one-line if statement

Signed-off-by: Jason St. John <jstjohn@purdue.edu>
2013-11-15 11:02:27 +10:00
Allan McRae 5273e38fb2 makepkg: move update_pkgver out of extract_sources
The extract_sources function should be just extracting sources.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-11-15 11:02:27 +10:00
Allan McRae da8cd388c4 Return zero from extract_file with local source file
The call to bsdtar to check if a file needs extracted returns 1 if it does
not.  We then propegate this return value accidentally which can cause
makepkg to report an error later on.  Explicitly return 0 in this case.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-11-15 11:02:12 +10:00
Allan McRae fe824f87b9 makepkg: only remove static libraries if they have a shared version
It is fairly common that packages contain static libraries with no
shared counterpart.  These should not be removed with !staticlibs.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-11-08 09:28:02 +10:00
Allan McRae 5c5b28833c makepkg: Allow "static library" to be translated
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-11-01 15:48:03 +10:00
Allan McRae b82a0d83ce makepkg: do not allow badly formatted arch lines
It appears there are a lot of packages with arch=('i686 x86_64')
floating around.  Quote the arch array when passing as a parameter
to detect such things.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-10-31 16:20:02 +10:00
Andrew Gregory a8285350cc makepkg: allow empty source arrays
Necessary for metapackages.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-10-31 16:20:02 +10:00
Dave Reisner 968486ecc0 makepkg: validate updated pkgver before replacement
Validate the new pkgver efore blindly ramming it into the PKGBUILD.
This gives us good feedback and prevents corrupting the PKGBUILD, e.g.

==> Starting pkgver()...
==> ERROR: pkgver is not allowed to contain colons, hyphens or whitespace.
==> ERROR: pkgver() generated an invalid version: a horse is not a pkgver

As an additional failsafe, exchange a valid for invalid character as
command separator in @SEDINPLACE@ expressions. For even more paranoia,
exit if sed fails for any reason.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-10-15 12:40:53 +10:00
Allan McRae e7ad883ebe makepkg: use source_safe when resourcing BUILDFILE
After updating the pkgver, we still need to safely source the BUILDFILE.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-10-15 12:40:53 +10:00
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 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 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 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
Allan McRae 9574bfd6c8 Merge branch 'maint' 2013-06-06 13:47:26 +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
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
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
Allan McRae 695f0e443e makepkg: fix svn repo extraction
Copy SVN repos rather than using "svn export" to keep all anotation
files in the repo for build scripts that use (e.g.) "svin info".

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-04-12 09:42:43 +10:00
Allan McRae 7e0f528274 Do not use checkout directory for SVN config
Using the checkout directory for the SVN config can result in clashes
between config files and files from the SVN checkout.  Instead, use
a ".makepkg" directory within the checkout.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-04-12 09:42:41 +10:00
Maxime Gauduin 2bf2700b74 Add support for all bzr URLs in the PKGBUILD source array
Add support for all bzr URLs, including "lp:" URLs, in the source array.
This, however, requires an internet connection and will fall back to the
current behavior for offline builds. In that case, only the URL reported
by 'bzr config parent_location' run inside the local repo can be used,
and is outputted.

Signed-off-by: Maxime Gauduin <alucryd@gmail.com>
2013-04-11 10:56:50 +10:00
William Giokas b7c994db8b makepkg: don't run remove_deps twice when unneeded
remove_deps already has a check and won't run unless -r is specified, so
if this was meant to remove dependencies of a failure no matter what,
then it's not doing it, and with -r it is run twice on a failure for no
real reason.

Signed-off-by: William Giokas <1007380@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-04-11 10:53:52 +10:00
Dave Reisner 87acfef166 makepkg: avoid file|grep dependency for CRLF check
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-04-06 15:37:48 +10:00
Andrew Gregory fa601c41ed makepkg: remove extra ansi color codes
All those extra '\e[1;'s were just setting bold redundantly or
immediately being cancelled.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-04-06 15:32:21 +10:00
Daniel Wallace 8d3ee29809 remove continue from download_local
Bug exposed by a6291858cc

popd doesn't run in the for loop in download_sources() if the continue
in download_files is executed. Causing the extract_files to extract
everything into $SRCDEST instead of $srcdir

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-04-01 15:53:12 +10:00
Andrew Gregory 950443a438 makepkg: unset GREP_OPTIONS
grep allows options to be set from the environment with GREP_OPTIONS.
Many of these options will alter grep's output, breaking makepkg.
GREP_OPTIONS=--line-number breaks installed dependency removal, for
instance.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-03-31 11:08:54 +10:00
Allan McRae a6291858cc Ensure we are always in $SRCDEST before downloading
When VCS sources were updated, we changed into their root directory.
Any following source was then downloaded to an incorrect place causing
a failure in makepkg.  Ensure we are always in the $SRCDEST directory
before starting any download.

Fixes FS#34488.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-03-30 09:06:12 +10:00
Allan McRae 6e2c15099a Remove duplicate option
The "skippgpcheck" option was specified twice.  Also, fix alphabetical
ordering.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-03-26 15:55:51 +10:00
Allan McRae 0ba9b262ab Revert "makepkg: Use a recursive git clone."
This reverts commit 8b03b1a877.

It is much better to download the submodules using separate source entries
and adjust the submodule configs to point at these versions in the
prepare() function.

See https://mailman.archlinux.org/pipermail/pacman-dev/2013-March/016771.html
for an example.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-03-14 11:47:12 +10:00
Olivier Brunel 2259dff7f3 makepkg: Add --verifysource to only download/verify source files
Because --noextract also implies to not download/verify source files, it wasn't
possible to simply do that, without either extracting and/or building.
(Note: --verifysource takes precedence over --noextract)

Signed-off-by: Olivier Brunel <i.am.jack.mail@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-03-10 09:01:56 +10:00