Commit Graph

860 Commits

Author SHA1 Message Date
Dave Reisner 35d8cc8bc8 makepkg: fix breakage in eval'ing quoted strings
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>
2011-09-01 11:32:14 -05:00
Dan McGee 50f53b293c pacman-key: add --lsign-key operation
This allows local signing of a given key to help establish the web of
trust rooted at the generated (or imported) master key.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-30 08:39:26 -05:00
Dan McGee 7479bf21e8 pacman-key master key generation
This enables pacman-key, during --init, to generate a single secret key
for the pacman keyring if one is not present. This will be used as the
root of the web of trust for those that do not wish to manage it with
their own key, as will be the default.

This does not preclude later adding other secret keys to the keyring, or
removing this one- we simply ensure you have at least one secret key
available.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-30 08:23:46 -05:00
Dan McGee 8129b93afe pacman-key: fix broken logic around updating trust database
Any option that flips UPDATEDB=1 doesn't work right now due to what we
thought was a good idea in commit cab1379a1a. Fix this by not
including the update operation in the option count and special casing
it where necessary.

Also, bring back the helpful "Updating trust database" message.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-29 19:55:28 -05:00
Dan McGee 12a6c77fdd pacman-key: have --init add more options to default gpg.conf
This adds a add_gpg_conf_option() helper function which tries to be
intelligent and only add not found options, and those which have not
been explicitly commented out.

The new options added are 'no-greeting', 'no-permission-warning', and a
default 'keyserver'.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-29 11:55:23 +10:00
Dan McGee 7ceeebf150 pacman-key: refine permission and locking checks
* secring.gpg can be 600, readable by root user only
* ensure grep for lock-never option in check_keyring doesn't catch comments

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-29 11:55:23 +10:00
Allan McRae e1b9f7b300 pacman-key: rework and document holding keys in keyring
The HoldKey option was undocumented and was not suited for pacman.conf.
Instead use the file "/etc/pacman.d/gnupg/heldkeys" to contain a list
of keys not to be removed from the pacman keyring with the --populate
option.

Signed-off-by: Allan McRae <allan@archlinux.org>
2011-08-29 11:55:23 +10:00
Allan McRae cab1379a1a pacman-key: update trust database for relevant operations
After most operations that touch the keyring, it is a good idea to
always run a check on the trustdb as this prevents gpg complaining
on later operations.

Inspiration-from: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2011-08-29 11:55:22 +10:00
Allan McRae 710e83999b pacman-key: import everything then revoke on --populate
The optimization of only importing keys that were not to be later
revoked was a not smart enough.  For example, if a key was
in both a repos keyring and its revoke list, alternate runs of
pacman-key --populate would add then remove the key from the pacman
keyring.  This problem is made worse when considering the possibility
of multiple keyrings being imported.

Instead, import all keys followed by the revoking of all keys.  This
may result in a key being added then revoked, but that is not much of
an issue given that is a very fast operation.

Signed-off-by: Allan McRae <allan@archlinux.org>
2011-08-29 11:55:22 +10:00
Allan McRae d1240f67ea pacman-key: rework importing distro/repo provided keyrings
The current --reload option, apart from being non-clear in its naming,
is very limited in that only one keyring can be provided.  A distribution
may want to provide multiple keyrings for various subsets of its
organisation or custom repo providers may also want to provide a keyring.

This patch adds a --populate option that reads keyrings from (by default)
/usr/share/pacman/keyrings.  A keyring is named foo.gpg, with optional
foo-revoked file providing a list of revoked key ids.  These files are
required to be signed (detached) by a key trusted by pacman-key, in
practice probably by the key that signed the package providing these
files. The --populate flag either updates the pacman keyring using all
keyrings in the directory or individual keyrings can be specified.

