Combine changelog and install file creation in create_package().
Signed-off-by: Andres P <aepd87@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Eases maintanence if we need to add further options in the future.
Extracted from a patch supplied by Andres P <aepd87@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
When performing local testing, it may be useful to add PKGEXT='.pkg.tar'
to the PKGBUILD to save time, especially with big packages.
Signed-off-by: Dan McGee <dan@archlinux.org>
Fixes repackaging issues when multiple package names are passed to the
--pkg option.
Signed-off-by: Dave Reisner <d@falconindy.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
Variables that are only meaningful within the function they are declared in are
now prefixed by "local".
Signed-off-by: Andres P <aepd87@gmail.com>
[Allan: fix whitespace]
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
This fixes two issues:
1) using "sudo -l" results in excess password asking under certian
configurations. Revert to the pre 3.4 behaviour of always using
sudo if it is installed.
2) Properly escape the command so that that versioned dependencies,
such as "foo>4", do not get treated as output redirection when using
su. This also unifies the generation of the pacman line and its
privilege escalation.
Based on patches supplied by Andres P <aepd87@gmail.com> with minor
adjustments for suitability for the maint branch.
Original-work-by: Andres P <aepd87@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
When makepkg catches a command failure it currently prints "Aborting..."
and exits. Clarify the reason for aborting from packaging is a failure
during one of the PKGBUILDs functions.
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
Attempt to find "du" from coreutils in the standard paths and if
not revert to the version in the users PATH. Using the full path
prevents issues such as FS#19932, where a different and incompatible
version of du is put earlier in the users path.
Signed-off-by: Allan McRae <allan@archlinux.org>
The 'grep -R' in the $srcdir check would not only grep regular files,
but also devices, symlinks (that might potentially point outside of
$pkgdir), pipes and so on. Use find to ensure only regular files are
examined.
This should fix https://bugs.archlinux.org/task/19975
Signed-off-by: Allan McRae <allan@archlinux.org>
Commit 13748ca052 inversed the nature of one test wherein the if clause would
throw a fatal error if a legitimate package function was defined in PKGBUILD.
Signed-off-by: Andres P <aepd87@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
Running "pacman -T foo" is expected to return a non-zero value when
"foo" is not installed. This sets of the error trap in bash-3.2 but
not bash 4.x. Work around this by disabling the error trap around
this pacman call as we are manually checking the return value anyway.
Signed-off-by: Allan McRae <allan@archlinux.org>
Commit 3d67d9b1 introduced multiple bash4 string manipulations.
Revert those in order retain compatibility with bash-3.2 which
is still widely used.
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
pacman -Qq output is sorted according to the users LC_COLLATE
setting as is needed for comm.
Signed-off-by: Andres P <aepd87@gmail.com>
[Allan: adjust commit message]
Signed-off-by: Allan McRae <allan@archlinux.org>
Ease maintainace; the two parts that have been combined into a function were
identical.
Signed-off-by: Andres P <aepd87@gmail.com>
[Allan: rename function]
Signed-off-by: Allan McRae <allan@archlinux.org>
Regression caused by c71fe7db. Was checking for "optdepend" and "conflict"
rather than "optdepends" and "conflicts" when populating .PKGINFO.
Signed-off-by: Andres P <aepd87@gmail.com>
[Allan: adjust commit message]
Signed-off-by: Allan McRae <allan@archlinux.org>
If the library stripping variables are not defined in makepkg.conf,
libraries will be fully stripped and become broken. Fallback to a
sane default stripping level.
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
If "file -bizL" does not return a supported type, check if the file is
recognized by bsdtar and if yes extract from it.
Dan: use '-q' option to prevent needing to seek the entire archive.
Signed-off-by: Nezmer <git@nezmer.info>
Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
Instead of specifying the output file on every echo, leave it to the
caller of write_pkginfo to specify the target.
Signed-off-by: Andres P <aepd87@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Change all instances of the (test) [ builtin to the [[ keyword.
Signed-off-by: Andres P <aepd87@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Rely on type -p's return value instead of a string check.
And gettext was previously being checked with type -t, which was
inconsistent with the rest of the tests pertaining commands that aren't
expected to be functions nor builtins.
Signed-off-by: Andres P <aepd87@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
If the library stripping variables are not defined in makepkg.conf,
libraries will be fully stripped and become broken. Fallback to a
sane default stripping level.
Signed-off-by: Allan McRae <allan@archlinux.org>
Source packages were getting created with only links to local source
files. Caused by commit 5cddcc90.
Also, fix dangling symlinks to install and changelog files. Caused
by commit fe1e3471.
Thanks to Christopher Rogers <slaxemulator@gmail.com> for pointing
out areas that were failing.
Signed-off-by: Allan McRae <allan@archlinux.org>
Move the absolute filename detection to a new function to reduce code
duplication.
This patch also fixes the --allsource option that did not include remote
source files if they reside in $startdir instead of $SRCDEST.
Signed-off-by: Cedric Staniewski <cedric@gmx.ca>
Signed-off-by: Allan McRae <allan@archlinux.org>
The complete file path of a temporary symlink is really useless
information.
Signed-off-by: Cedric Staniewski <cedric@gmx.ca>
Signed-off-by: Dan McGee <dan@archlinux.org>
Merges code in two almost identical chunks in create_srcpackage and
check_sanity.
Also discards the space kept by regex in ae73d75660 and earlier, since
the for loop discards it later on.
Signed-off-by: Andres P <aepd87@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
The .INSTALL and .CHANGELOG files in a package retained the permissions
that they had in $startdir. Do a chmod after copying to ensure
that the permissions are sane.
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
f569c4a042 wrongly relied on file's output.
The fix is to not decompress files in the first place.
Signed-off-by: Andres P <aepd87@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
Extends the use of the --skipinteg option to creating a source
package. Fixes FS#15984.
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
With this patch, dependencies will be resolved and not silently ignored
when running:
makepkg --nobuild --syncdeps
makepkg --repackage --syncdeps
Also, a warning is displayed when repackaging and dependencies are not
being resolved.
Thank you Allan for the feedback.
Signed-off-by: Nezmer <git@nezmer.info>
[Allan: Only warn when repackaging with a package function]
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
The current --skipinteg is a bit weird. It does not skip integrity
checks, but instead does them and prints a warning. Change this
behaviour to actually skipping the checks.
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
The presence of all install and changelog files (multiple files may
be used with package splitting) is checked for in check_sanity().
All install and changelog files are copied to the source location
when using --source. The check for install and changelog file presence
is removed in create_srcpackage() as this is redundant to the checks
performed in check_sanity().
Moved install and changelog handling in create_srcpackage() to after
source array files, as this is more logical and readily allows for the
following.
A check is made when creating a source package that a symlink to an
install file has not already been added. This can occur if the
install file is used multiple times or if it is listed in the source
array.
Fixes FS#18831, FS#18394 and partially fixes FS#16004
Signed-off-by: Allan McRae <allan@archlinux.org>