Commit Graph

1380 Commits

Author SHA1 Message Date
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
Allan McRae e9639ad172 Update translations from transifex
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-04-01 15:53:12 +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 3eee3d67af More translation updating
Pull updates from transifex.  Add new "id" translation.  Regerate po
files with updated filelists...

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-03-17 13:53:38 +10:00
Allan McRae 66fe80f39b repo-add: Update copyright year
Also adjust translations.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-03-15 13:21:32 +10:00
Allan McRae aa550a85f1 Merge updates from Transifex
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-03-15 13:21:32 +10:00
Allan McRae a97f792d3c Remove Indonesian translation
I imported this translation from transifex without realising that there
was no strings translated despite being "acitve" on transifex for quite
some time.  Remove it until translation begins...

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-03-15 13:21:32 +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
Dave Reisner 6c870953c5 pkgdelta: fix improper passing of file argument
Looks like I hosed this pretty hard in 5a5e712c74.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-03-14 11:47:11 +10:00
Allan McRae 1e21aa589d Update all translations files to push to Transifex
Run update-po and fix the few errors reported.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-03-10 13:32:11 +10:00
Allan McRae c5652361fb Pull updated translations from transifex
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-03-10 13:32:10 +10:00
Allan McRae 1366da57fa Add new languages from Transifex
Languages: eo, nl, hr, ko, ja, fa, ar, sl, gl, id

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-03-10 13:32:10 +10:00
Allan McRae f9be4eed42 distribute library/term_colors.sh
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-03-10 11:33:59 +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
Neer Sighted 93fa63ee8a makepkg: Make VCS download functions use get_filename
Make all VCS download functions uses get_filename to get the repo name.
In addition, creating a working directory from a Bazaar repository now shows
the short-name of the repository, not the full path on disk.

I'm not sure if the name of the variable that holds the basename of the local
clone should still be `repo`, but I have left the variable name for simplicity.

Signed-off-by: Neer Sighted <neersighted@myopera.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-03-10 09:01:56 +10:00
William Giokas fcdaa46b65 makepkg: Separate vcs download and extract
Previously makepkg would clone vcs sources in the download function,
regardless of the noextract settings. Now the download_* functions only
download or update the vcs sources, and the new extract_* functions just
create working copies using the specified protocols. The extract_sources
function will call the needed extract function for the protocol
specified. The tarball extraction has also been moved into its own
extract_file function to keep things consistent.

Signed-off-by: William Giokas <1007380@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-03-10 09:01:56 +10:00
William Giokas f8ed8620d0 contrib: Make pacdiff colors the same as makepkg
Added an `ask` message function that emulates pacman's appearance.

Signed-off-by: William Giokas <1007380@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-03-08 17:04:40 +10:00
William Giokas 5a67eee78c scripts: Add color to repo-add
Signed-off-by: William Giokas <1007380@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-03-08 17:04:39 +10:00
William Giokas 79d60f0f42 scripts: Add color to pkgdelta
Signed-off-by: William Giokas <1007380@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-03-08 17:04:39 +10:00
William Giokas 81f945e2a5 scripts: Add color to pacman-optimize
Color enabled by default, use --nocolor to disable colored output.

Signed-off-by: William Giokas <1007380@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-03-08 17:04:39 +10:00
William Giokas 9d99914a18 scripts: Add color to pacman-key
Use --nocolor to suppress colored output from pacman-key, otherwise
output will be in color.

Signed-off-by: William Giokas <1007380@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-03-08 17:04:39 +10:00
William Giokas 2c91b991ee scripts: Add color to pacman-db-upgrade
Color enabled by default, use --nocolor to turn off colors.

Signed-off-by: William Giokas <1007380@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-03-08 17:04:39 +10:00
William Giokas 65650f2cdb scripts: Add color to library/output_format.sh
Use the same colors as makepkg in messages. Add in the 'plain' function
as well.

To use the colors, you need to include the term_colors.sh file, or add
definitions for the colors explicitly.

Signed-off-by: William Giokas <1007380@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-03-08 17:04:39 +10:00
Neer Sighted 8b03b1a877 makepkg: Use a recursive git clone.
Make makepkg use a recursive clone when creating the working directory.
This will initialize submodules

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-03-07 15:38:48 +10:00
Sébastien Luttringer 6831a5f4b1 makepkg: Avoid find to fork for each rm call
Reported-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Sébastien Luttringer <seblu@seblu.net>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-03-07 15:38:48 +10:00
Sébastien Luttringer a03f5f55cd Add staticlibs option in PKGBUILD
This option helps to removes static library files in packages.

Related to the thread:
https://mailman.archlinux.org/pipermail/arch-dev-public/2013-March/024552.html

Signed-off-by: Sébastien Luttringer <seblu@seblu.net>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-03-07 15:38:48 +10:00
Dave Reisner 0a5b79e133 makepkg: add support for .pkg.tar.lzo
Supported by libarchive as of version 3.1.0 when compiled against lzo2
or in the presence of the lzop binary.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-02-16 11:06:43 +10:00
William Giokas 42b492b2fd makepkg: fix -r and --needed conflict
In makepkg, passing -sr --needed causes there to be a conflict when
pacman goes to remove the dependencies, as the --needed flag is not an
option for pacman -R. This patch makes --needed not get added to the
PACMAN_OPTS array, but it acts like ASDEPS, and is only added to an
install function.

Signed-off-by: William Giokas <1007380@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-02-13 11:50:33 +10:00
Allan McRae 572b1a5de7 makepkg: add lrzip compression support
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-02-13 11:50:32 +10:00
Allan McRae f170a94c13 makepkg: make $pkgdir non-accessible during build()
The idea of having separate build() and package() functions is that
build() is run as a normal uses and package() as (fake)root.  Any
files placed in $pkgdir during build() can have the wrong permissions.

Restrict access to $pkgdir during build() - unless there is no package()
function.

Also, set $pkgdir to something "useful" during build().  For split
packages, this uses "<path>/pkg/$pkgbase" because it is not obvious
which $pkgdir is being referred to.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-02-07 10:48:11 +10:00
Chirantan Ekbote 266b3dd706 makepkg: Integrate check_install into tidy_install
Rearrange tidy_install so we first remove docs, unwanted files,
libtool files, and empty directories.  Then check for missing backup
files and references to $srcdir and $pkgdir.  Finally compress manpages,
strip debug symbols, and compress executables with upx.

Fixes FS33318

Signed-off-by: Chirantan Ekbote <chirantan.ekbote@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-29 13:37:25 +10:00
William Giokas b27886ab59 makepkg: Formatting consistency in write_pkginfo
The difference between the echo and the printf's in write_pkginfo seemed
to be somewhat sporadic. Also, the INFAKEROOT check was doing the same
exact thing as the SPLITPKG check, but formatted much differently and
consuming two extra lines. I think this makes it more readable than it
was previously, if nothing else.

Signed-off-by: William Giokas <1007380@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-17 22:32:54 +10:00
Pierre Schmitz 49c5f515e9 pacman-key: reduce verbosity of --populate
Do not bother the user with gpg's verbose output.

Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-04 21:49:38 +10:00
Allan McRae 09295f7e40 pacman-key: handle local signing of multiple keys
gpg --lsign-key does not like being given multiple keys to sign.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-04 21:49:38 +10:00
Danny George 965e1de217 Add a -n option to repo-add to only add new packages
Packages are already in the pkg db were given a warning, and then
readded anyway.  With -n specified, the warning is printed, but skips
readding it.

Signed-off-by: Danny George <dangets@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-03 12:03:10 +10:00
William Giokas fe0586e240 makepkg: Print out full version on pkgver update
When building sources with a pkgver function, makepkg will print out the
original version before pkgver() is run, claiming that that is the
package that will be built. This patch simply re-prints the output
later, after pkgver() has been run so people can see which package they
are actually building.

Signed-off-by: William Giokas <1007380@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-03 12:03:10 +10:00
Allan McRae 241d6b884a makepkg: use --apparent-size when du supports it
Amazingly, using "sleep 1" to convince btrfs to report correct file
sizes is only a 90% fix.  Sometimes more sleep is needed.

Instead we use the --apparent-size argument to du to get actual file
sizes. This is used only on Linux as the various BSDs do not support
this argument.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-03 12:03:10 +10:00
Dave Reisner 60d2588192 parseopts: remove superfluous continue/shift statements
Fun fact about bash: the below is valid and will only ever print 'a'!

  fn() {
    continue 2
  }

  for x in {1..5}; do
    for y in {a..e}; do
      echo "$y"
      fn
    done
  done

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-03 12:03:09 +10:00
Allan McRae 1dd3405813 Update copyright year for 2013
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-03 12:03:09 +10:00
Allan McRae ad3a26c615 makepkg: add mtree file into package
Add an mtree file to the package with all file information. This
can be added to the local pacman database on install allowing full
package verification.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14 13:45:12 +10:00
William Giokas 0c74ffd6b6 Added LOGDEST variable
Places logs in a pre-defined location. The logs are always neatly
labeled with package names and numbers, and this way can be more easily
sent to network shares as they are written or compressed/cleaned en
masse.

Signed-off-by: William Giokas <1007380@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14 12:35:34 +10:00
Dave Reisner c8417f3386 makepkg: normalize whitespace in $pkgdesc when writing .PKGINFO
Specifically, we shouldn't allow newlines in the pkgdesc field, as
pacman will ignore the continuation and end the description prematurely
as written to the local DB. Normalize ALL whitespace, replacing it with
single whitespace characters.

