1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-08-13 17:03:46 -04:00
Commit Graph

718 Commits

Author SHA1 Message Date
Allan McRae
e92905a2c8 makepkg: fix removing symbolic link
The path was not being stripped from $file before prefixing with
$srcdir resulting in the attempted removal of a very weird
filename.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-30 10:28:18 -05:00
Dan McGee
9aab1440ca Revert "Merge branch 'master' of git://projects.archlinux.org/pacman"
This reverts the merge of 2d32a9a3a3,
which reverts the commit 8581694ceb.

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

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

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

Signed-off-by: Dave Reisner <d@falconindy.com>
2011-06-27 13:39:02 -04:00
Dave Reisner
122b4c2187 repo-add: move command invocation out of arg parsing loop
Signed-off-by: Dave Reisner <d@falconindy.com>
2011-06-27 13:39:02 -04:00
Dave Reisner
6f5a90edb3 repo-add: refactor repacking of repo file
Dump the whole conditional and filter the contents of the directory to
create an empty or non-empty archive.

Signed-off-by: Dave Reisner <d@falconindy.com>
2011-06-27 13:39:02 -04:00
Eric Bélanger
51ed7dff0d Remove -f option from ln for POSIX compliance
Fixes FS#24893.

Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-27 09:24:41 -05:00
Eric Bélanger
f5dc5c46e0 makepkg: Add warning if VCS tool is not present when determining latest VCS revision
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-27 09:24:28 -05:00
Eric Bélanger
bdd8ebd631 makepkg: Move check for sudo into check_software function
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-27 09:24:19 -05:00
Dave Reisner
7d8e9b8ed6 repo-add: use format_entry for all desc/depends fields
This ranks high on the code readability scale. The same function formats
all of our data and writes to the metadata file at once.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Dan: reuse an existing (translated) error message.

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

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

Fixes FS#24330.

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

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

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

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

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

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

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

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

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

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

Signed-off-by: Allan McRae <allan@archlinux.org>
2011-06-08 17:36:03 +10:00
Allan McRae
361b6a9403 pacman-key: add vim modeline and fix whitespace issues
Signed-off-by: Allan McRae <allan@archlinux.org>
2011-06-08 16:48:56 +10:00