Age | Commit message (Collapse) | Author | Files | Lines |
|
Fix indenting to something more familiar with the rest of the codebase.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Conflicts:
scripts/pacman-key.sh.in
|
|
PACMAN_OPTS would be erroneously set when it was undefined, causing
pacsysclean to error out.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
There's no reason to make these executable, and this also mimics what we
do in the scripts/ subdir.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This adds zsh completion for makepkg to the _pacman file
in /usr/share/zsh/site-functions/. it completes makepkg and allows for
stacking of flags like -si, -sci, et cetera.
Signed-off-by: Daniel Wallace <daniel.wallace@gatech.edu>
|
|
This patch adds zsh completion to pacman-key. It completes
files/directories for --config or --gpgdir and just completes the
command for --keyserver then it can complete keyids or files for all
the other flags.
Signed-off-by: Daniel Wallace <daniel.wallace@gatech.edu>
|
|
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>
|
|
Add longopts and update usage. This removes the TODO item and
incorporates --help/--version into the standard option set.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
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>
|
|
For consistency with the scripts/ directory, ensure that all bash
scripts use the same pre-build suffix.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Treat bash scripts separately from the others to allow for a different
build rule, which is reused from the scripts/ subdir.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Conflicts:
scripts/repo-add.sh.in
|
|
- only do file completion for options which expect files
- add completion for possible key ids when a relevant operation is in
COMPWORDS.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
This is a vestige leftover from the rewrite over a year ago in
622e7fdd4.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
I removed this in ff713a51 over a year ago.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
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>
|
|
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
6f4f9c1b66ed85 made in 2010.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Conflicts:
contrib/pacsysclean.in
src/pacman/conf.h
|
|
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>
|
|
Conflicts:
lib/libalpm/diskspace.c
src/pacman/util.h
|
|
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>
|
|
Conflicts:
lib/libalpm/signing.c
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Uninstall rules are provided as well.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
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>
|
|
|
|
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>
|
|
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>
|
|
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>
|
|
|
|
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>
|
|
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>
|
|
|
|
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
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>
|
|
Conflicts:
src/pacman/package.c
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
pkgrel, as with pkgver, simply mustn't contain hyphens.
Signed-off-by: lolilolicon <lolilolicon@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
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>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
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>
|
|
bacman should support whatever makepkg does as PKGEXT.
Also remove obsolete $EXT variable.
Signed-off-by: lolilolicon <lolilolicon@gmail.com>
|
|
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>
|
|
Another style change. The [[ expression ]] form is particularly
cleaner, safer and more powerful than the [ expression ] form.
Signed-off-by: lolilolicon <lolilolicon@gmail.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
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>
|