Fixes strange errors as seen by FS#32852.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14 12:35:34 +10:00
Dave Reisner 5a5e712c74 pkgdelta: avoid use of eval and IFS manipulation
Instead of blindly consuming data from the .PKGINFO file, parse it more
closely and only declare variables as needed.

Should help to avoid nonsensical errors and possibly dangerous command
execution as seen in FS#32852.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14 12:35:34 +10:00
Allan McRae 254329f6fb makepkg: install debug symbol packages if requested
When using "makepkg -i", install the debugging symbol packages too
if present.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27 15:16:15 +10:00
Allan McRae dbbe3e7cb4 makepkg: assign debugging symbol directory to a variable
Simplifies the stripping of files a lot.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27 15:16:15 +10:00
Allan McRae 13667fd4b1 makepkg: allow debug package suffix to be configurable
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27 15:16:15 +10:00
Allan McRae 7e8d9dfda2 makepkg: create package from stripped debug symbols
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27 15:16:15 +10:00
Allan McRae a5e81f5599 makepkg: output the name of the package being created
Although it should be currently quite obvious what package is being
created when "Creating package..." is printed, it will not be in the
future when a debug package is potentially created too.  Also, given
$pkgname is always correctly set when split packaging now, we no
longer need to pass that around.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27 15:16:15 +10:00
Allan McRae bd4ff4a377 makepkg: strip debugging symbols into separate folder
When using the "debug" option in combination with "strip", move the
debugging symbols into a separate directory ($pkgdir-debug/usr/lib/debug)
suitable for creating a package from.

Create hardlinks between debugging symbols of hardlinked files and add
symlinks in the .build_id directory if the binary has a build ID.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27 15:16:15 +10:00
Allan McRae a53fd79632 makepkg: always use pkg/$pkgname as $pkgdir
Unify split and single packages to always use a folder within pkg/
as thier $pkgdir.  This will allow a folder for storing a package with
stripped debug symbols to be added within pkg/ too.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27 15:16:15 +10:00
Allan McRae 6be96e7612 makepkg: move debug symbol stripping to separate function
Move stripping of files to a spearate function that will be expanded
for the handling of creating debug symbol packages.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27 15:16:15 +10:00
Allan McRae 6c22ef2c82 makepkg: add option to include debugging compiler flags
Add a "debug" option that appends the compiler flags specified in the
variables DEBUG_CFLAGS and DEBUG_CXXFLAGS in makepkg.conf to their
counterpart buildflags.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27 15:16:15 +10:00
Allan McRae 7199fb3b1a makepkg: always run tidy_install on repackaging
When using "makepkg -R" without a packge function, we should still
run tidy_install as the user might have added other packaging options
such as (e.g.) '!emptydir' to remove empty directories on repackaging.
Of course we can not revert some options when repackaging without a
package function.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27 15:16:15 +10:00
wgiokas 6b1deedf15 Add --needed option to makepkg
Simply add the option to pass the --needed flag to pacman when using -i
with makepkg. When using makepkg in scripts, particularly for git
packages with the new version functions and not just a date, this can
save disk io and time instead of reinstalling.

This would mostly be useful with the --noconfirm option.

Signed-off-by: wgiokas <1007380@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27 15:16:15 +10:00
Jason St. John 3536975bbf Use sentence case in makepkg
Most of makepkg already uses sentence case. This cleans up the last few
stragglers.

Signed-off-by: Jason St. John <jstjohn@purdue.edu>
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27 15:16:15 +10:00
Allan McRae 3531533c2f makepkg: save path to PACMAN and test availability
After we install dependencies, we source /etc/profile so that new
elements get added to the path. As this can override any local setting
of PATH, we store the full path of the PACMAN variable passed to makepkg.

Also, add a check for PACMAN availability if it is needed to deal with any
dependency operations.

Reported-by: Martin Panter <vadmium à gmail·com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27 15:16:15 +10:00
Martin Panter 86233476b0 Remove last traces of handling command arguments in $PACMAN
This resolves an inconsistency with how the $PACMAN variable was interpreted.
Previously “makepkg” would extract the first word from the $PACMAN variable
and check that it existed as a command. This appears to have been happening
ever since the variable was implemented in revision 66c6d28 (makepkg: allow
to specify an alternative pacman command). Thus it looks like command
arguments were originally allowed in the variable.

However the run_pacman() function now quotes $PACMAN, so the whole variable
has to be just the command name. This quoting was introduced more recently,
perhaps in revision 622326b (makepkg: fix sudo/su calling of pacman).

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27 15:16:15 +10:00
Christian Hesse 0285c678ab makepkg: fix signing built package
Fixes issue introduced in 9dd42dc0

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27 15:16:15 +10:00
Allan McRae 3232c975c6 makepkg: deprecate PKGBUILDs without a package() function
The package() function has been around since pacman-3.3 and has
significant advantages including limited fakeroot usage and correct
repackaging.  The ability to use PKGBUILDs without a package function
will be removed in a future release.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27 15:16:15 +10:00
Allan McRae 93148d0879 makepkg: print "SKIP" for signature checksums
There are valid reasons for a source files PGP signature to be changed
(expired key, expired signature, additional person signing...). Thus
providing a checksum for signature files can potentially cause a
PKGBUILD to require unnecessary updating.

Avoid this issue by using "SKIP" for the signature checksum.
Fixes FS#31590.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27 15:16:15 +10:00
Allan McRae fbf96203ab makepkg: use last match in BUILDENV/OPTIONS array
Using the last match in the BUILDENV and OPTIONS arrays allows the
user to easily override these values without specifying the entire
array. For example add "BUILDENV+=(sign)" in ~/.makepkg.conf.

Fixes FS#26701.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27 15:16:15 +10:00
Allan McRae fe8bd95092 repo-add: quote filename for consistent output style
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27 15:16:15 +10:00
Allan McRae 2abe1f1646 makepkg: fix incorrect bracket usage
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-09-18 08:41:46 -05:00
Gary van der Merwe 3b02f80dcb makepkg: Add Bazaar VCS support
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-09-18 08:41:35 -05:00
Allan McRae ea452d0277 makepkg: fix order of --help output
Small alphabeticalization issue in options passable to pacman.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-09-18 08:41:23 -05:00
Allan McRae 8b9cb8e03d makepkg: allow fragment to contain a "#" character
The frament element of a vcs url may contain the "#" charcter in the
(e.g) branch or tag name.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-09-18 08:41:02 -05:00
Allan McRae 306c274239 makepkg: always check makepkg.conf for match to download protocol
The list of which download protocol should look in makepkg.conf for the
download agent was hard coded into makepkg.  Instead, fallback to checking
the the download agents array for any non-local or (implemented) vcs
source.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-09-18 08:40:44 -05:00
Allan McRae 7a4f76c2af makepkg: do not embed timestamps in compressed manpages
This will make the checksum of man pages match across architectures
despite different build times.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-09-18 08:40:17 -05:00
Allan McRae 2d347132ba makepkg: check if hg and svn directories are non-empty before updating
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-09-18 08:40:08 -05:00
Allan McRae 800799ea63 makepkg: do not create hg working directory on checkout
Creating the working directory can waste a lot of space.
Fixes FS#31221.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-09-18 08:39:52 -05:00
Gary van der Merwe 03ea8ca6a9 makepkg: Improvements to get_filename:
* For any vcs other that git, the fall through resulted in being handled by the
  code for std url, hence fragments were being left on.
* Handle vcs urls than end in a slash correctly, eg http://example.com/project/

Signed-off-by: Gary van der Merwe <garyvdm@gmail.com>
2012-09-18 08:39:37 -05:00
Mohammad Alsaleh c926c39b04 makepkg: check if $dir is a local clone of the right git repo
Before this patch, makepkg does not check if $dir is a local clone of
the right repo.

For example, git fetch would be run even if $dir is not a local
bare clone of a git repo in present in source(), but a subdir of
a checked-out one. That means makepkg can potentially fetch from
a completely unrelated remote and update completely unrelated
dirs/files.

This patch adds a check to make sure we are fetching from the right
remote.

Signed-off-by: Mohammad Alsaleh <msal@i2pmail.org>
2012-09-18 08:39:18 -05:00
Mohammad Alsaleh 34b52c9a60 makepkg: git clone instead of git fetch if $dir exists but empty
Before this patch, makepkg would only check if $dir exists as an
indication that a local clone exists. And if $dir does exist, makepkg
will run git fetch inside it unconditionally.

After applying this patch, makepkg will check if the existent $dir is
empty. And if it is, it will be used to store a local clone.