Signed-off-by: Allan McRae <allan@archlinux.org>
2011-08-29 11:55:22 +10:00
Dan McGee f0357e415c Add new 'lt' and 'zh_TW' translations from transifex
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-25 16:04:41 -05:00
Dan McGee 5c48ca3239 Update existing translations from Transifex
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-25 16:04:41 -05:00
Dave Reisner 2ca27ab3a1 makepkg: quote re-evaluation of simple vars
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>
2011-08-19 09:42:41 -05:00
Allan McRae c28052e45b makepkg: deal with variable substitution when checking sanity
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>
2011-08-18 10:50:17 -05:00
Sebastien Luttringer 4a7f3bbc46 Add makepkg -S which is an alias to makepkg --source
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>
2011-08-18 10:47:41 -05:00
Dan McGee 3ceef97799 Fix trailing whitespace in whole codebase
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-17 17:03:19 -05:00
Allan McRae f41dc7e8fa repo-add: fix creation of signature symlink
When creating a repo outside the current directory, the signature
symlink was not created.

Reported-by: Gaetan Bisson <bisson@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-16 09:25:10 -05:00
Dan McGee 1175702828 Update message catalogs
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15 16:09:45 -05:00
Dan McGee d4a92cacc6 Update translations from Transifex
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15 16:09:11 -05:00
Dan McGee 11b9bc443d repo-add: reorganize output messages for clarity
The use of warning once we had already started adding a package was
confusing as it broke the standard indent pattern. It was especially bad
if adding multiple packages as it wasn't clear what sub-messages applied
to which package being added. This should be an output change only from:

    ==> Adding package '/tmp/sync/netcfg-2.6.7-1-any.pkg.tar.xz'
      -> Computing checksums...
      -> Adding package signature...
    ==> WARNING: An entry for 'netcfg-2.6.7-1' already existed
      -> Removing existing entry 'netcfg-2.6.7-1'...
      -> Creating 'desc' db entry...
      -> Creating 'depends' db entry...

to:

    ==> Adding package '/tmp/sync/netcfg-2.6.7-1-any.pkg.tar.xz'
    ==> WARNING: An entry for 'netcfg-2.6.7-1' already existed
      -> Computing checksums...
      -> Adding package signature...
      -> Removing existing entry 'netcfg-2.6.7-1'...
      -> Creating 'desc' db entry...
      -> Creating 'depends' db entry...

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15 15:15:11 -05:00
Dave Reisner 82ffe2cbfd build-sys: always use $(RM) instead of rm -f
These are equivalent. Use the autoconf macro for consistency.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15 13:05:27 -05:00
Dave Reisner 1741b5cc30 dist: preserve symlinks on installation
This applies to the repo-remove man page as well as the script itself.

Yes Dan, I ran distcheck afterwards.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15 13:05:17 -05:00
Allan McRae 31a7b150b0 repo-add: indicate whether package signature is found
When adding a package to a repo, it is useful to be able to see
that repo-add has indeed found the signature file.

[Dan: update text to be more in line with other messages]

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15 07:07:13 -05:00
Dave Reisner 71f854dde8 makepkg: don't hardcode path to strip
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15 06:33:01 -05:00
Dan McGee fffaba50fb scripts/pkgdelta: fix `make distcheck`
--help and --version are required by the sanity checks performed by
`make distcheck`.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-11 11:56:47 -05:00
Dan McGee 76dfea6e83 Update string catalogs after string tweaks
This also pulls in some early translations we had entered in Transifex
in the last day so those would not be lost. The diffstat is huge and not
very telling as usual, as all sorts of fuzzyness switches happened this
time around for some reason.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-09 16:00:48 -05:00
Dan McGee 1d16875db7 Update several translation strings
* Fix typos/capitalization
* Make sure large blocks of text are translated in one unit

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-08 19:01:26 -05:00
Dan McGee 9a40927533 Update all translation files
This moves us toward staring translations for the 4.0.0 release,
although this should not be interpreted as a string freeze by any means.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-08 17:17:15 -05:00
Dan McGee 8fa330335f Merge branch 'maint'
Conflicts:
	lib/libalpm/dload.c
	lib/libalpm/po/fi.po
	lib/libalpm/po/libalpm.pot
	po/de.po
	po/fi.po
	src/pacman/po/pacman.pot
	src/pacman/util.c
