summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rw-r--r--contrib/.gitignore2
-rw-r--r--contrib/Makefile.am8
-rw-r--r--contrib/PKGBUILD.proto35
-rw-r--r--contrib/PKGBUILD.vim233
-rw-r--r--contrib/README18
-rw-r--r--contrib/bash_completion57
-rw-r--r--contrib/install.proto40
-rwxr-xr-x[-rw-r--r--]contrib/pacdiff0
-rwxr-xr-xcontrib/pacsearch2
-rwxr-xr-xcontrib/re-pacman2
-rw-r--r--contrib/vimproject5
-rwxr-xr-xcontrib/wget-xdelta.sh70
-rw-r--r--contrib/zsh_completion16
13 files changed, 436 insertions, 52 deletions
diff --git a/contrib/.gitignore b/contrib/.gitignore
index 282522db..e69de29b 100644
--- a/contrib/.gitignore
+++ b/contrib/.gitignore
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
index f78cdf8c..73d2130a 100644
--- a/contrib/Makefile.am
+++ b/contrib/Makefile.am
@@ -1,8 +1,14 @@
EXTRA_DIST = \
+ PKGBUILD.proto \
+ PKGBUILD.vim \
bash_completion \
- pacsearch \
+ install.proto \
pacdiff \
+ pacsearch \
re-pacman \
+ vimproject \
+ wget-xdelta.sh \
zsh_completion \
README
+# vim:set ts=2 sw=2 noet:
diff --git a/contrib/PKGBUILD.proto b/contrib/PKGBUILD.proto
new file mode 100644
index 00000000..9e4b69a0
--- /dev/null
+++ b/contrib/PKGBUILD.proto
@@ -0,0 +1,35 @@
+# This is an example PKGBUILD file. Use this as a start to creating your own,
+# and remove these comments. For more information, see 'man PKGBUILD'.
+# NOTE: Please fill out the license field for your package! If it is unknown,
+# then please put 'unknown'.
+
+# Contributor: Your Name <youremail@domain.com>
+pkgname=NAME
+pkgver=VERSION
+pkgrel=1
+pkgdesc=""
+arch=()
+url=""
+license=('GPL')
+groups=()
+depends=()
+makedepends=()
+provides=()
+conflicts=()
+replaces=()
+backup=()
+options=()
+install=
+source=($pkgname-$pkgver.tar.gz)
+noextract=()
+md5sums=() #generate with 'makepkg -g'
+
+build() {
+ cd "$srcdir/$pkgname-$pkgver"
+
+ ./configure --prefix=/usr
+ make || return 1
+ make DESTDIR="$pkgdir" install
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/contrib/PKGBUILD.vim b/contrib/PKGBUILD.vim
new file mode 100644
index 00000000..86862e2e
--- /dev/null
+++ b/contrib/PKGBUILD.vim
@@ -0,0 +1,233 @@
+" Vim syntax file
+" Language: PKGBUILD
+" Maintainer: Alessio 'mOLOk' Bolognino <themolok at gmail.com>
+" Last Change: 2007/05/08
+" Version Info: PKGBUILD-0.2 (colorphobic)
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+let b:main_syntax = "sh"
+runtime! syntax/sh.vim
+
+" case on
+syn case match
+
+" pkgname
+" FIXME if '=' is in pkgname/pkgver, it highlights whole string, not just '='
+syn keyword pb_k_pkgname pkgname contained
+syn match pbValidPkgname /\([[:alnum:]]\|+\|-\|_\){,32}/ contained contains=pbIllegalPkgname
+syn match pbIllegalPkgname /[[:upper:]]\|[^[:alnum:]-+_=]\|=.*=\|=['"]\?.\{33,\}['"]\?/ contained
+syn match pbPkgnameGroup /^pkgname=.*/ contains=pbIllegalPkgname,pb_k_pkgname,shDoubleQuote,shSingleQuote
+
+" pkgver
+syn keyword pb_k_pkgver pkgver contained
+syn match pbValidPkgver /\([[:alnum:]]\|\.\|+\|_\)/ contained contains=pbIllegalPkgver
+syn match pbIllegalPkgver /[^[:alnum:]+=\.\_]\|=.*=/ contained
+syn match pbPkgverGroup /^pkgver=.*/ contains=pbIllegalPkgver,pbValidPkgver,pb_k_pkgver,shDoubleQuote,shSingleQuote
+
+" pkgrel
+syn keyword pb_k_pkgrel pkgrel contained
+syn match pbValidPkgrel /[[:digit:]]*/ contained contains=pbIllegalPkgver
+syn match pbIllegalPkgrel /[^[:digit:]=]\|=.*=/ contained
+syn match pbPkgrelGroup /^pkgrel=.*/ contains=pbIllegalPkgrel,pbValidPkgrel,pb_k_pkgrel,shDoubleQuote,shSingleQuote
+
+" pkgdesc
+syn keyword pb_k_desc pkgdesc contained
+" 90 chars: 80 for description, 8 for pkgdesc and 2 for ''
+syn match pbIllegalPkgdesc /.\{90,}\|=['"]\?.*['" ]\+[iI][sS] [aA]/ contained contains=pbPkgdescSign
+syn match pbValidPkgdesc /[^='"]\.\{,80}/ contained contains=pbIllegalPkgdesc
+syn match pbPkgdescGroup /^pkgdesc=.*/ contains=pbIllegalPkgdesc,pb_k_desc,pbValidPkgdesc,shDoubleQuote,shSingleQuote
+syn match pbPkgdescSign /[='"]/ contained
+
+" url
+syn keyword pb_k_url url contained
+syn match pbValidUrl /['"]*\(https\|http\|ftp\)\:\/.*\.\+.*/ contained
+
+syn match pbIllegalUrl /[^=]/ contained contains=pbValidUrl
+syn match pbUrlGroup /^url=.*/ contains=pbValidUrl,pb_k_url,pbIllegalUrl,shDoubleQuote,shSingleQuote
+
+" license
+syn keyword pb_k_license license contained
+syn keyword pbLicense APACHE CDDL EPL FDL GPL LGPL MPL PHP RUBY ZLIB ISC MIT BSD contained
+syn match pbLicenseCustom /custom\(:[[:alnum:]]*\)*/ contained
+syn match pbIllegalLicense /[^='"() ]/ contained contains=pbLicenseCustom,pbLicense
+syn match pbLicenseGroup /^license=.*/ contains=pb_k_license,pbLicenseCustom,pbLicense,pbIllegalLicense,shDoubleQuote,shSingleQuote
+
+" backup
+syn keyword pb_k_backup backup contained
+syn match pbValidBackup /\.\?[[:alpha:]]*\/[[:alnum:]\{\}+._$-]*]*/ contained
+syn match pbBackupGroup /^backup=.*/ contains=pb_k_backup,pbValidBackup,shDoubleQuote,shSingleQuote
+
+" arch
+syn keyword pb_k_arch arch contained
+syn keyword pbArch i686 x86_64 ppc contained
+syn match pbIllegalArch /[^='() ]/ contained contains=pbArch
+syn match pbArchGroup /^arch=.*/ contains=pb_k_arch,pbArch,pbIllegalArch,shDoubleQuote,shSingleQuote
+
+" makedepends
+syn keyword pb_k_makedepends makedepends contained
+syn match pbValidMakedepends /\([[:alnum:]]\|+\|-\|_\)*/ contained
+syn region pbMakedependsGroup start=/^makedepends=(/ end=/)/ contains=pb_k_makedepends,pbValidMakedepends,shDoubleQuote,shSingleQuote
+
+" depends
+syn keyword pb_k_depends depends contained
+syn match pbValidDepends /\([[:alnum:]]\|+\|-\|_\)*/ contained
+syn region pbDependsGroup start=/^depends=(/ end=/)/ contains=pb_k_depends,pbValidDepends,shDoubleQuote,shSingleQuote
+
+" XXX little hack to color conflicts/provides/replaces keyword even without =()
+syn match pbkw /^\(conflicts\|provides\|replaces\)/ contains=pb_k_conflicts,pb_k_provides,pb_k_replaces
+hi def link pbkw keyword
+
+" conflicts
+syn keyword pb_k_conflicts conflicts contained
+syn match pbValidConflicts /\([[:alnum:]]\|+\|-\|_\)*/ contained
+syn region pbConflictsGroup start=/^conflicts=(/ end=/)/ contains=pb_k_conflicts,pbValidConflicts,shDoubleQuote,shSingleQuote
+
+" provides
+syn keyword pb_k_provides provides contained
+syn match pbValidProvides /\([[:alnum:]]\|+\|-\|_\)*/ contained
+syn region pbProvidesGroup start=/^provides=(/ end=/)/ contains=pb_k_provides,pbValidProvides,shDoubleQuote,shSingleQuote
+
+" replaces
+syn keyword pb_k_replaces replaces contained
+syn match pbValidReplaces /\([[:alnum:]]\|+\|-\|_\)*/ contained
+syn region pbReplacesGroup start=/^replaces=(/ end=/)/ contains=pb_k_replaces,pbValidReplaces,shDoubleQuote,shSingleQuote
+
+" install
+" XXX remove install from bashStatement, fix strage bug
+syn clear bashStatement
+syn keyword bashStatement chmod clear complete du egrep expr fgrep find gnufind gnugrep grep less ls mkdir mv rm rmdir rpm sed sleep sort strip tail touch
+
+syn keyword pb_k_install install contained
+syn match pbValidInstall /\([[:alnum:]]\|\$\|+\|-\|_\)*\.install/ contained
+syn match pbIllegalInstall /[^=]/ contained contains=pbValidInstall
+syn match pbInstallGroup /^install=.*/ contains=pb_k_install,pbValidInstall,pbIllegalInstall,shDeref,shDoubleQuote,shSingleQuote
+
+" source:
+" XXX remove source from shStatement, fixstrange bug
+syn clear shStatement
+syn keyword shStatement xxx wait getopts return autoload whence printf true popd nohup enable r trap readonly fc fg kill ulimit umask disown stop pushd read history logout times local exit test pwd time eval integer suspend dirs shopt hash false newgrp bg print jobs continue functions exec help cd break unalias chdir type shift builtin let bind
+
+syn keyword pb_k_source source contained
+syn match pbIllegalSource /\(http\|ftp\|https\).*\.\+\(dl\|download.\?\)\.\(sourceforge\|sf\).net/
+syn region pbSourceGroup start=/^source=(/ end=/)/ contains=pb_k_source,pbIllegalSource,shNumber,shDoubleQuote,shSingleQuote,pbDerefEmulation
+syn match pbDerefEmulation /\$[{]\?[[:alnum:]_]*[}]\?/ contained
+hi def link pbDerefEmulation PreProc
+
+" md5sums
+
+syn keyword pb_k_md5sums md5sums contained
+syn match pbIllegalMd5sums /[^='"()\/ ]/ contained contains=pbValidMd5sums
+syn match pbValidMd5sums /[[:alnum:]]\{32\}/ contained
+syn region pbMd5sumsGroup start=/^md5sums/ end=/)/ contains=pb_k_md5sums,pbMd5Quotes,pbMd5Hash,pbIllegalMd5sums
+syn match pbMd5Quotes /'.*'\|".*"/ contained contains=pbMd5Hash,pbIllegalMd5sums
+syn match pbMd5Hash /[[:alnum:]]\+/ contained contains=pbValidMd5sums
+hi def link pbMd5Quotes Keyword
+hi def link pbMd5Hash Error
+hi def link pbValidMd5sums Number
+
+" sha1sums
+syn keyword pb_k_sha1sums sha1sums contained
+syn match pbIllegalSha1sums /[^='"()\/ ]/ contained contains=pbValidSha1sums
+syn match pbValidSha1sums /[[:alnum:]]\{40\}/ contained
+syn region pbSha1sumsGroup start=/^sha1sums/ end=/)/ contains=pb_k_sha1sums,pbSha1Quotes,pbSha1Hash,pbIllegalSha1sums
+syn match pbSha1Quotes /'.*'\|".*"/ contained contains=pbSha1Hash,pbIllegalSha1sums
+syn match pbSha1Hash /[[:alnum:]]\+/ contained contains=pbValidSha1sums
+hi def link pbSha1Quotes Keyword
+hi def link pbSha1Hash Error
+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 pbOptionsNeg /\!/ contained
+syn match pbOptionsDeprec /no/ contained
+syn region pbOptionsGroup start=/^options=(/ end=/)/ contains=pb_k_options,pbOptions,pbOptionsNeg,pbOptionsDeprec,pbIllegalOption,shDoubleQuote,shSingleQuote
+syn match pbIllegalOption /[^!"'()= ]/ contained contains=pbOptionsDeprec,pbOptions
+
+" noextract
+syn match pbNoextract /[[:alnum:]+._${}-]\+/ contained
+syn keyword pb_k_noextract noextract contained
+syn region pbNoextractGroup start=/^noextract=(/ end=/)/ contains=pb_k_noextract,pbNoextract,shDoubleQuote,shSingleQuote
+
+" comments
+syn keyword pb_k_maintainer Maintainer Contributor contained
+syn match pbMaintainerGroup /Maintainer.*/ contains=pbMaintainer contained
+
+syn match pbDate /[0-9]\{4}\/[0-9]\{2}\/[0-9]\{2}/ contained
+
+syn cluster pbCommentGroup contains=pbTodo,pb_k_maintainer,pbMaintainerGroup,pbDate
+syn keyword pbTodo contained COMBAK FIXME TODO XXX
+syn match pbComment "^#.*$" contains=@pbCommentGroup
+syn match pbComment "[^0-9]#.*$" contains=@pbCommentGroup
+
+" quotes are handled by sh.vim
+
+hi def link pbComment Comment
+hi def link pbTodo Todo
+
+hi def link pbIllegalPkgname Error
+hi def link pb_k_pkgname pbKeywords
+
+hi def link pbIllegalPkgver Error
+hi def link pb_k_pkgver pbKeywords
+
+hi def link pbIllegalPkgrel Error
+hi def link pb_k_pkgrel pbKeywords
+
+hi def link pbIllegalPkgdesc Error
+hi def link pb_k_desc pbKeywords
+
+hi def link pbIllegalUrl Error
+hi def link pb_k_url pbKeywords
+
+hi def link pb_k_license pbKeywords
+hi def link pbIllegalLicense Error
+
+hi def link pb_k_backup pbKeywords
+
+hi def link pb_k_arch pbKeywords
+hi def link pbIllegalArch Error
+
+hi def link pb_k_makedepends pbKeywords
+hi def link pb_k_depends pbKeywords
+hi def link pb_k_replaces pbKeywords
+hi def link pb_k_conflicts pbKeywords
+hi def link pb_k_provides pbKeywords
+
+hi def link pbIllegalInstall Error
+hi def link pb_k_install pbKeywords
+
+hi def link pb_k_source pbKeywords
+hi def link pbIllegalSource Error
+
+hi def link pb_k_md5sums pbKeywords
+hi def link pbIllegalMd5sums Error
+
+hi def link pb_k_sha1sums pbKeywords
+hi def link pbIllegalSha1sums Error
+
+hi def link pb_k_options pbKeywords
+hi def link pbOptionsDeprec Todo
+hi def link pbIllegalOption Error
+
+hi def link pb_k_noextract pbKeywords
+hi def link pbNoextract Normal
+
+hi def link pb_k_maintainer pbKeywords
+
+hi def link pbKeywords Keyword
+
+hi def link pbDate Special
+
+"syntax include @SHELL syntax/sh.vim
+"syntax region BUILD start=/^build()/ end=/^}/ contains=@SHELL
+"let b:current_syntax = "PKGBUILD"
+
+" vim: ft=vim
diff --git a/contrib/README b/contrib/README
index fa45bc9a..95186aba 100644
--- a/contrib/README
+++ b/contrib/README
@@ -1,16 +1,30 @@
Here is a brief description of the files included in this directory:
+{PKGBUILD,install}.proto - prototype PKGBUILD and install files for creating
+packages using makepkg.
+
+PKGBUILD.vim - a vim/gvim syntax file for PKGBUILDs. Colors known variable
+names, highlights common errors such as invalid characters in pkgname or
+pkgver, etc.
+
bash_completion - a bash completion script for pacman, install in
/etc/bash_completion.d/ for use (but rename to something descriptive!).
zsh_completion - a zsh completion script, install (with a rename) to
/usr/share/zsh/site-functions/.
+pacdiff - a simple pacnew/pacorig/pacsave updater for /etc/.
+
pacsearch - a colorized search combining both -Ss and -Qs output. Installed
packages are easily identified with a *** and local-only packages are also
listed.
-pacdiff - a simple pacnew/pacorig/pacsave updater for /etc/.
-
re-pacman - regenerate a pacman package based on installed files and the pacman
database entries. Useful for reuse, or possible config file extension.
+
+vimproject - a project file for the vim project plugin (some files listed
+may need to be updated).
+
+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.
diff --git a/contrib/bash_completion b/contrib/bash_completion
index a27f4d75..d0851e70 100644
--- a/contrib/bash_completion
+++ b/contrib/bash_completion
@@ -7,18 +7,6 @@
# Distributed under the terms of the GNU General Public License, v2 or later.
#
-## ChangeLog ##
-#
-# * 3.0 (2007-02-18)
-# - Updated to pacman 3.0.0 options
-# * 1.1 (2004-01-17)
-# - Code cleanup
-# - Updated to pacman 2.7.2-2
-# * 2004-02-16 (orelien)
-# - Improved available_{pkgs,groups) functions
-# - Added support for querying groups
-#
-
## initial functions
rem_selected ()
@@ -60,7 +48,7 @@ _available_pkgs ()
local available_pkgs
local enabled_repos
enabled_repos=$( grep '\[' /etc/pacman.conf | grep -v -e 'options' -e '^#' | tr -d '[]' )
- available_pkgs=$( for r in $enabled_repos; do echo /var/lib/pacman/$r/*; done )
+ available_pkgs=$( for r in $enabled_repos; do echo /var/lib/pacman/sync/$r/*; done )
COMPREPLY=( $( compgen -W "$( for i in $available_pkgs; do j=${i##*/}; echo ${j%-*-*}; done )" -- $cur ) )
}
@@ -79,7 +67,7 @@ _available_groups ()
local available_groups
local enabled_repos
enabled_repos=$( grep '\[' /etc/pacman.conf | grep -v -e 'options' -e '^#' | tr -d '[]' )
- available_groups=$( for r in $enabled_repos; do sed '/%GROUPS%/,/^$/{//d; p}' /var/lib/pacman/$r/*/desc | sort -u; done )
+ available_groups=$( for r in $enabled_repos; do sed '/%GROUPS%/,/^$/{//d; p}' /var/lib/pacman/sync/$r/*/desc | sort -u; done )
COMPREPLY=( $( compgen -W "$( for i in $available_groups; do echo ${i%-*-*}; done )" -- $cur ) )
}
@@ -105,8 +93,8 @@ _makepkg ()
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '\
+ -A --ignorearch \
-b --builddeps \
- -B --noccache \
-c --clean \
-C --cleancache \
-d --nodeps \
@@ -115,14 +103,14 @@ _makepkg ()
-g --geninteg \
-h --help \
-i --install \
- -j \
-L --log \
-m --nocolor \
-o --nobuild \
-p \
-r --rmdeps \
-s --syncdeps \
- -S --usesudo \
+ --asroot \
+ --source \
--noconfirm \
--noprogressbar' -- $cur ) )
fi
@@ -158,7 +146,7 @@ _pacman ()
toparse="${a:2}"
case "${arg}" in
- -@(A|U|F|R|S|Q|h|V))
+ -@(A|U|R|S|Q|h|V))
op="${arg/-}"
mod="${mod}${a:2}"
;;
@@ -168,7 +156,6 @@ _pacman ()
add) op="A" ;;
remove) op="R" ;;
upgrade) op="U" ;;
- freshen) op="F" ;;
query) op="Q" ;;
sync) op="S" ;;
help) op="h" ;;
@@ -184,15 +171,19 @@ _pacman ()
print-uris) mod="${mod}p" ;;
search) mod="${mod}s" ;;
sysupgrade) mod="${mod}u" ;;
+ upgrades) mod="${mod}u" ;;
downloadonly) mod="${mod}w" ;;
refresh) mod="${mod}y" ;;
- orphans) mod="${mod}e" ;;
+ changelog) mod="${mod}c" ;;
+ deps) mod="${mod}d" ;;
+ explicit) mod="${mod}e" ;;
+ orphans) mod="${mod}t" ;;
foreign) mod="${mod}m" ;;
owns) mod="${mod}o" ;;
file) mod="${mod}p" ;;
search) mod="${mod}s" ;;
+ upgrades) mod="${mod}u" ;;
cascade) mod="${mod}c" ;;
- nodeps) mod="${mod}d" ;;
dbonly) mod="${mod}k" ;;
nosave) mod="${mod}n" ;;
recursive) mod="${mod}s" ;;
@@ -212,7 +203,6 @@ _pacman ()
if [ $COMP_CWORD -eq 1 ] && [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '\
-A --add \
- -F --freshen \
-h --help \
-Q --query \
-R --remove \
@@ -226,14 +216,15 @@ _pacman ()
if [[ "$cur" == -* ]]; then
case "${op}" in
- A|U|F)
+ A|U)
COMPREPLY=( $( compgen -W '\
+ --asdeps \
-d --nodeps \
-f --force \
-h --help \
--config \
+ --logfile \
--noconfirm \
- --ask \
--noprogressbar \
--noscriptlet \
-v --verbose \
@@ -247,14 +238,13 @@ _pacman ()
COMPREPLY=( $( compgen -W '\
-c --cascade \
-d --nodeps \
- -f --force \
-h --help \
-k --dbonly \
-n --nosave \
-s --recursive \
--config \
+ --logfile \
--noconfirm \
- --ask \
--noprogressbar \
--noscriptlet \
-v --verbose \
@@ -266,6 +256,7 @@ _pacman ()
;;
S)
COMPREPLY=( $( compgen -W '\
+ --asdeps \
-c --clean \
-d --nodeps \
-e --dependsonly \
@@ -279,10 +270,12 @@ _pacman ()
-u --sysupgrade \
-w --downloadonly \
-y --refresh \
+ --needed \
--ignore \
+ --ignoregroup \
--config \
+ --logfile \
--noconfirm \
- --ask \
--noprogressbar \
--noscriptlet \
-v --verbose \
@@ -295,7 +288,8 @@ _pacman ()
Q)
COMPREPLY=( $( compgen -W '\
-c --changelog \
- -e --orphans \
+ -d --deps \
+ -e --explicit \
-g --groups \
-h --help \
-i --info \
@@ -304,9 +298,11 @@ _pacman ()
-o --owns \
-p --file \
-s --search \
+ -t --orphans \
+ -u --upgrades \
--config \
+ --logfile \
--noconfirm \
- --ask \
--noprogressbar \
--noscriptlet \
-v --verbose \
@@ -338,6 +334,9 @@ _pacman ()
elif _instring $mod p; then
COMPREPLY=( $( compgen -d -- "$cur" ) \
$( compgen -f -X '!*.pkg.tar.gz' -- "$cur" ) )
+ elif _instring $mod u; then
+ COMPREPLY=''
+ return 0
else
_installed_pkgs
fi
diff --git a/contrib/install.proto b/contrib/install.proto
new file mode 100644
index 00000000..4bf55280
--- /dev/null
+++ b/contrib/install.proto
@@ -0,0 +1,40 @@
+# This is a default template for a post-install scriptlet. You can
+# remove any functions you don't need (and this header).
+
+# arg 1: the new package version
+pre_install() {
+ /bin/true
+}
+
+# arg 1: the new package version
+post_install() {
+ /bin/true
+}
+
+# arg 1: the new package version
+# arg 2: the old package version
+pre_upgrade() {
+ /bin/true
+}
+
+# arg 1: the new package version
+# arg 2: the old package version
+post_upgrade() {
+ /bin/true
+}
+
+# arg 1: the old package version
+pre_remove() {
+ /bin/true
+}
+
+# arg 1: the old package version
+post_remove() {
+ /bin/true
+}
+
+op=$1
+shift
+["$(type -t "$op")" = "function" ] && $op "$@"
+
+# vim:set ts=2 sw=2 et:
diff --git a/contrib/pacdiff b/contrib/pacdiff
index 2ff431bb..2ff431bb 100644..100755
--- a/contrib/pacdiff
+++ b/contrib/pacdiff
diff --git a/contrib/pacsearch b/contrib/pacsearch
index 6eed254d..1e1c0504 100755
--- a/contrib/pacsearch
+++ b/contrib/pacsearch
@@ -72,7 +72,7 @@ done
# Print colorized package list and descriptions to screen
echo -e "$(sed -r \
- -e "s@current/.*@$CLR1&$BASE@" \
+ -e "s@core/.*@$CLR1&$BASE@" \
-e "s@extra/.*@$CLR2&$BASE@" \
-e "s@community/.*@$CLR3&$BASE@" \
-e "s@testing/.*@$CLR4&$BASE@" \
diff --git a/contrib/re-pacman b/contrib/re-pacman
index 350fe865..c53ce87d 100755
--- a/contrib/re-pacman
+++ b/contrib/re-pacman
@@ -48,6 +48,8 @@ make_pkginfo () {
done
}
+LANG="POSIX"
+
if [ $# -ne 1 ]; then
echo "usage: re-pacman <installed package name>"
exit 1
diff --git a/contrib/vimproject b/contrib/vimproject
index 662bf04f..c84b6762 100644
--- a/contrib/vimproject
+++ b/contrib/vimproject
@@ -24,16 +24,13 @@ pacman=~/devel/pacman-lib CD=. flags=S {
handle.c
log.c
md5.c
- md5driver.c
package.c
provide.c
remove.c
server.c
- sha1.c
sync.c
trans.c
util.c
- versioncmp.c
add.h
alpm.h
alpm_list.h
@@ -51,11 +48,9 @@ pacman=~/devel/pacman-lib CD=. flags=S {
provide.h
remove.h
server.h
- sha1.h
sync.h
trans.h
util.h
- versioncmp.h
Makefile.am
Makefile.in
}
diff --git a/contrib/wget-xdelta.sh b/contrib/wget-xdelta.sh
new file mode 100755
index 00000000..4656f4dd
--- /dev/null
+++ b/contrib/wget-xdelta.sh
@@ -0,0 +1,70 @@
+#!/bin/bash
+
+if [ -r "/etc/makepkg.conf" ]; then
+ source /etc/makepkg.conf
+else
+ echo "wget-xdelta: Unable to find makepkg.conf"
+ exit 1
+fi
+
+if [ -r ~/.makepkg.conf ]; then
+ source ~/.makepkg.conf
+fi
+
+out_file=$(basename $1)
+file_url=$2
+
+if ! [[ "$out_file" =~ "pkg.tar.gz" ]]; then
+ # If it's not a package file download as normal and exit.
+ #wget --passive-ftp -c -O "$out_file" "$file_url"
+ exit $?
+fi
+
+
+# Get the package name and version
+[[ "$out_file" =~ "$CARCH" ]] && arch="-$CARCH" || arch=""
+pkg_data=$(echo $out_file | \
+ sed "s|^\(.*\)-\([[:alnum:]_\.]*-[[:alnum:]_\.]*\)${arch}${PKGEXT}.part|\1 \2|")
+pkgname=$(echo $pkg_data | cut -d ' ' -f 1)
+new_version=$(echo $pkg_data | cut -d ' ' -f 2)
+base_url=${file_url%/*}
+
+# Look for the last version
+for file in $(ls -r /var/cache/pacman/pkg/${pkgname}-*-*{,-$CARCH}$PKGEXT 2>/dev/null); do
+ [[ "$file" =~ "$CARCH" ]] && arch="-$CARCH" || arch=""
+ check_version=$(echo $file | \
+ sed "s|^.*/${pkgname}-\([[:alnum:]_\.]*-[[:alnum:]_\.]*\)${arch}$PKGEXT$|\1|" | \
+ grep -v "^/var/cache/pacman/pkg")
+
+ [ "$check_version" = "" ] && continue
+
+ vercmp=$(vercmp "$check_version" "$old_version")
+ if [ "$check_version" != "$new_version" -a $vercmp -gt 0 ]; then
+ old_version=$check_version
+ old_file=$file
+ fi
+done
+
+if [ "$old_version" != "" -a "$old_version" != "$new_version" ]; then
+ # Great, we have a cached file, now calculate a patch name from it
+ delta_name="$pkgname-${old_version}_to_${new_version}-${CARCH}.delta"
+
+ echo "wget-xdelta: Attempting to download delta $delta_name..." >&2
+ if wget --passive-ftp -c "$base_url/$delta_name"; then
+ echo "wget-xdelta: Applying delta..."
+ if xdelta patch "$delta_name" "$old_file" "$out_file"; then
+ echo "wget-xdelta: Delta applied successfully!"
+ rm "$delta_name"
+ exit 0
+ else
+ echo "wget-xdelta: Failed to apply delta!"
+ rm $delta_name
+ fi
+ fi
+ fi
+
+echo "wget-xdelta: Downloading new package..."
+wget --passive-ftp -c -O "$out_file" "$file_url"
+exit $?
+
+# vim:set ts=4 sw=4 noet:
diff --git a/contrib/zsh_completion b/contrib/zsh_completion
index d7e14864..07cd422e 100644
--- a/contrib/zsh_completion
+++ b/contrib/zsh_completion
@@ -7,7 +7,6 @@ typeset -A opt_args
# options for passing to _arguments: main pacman commands
_pacman_opts_commands=(
'-A[Add a package to the system]'
- '-F[Upgrade an installed package]'
'-Q[Query the package database]'
'-R[Remove a package from the system]'
'-S[Synchronize packages]'
@@ -26,7 +25,7 @@ _pacman_opts_common=(
'--noconfirm[Do not ask for confirmation]'
)
-# options for passing to _arguments: options for --add, --freshen and --update commands
+# options for passing to _arguments: options for --add, and --update commands
_pacman_opts_pkgfile=(
'-d[Skip dependency checks]'
'-f[Overwrite conflicting files]'
@@ -76,6 +75,7 @@ _pacman_opts_sync_modifiers=(
'-w[Download packages only]'
'-y[Download fresh package databases]'
'*--ignore[Ignore a package upgrade]:package:_pacman_completions_installed_packages'
+ '*--ignoregroup[Ignore a group upgrade]:package group:_pacman_completions_all_groups'
)
# handles --action subcommand
@@ -85,13 +85,6 @@ _pacman_action_add() {
"$_pacman_opts_pkgfile[@]"
}
-# handles --freshen subcommand
-_pacman_action_freshen() {
- _arguments -s : \
- "$_pacman_opts_common[@]" \
- "$_pacman_opts_pkgfile[@]"
-}
-
# handles --help subcommand
_pacman_action_help() {
_arguments -s : \
@@ -227,9 +220,9 @@ _pacman_completions_all_packages() {
repositories=( $(_call_program repositories cat /etc/pacman.conf | grep "^\[" | sed "s,\(\[\|\]\),,g" | grep -v "^options" | sort -u) )
# these can be specified as either 'package' or 'repository/package'
if [[ "$PREFIX" == "" ]] ; then
- packages=( $(_call_program packages ls /var/lib/pacman/${^repositories} | grep -v "^/" | sed "s,\-[^-]*\-[^-]*$,," | sort -u) )
+ packages=( $(_call_program packages ls /var/lib/pacman/sync/${^repositories} | grep -v "^/" | sed "s,\-[^-]*\-[^-]*$,," | sort -u) )
else
- packages=( $(_call_program packages ls /var/lib/pacman/${^repositories} | grep -v "^/" | grep -e \^$PREFIX | sed "s,\-[^-]*\-[^-]*$,," | sort -u) )
+ packages=( $(_call_program packages ls /var/lib/pacman/sync/${^repositories} | grep -v "^/" | grep -e \^$PREFIX | sed "s,\-[^-]*\-[^-]*$,," | sort -u) )
fi
compadd "$@" -a packages
}
@@ -274,7 +267,6 @@ _pacman_get_command() {
_pacman() {
case $words[2] in
-A*) _pacman_action_add ;;
- -F*) _pacman_action_freshen ;;
-Qg) # ipkg groups
_arguments -s : \
"$_pacman_opts_common[@]" \