Signed-off-by: Mohammad Alsaleh <msal@i2pmail.org>
2012-09-18 08:39:08 -05:00
Allan McRae 8550680924 makepkg: fix warnings with --noextract
Three warnings after someone deliberately typed --noextract is a
tad excessive...   Also, an empty $srcdir is perfectly valid when
the source array is empty, although using --noextact then is
wasteful.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-09-18 08:38:08 -05:00
Dave Reisner aa50df630c makepkg: implement dir_is_empty for dir content checks
Rather than calling upon ls for this, use a proper shell function which
uses globbing to determine the existance of files in a directory.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-09-18 08:37:46 -05:00
Dave Reisner 37de9df7c0 pkgdelta: pass correct args to create_delta
Somewhere in the arg parse refactoring, the args array went away and we
simply stashed our remaining parameters as positionals. Fix this up so
that pkgdelta doesn't mysteriously hang in read_pkginfo().

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-09-18 08:30:17 -05:00
Allan McRae a818766c6e makepkg: delay checking for build package with pkgver()
If a pkgver() function is specified, delay checking the package is
built until the pkgver is updated..

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-04 00:16:39 +10:00
Allan McRae 7e4aa9e524 makepkg: add hg url support
Supported fragments are branch, revision and tag.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-04 00:16:39 +10:00
Allan McRae 4b129d4843 makepkg: check pkgver validity after updating
If a PKGBUILD has a pkgver() function, skip checking the pkgver validity
until it has been updated.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-04 00:16:39 +10:00
Allan McRae b1e75d7dd6 makepkg: only update pkgver when all sources are available
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-04 00:16:38 +10:00
Allan McRae 6c8def6ae0 makepkg: add --holdver to control VCS source updating
Do not update VCS sources if --holdver is used. If the VCS checkout
is not present, it will still be downloaded.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-04 00:16:38 +10:00
Allan McRae 7fd56118d0 makepkg: do not download VCS sources unless needed
VCS sources are not needed for --geninteg or --source operations.
This also prevents VCS downloads outputting to stdout, which
prevented piping -g output to the PKGBUILD.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-04 00:16:38 +10:00
Allan McRae b3e82ec59e makepkg: rename myver
myver is a bit generic for an internal variable name.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-04 00:16:38 +10:00
Allan McRae 2042b79bcc makepkg: add support for SVN urls
Allow SVN repo sources in the form:

source=("<folder>::<repo>#<fragment>")

