Commit Graph

757 Commits

Author SHA1 Message Date
Eric Bélanger bdd8ebd631 makepkg: Move check for sudo into check_software function
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-27 09:24:19 -05:00
Dave Reisner 7d8e9b8ed6 repo-add: use format_entry for all desc/depends fields
This ranks high on the code readability scale. The same function formats
all of our data and writes to the metadata file at once.

Signed-off-by: Dave Reisner <d@falconindy.com>
2011-06-24 14:55:49 -04:00
Dave Reisner 5246fdecf6 repo-add: store multi-value fields as arrays
Fields like groups and depends should be stored as arrays. This requires
rewriting our write_list_entry function to accomodate our new data type.
This new function will not write to a file, but rather only format it.

Signed-off-by: Dave Reisner <d@falconindy.com>
2011-06-24 14:55:49 -04:00
Dave Reisner 522c94f168 repo-add: bashify reading of .PKGINFO file
grep and sed aren't needed here, and this removes the truly ugly
manipulation of IFS. The process substituion could just as well be a
herestring, but it breaks vim's syntax highlighting. Style over
substance, mang.

Signed-off-by: Dave Reisner <d@falconindy.com>
2011-06-24 14:55:49 -04:00
Dave Reisner 2d32a9a3a3 Merge branch 'master' of git://projects.archlinux.org/pacman
* 'master' of git://projects.archlinux.org/pacman:
  pactree: carry a list of databases for dep resolution
  makepkg: Remove a lone quotation mark
  makepkg: remove the cleancache option
  Don't require a transaction for sync DB updates
  Move locking functions to handle
  Add a 'valid' flag to the database object
  Move database 'version' check to registration time
  Do database signature checking at load time
2011-06-24 14:55:32 -04:00
Wieland Hoffmann 61cb8e76c3 makepkg: Remove a lone quotation mark
Allan broke it in 4bdb868.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-24 13:36:46 -05:00
Allan McRae c45cfb1741 makepkg: remove the cleancache option
This is a fairly useless feature given all it does is an "rm" on a
directory.  It is also unlikely that you would want to remove the
entire SRCDEST anyway, but rather just the old files.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-24 13:36:38 -05:00
Dave Reisner 8581694ceb makepkg: fix incorrect parenthesis in gettext call
allan broke it in 4bdb868a.

Signed-off-by: Dave Reisner <d@falconindy.com>
2011-06-24 08:36:54 -04:00
Allan McRae 4bdb868ac8 makepkg: clean-up of output messages
There was a lot of inconsistency in how strings that should not be
translated (program names, option flags, PKGBUILD directives, etc) were
handled. This patch moves them all outside the gettext invocation for
consistency and to prevent accidental translation.

Note that some of these may need reverted if they cause difficulties in
translation due to gettext usage in bash not taking positional parameters
for arguments. A quick survey of current translations indicates that this
issue will be rare.  Also, we should be able to catch these before a full
string freeze given we are going to probably need a "developer preview"
release before the next release series.

Signed-off-by: Allan McRae <allan@archlinux.org>
2011-06-24 02:02:21 -05:00
Dave Reisner e27a5c8851 parse-options: simplify unused-arg & parameter printing
Signed-off-by: Dave Reisner <d@falconindy.com>
2011-06-24 00:02:06 -05:00
Dan McGee ac7d17f88e Merge branch 'po-split' 2011-06-23 23:44:35 -05:00
Dave Reisner d8d287b4d2 repo-add: fix path designation regression
b899099 made path checking a bit more strict than I had intended, and
would actually forbid creation of a repo in $PWD if only the filename
was specified. readlink would be the fun and easy solution here, but
it's avoided due to portability issues, making the validation process a
bit more verbose.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-23 23:27:07 -05:00
Dan McGee d62a429b92 scripts/po/: add pacman-key
This has gettext strings, but wasn't added to the list of files in
POTFILES.in just yet. Add it and update the catalogs.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-23 22:55:57 -05:00
Dan McGee 963b942bb9 scripts/po/: prune message catalog and translations
Now that we have performed the split, prune the catalogs of all
pacman-only messages.