2011-08-08 17:05:25 -05:00
Dave Reisner 1a919a11b8 makepkg: ignore epoch when undeclared
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>
2011-08-08 16:47:47 -05:00
Allan McRae c55cbfbd5f pacman-key: follow gpg options for listing keys
The current --list option outputed the keys and all their signatures
which can be overly verbose.  It also did not take a list of keys on
the command line to limit its output (although the code suggests that
was intended).

That patch brings consistency with gpg, providing --list-keys and
--list-sigs options that function equivalently to those provided by
gpg.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-02 08:20:42 -04:00
Dave Reisner e42d97b737 scripts/pkgdelta: exit properly on missing args
Removes usage of 'nounset' which, when combined with 'errexit' can cause
undesirable early exits.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-07-28 13:10:10 -04:00
Dave Reisner e99b6a131e scripts/repo-add: show usage when no DB file specified
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-07-28 13:07:25 -04:00
Pang Yan Han 804e2505cf pacman-key: Add --import and --import-trustdb
Currently, pacman-key allows the user to import their keys using the --add
option. However, no similar functionality exists for importing ownertrust
values.

The --import-trustdb option takes a list of directories and imports ownertrust
values if the directories have a trustdb.gpg database.

The --import option takes a list of directories and imports keys from
pubring.gpg and ownertrust values from trustdb.gpg. Think of it as a combination
of --add and --import-trustdb

Signed-off-by: Pang Yan Han <pangyanhan@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-27 12:47:53 -05:00
DJ Mills c5d4c92ad4 pacman-key: change GPG_PACMAN and GPG_NOKEYRING to arrays
Allows the commands to safely handle any possible arguments

Signed-off-by: DJ Mills <danielmills1@gmail.com>
Allan: rebase patch
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-27 12:47:46 -05:00
Allan McRae d9875c5e6c pacman-key: fix syntax error in -r arg parsing
Previous fix did not work...

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-27 12:47:37 -05:00
Allan McRae 49d9426b6a makepkg: refactor checking source integrity
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>
2011-07-27 12:47:23 -05:00
Allan McRae 2b3405e01b makepkg: more control of skipping integrity checks
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>
2011-07-27 12:47:13 -05:00
Wieland Hoffmann 94f61c5b29 makepkg: Add support for verifying pgp signatures
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>
2011-07-27 12:47:06 -05:00
Allan McRae ccdb2fa800 makepkg: get package version with overrides
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>
2011-07-27 12:45:25 -05:00
Allan McRae 03447ce39c makepkg: allow epoch to be overridden
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>
2011-07-27 12:45:18 -05:00
Allan McRae a7940e7419 makepkg: check arch overrides for required architecture
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>
2011-07-27 12:45:12 -05:00
Allan McRae 819f675004 makepkg: check overrides for pkgrel and pkgver
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>
2011-07-27 12:45:06 -05:00
Allan McRae 00949db191 makepkg: pkgver and pkgrel can not have whitespace
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>
2011-07-27 12:44:59 -05:00
Dave Reisner 98073afe55 pacman-key: refactor post parse opt check into a case
This is a cleaner expression of the same information.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-21 15:05:52 -05:00
Dave Reisner 768d3589a3 pacman-key: s/UPDATEBD/UPDATEDB/
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-21 15:05:39 -05:00
Dave Reisner 2bd1687f51 pacman-key: fix syntax error in -r arg parsing
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-21 15:05:30 -05:00
Dave Reisner 9f500f684d pacman-key: return $ret, not errors
fixes: /usr/bin/pacman-key: line 286: return: errors: numeric argument required

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-21 15:04:49 -05:00
Pang Yan Han 333269482a pacman-key: --init: correct creation of gpg.conf
Signed-off-by: Pang Yan Han <pangyanhan@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2011-07-19 10:27:54 +10:00
Pang Yan Han fa3aaa41e3 pacman-key: correct spelling mistake
Signed-off-by: Pang Yan Han <pangyanhan@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2011-07-19 10:27:54 +10:00
Allan McRae 7e5dea5d32 pacman-key: add dependency on parse_options to Makefile
Signed-off-by: Allan McRae <allan@archlinux.org>
2011-07-19 10:27:54 +10:00
Allan McRae 31c9a521b4 pacman-key: check required permissions on keyring
Makes sure that the pacman keyring is readable and that the user
has permissions to create a lock file if lock-never is not specified
in the gpg.conf file.