where <repo> must start with svn (e.g svn+http://) and a <fragment>
can specify a revision (e.g. revision=22).

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-04 00:16:38 +10:00
Allan McRae 888020de90 makepkg: provide mechanism for auto-updating pkgver
Now that VCS repos are provided in the source array, it becomes too
complicated to have automatic updating pkgver as was the case with
the old VCS PKGBUILDs (there can be multiple repos of different types
in the source array, the VCS repo may not be the package primary
source, etc).

Instead provide an optional way for a PKGBUILD to update the pkgver
value through the specifing of a pkgver() function that returns the
new version string.  This is run after all source files are downloaded
so can access the VCS repo if needed.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-04 00:16:38 +10:00
Allan McRae cca9849fc2 makepkg: modify get_filepath to handle VCS sources
With VCS sources, get_filepath should return the directory of the
checkout. This allows backing up of the VCS checkout when using
--allsource.  Fixes FS#21098.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-04 00:16:38 +10:00
Allan McRae aa6fe1160b makepkg: modify get_filename to handle VCS sources
Modify get_filename to return the name of the folder with VCS sources.
This fixes output issues in checksum checking.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-04 00:16:38 +10:00
Allan McRae 682c9af846 makepkg: fix checksum generation with VCS sources
VCS sources should have "SKIP" for their checksum value

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-04 00:16:38 +10:00
Allan McRae 91d119af1c makepkg: allow using GIT source URLs
Allow specifing GIT sources using the following syntax

source=('<folder>::<repo>#<fragment>')

This will download the git repo <repo> into <folder> (into $SRCDIR
if set, otherwise $startdir). <repo> must start with "git", but
non-git protocols are handled using (e.g.) "git+http://...".

The <fragment> can be used to specify a branch, tag, or commit to
build from. e.g. branch=maint.

Checksum entries for git sources should be "SKIP".

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-04 00:16:38 +10:00
Allan McRae 57e06394dd makepkg: skip integrity checking early
If "SKIP" is provided for an integrity check, abort checking as soon
as possible.

Also swap fork to tr for bash4 conversion.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-04 00:16:38 +10:00
Allan McRae 1a04e2e11a makepkg: generalize download_sources
In order to treat all VCS sources as URLs, we need to be able to
deal with more protocols. Rewrite download_sources to use a case
statement so additional protocols are easily added.

Also fix the use of scp to not pass the protocol in the URL
(noticed by William J. Bowman <wjb@williamjbowman.com>)

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-04 00:16:38 +10:00
Allan McRae a922d18056 makepkg: add function to return download protocol
Extract the download protocol from a source entry.  Returns "local"
for local source files.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-04 00:16:38 +10:00
Allan McRae e806414407 makepkg: reorder source handling functions
There is no actual code change here, but these related functions
were all over the place which makes this code difficult to adjust.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-04 00:16:38 +10:00
Allan McRae d338b3981d makepkg: remove VCS package support
The current VCS packaging support is really, really, really bad.
It is best to strip it out completely before rewriting it.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-04 00:16:38 +10:00
Pierre Schmitz ec5e6d9029 pacman-key: Use lsign_keys function in --populate
This reduces code duplication and also makes --populate a non-interactive function.

Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-08-02 09:46:16 -05:00
Dan McGee 7193ce1ecd Merge branch 'maint' 2012-08-01 09:21:33 -05:00
Enjolras 065b7f863a Add a function prepare() to PKGBUILD
prepare is run after the source extraction, and is not run with
--noextract option.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-01 09:17:58 -05:00
Allan McRae b782388f16 makepkg: remove unnecessary formatting
This extra newline leaves a gap that looks strange in of itself,
but is highlighted when piping -g output to a PKGBUILD.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-01 09:17:42 -05:00
Daniel Wallace 52550a2a0a asdeps flag passed from makepkg to pacman
add the asdeps flag for makepkg so that it does pacman -U --asdeps

[Allan: clean-up whitespace]
Signed-off-by: Daniel Wallace <daniel.wallace12@gmail.com>

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-01 09:17:12 -05:00
Dave Reisner b1bb2eaa50 paccache: adopt size_to_human
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-06-25 23:39:46 -05:00
Dave Reisner a98fce0896 scripts/library: add size_to_human
This function is the reverse of human_to_size, and converts integer byte
sizes to human readable SI prefixed values.

A logical extension of this might be to mimic the formatter that pacman
uses and allow a second argument to be passed in which can coerce the
size, rather than reducing until the unit count is below 1024.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-06-25 23:39:34 -05:00
Dave Reisner ab8431c929 pkgdelta: use human_to_size to parse --min-pkg-size
Update the documentation accordingly to mention that users can expect
huamn readable sizes to be acceptable.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-06-25 23:39:28 -05:00
Dave Reisner b58489d29a scripts/library: add human_to_size
This is a bash wrapper around an awk function that parses human readable
sizes and returns their representative values in bytes, as a string. A
small test harness is added to validate the functionality.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-06-25 23:39:12 -05:00
Allan McRae e253968b4d repo-add: add checkdepends information
Similar to the case for makedepends, it is useful to be able to
access this information without parsing a PKGBUILD.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-06-25 23:08:15 -05:00
Allan McRae 81dd6ddf0c makepkg: install deps with --repackage
I have noticed that quite a number of packages fail with "makepkg -R"
when their (make)dependencies are not installed. Adjust makepkg to
check for dependencies when used with -R.  This can still be avoided
by using --nodeps/-d.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-06-25 23:08:08 -05:00
Jeremy Huntwork d310b6f85c Allow wildcards in PURGE_TARGETS to match any type of file except for directories.
Signed-off-by: Jeremy Huntwork <jhuntwork@lightcubesolutions.com>
2012-06-25 23:07:49 -05:00
Allan McRae 3a24e44206 makepkg: allow url to be overridden in split packages
This is already being used (despite not working...) in packages
in the Arch Linux repos.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-06-25 23:07:03 -05:00
Jeremy Huntwork 19c2347507 Portability fixes for makepkg
Allow makepkg to work correctly when used with find from busybox.
Fix handling of cross directory symlinks.

Signed-off-by: Jeremy Huntwork <jhuntwork@lightcubesolutions.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-06-25 23:06:43 -05:00
Dave Reisner 7245bc8e8e pkgdelta: add missing --version longopt
This was missed in the switch to parseopts, and was caught by distcheck.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-06-25 23:02:05 -05:00
Allan McRae 1d32934769 Create repo-remove symlink in scripts dir
Fix the creation of the repo-remove symlink in the scripts/ dir
on building.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-06-25 23:00:41 -05:00
Allan McRae 9a76a458b8 makepkg: rework libdepends
Rewrite the handling of libdepends. The primary advantage are:
 - Moves functionality from write_pkginfo() to find_libdepends().
 - The order of the depends array in the PKGBUILD is kept in the package.
 - An unneeded libdepends is only a warning and not an error. This allows
   putting a libdepend on a library that is dlopened.
 - It is now modular so can be extended to library types other than
   ELF *.so.
 - Finding the list of libraries a package depends only occurs when a
   libdepend is specified in the depends array.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-05-20 19:04:38 -05:00
Allan McRae 81bc390dc1 repo-add: add makedepends information
This is useful for tools that automatically rebuild packages and
thus require to generate a build order. These entries are skipped
by pacman.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-20 19:03:43 -05:00
Allan McRae 18e0a97209 makepkg: write makedepends into .PKGINFO
Currently there is no way to access the makedepends for a package
apart from parsing its PKGBUILD. Put these into the .PKGINFO file
with the idea of making them available in the repo dbs so that
automated build tools can readily determine build order.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-20 19:00:42 -05:00
Allan McRae 8abef73ba9 makepkg: Add CPPFLAGS support
Add CPPFLAGS support in addition to the current CFLAGS and CXXFLAGS.
This keeps compiler flags split up in the same logical way done
everywhere else.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-20 18:58:17 -05:00
Dan McGee 9f6a67fee7 Merge branch 'maint'
Conflicts:
	scripts/pacman-key.sh.in
2012-05-20 17:41:21 -05:00
Dave Reisner fc9002188b pacman-key: use mapfile over read
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-05-20 17:39:21 -05:00
Dave Reisner 9d3e59e311 makepkg: use mapfile where plausible
With bash4 as a requirement, we can use mapfile when reading command
output into an array. mapfile has the advantage of using block buffered
I/O rather than line buffered I/O, making it slightly faster for most
jobs.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-05-20 17:39:21 -05:00
Dave Reisner ceb2362209 pkgdelta: adopt parseopts for option parsing
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-20 17:38:33 -05:00
Dave Reisner 5de465d63e pacman-key: test for content in keyring files
Test for file content (-s) rather than just existance (-f). This fixes a
bug that manifests itself in the case of an empty -revoked file. A zero
element 'keys' array would be passed to gpg, forcing it to list and,
subsequently, revoke all known keys.

Bug introduced in d1240f67ea.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-20 17:35:31 -05:00
Dan McGee 26abe8f600 Fix gettext usage in pkgdelta help instructions
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-20 11:27:36 -05:00
Dan McGee 2671581123 Update pacman-scripts message catalog
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-20 11:22:51 -05:00
Dan McGee 9e2078b179 pacman-key: clarify messages, s/keychain/keyring/
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-04 15:01:53 -05:00
Allan McRae 9d9c12e4e2 makepkg: fix package arch detection
get_pkg_arch checked for the arch variable being overridden in the
package_$1() function when used with a package as a parameter.
However, when there was no override, it did not fall back to the
global value.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-04-30 20:48:59 -05:00
Florian Pritz 678bdfb0d0 pkgdelta/repo-add: quoting fixes
Finish the job on master; most of these were applied to maint already.

Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-04-29 21:56:57 -05:00
Dan McGee 8c7202ca19 Merge remote-tracking branch 'dave/buildsys' 2012-04-29 20:27:32 -05:00
Dave Reisner 9dd42dc0da makepkg: remove subshelling from check_option and friends
Instead of creating a subshell for each of these checks (of which there
are many), pass in an expected value and make the check_* function do
the comparison for us, returning 0 (match), 1, (mismatch), or 127 (not
found).

For a measureable benefit, I tested this on a fairly simple package,
perl-term-readkey, and counted the number of clone(2) syscalls to try
and isolate those generated by makepkg itself, rather than the user
defined functions. Results as shown below:

  336 before
  180 after

So, roughly a 50% reduction, which makes sense given that a single
check_option() call could be up to 3 subprocesses in total.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-29 20:26:27 -05:00
Dave Reisner 8a9c666a8c makepkg: null terminate filenames to strip
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-29 20:26:11 -05:00
Dave Reisner 953415c86a rankmirrors: move to contrib/
This script is of questionable value, as it ranks mirrors by an
uninteresting attribute: ping. While the script itself is interesting,
people should be encouraged to rank mirrors by more useful measures,
such as actual speed, locality, or up to date-ness.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-24 20:33:08 -04:00
Allan McRae 242411a1b4 makepkg: Be more consistent with missing program message
Also prevent "sudo" and "su" from being translated.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-04-24 08:54:59 -05:00
Allan McRae 22050f18f4 makepkg: treat list of packages to be installed as an array
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-04-24 08:54:54 -05:00
Allan McRae d38a1c02db makepkg: deal with overriden package arch properly
This fixes a lot of checks done by makepkg (e.g. to see if a package
is already built and choosing which package to install).  Previously,
if a package had both "i686" and "any" versions, the "i686" one
always took precidence regardless of the value of "arch" in the
PKGBUILD for that package.  Fixes FS#27204.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-04-24 08:54:49 -05:00
Dave Reisner 03acea832a validate bash scripts with 'bash -n' during build.
Use the no-exec mode of $(BASH_SHELL) to check for syntax errors in
shell scripts. Since we use the extglob feature in various places, this
requires that we pass -O extglob to the shell as well, to ensure that
the parser is armed to handle this syntax.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-24 09:54:06 -04:00
Dave Reisner b2a2a98297 pacman-key: lookup keys before receiving
Perform a search for keys that clearly aren't key IDs. This allows
receiving keys by name or email address, but only if the key resolves
unambiguously.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-24 08:46:13 -05:00
Dan McGee ca4f8687f7 Merge branch 'maint'
Conflicts:
	scripts/repo-add.sh.in
2012-04-24 08:44:11 -05:00
Dave Reisner 2d0a00b409 pacman-key: allow verification of multiple sig files
Loop through arguments passed to verify_sig and treat each as a
signature to be verified against a source file. Output each file as its
checked to avoid ambiguity.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-24 08:38:36 -05:00
Dave Reisner 00ab01e634 scripts/library: remove parse_options
This is retired, as the two consumers of this function are now using the
new parseopts instead.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-24 08:38:36 -05:00
Dave Reisner 62dbf7ec43 scripts: avoid dumping usage on parser fail
Avoid letting the error message from parseopts get lost in the usage
output from pacman-key and makepkg (which is already verbose).
2012-04-24 08:38:36 -05:00
Dave Reisner f61f075b1c pacman-key: adopt parseopts for option parsing
This requires an ugly amount of reworking of how pacman-key handles
options. The change simply to avoid passing keys, files, and directories
as arguments to options, but to leave them as arguments to the overall
program. This is reasonable since pacman-key limits the user to
essentially one operation per invocation (like pacman).

Since we now pass around the positional parameters to the various
operations, we can add some better sanity checking. Each operation is
responsible for testing input and making sure it can operate properly,
otherwise it throws an error and exits.

The doc is updated to reflect this, and uses similar verbiage as pacman,
describing the non-option arguments now passed to pacman-key as targets.

Similar to the doc, --help is reorganized to separate operations and
options and remove argument tokens from operations.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-24 08:38:36 -05:00
Dave Reisner 3f9cf8471f makepkg: allow specifying --pkg multiple times
Make this option additive, so that the following two operations are
equivalent:

  makepkg --pkg foo --pkg bar
  makepkg --pkg foo,bar
2012-04-24 08:38:36 -05:00
Dave Reisner d85c71865e makepkg: adopt parseopts for option parsing
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-24 08:38:36 -05:00
Dave Reisner 8679cd68d8 scripts/library: introduce parseopts
This will replace our current options parser used in pacman-key,
makepkg, and ideally elsewhere. It follows heuristics closer to that of
GNU getopt long (and thus pacman itself), with the exception that it
does not allow for options with optional arguments. Due to the way this
parser will be used, this sort of functionality will not be needed.

Instead of relying on eval+set, options are normalized into an array,
OPTRET, which callers should expect to be populated after returning from
parseopts. This avoids problems with quotes and spaces in arguments,
assuming that the user quotes properly when passing into the
application.

A new test harness for parseopts is added in test/scripts.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-24 08:38:36 -05:00
Dave Reisner 5f71570ec4 makepkg: restrict allowed characters in pkgname
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-20 18:14:45 -05:00
Florian Pritz 133d174e60 pkgdelta/repo-add: quoting fixes
This removes some unnecessary quotes and adds quotes in a few places to
hopefully work correctly if the tempdir has spaces.

Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-20 18:03:54 -05:00
Florian Pritz 839953f111 pkgdelta: implement requirments for delta generation
Big deltas or deltas for very small packages are not needed so we should
check that and not generate any.

Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-20 18:00:06 -05:00
Florian Pritz 70d425c1d3 pkgdelta: rework option/argument parser
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-20 17:59:57 -05:00
Allan McRae 31091963ed makepkg: save and restore shopts when sourcing /etc/profile
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-04-08 21:52:42 -05:00
Dave Reisner 468270ce4f makepkg: complain when the buildfile isn't writeable
If the PKGBUILD isn't writeable for devel_update, throw a warning
instead of silently ignoring it. Some logical reordering is present in
this patch to reduce the number of nested if's.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-08 21:52:32 -05:00
Dave Reisner 8fe6791928 makepkg: catch errors sourcing files
create source_safe() function which temporarily disables extglob and
exits on error.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-08 21:52:26 -05:00
Dave Reisner dca10b062f makepkg: restrict usage of errexit to user functions
It's expected that this will lead to unwanted behavior, and needs
widespread testing. It's desirable to commit this for a few reasons:

- there's no reason we can't do our own error checking for code that we
  write.
- it avoids the need for ||true hacks scattered about in the code.
- it makes us immune to upstream changes in exit codes (FS#28248)

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-08 21:52:16 -05:00
Dan McGee 3a82885348 Merge branch 'maint' 2012-04-08 21:51:24 -05:00
Dave Reisner ca090e10d2 pacman-key: avoid use of tempfile in verify_sig
Use --status-fd rather than --status-file to keep this contained in a
pipeline.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-08 21:46:15 -05:00
Dave Reisner f053141c87 pacman-key: verify TRUST_ULTIMATE keys as good
Extend our grep pattern to match TRUST_ULTIMATE, not just TRUST_FULLY,
as these keys are to be trusted as well.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-08 17:43:53 -05:00
Dave Reisner 569876f930 makepkg: treat lib{provides,depends} returns as proper arrays
Make these functions more whitespace space by treating newlines as the
element delimiter rather than every form of whitespace.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-08 17:42:47 -05:00
Dave Reisner ecd6eddf13 makepkg: use proper array addition in libdeps
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-08 17:42:37 -05:00
Dave Reisner 87c4fb51a4 makepkg: add missing newline from libprovides output
This was a small oversight from 1917c845 which causes makepkg to write
provides entries to the .PKGINFO file improperly, e.g.

  provides = systemdlibsystemdudev=999

Add a newline in the printf format to ensure that these are spaced
appropriately.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-08 17:41:02 -05:00
Florian Pritz 62e8812fb9 repo-remove: remove deltas file if it becomes empty
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-07 11:30:56 -05:00
Allan McRae 923214497f makepkg: safely change directories
In preparation for the removal of the global error trap we need a
way to ensure changing directories succeeds.  Add a "cd_safe"
wrapper that performs the necessary check.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-07 11:27:39 -05:00
Allan McRae 1917c845f7 makepkg: use printf rather than echo to output variable
Also make sure the strings passed to %s in printf are always quoted.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-07 11:27:23 -05:00
Allan McRae d11192c73a makepkg: the rhs in string comparisons should be quoted
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-07 11:27:08 -05:00
Matthew Monaco bb71d254e2 makepkg: devel_check(): cleanup for hg version
Use pushd/popd, quote args, handle some more errors
2012-04-07 11:26:44 -05:00
Matthew Monaco 0fd477238f makepkg: devel_check(): set newpkgver (cleanup)
The case structure allows the syntax to focus on what's actually being
done here.
2012-04-07 11:26:31 -05:00
Matthew Monaco 0666b13669 makepkg: devel_check(): consolidate common code 2012-04-07 11:26:16 -05:00
Matthew Monaco 80a811ec96 makepkg: devel_check(): determine vcs
Rather than prioritizing an arbitrary VCS, collect all development
directives. If there is more than one, give a warning and abort.
2012-04-07 11:26:00 -05:00
Matthew Monaco 6310bb5fbe makepkg: remove unused variable
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-07 11:25:34 -05:00
Dan McGee 4ca6590af5 Merge branch 'maint'
Conflicts:
	lib/libalpm/signing.c
	lib/libalpm/sync.c
2012-04-07 11:23:55 -05:00
Dan McGee 3f1ea8b62f Revert "makepkg: calculate exact total file size"
This reverts commit b264fb9e9d.
With our "fix" of sleeping for BTRFS, we can go back to using `du` to
calculate total installed size.
2012-04-07 11:20:08 -05:00
Dave Reisner 3c5d5a19b3 Revert "parseopts: normalize options into an array"
This was really only half a fix for FS#28445, as it still doesn't
correctly handle the case of filenames with spaces. In the short term,
there is no obvious fix for this. In the long term, I believe the
correct decision is to rewrite the options parser to be more in line
with GNU getopt_long.

This reverts commits:
  ca41427141.
  969dcddbdf.
2012-04-07 11:03:48 -05:00
Florian Pritz 297916e6a2 pkgdelta: exit 1 upon error
This has been 0 since 9fa18d9a4b, but it
doesn't makes sense because we are raising an error.

Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-07 10:31:10 -05:00
Pierre Schmitz a8f03d07c7 pacman-key: Actually verify signatures and exit with correct codes
We cannot rely on gpg's exit code. Instead we have to check the status-fd to
figure out whether a signature is valid or not.

In addition to this pacman-key --verify can now be used in scripts as it will
return an exit code of 1 if the signature is invalid.

Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-07 10:22:10 -05:00
Dan McGee 114d121001 pkgdelta: use bsdtar -q option
This matches the optimization made to repo-add in commit 8bbaf045b9
way back in 2009. We don't need to read the whole package file to ensure
multiple .PKGINFO entries don't exist, as well-formed packages should
have this file first in the archive.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-07 10:13:38 -05:00
Dave Reisner 969dcddbdf parse_options: initialize unused_options as array
Since we treat this as an array, we need to initialize it as one. This
avoids addition of an empty element to the option string when we set the
option array from the calling program, e.g.

  +/usr/bin/makepkg[2033]: set -- -i --pkg vim -- ''

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-07 10:13:37 -05:00
Dan McGee 72ba4fb83f Updates from Transifex
This encompasses a few languages that have had changes since 4.0.2
available on Transifex.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-07 10:13:37 -05:00
Allan McRae d7f4e8fbcc pacman-key: change to more reliable default keyserver
User reports indicate that the SKS keyservers are more reliable
than both the gnupg.net and mit.edu ones.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-29 16:49:54 -05:00
Allan McRae ed353d91b7 pacman-key: make the -e option work as advertised
Using -e without arguments failed to export all keys. Using --export
worked as expected.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-29 16:49:22 -05:00
Dan McGee 1eeab12228 Update all translation files
Pull updates from transifex, run update-po on all files, fix a few
errors, and push them back to Transifex.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-28 18:05:06 -05:00
Dave Reisner 7f258619c6 makepkg: avoid reporting bogus install size on btrfs
delayed allocation hoses us here and causes erroenous install sizes to
be reported. Add a short sleep to allow the transaction to be committed
to the filesystem and the stat buffers to be updated.

This is apparently a "feature", as per to some of the denizens of #btrfs
on freenode.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-28 09:56:11 -05:00
Dan McGee e6f72c61a0 Merge branch 'maint'
Conflicts:
	lib/libalpm/sync.c
2012-03-16 12:08:10 -05:00
Allan McRae f988aa6b32 makepkg: quote removed filename as it can have spaces
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-16 12:01:52 -05:00
Allan McRae 573bd80f14 makepkg: abort when failing to create BUILDDIR
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-16 12:01:26 -05:00
Allan McRae 44de3183ff makepkg: prevent issues with files starting with a hyphen
Most places in makepkg deal with full file paths, but a few use the
file name only.  Protect from potential issues when a file name
starts with a hyphen.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-16 12:01:15 -05:00
Allan McRae 03465ad6b6 makepkg: append pkgbase to BUILDDIR if specified
This means multiple packages can be build using the same BUILDDIR
without their source files all ending up extracted in the same
directory.  Fixes FS#28417.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-16 12:00:42 -05:00
Dan McGee 8de0631edb Merge branch 'maint'
Conflicts:
	lib/libalpm/be_package.c
2012-03-08 18:08:15 -06:00
Dave Reisner 1a8c3e52d7 makepkg: exit via default signal handler in trap_exit
Similar to how we manage receipt of SIGINT in pacman's internal
downloader, catch the signal and invoke our own trap handler before
unsetting it and calling the default. This requires a slight
modification to the arguments passed to trap_exit so we can pass the
raised signal to trap_exit (note that we substitue USR1 for ERR since
the latter is unique to bash).

Fixes FS#28491.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-08 18:01:53 -06:00
Dave Reisner bc311a24ce makepkg: use array instead of string
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-03-08 17:30:25 -06:00
Dave Reisner 8d26df5ee5 makepkg: avoid use of eval in run_pacman
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-03-08 17:30:15 -06:00
Dave Reisner 708a227578 makepkg: enforce decimal format for pkgrel
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-03-08 17:29:27 -06:00
Christian Hesse 09a93b2e0e makepkg: allow specifying compression options
Adds the ability to override the commands used to compressing
compiled and source packages.  This is useful for those wanting
to use alternative implementations of the compression tools or
non-default compression options.

Allan: documented options in man page

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-03-08 17:28:36 -06:00
Dan McGee 6a636b2b6e pacman-optimize: standardize on openssl usage, only touch local/
The rest of our scripts have been using `openssl dgst` rather than tools
like `md5sum` for some time, so convert this one too. We also make the
following other adjustments:

* Use a `find -print0 | xargs -0` pipeline so paths with spaces and or
  newlines don't totally kill us.
* Ensure the files we write out contain only paths relative to the
  database root, where we know the filenames should all be sane.
* Remove use of `diff`, this was the only time we used it in scripts and
  we can get a cheap substitute by comparing file checksums instead.
* Only touch the local/ part of the database. It makes little sense to
  do anything to the sync/ directory anymore as they are compressed
  single files that should be regularly written out in full and won't be
  fragmented on any sane filesystem.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-08 17:26:23 -06:00
Pierre Schmitz 1fe6cabc4d pacman-key: Remove useless signature verification in --populate command
Verifing the keyring at this point is useless as a malicious package is already
installed and as such has several options to bypass this check anyway.

Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-05 11:57:30 -06:00
Dan McGee 4ffa0401d2 Translation updates from Transifex
* it updates to all translations
* minor fr, pt_BR, de, lt, sk and uk updates
* add new strings in pacman translation catalog

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-05 11:45:23 -06:00
Allan McRae cb64fbeac4 Do not dereference symlinks when calculating size
Passing the "-L" flag to stat means we get the size of the file
being pointed to for symlinks instead of the size of the symlink.

Keep "-L" usage in repo-add as we want the actual size of the
package/delta/signature there.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-03-05 11:44:34 -06:00
Florian Pritz ea7fc8962a makepkg: fix false error with multiple libdeps
With multiple items in $libdepends this check only worked for the first
one, everything after this returned an error. This was probably an issue
with \s being treated wrong.

Fix-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-03-05 11:44:34 -06:00
Florian Pritz fbfcd86650 makepkg: fix extraction of soname in find_libdepends
libperl.so results in soname="libperl.so.so" which is wrong.

This returns the correct string: "libperl.so"

Fix-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-03-05 11:44:34 -06:00
Dan McGee 3849c3aec1 Merge branch 'maint'
Conflicts:
	contrib/pacsysclean.in
	src/pacman/conf.h
2012-02-20 17:00:26 -06:00
Allan McRae 5bbe342932 makepkg: rework libprovides
This reworks the implmentation of libprovides for the following
benefits:
 - Moves functionality from write_pkginfo() to find_libprovides()
 - Only calculates the version for libraries specifically requested
   and not all libraries. This has the disadvantage of running find
   over the $pkgdir for as many libraries as needed, but is unlikely
   to be an issue due to caching.
 - The order of the provides array in the PKGBUILD is kept in the
   package
 - There are more warning messages when things fail and those that
   were there are no longer errors (as I do not think failure of
   libprovides should result in complete packaging failure)
 - It is now modular so can be easy extended to other library types
   other than ELF *.so.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-02-20 16:54:19 -06:00
Dave Reisner ca41427141 parseopts: normalize options into an array
Modify parse_options logic to fill an array instead of printing parsed
options. Avoid eval like the plague. Because it is the plague.

Fixes bugs such as FS#28445.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-02-16 17:31:16 -06:00
Christoph Vigano edd81f3e8b makepkg: fix syntax error in remove_deps
This fixes a problem that occurs if you tell makepkg to remove installed
dependencies (just to be sure) but there are none. As the $ was missing
in front of deplist, the check never happened and 'pacman -Rn' was
called which obviously failed.

Dan: later reported as FS#28448.

Signed-off-by: Christoph Vigano <mail@cvigano.de>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-02-15 15:12:59 -06:00
Dan McGee 13a1d5883c scripts: unset CDPATH if cd is used
This wonderful/awful little bash shell variable wrecks havoc on `cd`
calls in shell scripts. Unset CDPATH in makepkg where we use `cd` quite
heavily. In pacman-optimize, we can move the change directory logic into
the bsdtar call so we are left with no usages of `cd` in the script.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-02-14 10:11:43 -06:00
Dan McGee c7321a7b80 Merge branch 'maint'
Conflicts:
	lib/libalpm/sync.c
	src/util/pactree.c
2012-02-13 10:14:06 -06:00
Dan McGee f8ae60bc28 Final pre-release Transifex updates
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-02-11 15:01:35 -06:00
Allan McRae 31432edcbe makepkg: disable extglob when sourcing BUILDSCRIPT
PKGBUILDs are advertised as being pure bash so it would be expected
that the default bash options are in effect when sourcing it.

This inadvertantly "fixes" FS#27780 where enabling extglob causes
the bash parser to error on non-valid bash function names like
package_libxml++(). Note that these function names are unsupported
in bash and could break again even with this "fix" in future bash
releases.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-02-11 14:53:33 -06:00
Allan McRae 9b1ab3d767 makepkg: deal with mercurial exit codes
From mercurial-2.1, "hg pull" returns 1 when there are no updates.
Catch the return code and either pull the update or return an
error as appropriate.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-02-11 14:52:54 -06:00
Dan McGee 5945241469 Translation updates from Transifex, mostly scripts
This is after some manual massaging to fix issues with newlines in some
translations of the script catalogs.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-02-06 21:59:12 -06:00
Dan McGee f55be48977 Merge branch 'maint'
Conflicts:
	lib/libalpm/alpm_list.c
2012-02-06 05:50:48 -06:00
Andrew Gregory b7c06d6d67 makepkg.sh.in - if both -r and -i are provided, only remove makedeps
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-02-06 05:50:27 -06:00
Andrew Gregory 0fdf0b19ce makepkg.sh.in - fix remove_deps test for deps to be removed
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-02-06 05:34:55 -06:00
Mantas Mikulėnas 17e71fc908 makepkg: add forgotten newline in help output
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-02-06 05:34:46 -06:00
Allan McRae 47313acee4 makepkg: Fix non-writable SRCPKGDEST error message
Provide a helpful error message for when creating a source tarball
and SRCPKGDEST is not writable.

Fixes FS#28197.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-31 11:22:50 -06:00
Dan McGee 4f54bde439 Merge branch 'maint'
Conflicts:
	scripts/makepkg.sh.in
2012-01-30 22:00:26 -06:00
Dave Reisner 9aa4d9a7b9 pacman-key: call gpg fewer times for revocation keys
Instead of iterating over the revocation keyfile and calling gpg once
for each key, map the file into an array and call gpg once, iterating
over this output to mark each key as revoked.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-30 21:59:41 -06:00
Dave Reisner 2a73f4e994 pacman-key: simplify trusted keyring iteration
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-30 21:59:34 -06:00
Dan McGee 9d1e8084df Update translations
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-30 21:56:53 -06:00
Dan McGee 7b2f600d71 Update pot translation catalogs
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-30 21:49:34 -06:00
Dan McGee 5c2928aa25 Make a few more copyright date tweaks
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-30 21:43:23 -06:00
Dave Reisner 9e9835f464 scripts: always use printf with embedded gettext
This addresses two problems:

1) echo's behavior is inconsistent when dealing with flags, and can
potentially be problematic.

  $ echo -n
  $ echo -- -n
  -- -n

2) Always using the end of options markers prevents translated strings
from throwing errors, as shown in FS#28069.