All old messages were pruned from the files using the following command:
    sed -i -e '/^#\~/,' *.po

Note: the diff on this commit looks much less insane if the --patience
option is used.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-23 22:50:30 -05:00
Dan McGee a4a7006a13 po/: split into scripts/po/ and src/pacman/po/
This is the first step at separating the pacman message catalog and the
scripts message catalog. Makefiles, configure.ac, and other such files
are adjusted accordingly, as well as renaming files. The TEXTDOMAIN of
scripts is also adjusted.

Note that no actual pot or po files get changed here; these will get
pruned in a future commit so each catalog contains only the necessary
messages.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-23 22:50:01 -05:00
Eric Bélanger eedd56f320 makepkg: Added checks in check_software for distcc, ccache, strip and gzip
Dan: slightly shorten some of the messages.

Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-23 21:39:37 -05:00
Dan McGee aa89a65a83 makepkg: remove distcc/makeflags option interaction
Way back in c94bfbaba when refactoring makepkg options handling, I added
these lines to unset MAKEFLAGS if '!distcc' was set in a PKGBUILD (not
taking into account makepkg.conf settings). This was an attempt to say
"if it is broken in distcc, it is probably broken even more". However,
this is silly as one should be using '!makeflags' as well. Remove the
linkage.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-23 21:35:52 -05:00
Dan McGee 886a31ef20 makepkg: fix 'check_sofware' typo
Allan broke it!

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-22 11:51:58 -05:00
Dave Reisner 85902d98e8 repo-add: style cleanup
Unify function braces to be top right opening, bottom left closing.

Signed-off-by: Dave Reisner <d@falconindy.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-22 11:22:36 -05:00
Allan McRae 7468956236 makepkg: add software check function
Add a function that checks for the software needed by makepkg to
process a PKGBUILD with the requested options.  This allows makepkg
to bail early in the packaging process.

Many other checks can be added to this function...

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-22 10:49:33 -05:00
Allan McRae 41f9fa9bed makepkg: move comment into correct place
Oops... Introduced by commit d21f6ca4.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-22 10:47:12 -05:00
Allan McRae 3497eb4e2c makepkg: adjust libprovides/depends messages
Contractions are less clear for non-native speakers so should be
avoided (and cause syntax highlighting issues).  Also, the 'provides'
and 'depends' strings are not to be translated.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-22 10:46:38 -05:00
Allan McRae 508b360c24 makepkg: allow specifying alternative build directory
Add a BUILDDIR variable (which can be overridden in the environment)
to specify an alternative location for building the package. This is
useful for people who want to build on a different filesystem for
improved performance (e.g. tmpfs).

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-22 10:45:55 -05:00
Allan McRae b803a33a8f makepkg: Add UPX compression support
This patch enables the automatic compression of executable binaries
using UPX when the 'upx' options is specified in makepkg.conf or the
PKGBUILD.  Additional arguments can be passed to UPX by specifying
the UPXFLAGS variable.

Original-patch-by: Bryce Gibson <bryce@gibson-consulting.com.au>
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-22 10:45:18 -05:00
Dave Reisner b899099327 repo-add: show better error when path to repo does not exist
Previously, the error message when trying to add to a repo where a
parent directory didn't exist was:

==> ERROR: Failed to acquire lockfile: /path/to/noexist/repo.tar.gz.lck

This sucks. Make an explicit check to ensure that the path to the repo
really does exist, and throw a meaningful error message when it can't be
found.

Dan: reuse an existing (translated) error message.

