Commit Graph

169 Commits

Author SHA1 Message Date
Dan McGee c571bd7afb bash_completion: complete pacman-key options right away
pacman-key requires at least one dashed option, so complete them right
away, rather than falling back to default completion.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-27 19:29:48 -05:00
Dan McGee e66edf817b Drop bash 3.2 completion support
This is pretty old at this point, and upstream bash completions project
uses compopt heavily. Completions are by no means a make-or-break
feature anyway, so this is not critical. This basically reverts commit
6f4f9c1b66 made in 2010.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-27 19:25:50 -05:00
Dan McGee 3849c3aec1 Merge branch 'maint'
Conflicts:
	contrib/pacsysclean.in
	src/pacman/conf.h
2012-02-20 17:00:26 -06:00
Eric Bélanger 242006933d pacsysclean: Fix script description and accept -o option without hyphen
Close FS#28434

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>
2012-02-16 17:30:24 -06:00
Dan McGee e50c4a8837 Merge branch 'maint'
Conflicts:
	lib/libalpm/diskspace.c
	src/pacman/util.h
2012-01-23 12:20:52 -06:00
Dan McGee de56874cc9 contrib/bash_completion: don't print stderr messages
If you are a crazy developer like me and have bogus options in your
pacman.conf file, the tab completion gets messed up by the output on
stderr. Suppress it.