Signed-off-by: Allan McRae <allan@archlinux.org>
2011-07-19 10:27:54 +10:00
Allan McRae 0c9e86bab1 pacman-key: add --init option
Add an --init option that ensures that the pacman keyring has all
the necessary files and they have the correct permissions for being
read as a user.

Signed-off-by: Allan McRae <allan@archlinux.org>
2011-07-19 10:27:54 +10:00
Dave Reisner 0be9e4a4cd pacman-key: tidy up logic for finding pacman keyring directory
Signed-off-by: Allan McRae <allan@archlinux.org>
2011-07-19 10:27:54 +10:00
Dave Reisner df7b390514 pacman-key: refactor get_from
This function had a variety of pitfalls, including the inability to
successfully find a key=value pair where no whitespace surrounded the
equals sign. Make it more robust by splitting the line on the equals
itself, and performing whitespace trimming on the resulting key/value
pair.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2011-07-19 10:27:54 +10:00
Allan McRae 0e85c4989b pacman-key: add --verify option
Signed-off-by: Allan McRae <allan@archlinux.org>
2011-07-19 10:27:54 +10:00
Allan McRae fec10d4a65 pacman-key: check only a single operation has been specified
Follow the example of gpg and only allow a single operation to be
specified each time.  Prevents having to deal with conflicting
variable names and potential issues due to the order in which the
operations are run.

Signed-off-by: Allan McRae <allan@archlinux.org>
2011-07-19 10:27:53 +10:00
Allan McRae 74f6d717a3 pacman-key: move verifying keyring files to own function
Also check all files before bailing on errors.

Signed-off-by: Allan McRae <allan@archlinux.org>
2011-07-19 10:27:53 +10:00
Allan McRae 74e5a494b0 pacman-key: move --edit-key and --receive processing to functions
This moves the processing of the --edit-key and --receive options
to functions, keeping the final option processing to be all single
line statements.

Also rework the --edit-key option to validate all input before
processing.

Signed-off-by: Allan McRae <allan@archlinux.org>
2011-07-19 10:27:53 +10:00
Ivan Kanakarakis e37adcd664 pacman-key: hide output of executed commands on logic checks
This commit correctly redirects to /dev/null the output of several
commands that get executed on logic checks.

Original-patch-by: Denis A. Altoé Falqueto <denisfalqueto@gmail.com>
Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2011-07-19 10:27:53 +10:00
Allan McRae e458606ad2 pacman-key: rename --trust to --edit-key
This keeps the naming of the option more consistent with what is
actually being called by gpg.

Original-patch-by: Denis A. Altoé Falqueto <denisfalqueto@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2011-07-19 10:27:53 +10:00
Ivan Kanakarakis 15ca6dca5c pacman-key: fix quotation on several variable assignments
This commit adds quotes to several variable assignments. Unquoted values
can cause problems on several occasions if the value is empty. It is
safer to have every assignment quoted.

Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com>
2011-07-19 10:27:53 +10:00
Allan McRae b300b991a7 pacman-key: allow the export of all key ids
The gpg --export will exprt all keys if none are specified. Replicate
this behavior in pacman-key.

Signed-off-by: Allan McRae <allan@archlinux.org>
2011-07-19 10:27:53 +10:00
Allan McRae 8ee0724558 pacman-key: rename --del to --delete
There is already the short -d alias provided, so stay verbose with
the longer option name.

Signed-off-by: Allan McRae <allan@archlinux.org>
2011-07-19 10:27:53 +10:00
Allan McRae 95d7e16163 pacman-key: remove the --adv option
The conversion to using parse_options causes this option to break.
It is preferable to remove the option rather than fix it as it is
simply a wrapper for "gpg --homedir @sysconfdir@/pacman.d/gnupg".
Any user using more advanced keyring management than provided by
pacman-key can manage to point gpg at the right place themselves...

