Forcing vim users to view files with a tabstop of 2 seems really
unnecessary when noet is set. I find it much easier to read code with
ts=4 and I dislike having to override the modeline by hand.
Command run:
find . -type f -exec sed -i '/vim.* noet/s# ts=2 sw=2##' {} +
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Allan McRae <allan@archlinux.org>
Affected files:
-- contrib/bacman.sh.in
-- contrib/paccache.sh.in
-- contrib/pacdiff.sh.in
-- contrib/rankmirrors.sh.in
Signed-off-by: Jason St. John <jstjohn@purdue.edu>
Signed-off-by: Allan McRae <allan@archlinux.org>
Automatically removing the file after viewing is not good if on viewing you
decide to deal with it later.
Signed-off-by: Allan McRae <allan@archlinux.org>
The help output referred to variables in the script rather than what
they were labelled in the parameter argument.
Signed-off-by: Allan McRae <allan@archlinux.org>
Unify the formatting of the --help switch for pacman utils, if it exists.
All of the pacman utils will now output help text using the following
format:
util-name (pacman) v<pacman version>
one line description of util's purpose
Usage: util-name [options]
-b, --bar whatever --bar does
-f, --foo whatever --foo does
-h, --help display this help message
Reported-by: Karol Błażewicz <karol.blazewicz at gmail.com>
Signed-off-by: Jason St. John <jstjohn@purdue.edu>
This commit:
-- replaces space-based indents with tabs per the coding standards
-- removes extraneous whitespace (e.g. extra spaces between function args)
-- adds missing braces for a one-line if statement
Signed-off-by: Jason St. John <jstjohn@purdue.edu>
This fixes error messages to display the contents of variables rather
than the variable name by replacing backticks with single quotes (m4
eats backticks). It also removes $"" localization from error messages to
eliminate security holes.
For instance, `rankmirrors nonexistent_file' will now display:
'nonexistent_file' does not exist.
rather than:
$1 does not exist.
Signed-off-by: Aaron Lindsay <aaron@aclindsay.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
This is an option to just echo's the pacnews/pacsaves instead of merging
or removing them. This can be used to check the config status such as in
a cron job without modifying the system.
Signed-off-by: Jonathan Frazier <eyeswide@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
This is a new search type, using -p or --pacmandb options. It reads
config file locations directly from the local pacman db. It will find
active configs anywhere they are defined in installed packages. It is
not dependant on outside configs such as updatedb.conf or scanning a
large set of directories for find.
This will find more pacnews than find when searching with the current
default of /etc, and it is faster than both find and updatedb when
searching the entire fs. When run directly after an update, the local db
is more likely to be cached than all files in /etc or / as other methods
read. This will increase performance further post upgrade.
After a package is removed and a pacsave is created, this method will
not find these pacsaves until the base config is added to the local db
again. These files have no influence in a working system and only take
up a few blocks of disk space.
Active configs need to be dealt with immediately to keep a system
working. pacsaves related to removed configs can remain for weeks or
months without problems. I would recommend occasionally running other
methods such as --locate to remove them.
Signed-off-by: Jonathan Frazier <eyeswide@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Change cmd tests to if (( USE_FIND ))... as it is cleaner. All search
cmds have an option and a variable initialized to zero. The active option
should be set to 1. Add a switch to exclude multiple search options.
set the default when all are equal to zero.
Signed-off-by: Jonathan Frazier <eyeswide@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Allow colors to be disabled for use on broken/serial terminals.
Signed-off-by: Jonathan Frazier <eyeswide@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
loop over arguments, this will allow adding options such as --nocolor
Signed-off-by: Jonathan Frazier <eyeswide@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Clean up and reword --help
get rid of all the echos to make it easier to read in source.
Signed-off-by: Jonathan Frazier <eyeswide@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Changes to pacman mean that -Sp can be called without root permissions
and '-d' needs passed twice to completely ignore dependencies.
Signed-off-by: Karol Błażewicz <karol.blazewicz at gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
'-q' means "Exit as soon as each specified pattern or filename has
been matched." There is no reason to keep reading the whole package
from the cache when the install script has already been printed to
stdout.
Signed-off-by: Karol Błażewicz <karol.blazewicz at gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
su is terribad. In addition to reverting, this also removes support for
privilege escalation via su. If you want to use paccache as root and
fail to comprehend how much better sudo is than su, then run paccache
directly via su.
Fixes FS#35173.
This reverts commit 597286eb25.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
This new option disables the prepare function. Useful in combination
with -o to get an unpatched copy of the sources for testing purpose.
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Avoids problems with one of the worst CLI tools ever created, su.
Fixes FS#34656.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
if you put a type in pacman -Ss <regex> it doesn't work because it never
passes through they pointer ->sync_search to set $state. All of the
other iterations like this have a case, add one for -S*s*
Signed-off-by: Allan McRae <allan@archlinux.org>
Check all options are included in bash-completion. Alphabetize the
pacman_key options for easier maintenance.
Signed-off-by: Allan McRae <allan@archlinux.org>
use setopt extendedglob to remove sigfiles from package completion
Signed-off-by: Daniel Wallace <danielwallace@gtmanfred.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
The tmp variable is conflicting with the $tmp variable in
${^fpath}/_main_complete(N) and which is used to complete all the
functions, and causing an error: command not found: for whatever was in
$tmp (which in this case is the last value in $words[@])
making it local fixes this.
Signed-off-by: Daniel Wallace <danielwallace@gtmanfred.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
add all the longopts for the operations and allow for them to be
completed just like shortopts
Signed-off-by: Daniel Wallace <danielwallace@gtmanfred.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
include the flags that could be doubled up like -Sii -Syy -Suu -Qii etc
also include the long opts of all the commands
Signed-off-by: Daniel Wallace <danielwallace@gtmanfred.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
-i -y -u -d -s etc, so that they do not disappear
In the future I hope there is an easy way to limit it to just 2, right
now the *- makes it so that it can be added as many times as you want.
Signed-off-by: Daniel Wallace <danielwallace@gtmanfred.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Before this, if you do pacman -Sy<tab> it completes to -y. Now, with -S
and the other operations in the actual option _arguments, it won't
remove the operations.
Signed-off-by: Daniel Wallace <danielwallace@gtmanfred.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
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>
This removes the restriction on the length of the command line, as xargs
will work around by running multiple instances of the command for us.
As seen: https://bbs.archlinux.org/viewtopic.php?pid=1232959
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
Originally printed a leading \ before all path names as the `' would be
removed during the make. Using '' should be just as good as using `'.
paccache.sh.in:
die "cachedir \`%s' does not exist or is not a directory" "$cachedir"
paccache
die "cachedir \%s does not exist or is not a directory" "$cachedir"
Signed-off-by: William Giokas <1007380@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Doesn't hurt and reassures the user that we did the right thing.
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Allan McRae <allan@archlinux.org>
This fixes the current syntax highlighting behavior in the 'options'
array, which does *not* flag illegal options (e.g. typos, unsupported
options). The shDoubleQuote and shSingleQuote options were the culprits.
Now, if you enter `'!imptydurs'`, the typoed option will be flagged red.
I also added syntax highlighting for the new options listed in `man 5
makepkg.conf`, which I believe were introduced around pacman 4.0.0.
Signed-off-by: Jason St. John <jstjohn@purdue.edu>
Signed-off-by: Dan McGee <dan@archlinux.org>
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>
Give the generated package the correct architecture in its filename
rather than assuming the system architecture.
Also add updated copyright notice.
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
With pacman-key now having the ability to use names in --list-keys etc,
we can remove the comments that temporarily blocked this in the zsh
completion file.
Signed-off-by: Daniel Wallace <daniel.wallace@gatech.edu>
Signed-off-by: Allan McRae <allan@archlinux.org>
m4 has a field day parsing escapes and actually vandalizes this string,
causing the error to look like:
==> ERROR: \PKGBUILD\ not found or is not a file
Avoid all quoting and just match up with how makepkg reports errors (no
quoting at all).
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
The main motivation for this change is to allow this to be run as a cron
job.
Satisfies FS#29897 and some other undocumented requests for this.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
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>
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>
- 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>