The remaining "inconsistencies" are because printf is being used in a
guaranteed safe manner, e.g.

  printf '%s\n' "$(gettext "--this can never break")"

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-30 21:31:38 -06:00
Allan McRae 7ff1b945f6 makepkg: workaround for zipman issues
This "fixes" two issues:

1) MAN_DIRS contains a glob by default so should not be quoted.  It is
not quoted anywhere else so this should not cause breakage...

2) the find statement returns 1 when some of MAN_DIRS are missing. This
appears to only be exposed when running makepkg as root (which it appears
some wrappers do...).

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-30 21:18:28 -06:00
Dave Reisner 41db62b77a makepkg: check for license when creating srcpackage
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-01-23 13:34:28 -05:00
Dave Reisner 225ee71cae makepkg: abstract license check into separate function
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-01-23 13:34:28 -05:00
Dan McGee e50c4a8837 Merge branch 'maint'
Conflicts:
	lib/libalpm/diskspace.c
	src/pacman/util.h
2012-01-23 12:20:52 -06:00
Allan McRae edd4276bbf makepkg: restrict usage of flags passed to pacman
With pacman-4.0, using --noconfirm or --noprogressbar with -Q or -T
results in pacman reporting an "invalid option" error. Restrict the
passing of these options to pacman. Fixes FS#28012.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-23 09:23:21 -06:00
Allan McRae df47136bcf makepkg: fix error on unnecessary -r
The grep statement used to check for a difference between the
installed package list before and after resolving dependencies
returns 1 if there is no difference.  This sets of the error
trap when "-r" is used "unnecessarily".

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-23 09:23:15 -06:00
Dan McGee 562109c0e8 Update copyright on changed files since beginning of year
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-18 22:25:27 -06:00
canyonknight c231c9af97 Improve exit statuses and error messages in pacman-key
Return codes from gpg commands are currently lost. This adds the functionality
of taking non-zero exit statuses from gpg. This includes error reporting for all
gpg commands that are run individually, run in a loop, and run through a pipe.