How to manually edit the keyring with gpg will instead be documented
in the man page in a later commit.

Signed-off-by: Allan McRae <allan@archlinux.org>
2011-07-19 10:27:53 +10:00
Allan McRae 7d205a70a2 pacman-key: use our option parser
The pacman-key script is complicated enough to warrent usage of the
parse_options script.  This is especially helpful in dealing with
all the configuration file override flags as the no longer need to
be specified first.  It also allows us to do the right thing early
with --help/--version and no option cases cleanly. This change also
makde the check for root privileges only occur on operations where
they are needed.

This patch is inspired by and supercedes some patches submitted by
Denis A. Altoé Falqueto and Ivan Kanakarakis who were altering the
previous option handling in an attempt to deal with the above issues.

Signed-off-by: Allan McRae <allan@archlinux.org>
2011-07-19 10:27:53 +10:00
Dan McGee 48e2a1a119 Merge branch 'maint' 2011-07-18 10:41:37 -05:00
Allan McRae 297cd7897b makepkg: fix issue with filenames with spaces and noextract
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>
2011-07-18 10:41:27 -05:00
Allan McRae 49427d1fb4 repo-add: do not print full path of signature file
The full path to the signature file when it is created is in a temporary
directory so only print the filename.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-18 10:35:57 -05:00
Allan McRae bf120635a7 repo-add: always remove repo signature symlink
This prevents a dangling symlink being left behind if the repo goes
from being signed to unsigned.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-18 10:35:47 -05:00
Rogutės Sparnuotos 3a04267cdd makepkg: only test for writable PKGDEST when needed.
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>
2011-07-18 10:28:19 -05:00
Allan McRae 65847fad44 Move some .gitignore entries
Put a .gitignore entry at the right level and sort that file
alphabetically.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-18 10:28:19 -05:00
Dave Reisner 6907a22b27 makepkg: remove unused -C option from option list
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>
2011-07-14 15:49:13 -05:00
Dave Reisner 727e03fe19 makepkg: skip devel_check when reading from a pipe
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-14 15:44:48 -05:00
DJ Mills 282be6bf4b makepkg: Remove pre-optimization from in_array()
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>
2011-07-14 15:42:37 -05:00
DJ Mills 7f5b24597b makepkg: Remove OPT_TEMP hack in parse_options call
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>
2011-07-14 15:42:29 -05:00
Dan McGee 36e48573ce Add 'compress' compression format as an available option
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>
2011-07-14 14:58:46 -05:00
Allan McRae eda741ae93 repo-add: backup old database signature too
If you are keeping a copy of the old database, you probably want
to keep a copy of its signature too.  Also, delete the previously
backed-up database signature if no new one is being copied.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-05 21:40:26 -05:00
Allan McRae e2f00abe26 pacman-key: fix syntax highlighting
The lone quotation mark in "pacman's" causes issues for some syntax
highlighting. Change the printing of the nessage from echo to printf
so we can invisibly escape it.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-05 21:38:07 -05:00
Allan McRae 77a93328cf Add library files to POTFILES.in
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-05 10:22:37 -05:00
Allan McRae bfd6d22be2 parse_options: accept multiple arguments
Allow command-line options to accept multiple arguments without
additional quoting by taking the list of arguments until one
starting with a "-" is reached.

The only current use of this is the --pkg option in makepkg.  This
allows (e.g.)

makepkg --pkg foo bar