Signed-off-by: Dave Reisner <d@falconindy.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-20 11:22:39 -05:00
Dan McGee ee638415e3 repo-add: allow creating a database with no compression
A plain '.tar' ending should be allowed. This corresponds to how we
handle this extension in makepkg. Also fix up the other extension
checks, which were missing a leading '.' character.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-20 11:08:40 -05:00
Dave Reisner ab53aa3e3c repo-add: use bash equivalents of basename/dirname
Signed-off-by: Dave Reisner <d@falconindy.com>
2011-06-20 10:44:20 -05:00
Florian Pritz 34876e4fe9 makepkg: fix broken syntax (double $)
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-20 00:20:52 -05:00
Allan McRae d21f6ca4aa makepkg: create source package inside fakeroot
Create source package files inside the fakeroot environment to
ensure reasonable ownership of files within the archive.

Fixes FS#24330.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-15 09:20:52 -05:00
Allan McRae 06cb713f39 Clean up makefile for script generation
We no longer have any python scripts in our scripts/ directory so
we can simplify the makefile a bit.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-15 09:19:56 -05:00
Allan McRae e27e658033 parse_options: adjust error messages
Provide consistent error messages for unknown long and short options.
Also get full string translation for the messages.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-15 09:19:45 -05:00
Allan McRae 53f4e43191 scripts/library: add README file
Add a README file to briefly document the code snippets in the scripts
library folder.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-15 09:19:10 -05:00
Allan McRae 4272b37d3d scripts: refactor output formatting functions
Move the common output formatting functions into a separate
library file and import that into each script.  makepkg is
excluded due to its additional color formatting.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-15 09:18:05 -05:00
Allan McRae 6f3a2145b0 makepkg: move option parsing code to separate file
This move the getopt replacement function parse_options out of
makepkg.sh.in and into a separate file.  The code is inserted
into the relevant place in makepkg using m4.

This will allow the reuse of the option parsing code in other
scripts (i.e. pacman-key) while avoiding code duplication.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-15 09:16:38 -05:00
Allan McRae 700a5374f1 makepkg: reword purge message
Clarfiy that it is unwanted files are being removed rather than "other"
files (whatever they are...).

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-15 09:13:02 -05:00
Dan McGee c206b3a6d5 Merge remote-tracking branch 'florian/sodeps' 2011-06-14 08:30:23 -05:00
Allan McRae 451cd2c88d Fix bracket type in makefile
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-09 14:14:46 -05:00
Allan McRae 87072ff639 Fix name of original files in scripts
Our scripts all currently say:

Generated from foo.in; do not edit by hand.

Fix this to say foo.sh.in, which is the actual original file name.

Signed-off-by: Allan McRae <allan@archlinux.org>
2011-06-08 17:36:03 +10:00
Allan McRae 361b6a9403 pacman-key: add vim modeline and fix whitespace issues
Signed-off-by: Allan McRae <allan@archlinux.org>
2011-06-08 16:48:56 +10:00
Allan McRae 80b024d56a pkgdelta: add vim modeline
Signed-off-by: Allan McRae <allan@archlinux.org>
2011-06-08 16:44:38 +10:00
Dan McGee 8c6a636cd9 Merge branch 'maint'
Conflicts:
	lib/libalpm/add.c
2011-06-07 11:43:12 -05:00
Allan McRae c750114894 pacman-key: update copyright
Signed-off-by: Allan McRae <allan@archlinux.org>
2011-06-07 11:39:18 -05:00
Allan McRae 3df88a1a01 makepkg: fix creation of source package with -p
When creating a source package using an non-local buildscript via
the -p option, the inclusion of changelog and install files would
fail. Fixes FS#24567.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-07 10:49:28 -05:00
Dan McGee 9d73b261cf Merge branch 'maint'
Conflicts:
	src/pacman/callback.c
2011-06-02 17:34:12 -05:00
Dan McGee d63599719a repo-add: anchor exclusion pattern when generating filelist
Fixes FS#24534. Dotfiles, such as /etc/skel/.bash_profile, were not
being included in generated files entries. bsdtar --exclude option
supports anchors on the pattern, so using "^.*" instead of ".*" solves
our problem and still excludes all root-level dotfiles (e.g. .PKGINFO).

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-02 08:04:06 -05:00
Florian Pritz 73d5eb1edf makepkg: add libdepends support
The user adds libaries to the depends array without a version. These
must end with .so.
Example: depends=(glibc libc.so)