Includes the check_keyids_exist function which verifies a key exists locally
prior to attempted local manipulation of the key.

If a gpg command has a non-zero status, pacman-key will now exit with a non-zero
status. It will print a gettext error message of gpg's failure.

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-18 22:01:12 -06:00
canyonknight 24ca6ce1f9 Turn gpg commands into functions in pacman-key
Adds functions for every gpg command. By pulling out the gpg commands from the
"program start" section, additional commands can be run before or after a
specific gpg command without adding additional clutter to the function call
section.

Adds an explicit exit status of 0 to prevent arithmetic expansions from
returning non-zero, thereby falsely causing pacman-key to have a non-zero exit
status.

This change creates the framework for additional error messages and better
exit statuses being added to every pacman-key gpg call.

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-18 22:01:00 -06:00
Dan McGee 430b0df779 repo-add: clean up help messages
Use consistent blank lines across all commands, get rid of the
translated double newlines which only serve to confuse translators, and
fix -h/--help for that extra special third command this script offers.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-18 22:00:13 -06:00
Dan McGee 4f02b98338 Merge branch 'maint'
Conflicts:
	lib/libalpm/signing.c

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-08 12:14:04 -06:00
Allan McRae 73d0d743bd makepkg: abort on missing download agent
makepkg would not abort on a missing download agent due to the
output variable being declared local on the same line as the
function call in the assignment. That would result in strange output
such as:

==> Retrieving Sources...
==> ERROR: There is no agent set up to handle foo URLs. Check /etc/makepkg.conf.
    Aborting...
  -> Downloading foobaz...
/home/arch/code/pacman/scripts/makepkg: line 401: foo://foobaz: No such file or directory
==> ERROR: Failure while downloading foobaz
    Aborting...

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-08 12:13:32 -06:00
Allan McRae 2b38f4eab7 makepkg: fix missing source file detection
Declaring the variable as local on the same line as the assignment
results in result of the assignment being returned rather than the
result of the function on the righthand side of the assignment.