Fix the same basic issue in zsh_completion, thanks to the work by
Florian Pritz <bluewind@xinu.at>.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-19 16:28:04 -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
canyonknight 102e6209c7 Fix zsh completion for *.pkg.tar
Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-08 12:03:36 -06:00
canyonknight 24c166f42a Fix bash completion for *.pkg.tar
Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-08 12:03:28 -06:00
Dan McGee 566f5210ce contrib: add install rules for bash and zsh completion
Uninstall rules are provided as well.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-02 12:58:47 -06:00
Lukas Fleischer a77e638c77 contrib/*: Support the "--help" and "--version" options
Add "--help"/"-h" and "--version"/"-V" support to all contrib scripts.
Also, update scripts that used "-v" as a short option for "--version"
and use "-V" for the sake of consistency.

Additionally:

* Move version and usage messages to separate convenience functions in
  all scripts.

* Add a workaround to paccache to support "--help" and "--version". This
  should be replaced by a proper POSIX-compliant command line parser
  that supports long options in a future patch.

* Add a "$myver" variable to all scripts and use it whenever we refer to
  the program version (e.g. in version messages). Also, use the pacman
  version number everywhere instead of using a different versioning
  scheme for each contrib script. This is achieved by adding a
  "PACKAGE_VERSION" placeholder that is replaced by sed(1) when the
  script is built.

* Ensure we always return with exit status 0 if "--help" is used and
  return with exit status 1 if we display the usage message due to
  invalid arguments.

* Add "AUTOMAKE_OPTIONS = std-options" and add all scripts to
  "bin_SCRIPTS" to make `make installcheck` check that installed scripts
  actually support the "--help" and "--version" options.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-23 14:49:46 -06:00
Dan McGee 2a4df070c3 Merge branch 'maint' 2011-12-12 14:07:44 -06:00
Dave Reisner 67290441b8 contrib/paccache: silence possible output from cd
If CDPATH is set, this could possibly write to stdout.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-12 12:52:40 -06:00
Eric Bélanger b75fac5be3 pacsysclean: Add new contrib script
pacsysclean sort installed packages by decreasing installed size. It's
useful for finding large unused package when doing system clean-up. This
script is an improved version of other similar scripts posted on the
forums. Thanks goes to Dan for fixing and improving my original script.

Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-12 12:48:50 -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
Dan McGee a3a75e0a41 Merge branch 'maint' 2011-12-07 10:00:20 -06:00
Lukas Fleischer 1038e66964 contrib/*: Hardcode program names
Add a read-only variable "$myname" to every contrib script and hardcode
program names instead of relying on "$0". The variable name "$myname"
was chosen because it is already used in pacman and because we use
"$myver" to specify the program version in the official scripts.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-07 09:59:30 -06:00
Lukas Fleischer 61ce2ca1bb contrib/paclist: Add "--help" command line parameter
Be consistent with all other contrib scripts and support the "--help"
command line switch. Fixes FS#27258.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-05 09:22:12 -06:00
Dan McGee a4ce3edf95 Merge branch 'maint' 2011-11-01 10:26:45 -05:00
Dave Reisner 1052709921 paccache: add vim modeline
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-10-26 17:46:59 -05:00
Dave Reisner 24881034f6 paccache: ensure seen/seenarch vars are set
Doesn't do a whole lot of good to compare against values that are never
set. Fixes bug where -vvv output wasn't grouping packages together
properly.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-10-26 17:46:53 -05: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
lolilolicon d6e3446e70 bacman: pkgrel does not have to be an integer
pkgrel, as with pkgver, simply mustn't contain hyphens.

Signed-off-by: lolilolicon <lolilolicon@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-21 12:31:24 -05:00
Dan McGee 0d2600c575 Remove -f short option for --force
This is not something that should be used on a frequent basis, and
giving it a short option encourages use without making the drawbacks
obvious. For the 1% of situations that require it, the 5 extra
keystrokes are a fair price to pay.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-14 08:13:38 -05:00
lolilolicon 4de3d9092e PKGBUILD.vim: fix epoch syntax highlighting
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-11 09:07:20 -05:00
lolilolicon 22abe27bfa bacman: use globbing to get local package db path
The original code- pkg_dir="$(echo $pac_db/$pkg_name-[0-9]*)" is
problematic in several ways:

 - $pac_db and $pkg_name should be quoted, obviously.
 - It assumes pkgver always starts with an integer, while in fact
   it just can't contain ':' and '-'.
   Counterexample: the code breaks on lshw B.02.15-1.
 - It assumes there are no more than one directory matching the
   pattern.  While this should be the case if everything works
   perfectly, it certainly relies on external conditions.
   Counterexample: if the local db contains two packages named
   foo and foo-3g, even if everything else is perfect, the code
   will match two directories.

Don't make assumptions, use what is known.

Signed-off-by: lolilolicon <lolilolicon@gmail.com>
2011-10-06 02:10:25 -05:00
lolilolicon 4928f9edc3 bacman: add tar.Z package creation support
bacman should support whatever makepkg does as PKGEXT.
Also remove obsolete $EXT variable.

Signed-off-by: lolilolicon <lolilolicon@gmail.com>
2011-10-06 02:10:25 -05:00
lolilolicon 273cc66a8a bacman: small code cleanup
This includes:
 - Quoting fixes.
 - Drop deprecated mktemp option -p.
 - Set extglob nullglob shell options at the top.
 - Use extended globbing instead of regex to match %HEADER% in pacman db.

Signed-off-by: lolilolicon <lolilolicon@gmail.com>
2011-10-06 02:10:25 -05:00
lolilolicon 7e5bbf0387 bacman: bashify using [[ ]] and (( ))
Another style change.  The [[ expression ]] form is particularly
cleaner, safer and more powerful than the [ expression ] form.

Signed-off-by: lolilolicon <lolilolicon@gmail.com>
2011-10-06 02:10:24 -05:00
lolilolicon 3f937c8404 bacman: indent code using TAB
As every piece of code in the whole project uses TAB as indentation
character, bacman shouldn't be an exception.

Signed-off-by: lolilolicon <lolilolicon@gmail.com>
2011-10-06 02:10:24 -05:00
lolilolicon 6bb5948025 paccache: 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>
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-09-30 10:48:49 -05:00
lolilolicon e0400fff96 paccache: declare variables explicitly
Declare and initialize integer variables 'needsroot' and 'verbose'.
Don't use the fact that (( undefined_variable )) evaluates to 0.

Signed-off-by: lolilolicon <lolilolicon@gmail.com>
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-09-30 10:48:43 -05:00
lolilolicon 83c05e71bc paccache: allow strictly integer for -k option
Verify the argument to -k is a non-negative integer.  Leading zeros
are simply stripped.

'declare -i keep' allowed the argument to -k to be any arithmetic
evaluation expression.  The simple assignment 'keep=$OPTARG' triggers
arithmetic evaluation implicitly, which can either consume a huge amount
of resources with input such as '2**2**32' or immediately produce an error
on invalid input.  Instead, we simply 'declare -- keep' and avoid all that.

Signed-off-by: lolilolicon <lolilolicon@gmail.com>
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-09-29 13:02:41 -05:00
Dave Reisner d1fc3aec4c bash_completion: add completion for pacman-key
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 7ad78c2c88 paccache: remove unnecessary if check
This is superfluous as the ensuing for loop will exit immediately on the
same condition avoided by the if.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-09-18 15:34:54 -05:00
Dave Reisner 7f1235ccbc paccache: escape . in trimming of diskspace string
Before:
==> finished dry run: 2 candidates (diskspace saved: 7. MiB)

After:
==> finished dry run: 2 candidates (diskspace saved: 7.8 MiB)

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-09-11 13:46:07 +10:00
Dave Reisner d3f135af8f bash_completion: add dbonly to sync options
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-19 18:56:00 -05:00
Sebastien Luttringer 4a7f3bbc46 Add makepkg -S which is an alias to makepkg --source
makepkg --source is a often used go make source package like for AUR.
Have a -S shortcut will save the world.

Signed-off-by: Sebastien Luttringer <seblu@seblu.net>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-18 10:47:41 -05:00
Dan McGee 3ceef97799 Fix trailing whitespace in whole codebase
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-17 17:03:19 -05:00
Dave Reisner 82ffe2cbfd build-sys: always use $(RM) instead of rm -f
These are equivalent. Use the autoconf macro for consistency.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15 13:05:27 -05:00
Dan McGee d0c64c4196 Attempt to update zsh_completion
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-11 11:29:49 -05:00
Dave Reisner 0bfefa87c8 bash_completion: update for adjusted options
Remove -k option excepting query operations and add --recursive for sync
and upgrade operations.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-11 11:29:49 -05:00
Dave Reisner 5136df0f39 paccache: use pacsort instead of sort -V
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-08 16:49:56 -05:00
Dave Reisner 1e16b94a85 contrib/paccache: misc cleanup and bugfix
* change error verbiage when run as root
* delete sigs along with packages
* fix bug in diskspace calculations
* merge END block in pkgfilter

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-08 13:29:45 -05:00
Dave Reisner 6997a738bb paccache: add new contrib script
paccache is a robust and flexible package cache cleaner with a variety
of options. Much credit goes to DJ Mills and Pat Brisbin for ideas
behind this script.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
[Dan: add .gitignore entry]
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-02 08:24:06 -04:00
Dan McGee 06974ebf2f contrib/pacsearch: skip non-matching lines
This prevents some perl errors from popping up when pacman prints error
or warning messages.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-27 12:44:17 -05:00
Dan McGee 058ee17371 contrib: add paclog-pkglist to gitignore
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-21 15:03:33 -05:00
Dave Reisner d86a60c694 PKGBUILD.vim: add new var and assert bash syntax
* assert is_bash to pickup more valid syntax
* add checkdepends highlighting

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-07-18 11:50:47 -04:00
Dave Reisner 3934a842b8 contrib/paclog-pkglist: whitespace cleanup
add a modeline and change 2 space indent to a tab.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-18 10:35:12 -05:00
Dave Reisner 3294039a00 contrib/paclog-pkglist: rework as bash wrapping awk
Avoid some pain in awk's limited handling of command line arguments by
wrapping this in a Bash script. We also default to
@localstatedir@/log/pacman.log when no args are specified, meaning that
-h or --help is required to get the help message.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-18 10:34:56 -05:00