find_libdepends() looks for ELF files (not symlinks because these could
point outside of pkgdir) in $pkgdir, extracts the library sonames the
binary links to and outputs depends seperated by spaces.
This list contains all libraries needed by the package.
Example: libfoo.so=3-64

write_pkginfo() only keeps .so depends with version information and warns
the user about unneded ones.

Support-by: Thomas Bächler <thomas@archlinux.org>
Support-by: Christoph Schied <Christoph.Schied@uni-ulm.de>
Signed-off-by: Florian Pritz <bluewind@server-speed.net>
2011-06-01 21:34:16 +02:00
Pang Yan Han 5842dad7e7 pacman-key: print default gpgdir in usage
Signed-off-by: Pang Yan Han <pangyanhan@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-01 12:27:03 -05:00
Florian Pritz 79f1a3c4a1 makepkg: add libprovides support
The user adds libaries to the provides array without a version. These
must end with .so.
Example: provides=(readline libreadline.so)

find_libprovides() looks for .so files (not symlinks because these could
point outside of pkgdir) in $pkgdir, extracts the library soname (ld
links the binary to this name) and outputs provides seperated by spaces.
This list contains all libraries provided by the package.
Example: libfoo.so=3-64

write_pkginfo() only keeps .so provides with version information and warns
the user about unneded ones.