Declaring the variable as local on a separate line means the result
of the function on the r.h.s. is returned and our error function
will be invoked if necessary  (although it is practically impossible
to ever trigger it...).

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-08 12:03:56 -06:00
Allan McRae 36413aa856 makepkg: simplify source archive generation
Simplify the source tarball generation by unifying the handling of
local and remote files.  This also allows local files to be found
in $SRCDEST (FS#26580) and makepkg will abort on missing local source
files (only possible to trigger in combination with --skipinteg).

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-08 12:03:48 -06:00
Dan McGee a857b9c8e0 Update translations from Transifex
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-05 17:04:42 -06:00
Dan McGee c6e1d4ddde Update scripts translation catalog
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-05 17:02:10 -06:00
Allan McRae b264fb9e9d makepkg: calculate exact total file size
The current calculation of the total file size for a package using "du"
suffers from issues in portability and correctness.  Especially on btrfs,
this can result in clearly wrong package information such as:

Download Size  : 14684.29 KiB
Installed Size : 7628.00 KiB

Use an approach based on "stat" to calculate total file size.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-28 22:32:22 -06:00
Allan McRae 1b46137426 makepkg: Use SKIP in checksum to skip integrity check
Using the value of "SKIP" in the checksum array will cause that
integrity check to be skipped.  This makes building packages that
rely on user configurable sources less painful.

Based-on-patch-by: Dan McGee <dan@archlinux.org>
Based-on-patch-by: David Campbell <davekong@archlinux.us>
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-28 22:27:02 -06:00
Dan McGee 38143770a9 Merge branch 'maint' 2011-12-23 14:40:59 -06:00
Timothy Redaelli 5b749eeee9 pacman-key: Add missing quotes
Signed-off-by: Timothy Redaelli <timothy.redaelli@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-23 14:39:12 -06:00
Dave Reisner 5f0df42303 makepkg: split source elements when looking for sigs
Allows renamed .asc/.sig files to be still discovered by makepkg. This
is needed for a package such as PuTTY, which provides abnormally named
sig files (.DSA and .RSA) which are valid input for gpg --verify.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-12 12:47:46 -06:00
Dan McGee 781af8f91b Use automake verbose helpers in custom make rules
This converts our script generation to use the built-in AM_V_GEN macro,
which honors the V= setting passed to make and allows one to see the
full command if they truly desire. The AM_V_at macro is also used in
place of an explicit @ so verbose-mode compiles show all commands being
run.

We can also use these two macros in doc generation to quiet it down to
the level we expect.

Other minor changes:
* a pointless test call is removed in test/pacman/tests/
* sed is used instead of dos2unix as we depend on it anyway
* consecutive chmod calls are reduced to a single call (e.g., '+x,a-x')

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-08 09:17:39 -06:00
Lukas Fleischer 0e4946d559 scripts/*: Declare several constant variables read-only
Be more semantically accurate and avoid accidental overwriting of some
configuration variables that are considered to be constant.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-07 10:02:11 -06:00
Dan McGee a3a75e0a41 Merge branch 'maint' 2011-12-07 10:00:20 -06:00
Dan McGee 17e0be9e6a repo-add: enforce maximum .sig file size
This prevents user error in adding a file generated via `gpg --sign`
rather than `--detach-sign`, for example. The same 16KiB limit is used
we use in our pacman download code.

The section is moved above the checksum generation to avoid presenting
info messages to the user if the signature isn't valid.

Addresses a shortcoming pointed out in FS#27453.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-05 10:48:47 -06:00
Dan McGee 1d98c6347c Merge branch 'maint' 2011-11-30 22:34:25 -06:00
Dave Reisner a521cea96f makepkg: avoid using comm for diff'ing package lists
Whereas comm will check inputs to see if they're sorted (and warn when
they aren't), grep doesn't even care about ordering. In this particular
instance -- neither do we. We're only interested that the two lists are
equivalent.

Fixes FS#26580.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-30 22:28:13 -06:00
Dan McGee f5820c8bd6 Miscellaneous post-4.0.1 updates
Some late-arriving translation updates and add the correct dates to the
index.txt releases table.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-30 22:28:13 -06:00
Dan McGee 96b3ba3470 Merge branch 'maint' 2011-11-20 21:40:50 -06:00
Phillip Smith 5ba8b83b8b makepkg: add support for PACKAGER environment var
Add support for overriding configuration in /etc/makepkg.conf and
~/.makepkg.conf by setting the environment variable PACKAGER similar to
how SRCDEST and PKGDEST behave.

Signed-off-by: Allan McRae <allan@archlinux.org>
2011-11-20 21:36:30 -06:00
Allan McRae cb898be887 repo-add: Remove .tmp. prefix from output
Signed-off-by: Allan McRae <allan@archlinux.org>
2011-11-20 21:36:30 -06:00
Dan McGee 80868b0da6 repo-add: ensure database and signature files are always viewed in whole
This addresses a short but sweet race condition currently existing in
repo-add and repo-remove. We do the smart thing and zip the database to
a location in a temporary directory and not over the original database
directly. However, we then proceed to move this file directly from the
temporary directory to our final location, which is more than likely a
cross-filesystem move (/tmp on tmpfs) and thus non-atomic.

Instead, zip the file to the same directory, prefixing the filename with
'.tmp.'. We then move the file into place. This move is guaranteed to be
atomic, so any reader of the database file will get either the old
version, the new version, or ENOENT.

We also perform a hardlink if possible instead of a move when shifting
the old database out of the way to '.old'; this ensures there is no
chance of a database file not existing during the whole process.

Only one small race condition should now be present- when the database
has been fully moved into place and the signature has not, you may see a
mismatch. There seems to be no good way to address this, and it existed
before this patch.

A final note- if someone had locked-down permissions on the directory
that the database files are in (e.g., could only write to foo.db.tar.gz,
foo.db, foo.db.tar.gz.old, foo.db.old, and the lock file), this would
break.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-20 21:36:30 -06:00
Dan McGee 6a9ed33055 repo-add: ensure path to LOCKFILE is always absolute
Given our semi-frequent use of pushd/popd, if we are in any directory
but the original and the database path given was relative, we won't
unlock the database file when cleaning up after an error.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-20 21:36:30 -06:00
Dan McGee 507a2d15e6 Final changes before 4.0.1 release
* Add last-minute changes to NEWS
* Don't treat '_' or '_n' special in scripts when finding translatable
  strings; this breaks with one use of `read` and a dummy _ variable

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-20 21:29:46 -06:00
Dave Reisner b8ef22312b makepkg: trim trailing space from whitespace sensitive vars
This applies to pkgver, pkgrel, and epoch and ensures that any trailing
whitespace outside of the context of the variable declaration itself is
properly trimmed. The Bash parser will ignore this, and so should we.

We don't need to worry about leading space because it would force a
syntax error, or fail validation.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-20 21:17:43 -06:00
Dan McGee 919b604c29 Merge branch 'maint' 2011-11-16 14:51:17 -06:00
Dan McGee c79c068fe9 Update translations from Transifex
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-16 14:45:25 -06:00
Dan McGee c0ce10397a Update translations from Transifex
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-13 22:21:02 -06:00
Dan McGee fcf0a8b203 Updates in preparation for 4.0.1 release
Bump the version, update the translation template files, and fill in
NEWS with relevant commits and changes since 4.0.0.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-13 21:55:52 -06:00
Dan McGee 1de5070bb3 Merge branch 'maint' 2011-11-13 13:38:57 -06:00
Dave Reisner 42e2f8bfbf makepkg: check for value before using eval'd var
This prevent bsdtar from exploding when install= or changelog= are
present without a value.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-10 09:22:17 -06:00
Dan McGee 1a994bf180 Merge branch 'maint' 2011-11-07 09:16:10 -06:00
Allan McRae e7b56f48d7 makepkg: handle pgp signatures with .sign extension
Detached sgnature files with extension .sign are accepted by gnupg.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-07 09:14:09 -06:00
Dan McGee 90ddcbe71d Merge branch 'maint'
Conflicts:
	src/pacman/package.c

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-21 19:29:47 -05:00
Dan McGee 4bada45464 pacman-key: add a default keyserver timeout value on --init
The default is supposidely 30 seconds from the gpg manpage, but that
sure wasn't what I was seeing- it was somewhere closer to two minutes of
silence. Add a more reasonable 10 second timeout value which should be
good enough for any keyserver that doesn't totally stink at it's job.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-17 09:42:46 -05:00
Dan McGee a33424f879 Merge branch 'maint' 2011-10-14 08:16:18 -05:00
Dan McGee 020bdb4298 makepkg: don't attach traps until after argument parsing
Nothing we do in our traps is necessary this early in the script. This
fixes FS#26196.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-14 08:16:06 -05:00
Dan McGee ff87046354 Merge branch 'maint'
Conflicts:
	src/pacman/util.c
2011-10-13 11:25:50 -05:00
Lukas Fleischer 35e6136f4b scripts/*.sh.in: Honor TMPDIR environment variable
Replace "/tmp" with "${TMPDIR:-/tmp}" to allow for overriding the
hardcoded path.

Since we only use "/tmp" in conjunction with mktemp(1), we could also
have used "--tmpdir", which is GNU-ish, however (and the BSD counterpart
"-t" has been deprecated in GNU mktemp).

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-13 11:21:05 -05:00
Lukas Fleischer 241946ccea scripts/*.sh.in: Fix signal handler error messages
This includes some fixes to the messages that are displayed when a
signal is caught in makepkg or repo-add:

* Instead of always showing "==> ERROR: TERM signal caught. Exiting...",
  replace "TERM" by whatever signal is actually caught.

* Fix a typo in the SIGERR error message in repo-add ("occurred" instead
  of "occured"). Francois already fixed this for makepkg in 1e51b81c.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-13 11:20:12 -05:00
Lukas Fleischer d4c97ea2f6 repo-add: Avoid race condition in signal handlers
There is a small chance that a user sends SIGINT (or any other signal
that is trapped) when we're already in clean_up() which used to lead to
trap_exit() being executed and the remaining code in clean_up() being
skipped due to the bash signal/trap handler blocking EXIT (since its
handler is already being executed, even if it's interrupted).

In practice, this behaviour caused unexpected results (primarily because
pressing ^C at the wrong time left a lock file behind):

    $ ./repo-add extra.db.tar.gz foobar
    ==> Extracting database to a temporary location...
    ^C
    ==> ERROR: Aborted by user! Exiting...
    $ ./repo-add extra.db.tar.gz foobar
    ==> Extracting database to a temporary location...
    ==> ERROR: File 'foobar' not found.
    ==> No packages modified, nothing to do.
    ^C
    ==> ERROR: Aborted by user! Exiting...
    $ ./repo-add extra.db.tar.gz foobar
    ==> ERROR: Failed to acquire lockfile: extra.db.tar.gz.lck.
    ==> ERROR: Held by process 18522

Fix this and reduce the chance of race conditions in signal handlers by:

* Unhooking all traps in both clean_up() and trap_exit().

* Call clean_up() explicitly in trap_exit() to make sure we remove the
  lock file and the temporary directory even if we send SIGINT when
  clean_up() is already being executed but didn't reach the unhook code
  yet.

Also, add an optional parameter to clean_up() to allow for setting an
explicit exit code when we call clean_up() from trap_exit().

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-13 11:20:03 -05:00
Dan McGee a0d0f3f47f Final Transifex update before 4.0
We have a few incomplete translations, but these should be addressable
before the 4.0.1 maint release that is surely not that far in the
future.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-12 13:42:12 -05:00
Dan McGee 5a39172835 pacman-key: don't escape single quote in usage message
This screws up gettext and causes the message to display always
untranslated.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-11 09:07:20 -05:00
Dan McGee 8cc4ed0d63 Update translations from Transifex
In prep for the 4.0.0 release.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-11 09:07:19 -05:00
Allan McRae 36f31dd133 makepkg: strip comments after pkgver/pkgrel when checking value
Inline comments after pkgver or pkgrel would cause the sanity
checks to fail so remove them before checking the value.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-10 19:05:22 -05:00
Dan McGee a8ca9b93f8 Update translation message catalogs in prep for 4.0 release
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-05 22:39:05 -05:00
Dan McGee dc7d691b20 Update translations from Transifex
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-05 22:30:14 -05:00
Dan McGee 484d5ec624 pacman-key: treat foo-trusted as an ownertrust export file
This allows it to serve double-duty. In order to allow users to base
verification decisions off of both a valid signature and a trusted
signature, we need to assign some level of owner trust to the keys we
designate as trusted on import.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-05 22:00:52 -05:00
Dan McGee ab7d2890a4 pacman-key: refine and clarify import/import-trustdb behavior
* --import now only imports keys from pubkey.gpg and does not import
  owner trust; if you want to have both simply run the operations in
  sequence.
* --import-trustdb has been simplified; it will overwrite existing
  values in the trust database as before, but there is no need to export
  it first as those values are safe if left untouched.
* Fix the manpage referring to a non-existent option.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-05 21:55:53 -05:00
lolilolicon 94bc64ae1b makepkg: create tar file for bogus PKGEXT
If PKGEXT is not one of the recognized tar*'s, create_package() would
create an empty package file and fail, since bsdtar on the left side of
the pipe returns 141 on SIGPIPE (broken pipe).

This patch changes the behavior for an invalid PKGEXT. A warning is
printed on stderr, and a tar file is created. Also retire the obsolete
$EXT variable.

Add the obligatory comment why we don't use bsdtar's compression.
Finally, fix mixed-tab-space indentation.

Signed-off-by: lolilolicon <lolilolicon@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2011-10-03 10:59:10 -05:00
lolilolicon b0543440ca makepkg: support .tar.Z source packages creation
SRCEXT should allow whatever PKGEXT does.
Also address an uninitialized use of $ret.

Signed-off-by: lolilolicon <lolilolicon@gmail.com>
2011-09-30 10:57:44 -05:00
Dave Reisner 938fb2c878 pacman-key: remove errexit flag from shebang
We're ill equipped to be using this flag as we don't trap and respond to
the ERR signal. The result is that if is ever tripped, pacman-key will
instantly exit with no indication of why. At the same time, we're
already fairly good about doing our own error checking and verbalizing
it before dying.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-30 10:48:28 -05:00
Allan McRae 07ecd40a1a pacman-key: return 0 from get_from if default value used
This prevents the error trap being set off when GPGDir is commented
in pacman.conf.  Bug introduced in 507b01b9.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-30 10:48:19 -05:00
lolilolicon 775b94e649 pkgdelta: proper quoting in [[ expression ]]
Always quote the right-hand side of expression when the == or != operator
is used, unless intended as a pattern.

Signed-off-by: lolilolicon <lolilolicon@gmail.com>
2011-09-28 14:09:01 -05:00
lolilolicon 497501d1c7 makepkg: proper quoting in [[ expression ]]
Always quote the righthand side of expression when the == or != operator
is used, unless intended as a pattern.  Quoting bash(1):

When the == and != operators are used, the string to the right of the
operator is considered a pattern.  Any part of the pattern may be quoted
to force it to be matched as a string.

Signed-off-by: lolilolicon <lolilolicon@gmail.com>
2011-09-28 13:06:03 -05:00
Dave Reisner 619c3629ca makepkg: ensure '-' is last in a character glob
If '-' isn't the last item, it's interpreted as a range and not
literally, causing problematic behavior in parsing optdepends.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-09-27 11:35:17 -04:00
Dan McGee e70d540501 pacman-key: use consistent punctuation in error messages
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-27 09:17:11 -05:00
Dave Reisner 507b01b912 pacman-key: allow get_from to return a default value
Keep the non-zero return val to let the caller know that the key wasn't
found.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-26 16:02:19 -05:00
Dave Reisner b6ccae2d18 pacman-key: simplify writing to config file
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-26 16:02:19 -05:00
Allan McRae dd82b8d09f makepkg: normalize whitespace for optdepends in .PKGINFO
Many PKGBUILDs use formatting whitespace when specifying optdepends.
This is removed when adding a package to a repo-database so the
output of "pacman -Si <package>" and "pacman -Qip <package file>"
becomes inconsistent.  Instead, do the adjustment when creating
the .PKGINFO file.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-26 16:02:19 -05:00
Allan McRae 6adf502f0d makepkg: allow versioned optdepends with epoch
Allow the specification of versioned optdepends with an epoch.
This also (partially) enforces a whitespace between ":" and the
description which is required for the future optdepends parsing
code.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-26 16:02:19 -05:00
Dan McGee 43787d0067 Regenerate message catalogs and translations
We've had a bit of churn since the last time this was done.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 11:36:09 -05:00
Dan McGee a78e3e3a23 Translation file updates from Transifex
Pick up any updates before I push new source messages out to the
service.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 11:35:31 -05:00
Dan McGee 1df9b2aa79 pacman-key: add an additional plain text 'foo-trusted' file
This is similar to the 'foo-revoked' file we had. This will be used to
inform the user what keys in the shipped keyring need to be explicitly
trusted by the user.

A distro such as Arch will likely have 3-4 master keys listed in this
trusted file, but an additional 25 developer keys present in the keyring
that the user shouldn't have to directly sign.

We use this list to prompt the user to sign the keys locally. If the key
is already signed locally gpg will print a bit of junk but will continue
without pestering the user.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 11:15:45 -05:00
Dan McGee 067721cbff pacman-key: factor out validate_with_gpg() method
This was copy-pasted code for the most part once the filename was
factored out.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 11:15:45 -05:00
Dan McGee 33685b960d pacman-key: remove holdkeys functionality
We're putting the cart ahead of the horse a bit here. Given that our
keyring is not one where everything is implicitly trusted (ala gpgv),
keeping or deleting a key has no bearing on its trusted status, only
whether we can actually verify things signed by said key.

If we need to address this down the road, we can find a solution that
works for the problem at hand rather than trying to solve it now before
signing is even widespread.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 11:15:45 -05:00
Dan McGee 595e1a437f pacman-key: implement promptless lsigning
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 11:15:45 -05:00
Dan McGee 7d961c849b pacman-key: disable, don't remove, revoked keys
Unlike our protégé apt-key, removing a key from our keyring is not
sufficient to prevent it from being trusted or used for verification. We
are better off flagging it as disabled and leaving it in the keyring so
it cannot be reimported or fetched at a later date from a keyserver and
continue to be used.

Implement the logic to disable the key instead of delete it, figuring
out --command-fd in the process.

Note that the surefire way to disable a key involves including said key
in the keyring package, such that it is both in foobar.gpg and
foobar-revoked.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 11:15:39 -05:00
Dan McGee 213950afa3 pacman-key: simplify import in populate
This finishes the cleanup started in 710e83999b. We can do a straight
import from another keyring rather than all the funky parsing and piping
business we were doing.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 11:14:35 -05:00
Dan McGee 491b656c54 pacman-key: don't hide --verify details in populate
Otherwise we're hiding extremely relevant bits like this one:
    gpg: WARNING: This key is not certified with a trusted signature!
    gpg:          There is no indication that the signature belongs to the owner.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 11:14:35 -05:00
Dan McGee 03e1b4caa9 pacman-key: print message in populate if signature is missing
Rather than saying it was invalid, tell the user no signature exists.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 11:14:35 -05:00
Dan McGee a7691ba6fd pacman-key: clean up populate output
* Ensure usage message is indented correctly
* Show short filenames for both the gpg keyring and revocation file

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 11:14:35 -05:00