and packages "foo" and "bar" will be built.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-05 10:22:31 -05:00
Allan McRae 87ee38d8b3 parse_options: implement optional arguments
This allows options specified with a trailing "::" to optionally
take arguments.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-05 10:22:25 -05:00
Allan McRae ddb8617d96 parse_options: add missing newlines
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-05 10:22:20 -05:00
Florian Pritz 9efd10cd2a fix vim syntax highlighting of .sh files
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>
2011-06-30 10:44:45 -05:00
Dan McGee c2cce4f3f5 Merge remote-tracking branch 'dave/makepkg' 2011-06-30 10:41:49 -05:00
Dave Reisner 2860ade2f5 repo-add.sh.in: avoid being clever with repo repacking
Revert to the old behavior that 6f5a90 attempted to simplify and go with
the original proposed solution of using "ugly" bash to detect empty
directories.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-30 10:32:15 -05:00
Dan McGee 84974ed04c repo-add: fix db creation one last time
We fubar-ed this pretty good.

1. The whole old/new move shuffle was totally busted if you used a
relative path to your database, as we would just build the database in
place.
2. Our prior temp directory layout had the database files extracted
directly into it. When we tried to create a xxx.db.tar.gz file in this
same directory, due to the fact that we were no longer using a shell
wildcard, we tried to include the db in ourself, which is a big failure.
Fix all this by extracting to tree/ so we can have a clean top-level
temp directory.
3. Fix the inclusion of the './' directory entry; ensure the regex
prunes both leading paths of '.' as well as './'.

Where is that test suite again?

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-30 10:29:55 -05:00
Dan McGee c2e6a01a28 makepkg: only source user override if using default config file
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>
2011-06-30 10:29:49 -05:00
Rémy Oudompheng 4c80f994c3 makepkg: fix typo (missing quotes)
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>
2011-06-30 10:28:24 -05:00
Allan McRae e92905a2c8 makepkg: fix removing symbolic link
The path was not being stripped from $file before prefixing with
$srcdir resulting in the attempted removal of a very weird
filename.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-30 10:28:18 -05:00
Dave Reisner 9a29888ba7 makepkg: simplify SIGNPKG check
Signed-off-by: Dave Reisner <d@falconindy.com>
2011-06-28 23:15:58 -04:00
Dave Reisner 5f6e8c9274 makepkg: fix vim syntax highlighting
Signed-off-by: Dave Reisner <d@falconindy.com>
2011-06-28 23:05:57 -04:00
Dave Reisner 452bf71cec makepkg: remove unneeded echo
Signed-off-by: Dave Reisner <d@falconindy.com>
2011-06-28 23:05:57 -04:00
Dan McGee 9aab1440ca Revert "Merge branch 'master' of git://projects.archlinux.org/pacman"
This reverts the merge of 2d32a9a3a3,
which reverts the commit 8581694ceb.

Thanks Dave for the dirty branch and non-clean rebase! :) Dave broke it.
2011-06-27 21:43:58 -05:00
Dan McGee 97e1dd9318 repo-add: remove extra exit call
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-27 15:08:14 -05:00
Dan McGee 09c803783d pacman-optimize: use output library
We already use msg() and error() in here, might as well just use the
standard functions. In addition, fix one translated message that would
have printed ERROR twice if anyone ever saw it.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-27 13:30:41 -05:00
Dan McGee a12acbc2ff Merge remote-tracking branch 'dave/repo-add' 2011-06-27 13:30:37 -05:00
Dave Reisner db172b09c5 repo-add: add new command, repo-elephant
_    _
  / \__/ \_____
 /  /  \  \    `\
 )  \''/  (     |\
 `\__)/__/'_\  / `
    //_|_|~|_|_|
    ^""'"' ""'"'

Signed-off-by: Dave Reisner <d@falconindy.com>
2011-06-27 14:10:03 -04:00
Dave Reisner 399184d68f repo-add: enforce file extensions
Allow one of 4 archive extensions: .tar{,.gz,.xz,.bz2} for each of the 2
valid repo extensions: .db and .files. Check for this via
'verify_repo_extension' directly after option parsing to assert that
this extension is present, and again after files have been added to get
the proper archive option for bsdtar.

Signed-off-by: Dave Reisner <d@falconindy.com>
2011-06-27 13:39:02 -04:00
Dave Reisner 122b4c2187 repo-add: move command invocation out of arg parsing loop
Signed-off-by: Dave Reisner <d@falconindy.com>
2011-06-27 13:39:02 -04:00