Support-by: Thomas Bächler <thomas@archlinux.org>
Support-by: Christoph Schied <Christoph.Schied@uni-ulm.de>
Signed-off-by: Florian Pritz <bluewind@server-speed.net>
2011-05-27 13:29:22 +02:00
Dan McGee 991bfb7cbf Merge branch 'maint' 2011-05-04 15:54:42 -05:00
Allan McRae 8fd9037cfd makepkg: quote variable that may contain spaces
Prevents failures when $PKGDEST contains spaces (FS#24002)

Patch-by: Sebastien Duthil
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-05-02 10:04:36 -05:00
Allan McRae a7d33d0c36 repo-add: update copyright message
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-24 10:44:52 -05:00
Allan McRae 036f98575c repo-add: check for gpg early
Check for the presence of gpg as soon as we know we need it.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-24 10:43:43 -05:00
Allan McRae fade60088e repo-add: check for valid key when signing is requested
Follow the example of makepkg

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-24 10:43:25 -05:00
Denis A. Altoé Falqueto 59da64146d repo-add: add option to specify a different key to sign with
Add -k/--key option to specify a non-default key for signing
a package database.

Original-patch-by: Denis A. Altoé Falqueto <denisfalqueto@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-24 10:43:01 -05:00
Allan McRae 2eab4ab033 repo-add: simplify usage message
Listing every option on the usage line becomes unweildly as more
options get added so simplify it. Also, provide a standard package
name in the repo-add example.

Dan: just use 'options' as we use elsewhere, not 'option(s)'.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-24 10:41:52 -05:00
Ivan Kanakarakis 908e9f41ed pacman-key: improved reading of the configuration file
This commit replaces the find_config() function with the get_from()
function. get_from expects two arguments, the first is the file to
read and the second is the key to look for in the given file.
get_from returns the first matching value for the given key. The
file is expected to be in the format:
key = value
Each of 'key' 'equal sign' 'value' can be surrounded be random
whitespace.

Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-21 12:10:31 -05:00
Ivan Kanakarakis fdbcc9847d pacman-key: display the unsupported command to the user
If the user provides an unsupported command, inform the user that this
switch is unknown, display usage and exit.

Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-21 12:09:23 -05:00
Ivan Kanakarakis 6f19a8c9f7 makepkg, pacman-key: unify help message with other scripts
The help message changed to match the one rankmirrors script has.
It's clearer as to what the --help switch does.

Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-21 12:09:18 -05:00
Allan McRae 4c31bc6e3f Add configure option to specify package signing key
Add the "GPGKEY" option to makepkg.conf for specifying signing packages
with the non-default key from the keyring.  Is overridded by makepkg's
--key option.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-20 18:58:55 -05:00
Dan McGee efd8ae483f Merge branch 'maint'
Conflicts:
	lib/libalpm/alpm.h
	lib/libalpm/trans.c

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-15 18:41:49 -05:00
Rémy Oudompheng a93e058b68 makepkg.sh.in: fix a GNU-ism in su invocation
GNU su supports the -c option to specify a command to execute.
However, other flavours of su may have a different interpretation
of the '-c' flag (e.g. FreeBSD and OpenBSD).

The behaviour is correct when '-c' follows an explicit username.

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-04-13 10:33:22 -05:00
Dan McGee c5addd94e3 Merge branch 'maint'
Conflicts:
	lib/libalpm/be_sync.c
	lib/libalpm/db.c
	src/pacman/util.c
2011-04-05 00:49:30 -05:00
Rémy Oudompheng 40fd8123a2 makepkg: fix a GNU-ism in awk usage
A non-GNU version of awk may not support the (|...) syntax for
an optional group and require '()' to match an empty string.
The (...)? syntax is more appropriate for this usage.

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-04-04 19:03:49 -05:00
Allan McRae 37df0d4f4f makepkg: improve parsing for sanity checks
Trailing backslahses can lead to additional spaces at the front
of extracted entries.  See FS#23524.  Strip these while parsing
the PKGBUILD entries.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-04 19:03:40 -05:00
Allan McRae a164c8405a makepkg: remove unnecessary tr usage
The use of "tr" only leads to trouble.  Remove unnecessary usage
of it from within makepkg.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-30 20:43:36 -05:00
Dave Reisner 541c2470b8 makepkg: avoid usage of tr to sidestep locale issues
to quote dan:
  "turkish will FUCK YOU UP. this is not the first or the last time"

Signed-off-by: Dave Reisner <d@falconindy.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-30 20:43:11 -05:00
Denis A. Altoé Falqueto e8069cfc3d makepkg: command line options for signing packages
Three new command line options were added:

--sign: forces the generation of a signature for the resulting package,
taking precedence over the value in makepkg.conf

--nosign: do not sign the resulting package

--key <key>: use a different key than the user's default for signing
the package.

A check is performed to ensure the user has (provided) a valid gpg key
for signing.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-28 09:03:28 -05:00
Ray Kohler 4ef664f485 Create pacman keyring directory if missing
Use mode 755, so non-root users can see inside.
Add "--no-permission-warning" to GPG_PACMAN to suppress the noise that
otherwise comes of not using mode 700 - this is not private data.

GPGme turns out not to issue this warning itself, so no problem there.

TODO: should non-root users be allowed to use the read-only operations
(--list, --export, --finger)?

Signed-off-by: Ray Kohler <ataraxia937@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-27 21:50:52 -05:00
Ray Kohler 86ff381ac2 Clean up repo-add usage message
This now includes -s and -v, tailors itself to the current command,
and is formatted more like that of other pacman commands.

Signed-off-by: Ray Kohler <ataraxia937@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-27 21:13:52 -05:00
Dan McGee 3f269503d5 Merge branch 'maint'
Conflicts:
	lib/libalpm/deps.c
2011-03-27 20:41:23 -05:00
Ray Kohler 630b7b94c3 Sign database even if empty
Move the create_signature() call outside the case of non-empty
databases, so it will be called regardless.

Signed-off-by: Ray Kohler <ataraxia937@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-27 20:35:43 -05:00
Ray Kohler 43dacceb6b makepkg: allow PKGEXT and SRCEXT to be overridden by env variables
Signed-off-by: Ray Kohler <ataraxia937@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-27 20:15:52 -05:00
Dave Reisner c02556e290 Rely on the return value of type instead of its output
Signed-off-by: Dave Reisner <d@falconindy.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-27 20:15:20 -05:00
Dan McGee ea216d3f5a Clarify error message in pacman-db-upgrade
Addresses FS#23451.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-27 20:03:08 -05:00
Dan McGee 86e7f60756 Merge branch 'maint' 2011-03-24 21:18:09 -05:00
Jan Steffens 14474a32c9 Make log redirection saner
My main motivation was to remove the "sync", which can stall for
minutes on a busy machine (FS#23378). I also cleaned up the redirection.

Signed-off-by: Jan Steffens <jan.steffens@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-24 20:27:56 -05:00
Ray Kohler cfa2eebdaf Fix use of relative paths for packages in repo-add
Move checksum and pgpsig calcluation before changing into the
tmpdir, otherwise we can't find the files if a relative path
was used.

Signed-off-by: Ray Kohler <ataraxia937@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-24 17:15:35 -05:00
Dan McGee 0908533127 Merge branch 'gpg-build-tools' 2011-03-23 02:18:57 -05:00
Dan McGee a31d091fb3 repo-add: add sha256sum values to repo database
Implements FS#23103. Also modify libalpm so it ignores this value
without any warning as we know it is likely to exist.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-23 02:18:48 -05:00
Dan McGee 964e8c5bf2 pacman-key help, round three
Make it actually like all our other tools rather than some homegrown
format. Also make it translator friendly by not wrapping messages across
lines in different strings.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-23 01:59:42 -05:00
Allan McRae 5a89a12aa0 pacman-key: improve usage output
Make the usage output display nicely on 80 character width terminals.

Also fix parsing of "-h" and "-v" options and avoid root check when
run with no commands.

Signed-off-by: Allan McRae <allan@archlinux.org>
2011-03-23 01:59:42 -05:00
Denis A. Altoé Falqueto 422925a65e pacman-key: remake of --reload command
The --reload command was refactored to allow a more flexible management.
There are two sets of keys that will be added, one that will be
removed and one that will be kept.

The set of keys to be kept are configured in pacman.conf, with the
option HoldKeys, with the same meaning of HoldPkgs. It can be repeated
and several values can be put in the same entry.

The new behavior allows a key to be marked for removal, but the user
can decide if that key must be kept. For example, if a developer has
a public repository, signed with his own key, that key must be added
to the HoldKeys option. If the key is marked for removal from pacman's
keyring, it will not be removed for the users that have configured
HoldKeys correctly.

There are other minor fixes, mainly in the handling of --add command
when there is no aditional parameter. In that case, pacman-key will
behave just like gpg, adding the contents of stdin into pacman's keyring.

Signed-off-by: Denis A. Altoé Falqueto <denisfalqueto@gmail.com>
2011-03-23 01:59:42 -05:00
Denis A. Altoé Falqueto ae20f88202 pacman-key: keyring management tool
The script pacman-key will manage pacman's keyring. It imports, exports,
fetches from keyservers, helps in the process of trusting and updates
the trust database.

Signed-off-by: Denis A. Altoé Falqueto <denisfalqueto@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2011-03-23 01:59:42 -05:00
Allan McRae 93591d428f repo-add: add symlink to signature file
Signed-off-by: Allan McRae <allan@archlinux.org>
2011-03-23 00:26:54 -05:00
Dan McGee f0f8319769 repo-add: Fix up usage with GPG options
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-23 00:26:54 -05:00
Dan McGee 38f94da47d repo-add: add -v/--verify option
This is intended to verify an existing signature on a database before
making further changes to it and performing updates. Rarely would you
use this without immediately resigning it via the -s/--sign option.
Instead, it is intended as a "chain of trust" operation where the
previous signature is verified to give you some sense that what you sign
off on is also safe.

Still todo: don't make changes unless the signature is not only good,
but also in the accepted list of keys.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-23 00:26:54 -05:00
Dan McGee a4120f2015 repo-add: allow signing of the package database
In order to be fully secure, we can't only sign packages. We also need
to sign our repository metadata to prevent database falsification,
dependency injection, etc. Add an '-s/--sign' option that allows this
functionality, and will generate a .sig file side-by-side with the
package database.

While at it, fix the issue where a signature file would never be found
because of 'cd' madness (this needs fixing in another commit).

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-23 00:26:54 -05:00
Geoffroy Carrier 8fde399fe6 Add PGPSIG field in repo-add
Use base64 encoding to store the value in the database if a .sig file exists
for the package being added.

Signed-off-by: Geoffroy Carrier <geoffroy.carrier@koon.fr>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-23 00:26:54 -05:00
Allan McRae 2f2f53ddc9 makepkg: place signature symlink in build dir
Be consistent in package and signature placements when using
PKGDEST.

Signed-off-by: Allan McRae <allan@archlinux.org>
2011-03-22 23:52:00 -05:00
Dan McGee 82e22596d8 makepkg: allow signatures to work with split packages
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-22 23:52:00 -05:00
Geoffroy Carrier ee34869e89 Add GPG signature support to makepkg
This is a rather simple patch to add signing support to makepkg. Add a
create_signature() to makepkg, add a 'sign' BUILDENV option in makepkg.conf,
and document the changes in the makepkg.conf manpage.

Signed-off-by: Geoffroy Carrier <geoffroy.carrier@koon.fr>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-22 23:52:00 -05:00
Allan McRae b6cada3eed makepkg: Improve optdepends extraction
Prevents issues where optdepends descriptions contain a bracket.
Also, strip all comments from arrays before joining them.

Fixes FS#23307.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-20 11:15:34 -05:00
Dan McGee 09ce8b446c Fix some easy to find double translations
A lot of these were places that should have used the same message but
didn't, or were very easy to convert to using the same message and
letting some of the burden off of the translators.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-28 17:50:23 -06:00
Dan McGee 62fc966882 Ensure pkgbase/epoch are defined before doing anything
When generating integrity sums, we could get some weird output before due to
epoch being uninitialized:

    /usr/bin/makepkg: line 234: [[: 2.6.37: syntax error: invalid arithmetic operator (error token is ".6.37")

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-11 10:23:43 -06:00
Allan McRae bb071f4eb2 makepkg: more bash-3.2 compatibility
Adding the "|| true" to the subshell prevents bash-3.2 setting off the
error_trap but requires changing the if statement.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-06 12:52:59 -06:00
Allan McRae f892775366 makepkg: initialize local arrays to empty
Fixes bash-3.2 compatibility.

Thanks-to: Dave Reisner <d@falconindy.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-02 20:47:08 -06:00
Allan McRae 35a8cf134b makepkg: error on invalid optdepends
Missed in commit a88cb03a.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-02 18:46:47 -06:00
Cedric Staniewski d8c4b12c66 makepkg: make SRCPKGDEST default to $startdir
The current behaviour, which is placing source packages in PKGDEST if
SRCPKGDEST is not set, is inconsistent with {SRC,PKG}DEST handling and
there is no real advantage in doing so.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-02 18:46:39 -06:00
Nezmer 332dd86912 makepkg: Fix the check for references to srcdir/pkgdir
At least in FreeBSD, find always returns 0 if it finds stuff
(imagine that). It doesn't care about the exit status of whatever is
passed to -exec.

This patch makes the checks compatible with this behaviour.

Using xargs and not using grep directly because packages with too many
files would cause grep to complain about argument list being too long.

This should also fix the false positive in packages with no files.

Signed-off-by: Nezmer <git@nezmer.info>
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-02 18:46:23 -06:00
Cedric Staniewski 3444146b48 makepkg: fix indention to follow style guide
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-01 10:04:44 -06:00