summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rw-r--r--contrib/.gitignore0
-rw-r--r--contrib/Makefile.am3
-rw-r--r--contrib/PKGBUILD.vim2
-rw-r--r--contrib/README8
-rw-r--r--contrib/bash_completion13
-rwxr-xr-xcontrib/gensync134
-rwxr-xr-xcontrib/paclist88
-rwxr-xr-xcontrib/pacsearch163
-rwxr-xr-xcontrib/updatesync137
-rw-r--r--contrib/zsh_completion13
10 files changed, 483 insertions, 78 deletions
diff --git a/contrib/.gitignore b/contrib/.gitignore
deleted file mode 100644
index e69de29b..00000000
--- a/contrib/.gitignore
+++ /dev/null
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
index 7066f409..c68ef51c 100644
--- a/contrib/Makefile.am
+++ b/contrib/Makefile.am
@@ -1,9 +1,12 @@
EXTRA_DIST = \
PKGBUILD.vim \
bash_completion \
+ gensync \
pacdiff \
+ paclist \
pacsearch \
re-pacman \
+ updatesync \
vimprojects \
wget-xdelta.sh \
zsh_completion \
diff --git a/contrib/PKGBUILD.vim b/contrib/PKGBUILD.vim
index 57e4cf0e..8f45ae44 100644
--- a/contrib/PKGBUILD.vim
+++ b/contrib/PKGBUILD.vim
@@ -151,7 +151,7 @@ hi def link pbValidSha1sums Number
" options
syn keyword pb_k_options options contained
-syn match pbOptions /\(no\)\?\(strip\|docs\|libtool\|emptydirs\|ccache\|distcc\|makeflags\|force\)/ contained
+syn match pbOptions /\(no\)\?\(strip\|docs\|libtool\|emptydirs\|zipman\|ccache\|distcc\|makeflags\|force\)/ contained
syn match pbOptionsNeg /\!/ contained
syn match pbOptionsDeprec /no/ contained
syn region pbOptionsGroup start=/^options=(/ end=/)/ contains=pb_k_options,pbOptions,pbOptionsNeg,pbOptionsDeprec,pbIllegalOption,shDoubleQuote,shSingleQuote
diff --git a/contrib/README b/contrib/README
index 7eb36aae..73dbade0 100644
--- a/contrib/README
+++ b/contrib/README
@@ -12,6 +12,10 @@ zsh_completion - a zsh completion script, install (with a rename) to
pacdiff - a simple pacnew/pacorig/pacsave updater for /etc/.
+paclist - list all packages installed from a given repository. Useful for
+seeing which packages you may have installed from the testing repository,
+for instance.
+
pacsearch - a colorized search combining both -Ss and -Qs output. Installed
packages are easily identified with a *** and local-only packages are also
listed.
@@ -24,3 +28,7 @@ vimprojects - a project file for the vim project plugin.
wget-xdelta.sh - A download script for pacman which allows binary deltas
generated with makepkg to be used instead of downloading full binary packages.
This should cut download sizes for some package upgrades significantly.
+
+gensync, updatesync - The former repository management scripts that have since
+been superseded by repo-add and repo-remove. They are here for posterity's
+sake, and to show how repo-add and repo-remove can be wrapped in other scripts.
diff --git a/contrib/bash_completion b/contrib/bash_completion
index 77192858..11f021c8 100644
--- a/contrib/bash_completion
+++ b/contrib/bash_completion
@@ -146,14 +146,13 @@ _pacman ()
toparse="${a:2}"
case "${arg}" in
- -@(A|U|R|S|Q|h|V))
+ -@(U|R|S|Q|h|V))
op="${arg/-}"
mod="${mod}${a:2}"
;;
--)
arg="${a:2}"
case "${arg}" in
- add) op="A" ;;
remove) op="R" ;;
upgrade) op="U" ;;
query) op="Q" ;;
@@ -187,6 +186,7 @@ _pacman ()
dbonly) mod="${mod}k" ;;
nosave) mod="${mod}n" ;;
recursive) mod="${mod}s" ;;
+ unneeded) mod="${mod}u" ;;
esac ;;
*) toparse="${a}" ;;
esac
@@ -202,7 +202,6 @@ _pacman ()
if [ $COMP_CWORD -eq 1 ] && [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '\
- -A --add \
-h --help \
-Q --query \
-R --remove \
@@ -216,9 +215,10 @@ _pacman ()
if [[ "$cur" == -* ]]; then
case "${op}" in
- A|U)
+ U)
COMPREPLY=( $( compgen -W '\
--asdeps \
+ --asexplicit \
-d --nodeps \
-f --force \
-h --help \
@@ -242,6 +242,7 @@ _pacman ()
-k --dbonly \
-n --nosave \
-s --recursive \
+ -u --unneeded \
--config \
--logfile \
--noconfirm \
@@ -257,9 +258,9 @@ _pacman ()
S)
COMPREPLY=( $( compgen -W '\
--asdeps \
+ --asexplicit \
-c --clean \
-d --nodeps \
- -e --dependsonly \
-f --force \
-g --groups \
-h --help \
@@ -316,7 +317,7 @@ _pacman ()
rem_selected
else
case "${op}" in
- A|U)
+ U)
COMPREPLY=( $( compgen -d -- "$cur" ) \
$( compgen -f -X '!*.pkg.tar.gz' -- "$cur" ) )
return 0
diff --git a/contrib/gensync b/contrib/gensync
new file mode 100755
index 00000000..51d32ceb
--- /dev/null
+++ b/contrib/gensync
@@ -0,0 +1,134 @@
+#!/bin/bash
+#
+# gensync
+#
+# Copyright (c) 2002-2007 by Judd Vinet <jvinet@zeroflux.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+myver='3.1.1'
+
+# functions
+
+usage() {
+ printf "gensync (pacman) %s\n\n" "$myver"
+ printf "Usage: %s <root> <destfile> [package_directory]\n\n" "$0"
+ printf "\
+gensync will generate a sync database by reading all PKGBUILD files\n\
+from <root>. gensync builds the database in a temporary directory\n\
+and then compresses it to <destfile>.\n\n"
+ printf "\
+gensync will calculate md5sums of packages in the same directory as\n\
+<destfile>, unless an alternate [package_directory] is specified.\n\n"
+ printf "\
+note: The <destfile> name is important. It must be of the form\n\
+ {treename}.db.tar.gz where {treename} is the name of the custom\n\
+ package repository you configured in /etc/pacman.conf. The\n\
+ generated database must reside in the same directory as your\n\
+ custom packages (also configured in /etc/pacman.conf)\n\n"
+ echo "Example: gensync /var/abs/local /home/mypkgs/custom.db.tar.gz"
+}
+
+version() {
+ printf "gensync (pacman) %s\n" "$myver"
+ printf "\
+Copyright (C) 2002-2007 Judd Vinet <jvinet@zeroflux.org>.\n\n\
+This is free software; see the source for copying conditions.\n\
+There is NO WARRANTY, to the extent permitted by law.\n"
+}
+
+error () {
+ local mesg=$1; shift
+ printf "==> ERROR: ${mesg}\n" "$@" >&2
+}
+
+die () {
+ error $*
+ exit 1
+}
+
+# PROGRAM START
+
+if [ "$1" = "-h" -o "$1" = "--help" ]; then
+ usage
+ exit 0
+fi
+
+if [ "$1" = "-V" -o "$1" = "--version" ]; then
+ version
+ exit 0
+fi
+
+if [ $# -lt 2 ]; then
+ usage
+ exit 1
+fi
+
+# source system and user makepkg.conf
+if [ -r /etc/makepkg.conf ]; then
+ source /etc/makepkg.conf
+else
+ die "/etc/makepkg.conf not found. Cannot continue."
+fi
+
+if [ -r ~/.makepkg.conf ]; then
+ source ~/.makepkg.conf
+fi
+
+
+d=$(dirname $1)
+rootdir="$(cd $d && pwd)/$(basename $1)"
+d="$(dirname $2)"
+destdir="$(cd $d && pwd)"
+destfile="$destdir/$(basename $2)"
+pkgdir=""
+if [ "$3" != "" ]; then
+ pkgdir="$3"
+fi
+
+[ ! -d "$rootdir" ] && die "invalid root dir: $rootdir"
+
+echo "gensync: building database entries, generating md5sums..." >&2
+cd "$destdir"
+
+pkgs=""
+
+for file in $(find "$rootdir"/* -name "$BUILDSCRIPT"); do
+ unset pkgname pkgver pkgrel options
+
+ source $file || die "failed to parse $file"
+ if [ "$arch" = 'any' ]; then
+ CARCH='any'
+ fi
+ if [ "$pkgdir" != "" ]; then
+ pkgfile="$pkgdir/$pkgname-$pkgver-$pkgrel-${CARCH}${PKGEXT}"
+ else
+ pkgfile="$destdir/$pkgname-$pkgver-$pkgrel-${CARCH}${PKGEXT}"
+ fi
+
+ if [ ! -f "$pkgfile" ]; then
+ error "could not find %s-%s-%s-%s%s - skipping" $pkgname $pkgver $pkgrel $CARCH $PKGEXT
+ else
+ pkgs="$pkgs $pkgfile"
+ fi
+done
+
+echo "creating repo DB..."
+
+# we'll trim the output just a tad, as gensync may be used on large repos
+repo-add $destfile $pkgs \
+ | grep -e "package" -e "database"
+
+# vim: set ts=2 sw=2 noet:
diff --git a/contrib/paclist b/contrib/paclist
new file mode 100755
index 00000000..0379a4c5
--- /dev/null
+++ b/contrib/paclist
@@ -0,0 +1,88 @@
+#!/usr/bin/perl
+# paclist - List all packages installed from a given repo
+#
+# Copyright (C) 2008 Dan McGee <dpmcgee@gmail.com>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+use strict;
+use warnings;
+
+my $progname = "paclist";
+my $version = "1.0";
+
+if ($#ARGV != 0 || $ARGV[0] eq "--help" || $ARGV[0] eq "-h") {
+ print "$progname - List all packages installed from a given repo\n";
+ print "Usage: $progname <repo>\n";
+ print "Example: $progname testing\n";
+ if ($#ARGV != 0) {
+ exit 1;
+ }
+ exit 0;
+}
+
+if ( $ARGV[0] eq "--version" || $ARGV[0] eq "-v") {
+ print "$progname version $version\n";
+ print "Copyright (C) 2008 Dan McGee\n";
+ exit 0;
+}
+
+# This hash table will be used to store pairs of ('name version', count) from
+# the return of both pacman -Sl <repo> and pacman -Q output. We then check to
+# see if a value was added twice (count = 2)- if so, we will print that package
+# as it is both in the repo we queried and installed on our local system.
+my %packages = ();
+my $output;
+
+$output = `pacman -Sl $ARGV[0]`;
+if ($? != 0) {
+ exit 1;
+}
+my @sync = split(/\n/, $output);
+# sample output from pacman -Sl:
+# testing foobar 1.0-1
+foreach $_ (@sync) {
+ my @info = split(/ /);
+ # we only want to store 'foobar 1.0-1' in our hash table
+ my $pkg = $info[1] . " " . $info[2];
+ $packages{$pkg}++;
+}
+
+$output = `pacman -Q`;
+if ($? != 0) {
+ exit 1;
+}
+# sample output from pacman -Q:
+# foobar 1.0-1
+my @local = split(/\n/, $output);
+foreach $_ (@local) {
+ # store 'foobar 1.0-1' in our hash table
+ $packages{$_}++;
+}
+
+# run comparison check- if value was added twice, it was in the intersection
+my @intersection;
+foreach $_ (keys %packages) {
+ if ($packages{$_} == 2) {
+ push @{ \@intersection }, $_;
+ }
+}
+
+# print our intersection, and bask in the glory and speed of perl
+@intersection = sort @intersection;
+foreach $_ (@intersection) {
+ print $_ . "\n";
+}
+
+#vim: set noet:
diff --git a/contrib/pacsearch b/contrib/pacsearch
index c07c28a8..3cf8b925 100755
--- a/contrib/pacsearch
+++ b/contrib/pacsearch
@@ -1,6 +1,9 @@
-#!/bin/bash
+#!/usr/bin/perl
# pacsearch - Adds color and install information to a 'pacman -Ss' search
#
+# Copyright (C) 2008 Dan McGee <dpmcgee@gmail.com>
+#
+# Based off original shell script version:
# Copyright (C) 2006-2007 Dan McGee <dpmcgee@gmail.com>
#
# This program is free software; you can redistribute it and/or
@@ -18,72 +21,112 @@
#TODO: colors flag on commandline
-readonly progname="pacsearch"
-readonly version="1.0"
+use strict;
+use warnings;
+
+my $progname = "pacsearch";
+my $version = "2.0";
+
+if ($#ARGV lt 0 || $ARGV[0] eq "--help" || $ARGV[0] eq "-h") {
+ print "$progname - Add color and install information to a pacman -Ss search\n";
+ print "Usage: $progname <pattern>\n";
+ print "Example: $progname ^gnome\n";
+ if ($#ARGV lt 0) {
+ exit 1;
+ }
+ exit 0;
+}
-readonly CLR1='\\\e[0;34m'
-readonly CLR2='\\\e[0;32m'
-readonly CLR3='\\\e[0;35m'
-readonly CLR4='\\\e[0;36m'
-readonly CLR5='\\\e[0;31m'
-readonly CLR6='\\\e[0;33m'
-readonly CLR7='\\\e[1;36m'
-readonly INST='\\\e[1;31m'
-readonly BASE='\\\e[0m'
+if ($ARGV[0] eq "--version" || $ARGV[0] eq "-v") {
+ print "$progname version $version\n";
+ print "Copyright (C) 2006-2008 Dan McGee\n";
+ exit 0;
+}
-if [ "$1" = "--help" -o "$1" = "-h" ]; then
- echo "Usage: $progname <pattern>"
- echo "Ex: $progname ^gnome"
- exit 0
-fi
+# define our colors to use when printing
+my $CLR1 = "\e[0;34m";
+my $CLR2 = "\e[0;32m";
+my $CLR3 = "\e[0;35m";
+my $CLR4 = "\e[0;36m";
+my $CLR5 = "\e[0;31m";
+my $CLR6 = "\e[0;33m";
+my $CLR7 = "\e[1;36m";
+my $INST = "\e[1;31m";
+my $BASE = "\e[0m";
+my $INSTMARK = $INST."***";
-if [ "$1" = "--version" -o "$1" = "-v" ]; then
- echo "$progname version $version"
- echo "Copyright (C) 2006-2007 Dan McGee"
- exit 0
-fi
+# color a "repo/pkgname pkgver" line based on the respository name
+sub to_color {
+ my $line = shift;
+ $line =~ s/(^core\/.*)/$CLR1$1$BASE/;
+ $line =~ s/(^extra\/.*)/$CLR2$1$BASE/;
+ $line =~ s/(^community\/.*)/$CLR3$1$BASE/;
+ $line =~ s/(^testing\/.*)/$CLR4$1$BASE/;
+ $line =~ s/(^unstable\/.*)/$CLR5$1$BASE/;
+ $line =~ s/(^custom\/.*)/$CLR6$1$BASE/;
+ $line =~ s/(^local\/.*)/$CLR7$1$BASE/;
+ # any other unknown repository
+ $line =~ s/(^[\w-]*\/.*)/$CLR6$1$BASE/;
+ return $line;
+}
-if [ -z "$1" -o "${1:0:1}" = "-" ]; then
- echo "Usage: $progname <pattern>"
- echo "Ex: $progname ^gnome"
- exit 1
-fi
+my %allpkgs = ();
-# Make two temp files and send output of commands to these files
-querydump=$(mktemp)
-pacman -Qs $1 > $querydump
-syncdump=$(mktemp)
-pacman -Ss $1 > $syncdump
+my $syncout = `pacman -Ss @ARGV`;
+# split each sync search entry into its own array entry
+my @syncpkgs = split(/\n^(?=\w)/m, $syncout);
+# remove the extra \n from the last desc entry
+if ($#syncpkgs >= 0) {
+ chomp($syncpkgs[$#syncpkgs]);
+}
-# Strip descriptions and 'local/' from -Qs query
-instpkg=$(mktemp)
-egrep '^[^ ]' $querydump | sed -e 's@^local/@@' > $instpkg
+# counter var for packages, used here and in the query loop too
+my $cnt = 0;
+foreach $_ (@syncpkgs) {
+ # we grab 3 fields here: repo, name/ver, and desc
+ my @pkgfields = /^(.*?)\/(.*?)\n(.*)$/s;
+ # add a fourth field that will indicate install status
+ push (@pkgfields, "");
+ # add a fifth field that indicates original order
+ push (@pkgfields, $cnt++);
+ # add each sync pkg by name/ver to a hash table for quick lookup
+ $allpkgs{$pkgfields[1]} = [ @pkgfields ];
+}
-# Add pkgs not in sync db, mark pkgs that are installed
-cat $instpkg | while read -r pkg; do
- if [ -z "$(grep "$pkg" $syncdump)" ]; then
- # grep package name; pipe to another grep that prints at most one
- # line starting with 'local/', allows for comments >1 line
- grep -A10 "$pkg" $querydump | grep -A10 -m1 "local/" >> $syncdump
- fi
- sed -i "s@^\(.\+/$pkg\)@\***\1@" $syncdump
-done
+my $queryout = `pacman -Qs @ARGV`;
+# split each querysearch entry into its own array entry
+my @querypkgs = split(/\n^(?=\w)/m, $queryout);
+# remove the extra \n from the last desc entry
+if ($#querypkgs >= 0) {
+ chomp ($querypkgs[$#querypkgs]);
+}
-# Print colorized package list and descriptions to screen
-echo -e "$(sed -r \
- -e "s@core/.*@$CLR1&$BASE@" \
- -e "s@extra/.*@$CLR2&$BASE@" \
- -e "s@community/.*@$CLR3&$BASE@" \
- -e "s@testing/.*@$CLR4&$BASE@" \
- -e "s@unstable/.*@$CLR5&$BASE@" \
- -e "s@custom/.*@$CLR6&$BASE@" \
- -e "s@local/.*@$CLR7&$BASE@" \
- -e "s@(^|\*\*\*)([[:alnum:]]*/.* .*)@\1$CLR6\2$BASE@" \
- -e "s@\*\*\*@$INST&@" \
- < $syncdump )"
-echo -en "\e[0m"
+foreach $_ (@querypkgs) {
+ # we grab 3 fields here: repo, name/ver, and desc
+ my @pkgfields = /^(.*?)\/(.*?)\n(.*)$/s;
+ # check if the package was listed in the sync out
+ # if it is we want to mark it with a *** marker
+ if (exists $allpkgs{$pkgfields[1]}) {
+ # mark it in our fourth field as installed
+ @{ $allpkgs{$pkgfields[1]} }[3] = $INSTMARK;
+ } else {
+ # add a fourth field that will indicate install status
+ push (@pkgfields, $INSTMARK);
+ # add a fifth field that indicates original order (after sync)
+ push (@pkgfields, $cnt++);
+ # add our local-only package to the hash
+ $allpkgs{$pkgfields[1]} = [ @pkgfields ];
+ }
+}
-rm $querydump
-rm $syncdump
-rm $instpkg
+# sort by original order (the fifth field) and print
+foreach $_ ( sort{ @{$allpkgs{$a}}[4] <=> @{$allpkgs{$b}}[4] } keys %allpkgs) {
+ my @v = @{$allpkgs{$_}};
+ my $line = "$v[0]/$v[1]";
+ $line = to_color($line);
+ # print install marker + colorized "repo/pkgname pkgver" string
+ print "$v[3]$line\n";
+ print "$v[2]\n";
+}
+#vim: set noet:
diff --git a/contrib/updatesync b/contrib/updatesync
new file mode 100755
index 00000000..f88e8237
--- /dev/null
+++ b/contrib/updatesync
@@ -0,0 +1,137 @@
+#!/bin/bash
+#
+# updatesync
+#
+# Copyright (c) 2004 by Jason Chu <jason@archlinux.org>
+# Derived from gensync (c) 2002-2006 Judd Vinet <jvinet@zeroflux.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+myver='3.1.1'
+
+# functions
+
+usage() {
+ printf "updatesync (pacman) %s\n\n" "$myver"
+ printf "Usage: %s <action> <destfile> <option> [package_directory]\n\n" "$0"
+ printf "\
+updatesync will update a sync database by reading a PKGBUILD and\n\
+modifying the destfile. updatesync updates the database in a temporary\n\
+directory and then compresses it to <destfile>.\n\n"
+ printf "There are two types of actions:\n\n"
+ printf "upd - Will update a package's entry or create it if it doesn't exist.\n It takes the package's PKGBUILD as an option.\n"
+ printf "del - Will remove a package's entry from the db. It takes the package's\n name as an option.\n"
+ echo
+ printf "\
+updatesync will calculate md5sums of packages in the same directory as\n\
+<destfile>, unless an alternate [package_directory] is specified.\n\n"
+ echo "Example: updatesync upd /home/mypkgs/custom.db.tar.gz PKGBUILD"
+}
+
+version() {
+ printf "updatesync (pacman) %s\n" "$myver"
+ printf "\
+Copyright (C) 2004 Jason Chu <jason@archlinux.org>.\n\n\
+This is free software; see the source for copying conditions.\n\
+There is NO WARRANTY, to the extent permitted by law.\n"
+}
+
+error () {
+ local mesg=$1; shift
+ printf "==> ERROR: ${mesg}\n" "$@" >&2
+}
+
+die () {
+ error $*
+ exit 1
+}
+
+# PROGRAM START
+
+if [ "$1" = "-h" -o "$1" = "--help" ]; then
+ usage
+ exit 0
+fi
+
+if [ "$1" = "-V" -o "$1" = "--version" ]; then
+ version
+ exit 0
+fi
+
+if [ $# -lt 3 ]; then
+ usage
+ exit 1
+fi
+
+# source system and user makepkg.conf
+if [ -r /etc/makepkg.conf ]; then
+ source /etc/makepkg.conf
+else
+ die "/etc/makepkg.conf not found. Cannot continue."
+fi
+
+if [ -r ~/.makepkg.conf ]; then
+ source ~/.makepkg.conf
+fi
+
+if [ "$1" != "upd" -a "$1" != "del" ]; then
+ usage
+ exit 1
+fi
+
+action=$1
+pkgdb=$2
+option=$3
+pkgdir="$(pwd)"
+if [ "$4" != "" ]; then
+ pkgdir="$4"
+fi
+
+if [ "$action" = "upd" ]; then # INSERT / UPDATE
+ if [ ! -f "$option" ]; then
+ die "$option not found"
+ fi
+
+ unset pkgname pkgver pkgrel options
+
+ source $option || die "failed to parse $option"
+ if [ "$arch" = 'any' ]; then
+ CARCH='any'
+ fi
+ pkgfile="$pkgdir/$pkgname-$pkgver-$pkgrel-${CARCH}${PKGEXT}"
+
+ if [ ! -f "$pkgfile" ]; then
+ die "could not find %s-%s-%s-%s%s - aborting" $pkgname $pkgver $pkgrel $CARCH $PKGEXT
+ fi
+
+ repo-add "$pkgdb" "$pkgfile"
+else # DELETE
+ fname="$(basename $option)"
+ if [ "$fname" = "PKGBUILD" ]; then
+ if [ ! -f "$option" ]; then
+ die "%s not found" $option
+ fi
+
+ unset pkgname pkgver pkgrel options
+ source $option
+ else
+ pkgname=$option
+ fi
+
+ repo-remove "$pkgdb" "$pkgname"
+fi
+
+exit 0
+# vim: set ts=2 sw=2 noet:
diff --git a/contrib/zsh_completion b/contrib/zsh_completion
index 8dec06df..e1273184 100644
--- a/contrib/zsh_completion
+++ b/contrib/zsh_completion
@@ -6,7 +6,6 @@ typeset -A opt_args
# options for passing to _arguments: main pacman commands
_pacman_opts_commands=(
- '-A[Add a package to the system]'
'-Q[Query the package database]'
'-R[Remove a package from the system]'
'-S[Synchronize packages]'
@@ -29,7 +28,7 @@ _pacman_opts_common=(
'--noscriptlet[Do not execute the install scriptlet if one exists]'
)
-# options for passing to _arguments: options for --add and --update commands
+# options for passing to _arguments: options for --upgrade commands
_pacman_opts_pkgfile=(
'-d[Skip dependency checks]'
'-f[Overwrite conflicting files]'
@@ -78,7 +77,6 @@ _pacman_opts_sync_actions=(
# options for passing to _arguments: options for --sync command
_pacman_opts_sync_modifiers=(
'-d[Skip dependency checks]'
- '-e[Install dependencies only]'
'-f[Overwrite conflicting files]'
'-i[View package information]'
'-l[List all packages in a repository]'
@@ -91,15 +89,9 @@ _pacman_opts_sync_modifiers=(
'*--ignoregroup[Ignore a group upgrade]:package group:
_pacman_completions_all_groups'
'--asdeps[Install packages as non-explicitly installed]'
+ '--asexplicit[Install packages as explicitly installed]'
)
-# handles --action subcommand
-_pacman_action_add() {
- _arguments -s : \
- "$_pacman_opts_common[@]" \
- "$_pacman_opts_pkgfile[@]"
-}
-
# handles --help subcommand
_pacman_action_help() {
_arguments -s : \
@@ -290,7 +282,6 @@ _pacman_get_command() {
# main dispatcher
_pacman() {
case $words[2] in
- -A*) _pacman_action_add ;;
-Q*g*) # ipkg groups
_arguments -s : \
"$_pacman_opts_common[@]" \