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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Address the issue of our scripts not working so great when gettext is not
available. This has come up in multiple bug reports, and is relatively easy
to address by adding a simple check and a stub function if gettext was not
found that simply echos the original message.
Addresses concerns from FS#9214 and FS#9607.
Signed-off-by: Dan McGee <dan@archlinux.org>
This fixes FS#9242 and FS#9362.
Set umask before the sources are extracted, and after the /etc/profile.d/*
files are sourced in handledeps.
This sourcing of profile.d files is why umask was moved to the build
function in the first place, as can be seen in commit ac965ed401.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Fixes FS#9230. Ensure we have the VCS binaries available when doing the
development version number checking.
Signed-off-by: Dan McGee <dan@archlinux.org>
The path selection for stripping binaries was slightly off, so any binaries
in subdirectories of opt/ were missed. Fixes FS#9342.
Signed-off-by: Dan McGee <dan@archlinux.org>
The previous sed command matched every line starting with r.
For example, with mpd-svn package in aur, the svn log output was rather big,
and there were several lines starting with r (the actual revision : r7155,
but also other lines starting with reverting and run), so this broke makepkg:
> makepkg
==> Determining latest svn revision...
-> Version found: 7155
everting
un
sed: -e expression #1, char 27: unterminated `s' command
To make the sed command more bullet proof, I added the -q option of svn log,
which produces a quieter output, without the log.
And I changed the sed command to only match numbers for the revision.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
Workaround found in Advanced Bash-Scripting Guide, localization section.
"added a \0 (NULL) at the beginning of the sentence."
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Pacman 3.0 printed the following message if a file could not be found:
ERROR: xxx was not found in the build directory and is not a proper URL.
We lost this logic in 3.1 when moving to the DLAGENT type stuff, so a
not-found file got passed all the way to the download logic where it failed
with a odd error message. Bring back some logic to ensure only files with
URLs get past a certain point, and fail if the file is not available.
Fixes FS#9208.
Signed-off-by: Dan McGee <dan@archlinux.org>
The --asroot option was not passed to recursive calls of makepkg.
In addition, a 'cd' call was done only on the fakeroot branch instead of
both fakeroot and root branches. Move it outside the conditional.
Noticed-by: Karolina Lindqvist <karolina.lindqvist@kramnet.se>
Signed-off-by: Dan McGee <dan@archlinux.org>
The recent upgrade of magic.mime in the file program changed the mime type
output to application/zip instead of application/x-zip as it is a registered
type. Unfortunately we then just skipped zip file extraction becuase of this
change.
Signed-off-by: Dan McGee <dan@archlinux.org>
This is something pacman can do on its own straight from the archive, and we
will reduce the chance of problems occurring becuase of inproper FILELIST
generation as we have had in the past with special characters in filenames.
Once we remove it from makepkg. we can remove any usage of it from all of
our other tools, including pacman, pactest, and contrib/ utilities.
Note that removing it from pacman uncovered a few other bugs anyway, so this
was probably a good move.
Signed-off-by: Dan McGee <dan@archlinux.org>
I thought it was wierd that makepkg didn't do a sanity check for the
$pkgname. This makes for a simple first try at a GIT patch.
Signed-off-by: K. Piche <kevin@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
There is no real reason to make it look like someone that can't bother to
set the packager variable is official in any way, so remove the Arch Linux
reference from makepkg.
Signed-off-by: Dan McGee <dan@archlinux.org>
Update the GPL boilerplate to direct people to the GNU website for a copy of
the license, as well as bump all of Judd's copyrights to 2007.
Signed-off-by: Dan McGee <dan@archlinux.org>
This fixes FS#5392. If hard links are present for a man page, all
other hard linked files are removed, the man page is zipped and the
hard links are updated to the newly compress man page.
Signed-off-by: Allan McRae <mcrae_allan@hotmail.com>
[Dan: use find -samefile option, don't fail if one of mandirs is
nonexistent]
Signed-off-by: Dan McGee <dan@archlinux.org>
Retrieve SVN/CVS/etc revision number before checking if the
package has already been built. This allows building a newer
version of a developmental package without having to use -f.
Now -f will only be needed if the latest SVN/CVS/etc revision
is the same as the built package.
Signed-off-by: Scott Horowitz <stonecrest@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
Some of the find calls did not have a path, which isn't valid in some
versions of the find utility. Add a . for compatibility.
Signed-off-by: Dan McGee <dan@archlinux.org>
If PKGBUILDs use the correct svn/cvs/etc variables, determine the latest
revision number and force this as the pkgver for building.
Signed-off-by: Scott Horowitz <stonecrest@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
In one of the original clean up patches[1] I changed the search path
for stripping binaries and libraries. This resulted in only
usr/{bin,sbin,lib} being searched. This patch reverts that change.
[1] 721ceee1e2
Signed-off-by: Andrew Fyfe <andrew@neptune-one.net>
This is needed because 'xdelta delta' returns 1 even when the delta
creation succeeds. This was causing makepkg to exit after the command
due to bash's -e option.
Some information from the xdelta man page:
The delta command exits with status 0 to indicate that no differences
were found, with status 1 to indicate that some differences were found,
and with status 2 to indicate an error of some kind.
Signed-off-by: Nathan Jones <nathanj@insightbb.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
The -A,--ignorearch option was added and given help text, but never actually
listed as valid to the option parser. Fix this.
Signed-off-by: Dan McGee <dan@archlinux.org>
Packages and DBs now support using the UNIX epoch (seconds since Jan 1, 1970)
for use in builddate and installdate. This will only affect newly built
packages. Old existing packages with the text format are still supported, but
this is deprecated.
In the case of removal of text time support, this code will fail gracefully,
returning the start of the epoch for broken packages.
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
Add some alpm functions for getting optdepends, have makepkg include them
in the PKGINFO file, and have a pacman -Qi operation display the raw string
as stored by libalpm.
Signed-off-by: Dan McGee <dan@archlinux.org>
repo-add, repo-remove:
'bsdtar -c * | ...' doesn't work (you need '-f -'). Code clean up
eliminated this bug.
Removed the multiple checksum support, pacman now only supports MD5, so
there's no need for the database to contain multiple checksums.
Quote all variables containing file/dir names to prevent paths
containing spaces from causing problems.
Add msg, warning and error functions.
General code clean up.
pacman-optimize:
Use a sub-directory in /tmp for working files to make it easier to clean
up at the end.
Add quotes round $@ in die and die_r, otherwise printf can't display the
message correctly.
makepkg:
Disable colour output if stderr is not a tty.
Signed-off-by: Andrew Fyfe <andrew@neptune-one.net>
makepkg didn't correctly detect the type of the archive
since it didn't dereference symlinks, and so failed
to extract the source tarball.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
- Downloaded files weren't being copied to $srcdir
- Counter wasn't being incremented for checksum checks
Signed-off-by: Andrew Fyfe <andrew@neptune-one.net>
This replaces the former -D operation that was undocumented and rather
hacky. It can be used with add, upgrade, or sync transactions and will affect
all packages installed. Should close FS #7193.
Also tell makepkg to use this new flag.
Signed-off-by: Dan McGee <dan@archlinux.org>
makepkg: We still need the source files in $srcdir because PKGBUILDS need
access to noextract() files and other file not handled by by
extract_source(). (eg config files)
query.c: Fix some output formating.
Signed-off-by: Andrew Fyfe <andrew@neptune-one.net>
Change the behaviour of makepkg so no longer stores a copy of the
source tarball in $srcdir, instead it downloads all sources to $SRCDEST
then extracts them to $srcdir.
Signed-off-by: Andrew Fyfe <andrew@neptune-one.net>
When running as root, we don't care if fakeroot is installed, and the user
certainly isn't "unprivileged". Cut out these warnings.
Signed-off-by: Dan McGee <dan@archlinux.org>
Changed the exit code for missing deps from 1 to 127 because 1 is used
for other errors. makepkg breaks if pacman exits with 1 for any reason
other than a missing dep.
Signed-off-by: Andrew Fyfe <andrew@neptune-one.net>
It is much easier for translators to deal with paragraphs as strings rather
than by lines. Take all usage and version information and convert it to this
format.
Signed-off-by: Dan McGee <dan@archlinux.org>
If we move the scripts from *.in to *.sh.in and *.py.in, gettext can pull the
required strings to translate a whole lot easier. Do this.
Signed-off-by: Dan McGee <dan@archlinux.org>