summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rw-r--r--contrib/.gitignore12
-rw-r--r--contrib/Makefile.am113
-rw-r--r--contrib/PKGBUILD.vim320
-rw-r--r--contrib/README41
-rw-r--r--contrib/bacman.sh.in391
-rw-r--r--contrib/bash_completion.in156
-rw-r--r--contrib/checkupdates.sh.in59
-rw-r--r--contrib/doc/.gitignore2
-rw-r--r--contrib/doc/Makefile.am60
l---------contrib/doc/asciidoc.conf1
-rw-r--r--contrib/doc/bacman.8.txt67
l---------contrib/doc/footer.txt1
-rw-r--r--contrib/doc/verify-pacman-repo-db.1.txt60
-rw-r--r--contrib/paccache.sh.in366
-rw-r--r--contrib/pacdiff.sh.in194
-rw-r--r--contrib/paclist.sh.in68
-rw-r--r--contrib/paclog-pkglist.sh.in99
-rw-r--r--contrib/pacscripts.sh.in140
-rw-r--r--contrib/pacsearch.in125
-rw-r--r--contrib/rankmirrors.sh.in234
-rw-r--r--contrib/updpkgsums.sh.in115
-rwxr-xr-xcontrib/verify-pacman-repo-db.pl259
-rw-r--r--contrib/vimprojects25
-rw-r--r--contrib/zsh_completion.in723
24 files changed, 0 insertions, 3631 deletions
diff --git a/contrib/.gitignore b/contrib/.gitignore
deleted file mode 100644
index 8a32b419..00000000
--- a/contrib/.gitignore
+++ /dev/null
@@ -1,12 +0,0 @@
-bacman
-bash_completion
-checkupdates
-paccache
-pacdiff
-paclist
-paclog-pkglist
-pacscripts
-pacsearch
-rankmirrors
-updpkgsums
-zsh_completion
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
deleted file mode 100644
index 897cd856..00000000
--- a/contrib/Makefile.am
+++ /dev/null
@@ -1,113 +0,0 @@
-# enforce that all scripts have a --help and --version option
-AUTOMAKE_OPTIONS = std-options
-SUBDIRS=
-if WANT_DOC
-SUBDIRS += doc
-endif
-
-DIST_SUBDIRS = $(SUBDIRS)
-
-bin_SCRIPTS = \
- $(OURSCRIPTS)
-
-BASHSCRIPTS = \
- bacman \
- checkupdates \
- paccache \
- pacdiff \
- paclist \
- paclog-pkglist \
- pacscripts \
- rankmirrors \
- updpkgsums
-
-OTHERSCRIPTS = \
- pacsearch
-
-OURSCRIPTS = \
- $(BASHSCRIPTS) \
- $(OTHERSCRIPTS)
-
-OURFILES = \
- bash_completion \
- zsh_completion
-
-EXTRA_DIST = \
- PKGBUILD.vim \
- bacman.sh.in \
- bash_completion.in \
- checkupdates.sh.in \
- paccache.sh.in \
- paclog-pkglist.sh.in \
- pacdiff.sh.in \
- paclist.sh.in \
- pacscripts.sh.in \
- pacsearch.in \
- rankmirrors.sh.in \
- updpkgsums.sh.in \
- vimprojects \
- zsh_completion.in \
- README
-
-# Files that should be removed, but which Automake does not know.
-MOSTLYCLEANFILES = $(OURSCRIPTS) $(OURFILES) *.tmp
-
-if USE_GIT_VERSION
-GIT_VERSION := $(shell sh -c 'git describe --abbrev=4 --dirty | sed s/^v//')
-REAL_PACKAGE_VERSION = $(GIT_VERSION)
-else
-REAL_PACKAGE_VERSION = $(PACKAGE_VERSION)
-endif
-
-edit = sed \
- -e 's|@sysconfdir[@]|$(sysconfdir)|g' \
- -e 's|@localstatedir[@]|$(localstatedir)|g' \
- -e 's|@PACKAGE_VERSION[@]|$(REAL_PACKAGE_VERSION)|g' \
- -e 's|@SIZECMD[@]|$(SIZECMD)|g' \
- -e 's|@SCRIPTNAME[@]|$@|g' \
- -e '1s|!/bin/bash|!$(BASH_SHELL)|g'
-
-$(OTHERSCRIPTS): Makefile
- $(AM_V_at)$(RM) $@ $@.tmp
- $(AM_V_GEN)$(edit) $(srcdir)/$@.in >$@.tmp
- $(AM_V_at)chmod +x,a-w $@.tmp
- $(AM_V_at)mv $@.tmp $@
-
-$(BASHSCRIPTS): Makefile
- $(AM_V_at)$(RM) $@
- $(AM_V_GEN)test -f $(srcdir)/$@.sh.in && m4 -P -I $(srcdir) $(srcdir)/$@.sh.in | $(edit) >$@
- $(AM_V_at)chmod +x,a-w $@
- @$(BASH_SHELL) -O extglob -n $@
-
-$(OURFILES): Makefile
- $(AM_V_at)$(RM) $@ $@.tmp
- $(AM_V_GEN)$(edit) $(srcdir)/$@.in >$@.tmp
- $(AM_V_at)chmod a-w $@.tmp
- $(AM_V_at)mv $@.tmp $@
-
-all-am: $(OURSCRIPTS) $(OURFILES)
-
-install-data-local:
- $(MKDIR_P) $(DESTDIR)$(sysconfdir)/bash_completion.d/
- $(INSTALL_DATA) bash_completion $(DESTDIR)$(sysconfdir)/bash_completion.d/pacman
- $(MKDIR_P) $(DESTDIR)$(datarootdir)/zsh/site-functions/
- $(INSTALL_DATA) zsh_completion $(DESTDIR)$(datarootdir)/zsh/site-functions/_pacman
-
-uninstall-local:
- $(RM) $(DESTDIR)$(sysconfdir)/bash_completion.d/pacman
- $(RM) $(DESTDIR)$(datarootdir)/zsh/site-functions/_pacman
-
-bacman: $(srcdir)/bacman.sh.in
-bash_completion: $(srcdir)/bash_completion.in
-checkupdates: $(srcdir)/checkupdates.sh.in
-paccache: $(srcdir)/paccache.sh.in $(top_srcdir)/scripts/library/parseopts.sh $(top_srcdir)/scripts/library/size_to_human.sh
-pacdiff: $(srcdir)/pacdiff.sh.in
-paclist: $(srcdir)/paclist.sh.in
-paclog-pkglist: $(srcdir)/paclog-pkglist.sh.in
-pacscripts: $(srcdir)/pacscripts.sh.in
-pacsearch: $(srcdir)/pacsearch.in
-rankmirrors: $(srcdir)/rankmirrors.sh.in
-updpkgsums: $(srcdir)/updpkgsums.sh.in
-zsh_completion: $(srcdir)/zsh_completion.in
-
-# vim:set noet:
diff --git a/contrib/PKGBUILD.vim b/contrib/PKGBUILD.vim
deleted file mode 100644
index 110bbc71..00000000
--- a/contrib/PKGBUILD.vim
+++ /dev/null
@@ -1,320 +0,0 @@
-" 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"
-let b:is_bash = 1
-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
-
-" pkgbase
-" FIXME if '=' is in pkgbase/pkgname/pkgver, it highlights whole string, not just '='
-syn keyword pb_k_pkgbase pkgbase contained
-syn match pbValidPkgbase /\([[:alnum:]]\|+\|-\|_\){,32}/ contained contains=pbIllegalPkgbase
-syn match pbIllegalPkgbase /[[:upper:]]\|[^[:alnum:]-+_=]\|=.*=\|=['"]\?.\{33,\}['"]\?/ contained
-syn match pbPkgbaseGroup /^pkgbase=.*/ contains=pbIllegalPkgbase,pb_k_pkgbase,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=pbIllegalPkgrel
-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
-
-" epoch
-syn keyword pb_k_epoch epoch contained
-syn match pbValidEpoch /[[:digit:]]*/ contained contains=pbIllegalEpoch
-syn match pbIllegalEpoch /[^[:digit:]=]\|=.*=/ contained
-syn match pbEpochGroup /^epoch=.*/ contains=pbIllegalEpoch,pbValidEpoch,pb_k_epoch,shDoubleQuote,shSingleQuote
-
-" 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
-" echo $(pacman -Ql licenses | grep '/usr/share/licenses/common/' | cut -d'/' -f6 | sort -u)
-syn keyword pbLicense AGPL AGPL3 Apache APACHE Artistic2.0 CCPL CDDL CPL EPL FDL FDL1.2 FDL1.3 GPL GPL2 GPL3 LGPL LGPL2.1 LGPL3 LPPL MPL PerlArtistic PHP PSF RUBY W3C ZPL contained
-" special cases from https://wiki.archlinux.org/index.php/Arch_Packaging_Standards
-syn keyword pbLicenseSpecial BSD MIT ZLIB Python contained
-syn match pbLicenseCustom /custom\(:[[:alnum:]]*\)*/ contained
-syn match pbIllegalLicense /[^='"() ]/ contained contains=pbLicenseCustom,pbLicenseSpecial,pbLicense
-syn region pbLicenseGroup start=/^license=(/ end=/)/ contains=pb_k_license,pbLicenseCustom,pbLicenseSpecial,pbLicense,pbIllegalLicense
-
-" backup
-syn keyword pb_k_backup backup contained
-syn match pbValidBackup /\.\?[[:alpha:]]*\/[[:alnum:]\{\}+._$-]*]*/ contained
-syn region pbBackupGroup start=/^backup=(/ end=/)/ contains=pb_k_backup,pbValidBackup,shDoubleQuote,shSingleQuote
-
-" arch
-syn keyword pb_k_arch arch contained
-syn keyword pbArch i686 x86_64 ppc any contained
-syn match pbIllegalArch /[^='"() ]/ contained contains=pbArch
-syn region pbArchGroup start=/^arch=(/ end=/)/ contains=pb_k_arch,pbArch,pbIllegalArch
-
-" groups
-syn keyword pb_k_groups groups contained
-syn match pbValidGroups /\([[:alnum:]]\|+\|-\|_\)*/ contained
-syn region pbGroupsGroup start=/^groups=(/ end=/)/ contains=pb_k_groups,pbValidGroups,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
-
-" 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
-
-" optdepends
-syn keyword pb_k_optdepends optdepends contained
-syn match pbValidOptdepends /\([[:alnum:]]\|+\|-\|_\)*/ contained
-syn region pbOptdependsGroup start=/^optdepends=(/ end=/)/ contains=pb_k_optdepends,pbValidOptdepends,shDoubleQuote,shSingleQuote
-
-" checkdepends
-syn keyword pb_k_ckdepends checkdepends contained
-syn match pbValidCkdepends /\([[:alnum:]]\|+\|-\|_\)*/ contained
-syn region pbCkdependsGroup start=/^checkdepends=(/ end=/)/ contains=pb_k_ckdepends,pbValidCkdepends,shDoubleQuote,shSingleQuote
-
-" 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 strange 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
-
-" changelog
-syn keyword pb_k_changelog changelog contained
-syn match pbValidChangelog /\([[:alnum:]]\|\$\|+\|-\|_\)*/ contained
-syn match pbIllegalChangelog /[^=]/ contained contains=pbValidChangelog
-syn match pbChangelogGroup /^changelog=.*/ contains=pb_k_changelog,pbValidChangelog,pbIllegalChangelog,shDeref,shDoubleQuote,shSingleQuote
-
-" source:
-" XXX remove source from shStatement, fix strange 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 /\x\{32\}/ contained
-syn region pbMd5sumsGroup start=/^md5sums/ end=/)/ contains=pb_k_md5sums,pbMd5Quotes,pbMd5Hash,pbIllegalMd5sums keepend
-syn match pbMd5Quotes /'.*'\|".*"/ contained contains=pbMd5Hash,pbIllegalMd5sums
-syn match pbMd5Hash /\x\+/ 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 /\x\{40\}/ contained
-syn region pbSha1sumsGroup start=/^sha1sums/ end=/)/ contains=pb_k_sha1sums,pbSha1Quotes,pbSha1Hash,pbIllegalSha1sums keepend
-syn match pbSha1Quotes /'.*'\|".*"/ contained contains=pbSha1Hash,pbIllegalSha1sums
-syn match pbSha1Hash /\x\+/ contained contains=pbValidSha1sums
-hi def link pbSha1Quotes Keyword
-hi def link pbSha1Hash Error
-hi def link pbValidSha1sums Number
-
-" sha256sums
-syn keyword pb_k_sha256sums sha256sums contained
-syn match pbIllegalSha256sums /[^='"()\/ ]/ contained contains=pbValidSha256sums
-syn match pbValidSha256sums /\x\{64\}/ contained
-syn region pbSha256sumsGroup start=/^sha256sums/ end=/)/ contains=pb_k_sha256sums,pbSha256Quotes,pbSha256Hash,pbIllegalSha256sums keepend
-syn match pbSha256Quotes /'.*'\|".*"/ contained contains=pbSha256Hash,pbIllegalSha256sums
-syn match pbSha256Hash /\x\+/ contained contains=pbValidSha256sums
-hi def link pbSha256Quotes Keyword
-hi def link pbSha256Hash Error
-hi def link pbValidSha256sums Number
-
-" sha384sums
-syn keyword pb_k_sha384sums sha384sums contained
-syn match pbIllegalSha384sums /[^='"()\/ ]/ contained contains=pbValidSha384sums
-syn match pbValidSha384sums /\x\{96\}/ contained
-syn region pbSha384sumsGroup start=/^sha384sums/ end=/)/ contains=pb_k_sha384sums,pbSha384Quotes,pbSha384Hash,pbIllegalSha384sums keepend
-syn match pbSha384Quotes /'.*'\|".*"/ contained contains=pbSha384Hash,pbIllegalSha384sums
-syn match pbSha384Hash /\x\+/ contained contains=pbValidSha384sums
-hi def link pbSha384Quotes Keyword
-hi def link pbSha384Hash Error
-hi def link pbValidSha384sums Number
-
-" sha512sums
-syn keyword pb_k_sha512sums sha512sums contained
-syn match pbIllegalSha512sums /[^='"()\/ ]/ contained contains=pbValidSha512sums
-syn match pbValidSha512sums /\x\{128\}/ contained
-syn region pbSha512sumsGroup start=/^sha512sums/ end=/)/ contains=pb_k_sha512sums,pbSha512Quotes,pbSha512Hash,pbIllegalSha512sums keepend
-syn match pbSha512Quotes /'.*'\|".*"/ contained contains=pbSha512Hash,pbIllegalSha512sums
-syn match pbSha512Hash /\x\+/ contained contains=pbValidSha512sums
-hi def link pbSha512Quotes Keyword
-hi def link pbSha512Hash Error
-hi def link pbValidSha512sums Number
-
-" options
-syn keyword pb_k_options options contained
-syn match pbOptions /\(no\)\?\(strip\|docs\|libtool\|emptydirs\|zipman\|purge\|distcc\|color\|ccache\|check\|sign\|makeflags\|buildflags\)/ contained
-syn match pbOptionsNeg /\!/ contained
-syn match pbOptionsDeprec /no/ contained
-syn region pbOptionsGroup start=/^options=(/ end=/)/ contains=pb_k_options,pbOptions,pbOptionsNeg,pbOptionsDeprec,pbIllegalOption
-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 pbIllegalPkgbase Error
-hi def link pb_k_pkgbase 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 pbIllegalEpoch Error
-hi def link pb_k_epoch 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_groups pbKeywords
-hi def link pb_k_makedepends pbKeywords
-hi def link pb_k_optdepends pbKeywords
-hi def link pb_k_ckdepends 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 pbIllegalChangelog Error
-hi def link pb_k_changelog 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_sha256sums pbKeywords
-hi def link pbIllegalSha256sums Error
-
-hi def link pb_k_sha384sums pbKeywords
-hi def link pbIllegalSha384sums Error
-
-hi def link pb_k_sha512sums pbKeywords
-hi def link pbIllegalSha512sums 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
deleted file mode 100644
index befd3c1d..00000000
--- a/contrib/README
+++ /dev/null
@@ -1,41 +0,0 @@
-Here is a brief description of the files included in this directory:
-
-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.
-
-bacman - regenerate a pacman package based on installed files and the pacman
-database entries. Useful for reuse, or possible config file extension.
-
-bash_completion - a bash completion script for pacman, install in
-/etc/bash_completion.d/ for use (but rename to something descriptive!).
-
-checkupdates - print a list of pending updates without touching the system
-sync databases (for safety on rolling release distributions).
-
-paccache - a flexible package cache cleaning utility that allows greater
-control over which packages are removed.
-
-pacdiff - a simple pacnew/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.
-
-paclog-pkglist - lists currently installs packages based pacman's log.
-
-pacscripts - tries to print out the {pre,post}_{install,remove,upgrade}
-scripts of a given package.
-
-pacsearch - a colorized search combining both -Ss and -Qs output. Installed
-packages are easily identified with a *** and local-only packages are also
-listed.
-
-rankmirrors - ranks pacman mirrors by their connection and opening speed.
-
-updpkgsums - performs an in place update of the checksums in a PKGBUILD.
-
-vimprojects - a project file for the vim project plugin.
-
-zsh_completion - a zsh completion script, install (with a rename) to
-/usr/share/zsh/site-functions/.
diff --git a/contrib/bacman.sh.in b/contrib/bacman.sh.in
deleted file mode 100644
index 39fbe99c..00000000
--- a/contrib/bacman.sh.in
+++ /dev/null
@@ -1,391 +0,0 @@
-#!/bin/bash
-#
-# bacman: recreate a package from a running system
-# This script rebuilds an already installed package using metadata
-# stored into the pacman database and system files
-#
-# Copyright (c) 2008 locci <carlocci_at_gmail_dot_com>
-# Copyright (c) 2008-2016 Pacman Development Team <pacman-dev@archlinux.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/>.
-#
-
-shopt -s extglob
-shopt -s nullglob
-
-declare -r myname='bacman'
-declare -r myver='@PACKAGE_VERSION@'
-USE_COLOR='y'
-INCLUDE_PACNEW='n'
-QUIET=0
-# Required for fakeroot because options are shifted off the array.
-ARGS=("$@")
-
-m4_include(../scripts/library/output_format.sh)
-m4_include(../scripts/library/parseopts.sh)
-
-# Lazy recursive clean up of temporary dirs
-work_dir_root="${TMPDIR:-/tmp}/bacman"
-clean_up() {
- rm -rf "$work_dir_root".*
- echo
- exit
-}
-# Trap termination signals
-trap clean_up SIGHUP SIGINT SIGTERM
-
-# Print usage information
-usage() {
- printf "%s (pacman) %s\n" "$myname" "$myver"
- echo
- printf -- "$(gettext "Recreate packages using pacman's database and system files")\n"
- echo
- printf -- "$(gettext "Usage: %s [options] <package(s)>")\n" "$0"
- echo
- printf -- "$(gettext "Options:")\n"
- printf -- "$(gettext " -h, --help Show this help message and exit")\n"
- printf -- "$(gettext " -q, --quiet Silence most of the status reporting")\n"
- printf -- "$(gettext " -m, --nocolor Disable colorized output messages")\n"
- printf -- "$(gettext " -o, --out <dir> Write output to specified directory (instead of \$PKGDEST)")\n"
- printf -- "$(gettext " --pacnew Package .pacnew files")\n"
- echo
- printf -- "$(gettext "Examples:")"
- printf -- " %s linux-headers\n" "$myname"
- printf -- " %s -o ~/packages libarchive\n" "$myname"
- printf -- " %s --nocolor --pacnew gzip make binutils\n" "$myname"
- printf -- " %s \$(pacman -Qq)\n" "$myname"
- echo
-}
-
-# Print version information
-version() {
- printf "%s %s\n" "$myname" "$myver"
- echo 'Copyright (C) 2008 locci <carlocci_at_gmail_dot_com>'
- echo 'Copyright (C) 2008-2016 Pacman Development Team <pacman-dev@archlinux.org>'
-}
-
-
-# Printing the usage information takes precedence over every other parameter
-for option in "$@"; do
- [[ $option == "-h" || $option == "--help" ]] && usage && exit 0
-done
-
-# Parse arguments
-OPT_SHORT='o:qmv'
-OPT_LONG=('out:' 'quiet' 'nocolor' 'pacnew' 'version')
-if ! parseopts "$OPT_SHORT" "${OPT_LONG[@]}" -- "$@"; then
- usage
- exit 1
-fi
-set -- "${OPTRET[@]}"
-unset OPT_SHORT OPT_LONG OPTRET
-
-while :; do
- case "$1" in
- -o|--out)
- pkg_dest=$2
- [[ ! -d "$2" ]] && echo -e "The directory \e[39;1m$2\e[0m does not exist!" && exit 3
- shift ;;
- -q|--quiet)
- QUIET=1 ;;
- -m|--nocolor)
- USE_COLOR='n' ;;
- --pacnew)
- INCLUDE_PACNEW='y' ;;
- -v|--version)
- version
- exit 0 ;;
- --)
- shift
- break 2 ;;
- esac
- shift
-done
-
-# Configure colored output
-m4_include(../scripts/library/term_colors.sh)
-
-# Retrieve the list of packages to be assembled and break if none was specified
-pkg_list=($*)
-if [[ ${#pkg_list[@]} == 0 ]]; then
- usage
- exit 1
-fi
-
-# Run with fake root privileges if EUID is not root
-if (( EUID )); then
- if [[ -f /usr/bin/fakeroot ]]; then
- msg "Entering fakeroot environment"
- export INFAKEROOT="1"
- /usr/bin/fakeroot -u -- "$0" "${ARGS[@]}"
- exit $?
- else
- warning "installing fakeroot or running $myname as root is required to"
- plain " preserve the ownership permissions of files in some packages\n"
- fi
-fi
-
-# Source environmental variables and specify fallbacks
-if [[ ! -r @sysconfdir@/pacman.conf ]]; then
- error "unable to read @sysconfdir@/pacman.conf"
- exit 1
-fi
-eval $(awk '/DBPath/ {print $1$2$3}' @sysconfdir@/pacman.conf)
-pac_db="${DBPath:-@localstatedir@/lib/pacman/}/local"
-if [[ ! -r @sysconfdir@/makepkg.conf ]]; then
- error "unable to read @sysconfdir@/makepkg.conf"
- exit 1
-fi
-source "@sysconfdir@/makepkg.conf"
-if [[ -r ~/.makepkg.conf ]]; then
- source ~/.makepkg.conf
-fi
-PKGDEST="${PKGDEST:-$PWD}"
-pkg_dest="${pkg_dest:-$PKGDEST}"
-pkg_pkger="${PACKAGER:-'Unknown Packager'}"
-
-# Check for an existing database
-if [[ ! -d $pac_db ]]; then
- error "pacman database directory ${pac_db} not found"
- exit 1
-fi
-
-# Assemble a single package: $1 = pkgname
-fakebuild() {
- pkg_name="$1"
- pkg_dir=("$pac_db/$pkg_name"-+([^-])-+([^-]))
- pkg_namver=("${pkg_dir[@]##*/}")
-
- # Checks database for specified package
- if (( ${#pkg_dir[@]} != 1 )); then
- error "%d entries for package %s found in pacman database" \
- ${#pkg_dir[@]} "${pkg_name}"
- msg2 "%s" "${pkg_dir[@]}"
- exit 1
- fi
- if [[ ! -d $pkg_dir ]]; then
- error "package %s is found in pacman database," "${pkg_name}"
- plain " but '%s' is not a directory" "${pkg_dir}"
- exit 1
- fi
-
- # Create working directory
- msg "Package: ${pkg_namver}"
- work_dir=$(mktemp -d "${work_dir_root}.XXXXXXXXXX")
- cd "$work_dir" || exit 1
-
- # Assemble list of files which belong to the package and tar them
- msg2 "Copying package files..."
-
- while read i; do
- if [[ -z $i ]]; then
- continue
- fi
-
- if [[ $i == %+([A-Z])% ]]; then
- current=$i
- continue
- fi
-
- case "$current" in
- %FILES%)
- local_file="/$i"
- package_file="$work_dir/$i"
-
- if [[ ! -e $local_file ]]; then
- warning "package file $local_file is missing"
- continue
- fi
- ;;
-
- %BACKUP%)
- # Get the MD5 checksum.
- original_md5="${i##*$'\t'}"
- # Strip the md5sum after the tab.
- i="${i%$'\t'*}"
- local_file="/$i.pacnew"
- package_file="$work_dir/$i"
-
- # Include unmodified .pacnew files.
- local_md5="$(md5sum "$local_file" | cut -d' ' -f1)"
- if [[ $INCLUDE_PACNEW == 'n' ]] \
- || [[ ! -e $local_file ]] \
- || [[ $local_md5 != $original_md5 ]]; then
- # Warn about modified files.
- local_md5="$(md5sum "/$i" | cut -d' ' -f1)"
- if [[ $local_md5 != $original_md5 ]]; then
- warning "package file /$i has been modified"
- fi
- # Let the normal file be included in the %FILES% list.
- continue
- fi
- ;;
-
- *)
- continue
- ;;
- esac
-
- # Tar files
- ret=0
- bsdtar -cnf - -s'/.pacnew$//' "$local_file" 2> /dev/null | bsdtar -xpf - 2> /dev/null
- # Workaround to bsdtar not reporting a missing file as an error
- if ! [[ -e $package_file || -L $package_file ]]; then
- error "unable to add $local_file to the package"
- plain " If your user does not have permission to read this file, then"
- plain " you will need to run $myname as root."
- rm -rf "$work_dir"
- exit 1
- fi
- done < "$pkg_dir"/files
-
- ret=$?
- if (( ret )); then
- rm -rf "$work_dir"
- exit 1
- fi
-
- # Calculate package size
- pkg_size=$(du -sk | awk '{print $1 * 1024}')
-
- # Reconstruct .PKGINFO from database
- # TODO adopt makepkg's write_pkginfo() into this or scripts/library
- msg2 "Generating .PKGINFO metadata..."
- echo "# Generated by $myname $myver" > .PKGINFO
- if [[ $INFAKEROOT == "1" ]]; then
- echo "# Using $(fakeroot -v)" >> .PKGINFO
- fi
- echo "# $(LC_ALL=C date)" >> .PKGINFO
- echo "#" >> .PKGINFO
- while read i; do
- if [[ -z $i ]]; then
- continue;
- fi
- if [[ $i == %+([A-Z])% ]]; then
- current=$i
- continue
- fi
-
- case "$current" in
- # desc
- %NAME%)
- echo "pkgname = $i" >> .PKGINFO
- ;;
- %VERSION%)
- echo "pkgver = $i" >> .PKGINFO
- ;;
- %DESC%)
- echo "pkgdesc = $i" >> .PKGINFO
- ;;
- %URL%)
- echo "url = $i" >> .PKGINFO
- ;;
- %LICENSE%)
- echo "license = $i" >> .PKGINFO
- ;;
- %ARCH%)
- echo "arch = $i" >> .PKGINFO
- pkg_arch="$i"
- ;;
- %BUILDDATE%)
- echo "builddate = $(date -u "+%s")" >> .PKGINFO
- ;;
- %PACKAGER%)
- echo "packager = $pkg_pkger" >> .PKGINFO
- ;;
- %SIZE%)
- echo "size = $pkg_size" >> .PKGINFO
- ;;
- %GROUPS%)
- echo "group = $i" >> .PKGINFO
- ;;
- %REPLACES%)
- echo "replaces = $i" >> .PKGINFO
- ;;
- %DEPENDS%)
- echo "depend = $i" >> .PKGINFO
- ;;
- %OPTDEPENDS%)
- echo "optdepend = $i" >> .PKGINFO
- ;;
- %CONFLICTS%)
- echo "conflict = $i" >> .PKGINFO
- ;;
- %PROVIDES%)
- echo "provides = $i" >> .PKGINFO
- ;;
- %BACKUP%)
- # Strip the md5sum after the tab
- echo "backup = ${i%%$'\t'*}" >> .PKGINFO
- ;;
- esac
- done < <(cat "$pkg_dir"/{desc,files})
-
- comp_files=".PKGINFO"
-
- # Add instal file if present
- if [[ -f $pkg_dir/install ]]; then
- cp "$pkg_dir/install" "$work_dir/.INSTALL"
- comp_files+=" .INSTALL"
- fi
- if [[ -f $pkg_dir/changelog ]]; then
- cp "$pkg_dir/changelog" "$work_dir/.CHANGELOG"
- comp_files+=" .CHANGELOG"
- fi
-
- # Fixes owner:group and permissions for .PKGINFO, .CHANGELOG, .INSTALL
- chown root:root "$work_dir"/{.PKGINFO,.CHANGELOG,.INSTALL} 2> /dev/null
- chmod 644 "$work_dir"/{.PKGINFO,.CHANGELOG,.INSTALL} 2> /dev/null
-
- # Generate the package
- msg2 "Generating the package..."
-
- pkg_file="$pkg_dest/$pkg_namver-$pkg_arch${PKGEXT}"
- ret=0
-
- # Move compressed package to destination
- # TODO: Maybe this can be set globally for robustness
- shopt -s -o pipefail
- bsdtar -cf - $comp_files * |
- case "$PKGEXT" in
- *tar.gz) gzip -c -f -n ;;
- *tar.bz2) bzip2 -c -f ;;
- *tar.xz) xz -c -z - ;;
- *tar.Z) compress -c -f ;;
- *tar) cat ;;
- *) warning "'%s' is not a valid archive extension." \
- "$PKGEXT"; cat ;;
- esac > "${pkg_file}"; ret=$?
-
- # Evaluate return code
- if (( ret )); then
- error "Unable to write package to $pkg_dest"
- plain " Maybe the disk is full or you do not have write access"
- rm -rf "$work_dir"
- exit 1
- fi
-
- # Clean up working directory
- rm -rf "$work_dir"
-}
-
-
-for PKG in ${pkg_list[@]}; do
- fakebuild $PKG
-done
-msg "Done."
-
-exit 0
-
-# vim: set noet:
diff --git a/contrib/bash_completion.in b/contrib/bash_completion.in
deleted file mode 100644
index 06963c42..00000000
--- a/contrib/bash_completion.in
+++ /dev/null
@@ -1,156 +0,0 @@
-# This file is in the public domain.
-
-_arch_compgen() {
- local i r
- COMPREPLY=($(compgen -W '$*' -- "$cur"))
- for ((i=1; i < ${#COMP_WORDS[@]}-1; i++)); do
- for r in ${!COMPREPLY[@]}; do
- if [[ ${COMP_WORDS[i]} = ${COMPREPLY[r]} ]]; then
- unset 'COMPREPLY[r]'; break
- fi
- done
- done
-}
-
-_arch_ptr2comp() {
- local list= x y
- for x; do
- for y in '0 --' '1 -'; do
- eval 'set -- ${'$x'[${y% *}]}'
- list+=\ ${@/#/${y#* }}
- done
- done
- _arch_compgen $list
-}
-
-_arch_incomp() {
- local r="\s-(-${1#* }\s|\w*${1% *})"; [[ $COMP_LINE =~ $r ]]
-}
-
-_pacman_keyids() {
- \pacman-key --list-keys 2>/dev/null | awk '
- $1 == "pub" {
- # key id
- split($2, a, "/"); print a[2]
- }
- $1 == "uid" {
- # email
- if (match($NF, /<[^>]+>/))
- print substr($NF, RSTART + 1, RLENGTH - 2)
- }'
-}
-
-_pacman_key() {
- local o cur opts prev wantfiles
- COMPREPLY=()
- _get_comp_words_by_ref cur prev
- opts=('add config delete edit-key export finger gpgdir
- help import import-trustdb init keyserver list-keys list-sigs
- lsign-key nocolor populate recv-keys refresh-keys updatedb
- verify version'
- 'a d e f h l r u v V')
-
- # operations for which we want to complete keyids
- for o in 'd delete' 'e export' 'f finger' 'l list-keys' 'r recv-keys' \
- 'edit-key' 'list-sigs' 'lsign-key' 'refresh-keys'; do
- _arch_incomp "$o" && break
- unset o
- done
-
- # options for which we want file completion
- wantfiles='-@(c|-config|g|-gpgdir)'
-
- if [[ $prev = 'pacman-key' || ( $cur = -* && $prev != $wantfiles ) ]]; then
- _arch_ptr2comp opts
- elif [[ $prev = @(-k|--keyserver) ]]; then
- return
- elif [[ $prev != $wantfiles && $o ]]; then
- COMPREPLY=($(compgen -W '$(_pacman_keyids)' -- "$cur"))
- fi
- true
-}
-
-_makepkg() {
- local cur opts prev
- COMPREPLY=()
- _get_comp_words_by_ref cur prev
- if [[ $cur = -* && ! $prev =~ ^-(-(config|help|key|version)$|\w*[Vhp]) ]]; then
- opts=('allsource asdeps check clean cleanbuild config force geninteg help
- holdver ignorearch install key log needed noarchive nobuild nocheck
- nocolor noconfirm nodeps noextract noprepare noprogressbar nosign
- packagelist printsrcinfo repackage rmdeps sign skipchecksums
- skipinteg skippgpcheck source syncdeps verifysource version'
- 'A C L R S c d e f g h i m o p r s')
- _arch_ptr2comp opts
- fi
- true
-}
-
-_pacman_pkg() {
- _arch_compgen "$(
- if [[ $2 ]]; then
- \pacman -$1 2>/dev/null | \cut -d' ' -f1 | \sort -u
- else
- \pacman -$1 2>/dev/null
- fi
- )"
-}
-
-_pacman() {
- local common core cur database files prev query remove sync upgrade o
- COMPREPLY=()
- _get_comp_words_by_ref cur prev
- database=('asdeps asexplicit')
- files=('list machinereadable owns search refresh regex' 'l o s x y')
- query=('changelog check deps explicit file foreign groups info list owns
- search unrequired upgrades' 'c e g i k l m o p s t u')
- remove=('cascade dbonly nodeps assume-installed nosave print recursive unneeded' 'c n p s u')
- sync=('asdeps asexplicit clean dbonly downloadonly force groups ignore ignoregroup
- info list needed nodeps assume-installed print refresh recursive search sysupgrade'
- 'c g i l p s u w y')
- upgrade=('asdeps asexplicit force needed nodeps assume-installed print recursive' 'p')
- common=('arch cachedir color config confirm dbpath debug gpgdir help hookdir logfile
- noconfirm noprogressbar noscriptlet quiet root verbose' 'b d h q r v')
- core=('database files help query remove sync upgrade version' 'D F Q R S U V h')
-
- for o in 'D database' 'F files' 'Q query' 'R remove' 'S sync' 'U upgrade'; do
- _arch_incomp "$o" && break
- done
-
- if [[ $? != 0 ]]; then
- _arch_ptr2comp core
- elif [[ ! $prev =~ ^-\w*[Vbhr] &&
- ! $prev = --@(cachedir|color|config|dbpath|help|hookdir|gpgdir|logfile|root|version) ]]
- then
- [[ $cur = -* ]] && _arch_ptr2comp ${o#* } common ||
- case ${o% *} in
- D|R)
- _pacman_pkg Qq;;
- F)
- _arch_incomp 'l list' && _pacman_pkg Slq;
- ;;
- Q)
- { _arch_incomp 'g groups' && _pacman_pkg Qg sort; } ||
- { _arch_incomp 'p file' && _pacman_file; } ||
- _arch_incomp 'o owns' || _arch_incomp 'u upgrades' ||
- _pacman_pkg Qq;;
- S)
- { _arch_incomp 'g groups' && _pacman_pkg Sg; } ||
- { _arch_incomp 'l list' && _pacman_pkg Sl sort; } ||
- _pacman_pkg Slq;;
- U)
- _pacman_file;;
- esac
- fi
- true
-}
-
-_pacman_file() {
- compopt -o filenames; _filedir 'pkg.tar*'
-}
-
-complete -F _pacman -o default pacman
-complete -F _makepkg -o default makepkg
-complete -F _pacman_key -o default pacman-key
-
-# ex:et ts=2 sw=2 ft=sh
diff --git a/contrib/checkupdates.sh.in b/contrib/checkupdates.sh.in
deleted file mode 100644
index ff62891b..00000000
--- a/contrib/checkupdates.sh.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/bin/bash
-#
-# checkupdates: Safely print a list of pending updates.
-#
-# Copyright (c) 2013 Kyle Keen <keenerd@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/>.
-#
-
-declare -r myname='checkupdates'
-declare -r myver='@PACKAGE_VERSION@'
-
-m4_include(../scripts/library/output_format.sh)
-m4_include(../scripts/library/term_colors.sh)
-
-if (( $# > 0 )); then
- echo "${myname} (pacman) v${myver}"
- echo
- echo "Safely print a list of pending updates"
- echo
- echo "Usage: ${myname}"
- echo
- echo 'Note: Export the "CHECKUPDATES_DB" variable to change the path of the temporary database.'
- exit 0
-fi
-
-if ! type -P fakeroot >/dev/null; then
- error 'Cannot find the fakeroot binary.'
- exit 1
-fi
-
-if [[ -z $CHECKUPDATES_DB ]]; then
- CHECKUPDATES_DB="${TMPDIR:-/tmp}/checkup-db-${USER}/"
-fi
-
-trap 'rm -f $CHECKUPDATES_DB/db.lck' INT TERM EXIT
-
-DBPath="${DBPath:-@localstatedir@/lib/pacman/}"
-eval $(awk -F' *= *' '$1 ~ /DBPath/ { print $1 "=" $2 }' @sysconfdir@/pacman.conf)
-
-mkdir -p "$CHECKUPDATES_DB"
-ln -s "${DBPath}/local" "$CHECKUPDATES_DB" &> /dev/null
-fakeroot -- pacman -Sy --dbpath "$CHECKUPDATES_DB" --logfile /dev/null &> /dev/null
-pacman -Qu --dbpath "$CHECKUPDATES_DB" 2> /dev/null | grep -v '\[.*\]'
-
-exit 0
-
-# vim: set noet:
diff --git a/contrib/doc/.gitignore b/contrib/doc/.gitignore
deleted file mode 100644
index 3ab20353..00000000
--- a/contrib/doc/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-verify-pacman-repo-db.1
-bacman.8
diff --git a/contrib/doc/Makefile.am b/contrib/doc/Makefile.am
deleted file mode 100644
index d5725b1e..00000000
--- a/contrib/doc/Makefile.am
+++ /dev/null
@@ -1,60 +0,0 @@
-# We have to do some funny stuff here with the manpages. In order to ensure
-# a dist tarball doesn't get put out there without manpages, we keep those
-# files listed in EXTRA_DIST no matter what. However, we only add them to
-# man_MANS if --enable-asciidoc and/or --enable-doxygen are used.
-
-ASCIIDOC_MANS = \
- verify-pacman-repo-db.1 \
- bacman.8
-
-EXTRA_DIST = \
- asciidoc.conf \
- footer.txt \
- verify-pacman-repo-db.1.txt \
- bacman.8.txt \
- $(ASCIIDOC_MANS)
-
-# Files that should be removed, but which Automake does not know.
-MOSTLYCLEANFILES = *.xml $(ASCIIDOC_MANS)
-
-# Ensure manpages are fresh when building a dist tarball
-dist-hook:
- $(MAKE) $(AM_MAKEFLAGS) clean
- $(MAKE) $(AM_MAKEFLAGS) all
-
-if USE_GIT_VERSION
-GIT_VERSION := $(shell sh -c 'git describe --abbrev=4 --dirty | sed s/^v//')
-REAL_PACKAGE_VERSION = $(GIT_VERSION)
-else
-REAL_PACKAGE_VERSION = $(PACKAGE_VERSION)
-endif
-
-man_MANS =
-dist_man_MANS = $(ASCIIDOC_MANS)
-
-pkgdatadir = ${datadir}/${PACKAGE}
-
-ASCIIDOC_OPTS = \
- -f $(srcdir)/asciidoc.conf \
- -a pacman_version="$(REAL_PACKAGE_VERSION)" \
- -a pacman_date="`date +%Y-%m-%d`" \
- -a pkgdatadir=$(pkgdatadir) \
- -a localstatedir=$(localstatedir) \
- -a sysconfdir=$(sysconfdir) \
- -a datarootdir=$(datarootdir)
-
-A2X_OPTS = \
- --no-xmllint \
- -d manpage \
- -f manpage \
- --xsltproc-opts='-param man.endnotes.list.enabled 0 -param man.endnotes.are.numbered 0'
-
-# These rules are due to the includes and files of the asciidoc text
-$(ASCIIDOC_MANS): asciidoc.conf footer.txt Makefile.am
- $(AM_V_GEN)a2x $(A2X_OPTS) --asciidoc-opts="$(ASCIIDOC_OPTS) --out-file=./$@" $(srcdir)/$@.txt
-
-# Dependency rules
-verify-pacman-repo-db.1: verify-pacman-repo-db.1.txt
-bacman.8: bacman.8.txt
-
-# vim:set noet:
diff --git a/contrib/doc/asciidoc.conf b/contrib/doc/asciidoc.conf
deleted file mode 120000
index ff9653d3..00000000
--- a/contrib/doc/asciidoc.conf
+++ /dev/null
@@ -1 +0,0 @@
-../../doc/asciidoc.conf \ No newline at end of file
diff --git a/contrib/doc/bacman.8.txt b/contrib/doc/bacman.8.txt
deleted file mode 100644
index dc5af481..00000000
--- a/contrib/doc/bacman.8.txt
+++ /dev/null
@@ -1,67 +0,0 @@
-/////
-vim:set ts=4 sw=4 syntax=asciidoc noet spell spelllang=en_us:
-/////
-bacman(8)
-==========
-
-Name
-----
-bacman - recreate installed packages
-
-
-Synopsis
---------
-'bacman' [options] <package(s)>
-
-
-Description
------------
-'bacman' was designed to reassemble installed packages using pacman's database
-and system files.
-It is useful for regenerating an installed package that you are unable to
-download that is also not available in your package cache.
-
-'bacman' honors packaging settings from linkman:makepkg.conf[8].
-
-
-Options
--------
-*-h, \--help*::
- Display usage information.
-
-*-q, \--quiet*::
- Silence most of the status reporting.
-
-*-m, \--nocolor*::
- Disable colored output.
-
-*-o, \--out <dir>*::
- Write the assembled package(s) to the specified directory.
-
-*\--pacnew*::
- Package `.pacnew` files if available instead of the (possibly modified)
- versions in place on the filesystem.
-
-
-Examples
---------
-
-The following are example usages of the 'bacman' utility:
-
-$ bacman linux-headers::
- Recreate the package ``linux-headers''.
-
-$ bacman gzip make binutils -o ~/packages::
- Assemble the packages ``gzip'', ``make'', and ``binutils'' and place
- the packages in the ``~/packages'' directory.
-
-$ bacman --nocolor --pacnew -o ~/backup $(pacman -Qq)::
- Assemble all currently installed packages using ``.pacnew'' whenever
- available, suppress colored output and place the desired packages in
- the ``~/backup''. directory
-
-See Also
---------
-linkman:makepkg[8], linkman:pacman[8]
-
-include::footer.txt[]
diff --git a/contrib/doc/footer.txt b/contrib/doc/footer.txt
deleted file mode 120000
index 9dd4bae1..00000000
--- a/contrib/doc/footer.txt
+++ /dev/null
@@ -1 +0,0 @@
-../../doc/footer.txt \ No newline at end of file
diff --git a/contrib/doc/verify-pacman-repo-db.1.txt b/contrib/doc/verify-pacman-repo-db.1.txt
deleted file mode 100644
index 62564b8f..00000000
--- a/contrib/doc/verify-pacman-repo-db.1.txt
+++ /dev/null
@@ -1,60 +0,0 @@
-/////
-vim:set ts=4 sw=4 syntax=asciidoc noet spell spelllang=en_us:
-/////
-verify-pacman-repo-db(1)
-========================
-
-Name
-----
-verify-pacman-repo-db - package repository verification utility
-
-
-Synopsis
---------
-'verify-pacman-repo-db' [options]
-
-
-Description
------------
-'verify-pacman-repo-db' looks at a pacman repo database and verifies its
-content with the actual package files. The database is expected to be in
-the same directory as the packages (or symlinks to the packages).
-
-The following properties are verified for each package in the database:
-
- - existence of the package file
- - file size
- - MD5 and SHA256 checksum (--checksum)
-
-Options
--------
-*-h, \--help*::
- Output a short help message.
-
-*\--debug*::
- Enable debug output.
-
-*-c, \--checksum*::
- Verify checksums of packages. Note that this means all packages files will
- be read from disk. Otherwise only metadata is compared which does not
- require to read package file contents.
-
-*-t, \--threads* <number>::
- Use 'number' threads to verify packages. Note that each thread may use up
- to approximately 128MiB of memory. Default: 1
-
-Notes
------
-
-This script does intentionally not use any ALPM libraries. The format is simple
-enough to be parsed and this way we might just detect more problems because the
-libalpm parsing code might also have bugs. We also stay much more portable
-which might be good for people that want to check a db, but don't actually have
-pacman installed.
-
-
-See Also
---------
-linkman:repo-add[8]
-
-include::footer.txt[]
diff --git a/contrib/paccache.sh.in b/contrib/paccache.sh.in
deleted file mode 100644
index 02fae527..00000000
--- a/contrib/paccache.sh.in
+++ /dev/null
@@ -1,366 +0,0 @@
-#!/bin/bash
-#
-# pacache - flexible pacman cache cleaning
-#
-# Copyright (C) 2011 Dave Reisner <dreisner@archlinux.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/>.
-
-
-shopt -s extglob
-
-declare -r myname='paccache'
-declare -r myver='@PACKAGE_VERSION@'
-
-declare -a cachedirs=() candidates=() cmdopts=() whitelist=() blacklist=()
-declare -i delete=0 dryrun=0 filecount=0 move=0 needsroot=0 totalsaved=0 verbose=0
-declare delim=$'\n' keep=3 movedir= scanarch=
-
-QUIET=0
-USE_COLOR='y'
-
-m4_include(../scripts/library/output_format.sh)
-m4_include(../scripts/library/parseopts.sh)
-
-die() {
- error "$@"
- exit 1
-}
-
-get_cachedir_from_config() {
- local key value
-
- while IFS=$'= \t' read -r key value _; do
- if [[ $key = CacheDir ]]; then
- echo "$value"
- return 0
- fi
- done <"$1"
-
- return 1
-}
-
-# reads a list of files on stdin and prints out deletion candidates
-pkgfilter() {
- # there's whitelist and blacklist parameters passed to this
- # script after the block of awk.
-
- awk -v keep="$1" -v scanarch="$2" '
- function basename(str) {
- sub(".*/", "", str);
- return str;
- }
-
- function parse_filename(filename, parts, count, i, pkgname, arch) {
-
- count = split(basename(filename), parts, "-")
-
- i = 1
- pkgname = parts[i++]
- while (i <= count - 3) {
- pkgname = pkgname "-" parts[i++]
- }
-
- arch = substr(parts[count], 1, index(parts[count], ".") - 1)
-
- # filter on whitelist or blacklist
- if (wlen && !whitelist[pkgname]) return
- if (blen && blacklist[pkgname]) return
-
- if ("" == packages[pkgname,arch]) {
- packages[pkgname,arch] = filename
- } else {
- packages[pkgname,arch] = packages[pkgname,arch] SUBSEP filename
- }
- }
-
- BEGIN {
- # create whitelist
- wlen = ARGV[1]; delete ARGV[1]
- for (i = 2; i < 2 + wlen; i++) {
- whitelist[ARGV[i]] = 1
- delete ARGV[i]
- }
-
- # create blacklist
- blen = ARGV[i]; delete ARGV[i]
- while (i++ < ARGC) {
- blacklist[ARGV[i]] = 1
- delete ARGV[i]
- }
-
- # read package filenames
- while (getline < "/dev/stdin") {
- parse_filename($0)
- }
-
- for (pkglist in packages) {
- # idx[1,2] = idx[pkgname,arch]
- split(pkglist, idx, SUBSEP)
-
- # enforce architecture match if specified
- if (!scanarch || scanarch == idx[2]) {
- count = split(packages[idx[1], idx[2]], pkgs, SUBSEP)
- for(i = 1; i <= count - keep; i++) {
- print pkgs[i]
- }
- }
- }
- }' "${@:3}"
-}
-
-m4_include(../scripts/library/size_to_human.sh)
-
-runcmd() {
- if (( needsroot && EUID != 0 )); then
- msg "Privilege escalation required"
- if sudo -v &>/dev/null && sudo -l &>/dev/null; then
- sudo "$@"
- else
- die 'Unable to escalate privileges using sudo'
- fi
- else
- "$@"
- fi
-}
-
-summarize() {
- (( QUIET )) && return
-
- local -i filecount=$1; shift
- local seenarch= seen= arch= name=
- local -r pkg_re='(.+)-[^-]+-[0-9]+-([^.]+)\.pkg.*'
-
- if (( delete )); then
- printf -v output 'finished: %d packages removed' "$filecount"
- elif (( move )); then
- printf -v output "finished: %d packages moved to '%s'" "$filecount" "$movedir"
- elif (( dryrun )); then
- if (( verbose )); then
- msg "Candidate packages:"
- while read -r pkg; do
- if (( verbose >= 3 )); then
- [[ $pkg =~ $pkg_re ]] && name=${BASH_REMATCH[1]} arch=${BASH_REMATCH[2]}
- if [[ -z $seen || $seenarch != "$arch" || $seen != "$name" ]]; then
- seen=$name seenarch=$arch
- printf '%s (%s):\n' "${name##*/}" "$arch"
- fi
- printf ' %s\n' "${pkg##*/}"
- elif (( verbose >= 2 )); then
- printf "%s$delim" "$pkg"
- else
- printf "%s$delim" "${pkg##*/}"
- fi
- done < <(printf '%s\n' "$@" | pacsort --files)
- fi
- printf -v output 'finished dry run: %d candidates' "$filecount"
- fi
-
- echo
- msg "$output (disk space saved: %s)" "$(size_to_human "$totalsaved")"
-}
-
-usage() {
- cat <<EOF
-${myname} (pacman) v${myver}
-
-A flexible pacman cache cleaning utility.
-
-Usage: ${myname} <operation> [options] [targets...]
-
- Operations:
- -d, --dryrun perform a dry run, only finding candidate packages.
- -m, --move <dir> move candidate packages to "dir".
- -r, --remove remove candidate packages.
-
- Options:
- -a, --arch <arch> scan for "arch" (default: all architectures).
- -c, --cachedir <dir> scan "dir" for packages. can be used more than once.
- (default: read from @sysconfdir@/pacman.conf).
- -f, --force apply force to mv(1) and rm(1) operations.
- -h, --help display this help message and exit.
- -i, --ignore <pkgs> ignore "pkgs", comma-separated. Alternatively, specify
- "-" to read package names from stdin, newline-
- delimited.
- -k, --keep <num> keep "num" of each package in the cache (default: 3).
- --nocolor remove color from output.
- -q, --quiet minimize output
- -u, --uninstalled target uninstalled packages.
- -v, --verbose increase verbosity. specify up to 3 times.
- -z, --null use null delimiters for candidate names (only with -v
- and -vv).
-
-EOF
-}
-
-version() {
- printf "%s %s\n" "$myname" "$myver"
- echo 'Copyright (C) 2011 Dave Reisner <dreisner@archlinux.org>'
-}
-
-OPT_SHORT=':a:c:dfhi:k:m:qrsuVvz'
-OPT_LONG=('arch:' 'cachedir:' 'dryrun' 'force' 'help' 'ignore:' 'keep:' 'move'
- 'nocolor' 'quiet' 'remove' 'uninstalled' 'version' 'verbose' 'null')
-
-if ! parseopts "$OPT_SHORT" "${OPT_LONG[@]}" -- "$@"; then
- exit 1
-fi
-set -- "${OPTRET[@]}"
-unset OPT_SHORT OPT_LONG OPTRET
-
-while :; do
- case $1 in
- -a|--arch)
- scanarch=$2
- shift ;;
- -c|--cachedir)
- cachedirs+=("$2")
- shift ;;
- -d|--dryrun)
- dryrun=1 ;;
- -f|--force)
- cmdopts=(-f) ;;
- -h|--help)
- usage
- exit 0 ;;
- -i|--ignore)
- if [[ $2 = '-' ]]; then
- [[ ! -t 0 ]] && IFS=$'\n' read -r -d '' -a ign
- else
- IFS=',' read -r -a ign <<< "$2"
- fi
- blacklist+=("${ign[@]}")
- unset i ign
- shift ;;
- -k|--keep)
- keep=$2
- if [[ -z $keep || -n ${keep//[0-9]/} ]]; then
- die 'argument to option -k must be a non-negative integer'
- else
- keep=$(( 10#$keep ))
- fi
- shift ;;
- -m|--move)
- move=1 movedir=$2
- shift ;;
- --nocolor)
- USE_COLOR='n' ;;
- -q|--quiet)
- QUIET=1 ;;
- -r|--remove)
- delete=1 ;;
- -u|--uninstalled)
- IFS=$'\n' read -r -d '' -a ign < <(pacman -Qq)
- # pacman -Qq may exit with an error, thus making ign an empty array
- (( ${#ign[@]} )) || die 'failed to retrieve the list of installed packages'
- blacklist+=("${ign[@]}")
- unset ign ;;
- -V|--version)
- version
- exit 0 ;;
- -v|--verbose)
- (( ++verbose )) ;;
- -z|--null)
- delim='\0' ;;
- --)
- shift
- break 2 ;;
- esac
- shift
-done
-
-m4_include(../scripts/library/term_colors.sh)
-
-# setting default cachedir
-if [[ -z $cachedirs ]]; then
- if cachedir=$(get_cachedir_from_config "@sysconfdir@/pacman.conf"); then
- cachedirs=("$cachedir")
- else
- cachedirs=("${cachedirs[@]:-@localstatedir@/cache/pacman/pkg}")
- fi
-fi
-
-# remaining args are a whitelist
-whitelist=("$@")
-
-# sanity checks
-case $(( dryrun+delete+move )) in
- 0) die "no operation specified (use -h for help)" ;;
- [^1]) die "only one operation may be used at a time" ;;
-esac
-
-[[ $movedir && ! -d $movedir ]] &&
- die "destination directory '%s' does not exist or is not a directory" "$movedir"
-
-if (( move || delete )); then
- # make it an absolute path since we're about to chdir
- [[ $movedir && ${movedir:0:1} != '/' ]] && movedir=$PWD/$movedir
- [[ $movedir && ! -w $movedir ]] && needsroot=1
-fi
-
-for cachedir in "${cachedirs[@]}"; do
- [[ -d $cachedir ]] ||
- die "cachedir '%s' does not exist or is not a directory" "$cachedir"
-
- if (( move || delete )); then
- [[ ! -w $cachedir ]] && needsroot=1
- fi
-
- # unlikely that this will fail, but better make sure
- pushd "$cachedir" &>/dev/null || die "failed to chdir to '%s'" "$cachedir"
-
- # note that these results are returned in an arbitrary order from awk, but
- # they'll be resorted (in summarize) iff we have a verbosity level set.
- IFS=$'\n' read -r -d '' -a cand < \
- <(printf '%s\n' "$PWD"/*.pkg.tar?(.+([^.])) | pacsort --files |
- pkgfilter "$keep" "$scanarch" \
- "${#whitelist[*]}" "${whitelist[@]}" \
- "${#blacklist[*]}" "${blacklist[@]}")
-
- candidates+=("${cand[@]}")
- unset cand
-
- popd &>/dev/null
-done
-
-if (( ! ${#candidates[*]} )); then
- msg 'no candidate packages found for pruning'
- exit 0
-fi
-
-# grab this prior to signature scavenging
-pkgcount=${#candidates[*]}
-
-# copy the list, merging in any found sigs
-for cand in "${candidates[@]}"; do
- candtemp+=("$cand")
- [[ -f $cand.sig ]] && candtemp+=("$cand.sig")
-done
-candidates=("${candtemp[@]}")
-unset candtemp
-
-# do this before we destroy anything
-totalsaved=$(@SIZECMD@ "${candidates[@]}" | awk '{ sum += $1 } END { print sum }')
-
-# crush. kill. destroy.
-(( verbose )) && cmdopts+=(-v)
-if (( delete )); then
- printf '%s\0' "${candidates[@]}" | runcmd xargs -0 rm "${cmdopts[@]}"
-elif (( move )); then
- printf '%s\0' "${candidates[@]}" | runcmd xargs -0 mv "${cmdopts[@]}" -t "$movedir"
-fi
-
-summarize "$pkgcount" "${candidates[@]}"
-
-# vim: set noet:
diff --git a/contrib/pacdiff.sh.in b/contrib/pacdiff.sh.in
deleted file mode 100644
index dff2115a..00000000
--- a/contrib/pacdiff.sh.in
+++ /dev/null
@@ -1,194 +0,0 @@
-#!/bin/bash
-# pacdiff : a simple pacnew/pacsave updater
-#
-# Copyright (c) 2007 Aaron Griffin <aaronmgriffin@gmail.com>
-# Copyright (c) 2013-2016 Pacman Development Team <pacman-dev@archlinux.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/>.
-#
-
-shopt -s extglob
-
-declare -r myname='pacdiff'
-declare -r myver='@PACKAGE_VERSION@'
-
-diffprog=${DIFFPROG:-'vim -d'}
-diffsearchpath=${DIFFSEARCHPATH:-/etc}
-USE_COLOR='y'
-declare -a oldsaves
-declare -i USE_FIND=0 USE_LOCATE=0 USE_PACDB=0 OUTPUTONLY=0
-
-m4_include(../scripts/library/output_format.sh)
-
-usage() {
- cat <<EOF
-${myname} (pacman) v${myver}
-
-A simple program to merge or remove pacnew/pacsave files.
-
-Usage: $myname [-l | -f | -p] [--nocolor]
-
-Search Options: select one (default: --pacmandb)
- -l/--locate scan using locate
- -f/--find scan using find
- -p/--pacmandb scan active config files from pacman database
-
-General Options:
- -o/--output print files instead of merging them
- --nocolor remove colors from output
-
-Environment Variables:
- DIFFPROG override the merge program: (default: 'vim -d')
- DIFFSEARCHPATH override the search path. (only when using find)
- (default: /etc)
-
-Example: DIFFPROG=meld DIFFSEARCHPATH="/boot /etc /usr" $myname
-Example: $myname --output --locate
-
-EOF
-}
-
-version() {
- printf "%s %s\n" "$myname" "$myver"
- echo 'Copyright (C) 2007 Aaron Griffin <aaronmgriffin@gmail.com>'
- echo 'Copyright (C) 2013-2016 Pacman Development Team <pacman-dev@archlinux.org>'
-}
-
-print_existing() {
- [[ -f "$1" ]] && printf '%s\0' "$1"
-}
-
-print_existing_pacsave(){
- for f in "${1}"?(.+([0-9])); do
- [[ -f $f ]] && printf '%s\0' "$f"
- done
-}
-
-cmd() {
- if (( USE_LOCATE )); then
- locate -0 -e -b \*.pacnew \*.pacorig \*.pacsave '*.pacsave.[0-9]*'
- elif (( USE_FIND )); then
- find $diffsearchpath \( -name \*.pacnew -o -name \*.pacorig -o -name \*.pacsave -o -name '*.pacsave.[0-9]*' \) -print0
- elif (( USE_PACDB )); then
- awk '/^%BACKUP%$/ {
- while (getline) {
- if (/^$/) { nextfile }
- print $1
- }
- }' "${pac_db}"/*/files | while read -r bkup; do
- print_existing "/$bkup.pacnew"
- print_existing "/$bkup.pacorig"
- print_existing_pacsave "/$bkup.pacsave"
- done
- fi
-}
-
-while [[ -n "$1" ]]; do
- case "$1" in
- -l|--locate)
- USE_LOCATE=1;;
- -f|--find)
- USE_FIND=1;;
- -p|--pacmandb)
- USE_PACDB=1;;
- -o|--output)
- OUTPUTONLY=1;;
- --nocolor)
- USE_COLOR='n';;
- -V|--version)
- version; exit 0;;
- -h|--help)
- usage; exit 0;;
- *)
- usage; exit 1;;
- esac
- shift
-done
-
-m4_include(../scripts/library/term_colors.sh)
-
-if ! type -p ${diffprog%% *} >/dev/null && (( ! OUTPUTONLY )); then
- error "Cannot find the $diffprog binary required for viewing differences."
- exit 1
-fi
-
-case $(( USE_FIND + USE_LOCATE + USE_PACDB )) in
- 0) USE_PACDB=1;; # set the default search option
- [^1]) error "Only one search option may be used at a time"
- usage; exit 1;;
-esac
-
-if (( USE_PACDB )); then
- if [[ ! -r @sysconfdir@/pacman.conf ]]; then
- error "unable to read @sysconfdir@/pacman.conf"
- usage; exit 1
- fi
-
- eval $(awk '/DBPath/ {print $1$2$3}' @sysconfdir@/pacman.conf)
- pac_db="${DBPath:-@localstatedir@/lib/pacman/}local"
- if [[ ! -d "${pac_db}" ]]; then
- error "unable to read pacman database %s". "${pac_db}"
- usage; exit 1
- fi
-fi
-
-# see http://mywiki.wooledge.org/BashFAQ/020
-while IFS= read -u 3 -r -d '' pacfile; do
- file="${pacfile%.pac*}"
- file_type="pac${pacfile##*.pac}"
-
- if (( OUTPUTONLY )); then
- echo "$pacfile"
- continue
- fi
-
- # add matches for pacsave.N to oldsaves array, do not prompt
- if [[ $file_type = pacsave.+([0-9]) ]]; then
- oldsaves+=("$pacfile")
- continue
- fi
-
- msg "%s file found for %s" "$file_type" "$file"
- if [ ! -f "$file" ]; then
- warning "$file does not exist"
- rm -iv "$pacfile"
- continue
- fi
-
- if cmp -s "$pacfile" "$file"; then
- msg2 "Files are identical, removing..."
- rm -v "$pacfile"
- else
- ask "(V)iew, (S)kip, (R)emove %s, (O)verwrite with %s, (Q)uit: [v/s/r/o/q] " "$file_type" "$file_type"
- while read c; do
- case $c in
- q|Q) exit 0;;
- r|R) rm -v "$pacfile"; break ;;
- o|O) mv -v "$pacfile" "$file"; break ;;
- v|V)
- $diffprog "$pacfile" "$file"
- ask "(V)iew, (S)kip, (R)emove %s, (O)verwrite with %s, (Q)uit: [v/s/r/o/q] " "$file_type" "$file_type";
- continue ;;
- s|S) break ;;
- *) ask "Invalid answer. Try again: [v/s/r/o/q] "; continue ;;
- esac
- done
- fi
-done 3< <(cmd)
-
-(( ${#oldsaves[@]} )) && warning "Ignoring %s" "${oldsaves[@]}"
-
-exit 0
-
-# vim: set noet:
diff --git a/contrib/paclist.sh.in b/contrib/paclist.sh.in
deleted file mode 100644
index f4fd540b..00000000
--- a/contrib/paclist.sh.in
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/bin/bash
-# paclist - List all packages installed from a given repo
-#
-# Copyright (C) 2008 Dan McGee <dpmcgee@gmail.com>
-# Copyright (C) 2011 Dave Reisner <dreisner@archlinux.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/>.
-
-declare -r myname='paclist'
-declare -r myver='@PACKAGE_VERSION@'
-
-export TEXTDOMAIN='pacman'
-export TEXTDOMAINDIR='/usr/share/locale'
-
-# determine whether we have gettext; make it a no-op if we do not
-if ! type gettext &>/dev/null; then
- gettext() {
- echo "$@"
- }
-fi
-
-usage() {
- printf "%s (pacman) v%s\n" "${myname}" "${myver}"
- echo
- printf "List all packages installed from a given repository\n" "${myname}"
- echo
- printf "Usage: %s <repository>\n" "${myname}"
- echo
- printf "Example: %s testing\n" "${myname}"
-}
-
-version() {
- printf "%s %s\n" "$myname" "$myver"
- echo 'Copyright (C) 2008 Dan McGee <dpmcgee@gmail.com>'
- echo 'Copyright (C) 2011 Dave Reisner <dreisner@archlinux.org>'
-}
-
-if [[ -z $1 ]]; then
- usage
- exit 1
-fi
-
-if [[ $1 = -@(h|-help) ]]; then
- usage
- exit 0
-elif [[ $1 = -@(V|-version) ]]; then
- version
- exit 0
-fi
-
-printf -v installed '[%s]' "$(gettext installed)"
-pacman -Sl $1 | awk -v i="$installed" '$NF == i { print $2,$3 }'
-
-# exit with pacman's return value, not awk's
-exit ${PIPESTATUS[0]}
-
-# vim: set noet:
diff --git a/contrib/paclog-pkglist.sh.in b/contrib/paclog-pkglist.sh.in
deleted file mode 100644
index 847b389c..00000000
--- a/contrib/paclog-pkglist.sh.in
+++ /dev/null
@@ -1,99 +0,0 @@
-#!/bin/bash
-#
-# paclog-pkglist - Parse a log file into a list of currently installed packages
-#
-# Copyright (C) 2011 Dave Reisner <dave@archlinux.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/>.
-
-declare -r myname='paclog-pkglist'
-declare -r myver='@PACKAGE_VERSION@'
-
-export TEXTDOMAIN='pacman'
-export TEXTDOMAINDIR='/usr/share/locale'
-declare logfile=${1:-@localstatedir@/log/pacman.log}
-
-usage() {
- printf "%s (pacman) v%s\n" "${myname}" "${myver}"
- echo
- echo "Parse a log file into a list of currently installed packages"
- echo
- printf "Usage: %s [path to pacman log]\n" "${myname}"
- echo
- printf "Example: %s @localstatedir@/log/pacman.log\n" "${myname}"
- echo
- echo 'Defaults to: @localstatedir@/log/pacman.log'
-}
-
-version() {
- printf "%s %s\n" "$myname" "$myver"
- echo 'Copyright (C) 2011 Dave Reisner <dave@archlinux.org>'
-}
-
-if [[ $1 ]]; then
- if [[ $1 = -@(h|-help) ]]; then
- usage
- exit 0
- elif [[ $1 = -@(V|-version) ]]; then
- version
- exit 0
- elif [[ ! -e $logfile ]]; then
- printf $"target not found: %s\n" "$1"
- exit 1
- fi
-fi
-
-<"$logfile" awk '
-{
- if ($3 ~ /^\[.*\]$/) {
- # new style with caller name
- action = $4
- pkgname = $5
- pkgver = $6
- upgver = $8
- nfields = NF
- } else {
- action = $3
- pkgname = $4
- pkgver = $5
- upgver = $7
- nfields = (NF + 1) # compensate for missing caller field
- }
-}
-
-nfields == 6 && action == "installed" {
- gsub(/[()]/, "", pkgver)
- pkg[pkgname] = pkgver
- next
-}
-
-nfields == 8 && (action == "upgraded" || action == "downgraded") {
- sub(/\)/, "", upgver)
- pkg[pkgname] = upgver
- next
-}
-
-nfields == 6 && action == "removed" {
- pkg[pkgname] = -1
-}
-
-END {
- for (i in pkg) {
- if (pkg[i] != -1) {
- printf "%s %s\n",i,pkg[i]
- }
- }
-}' | sort
-
-# vim: set noet:
diff --git a/contrib/pacscripts.sh.in b/contrib/pacscripts.sh.in
deleted file mode 100644
index 4a1e0c50..00000000
--- a/contrib/pacscripts.sh.in
+++ /dev/null
@@ -1,140 +0,0 @@
-#!/bin/bash
-#
-# pacscripts : tries to print out the {pre,post}_{install,remove,upgrade}
-# scripts of a given package
-#
-# Copyright (c) 2009 Xavier Chantry <shiningxc@gmail.com>
-# Copyright (c) 2009-2016 Pacman Development Team <pacman-dev@archlinux.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/>.
-#
-
-# bash options
-set -o nounset
-set -o errexit
-
-declare -r myname='pacscripts'
-declare -r myver='@PACKAGE_VERSION@'
-
-conf="@sysconfdir@/pacman.conf"
-
-if [ ! -r "$conf" ]; then
- echo "ERROR: unable to read $conf"
- exit 1
-fi
-
-eval $(awk '/DBPath/ {print $1$2$3}' "$conf")
-eval $(awk '/CacheDir/ {print $1$2$3}' "$conf")
-pac_db="${DBPath:-@localstatedir@/lib/pacman}/local"
-pac_cache="${CacheDir:-@localstatedir@/cache/pacman/pkg}"
-
-error() {
- local mesg=$1; shift
- printf "==> $(gettext "ERROR:") ${mesg}\n" "$@" >&2
-}
-
-usage() {
- echo "${myname} (pacman) v${myver}"
- echo
- echo "Prints the {pre,post}_{install,remove,upgrade} scripts of a given package."
- echo
- echo "Usage: ${myname} <pkgname|pkgfile>"
- echo
- echo " Options:"
- echo " -h, --help Print this help message"
- echo " -v, --version Print program name and version"
- echo
- echo "Example: ${myname} gconf-editor"
- echo "Example: ${myname} gconf-editor-3.0.1-3-x86_64.pkg.tar.xz"
-}
-
-version() {
- printf "%s %s\n" "$myname" "$myver"
- echo 'Copyright (c) 2009 Giulio "giulivo" Fidente <giulivo.navigante@gmail.com>'
- echo 'Copyright (c) 2009 Xavier Chantry <shiningxc@gmail.com>'
-}
-
-spacman() {
- if [ $EUID -eq 0 ]; then
- pacman "$@"
- else
- if ! type -p sudo; then
- error "Cannot find the sudo binary!"
- error "${myname} requires root privileges. Either install \"sudo\" or run as root."
- exit 1
- else
- sudo pacman "$@"
- fi
- fi
-}
-
-print_db() {
- pkg=$(pacman -Q "$1")
- pkg=${pkg/ /-}
- if [ -f $pac_db/$pkg*/install ]; then
- cat $pac_db/$pkg*/install
- echo
- return 0
- else
- error "Package $1 does not include any .INSTALL script"
- return 1
- fi
-}
-
-print_pkg() {
- if ! bsdtar -xqOf "$1" .INSTALL 2>/dev/null; then
- error "Package $1 does not include any .INSTALL script"
- return 1
- fi
- echo
-}
-
-print_scriptlet() {
- if [ -f "$1" ]; then
- if bsdtar tf "$1" .PKGINFO &>/dev/null; then
- print_pkg "$1"
- return
- fi
- fi
- if pacman -Q "$1" &>/dev/null; then
- print_db "$1"
- return
- fi
- if ! pacman -Si $1 &>/dev/null; then
- error "Package $1 not found"
- return 1
- fi
- url=$(pacman -Sddp $1)
- filename=$(basename $url)
- if [ ! -f "$pac_cache/$filename" ]; then
- if ! spacman -Sddw --noconfirm $1 >&2; then
- error "Failed to download $1"
- return 1
- fi
- echo >&2
- fi
- print_pkg "$pac_cache/$filename"
- return
-}
-
-if [ $# -ne 1 ] ; then
- usage
- exit 1
-fi
-
-case "$1" in
- --help|-h) usage; exit 0 ;;
- --version|-V) version; exit 0 ;;
- *) print_scriptlet $1 ;;
-esac
diff --git a/contrib/pacsearch.in b/contrib/pacsearch.in
deleted file mode 100644
index a89328d0..00000000
--- a/contrib/pacsearch.in
+++ /dev/null
@@ -1,125 +0,0 @@
-#!/usr/bin/perl
-# pacsearch - Perform a pacman search using both the local and the sync databases
-#
-# Copyright (C) 2008-2014 Dan McGee <dan@archlinux.org>
-#
-# Based off original shell script version:
-# Copyright (C) 2006-2007 Dan McGee <dan@archlinux.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/>.
-
-use strict;
-use warnings;
-use Term::ANSIColor;
-
-my $myname = 'pacsearch';
-my $myver = '@PACKAGE_VERSION@';
-
-sub usage {
- print "$myname (pacman) v$myver\n\n";
- print "Perform a pacman search using both the local and the sync databases.\n\n";
- print "Usage: $myname [-n] <pattern>\n\n";
- print "Options:\n";
- print " -n, --nocolor: turn off coloring\n\n";
- print "Example: $myname ^gnome\n";
-}
-
-sub version {
- printf "%s %s\n", $myname, $myver;
- print "Copyright (C) 2008-2014 Dan McGee <dan\@archlinux.org>\n\n";
- print "Based off original shell script version:\n";
- print "Copyright (C) 2006-2007 Dan McGee <dan\@archlinux.org>\n";
-}
-
-if ($#ARGV lt 0 || $ARGV[0] eq "--help" || $ARGV[0] eq "-h") {
- usage;
- if ($#ARGV lt 0) {
- exit 1;
- }
- exit 0;
-}
-
-if ($ARGV[0] eq "--version" || $ARGV[0] eq "-V") {
- version;
- exit 0;
-}
-
-# define formatting variables
-my($BLUE, $CYAN, $GREEN, $MAGENTA, $RED, $YELLOW, $BOLD, $RESET);
-if ($ARGV[0] eq "--nocolor" || $ARGV[0] eq "-n") {
- shift;
- $BLUE = "";
- $CYAN = "";
- $GREEN = "";
- $MAGENTA = "";
- $RED = "";
- $YELLOW = "";
- $BOLD = "";
- $RESET = "";
-} else {
- $BLUE = color('blue');
- $CYAN = color('cyan');
- $GREEN = color('green');
- $MAGENTA = color('magenta');
- $RED = color('red');
- $YELLOW = color('yellow');
- $BOLD = color('bold');
- $RESET = color('reset');
-}
-
-# localization
-my $LC_INSTALLED = `gettext pacman installed`;
-
-# Print a "repo/pkgname pkgver (groups) [installed]" line.
-# We stick to pacman colors.
-sub print_pkg {
- my @v = @_;
- print "$RESET$BOLD";
- if ( "$v[0]" eq "local" ) {
- print "$RED";
- } else {
- print "$MAGENTA";
- }
- print "$v[0]/$RESET$BOLD$v[1] $GREEN$v[2]$BLUE$v[3]$CYAN$v[4]$RESET\n";
- print "$v[5]";
-}
-
-sub list_pkg {
- my $db = shift;
- open (my $out, '-|', 'pacman', $db, '--', @ARGV) or exit 1;
- my @pkglist = ();
- while ( readline($out) ) {
- # We grab the following fields: repo, name, ver, group, installed, and
- # desc. We grab leading space for 'group' and 'installed' so that we do
- # not need to test if non-empty when printing.
- my @pkgfields = /^(.*?)\/(.*?) (.*?)( \(.*?\))?( \[.*\])?$/s;
- my $desc = readline($out);
- # since 'group' and 'installed' are optional, we should fill it in if
- # necessary
- $pkgfields[3] = "" if not defined $pkgfields[3];
- $pkgfields[4] = "" if not defined $pkgfields[4];
- $pkgfields[5] = $desc;
- push (@pkglist, \@pkgfields);
- }
- close ($out);
- return @pkglist;
-}
-
-my @sync = list_pkg('-Ss', @ARGV);
-my %allpkgs = map {$_->[1] . $_->[2] => 1} @sync;
-my @query = grep { not $allpkgs{$_->[1] . $_->[2]}} list_pkg('-Qs', @ARGV);
-$_->[4] = " [$LC_INSTALLED]" foreach @query;
-print_pkg (@{$_}) foreach (@sync, @query);
-
-#vim: set noet:
diff --git a/contrib/rankmirrors.sh.in b/contrib/rankmirrors.sh.in
deleted file mode 100644
index 7b50eb29..00000000
--- a/contrib/rankmirrors.sh.in
+++ /dev/null
@@ -1,234 +0,0 @@
-#!/bin/bash
-#
-# rankmirrors - read a list of mirrors from a file and rank them by speed
-# @configure_input@
-#
-# Copyright (c) 2009 Matthew Bruenig <matthewbruenig@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 3 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/>.
-
-# traps interrupt key to spit out pre-interrupt info
-trap finaloutput INT
-
-declare -r myname='rankmirrors'
-declare -r myver='@PACKAGE_VERSION@'
-
-usage() {
- echo "${myname} (pacman) v${myver}"
- echo
- echo "Ranks pacman mirrors by their connection and opening speed. Pacman mirror"
- echo "files are located in @sysconfdir@/pacman.d/. It can also rank one mirror if the URL is"
- echo "provided."
- echo
- echo "Usage: ${myname} [options] MIRRORFILE | URL"
- echo
- echo "Options:"
- echo " --version show program's version number and exit"
- echo " -h, --help show this help message and exit"
- echo " -n NUM number of servers to output, 0 for all"
- echo " -t, --times only output mirrors and their response times"
- echo " -u, --url test a specific URL"
- echo " -v, --verbose be verbose in ouptut"
- echo " -r, --repo specify a repository name instead of guessing"
- exit 0
-}
-
-version() {
- echo "${myname} (pacman) ${myver}"
- echo "Copyright (c) 2009 Matthew Bruenig <matthewbruenig@gmail.com>."
- echo
- echo "This is free software; see the source for copying conditions."
- echo "There is NO WARRANTY, to the extent permitted by law."
- exit 0
-}
-
-err() {
- echo "$1" >&2
- exit 1
-}
-
-# gettime fetchurl (e.g gettime http://foo.com/core/os/i686/core.db.tar.gz)
-# returns the fetching time, or timeout, or unreachable
-gettime() {
- IFS=' ' output=( $(curl -s -m 10 -w "%{time_total} %{http_code}" "$1" -o/dev/null) )
- (( $? == 28 )) && echo timeout && return
- (( ${output[1]} >= 400 || ! ${output[1]} )) && echo unreachable && return
- echo "${output[0]}"
-}
-
-# getfetchurl serverurl (e.g. getturl http://foo.com/core/os/i686)
-# if $repo is in the line, then assumes core
-# if $arch is in the line, then assumes $(uname -m)
-# returns a fetchurl (e.g. http://foo.com/core/os/i686/core.db.tar.gz)
-ARCH="$(uname -m)"
-getfetchurl() {
- local strippedurl="${1%/}"
-
- local replacedurl="${strippedurl//'$arch'/$ARCH}"
- if [[ ! $TARGETREPO ]]; then
- replacedurl="${replacedurl//'$repo'/core}"
- local tmp="${replacedurl%/*}"
- tmp="${tmp%/*}"
-
- local reponame="${tmp##*/}"
- else
- replacedurl="${replacedurl//'$repo'/$TARGETREPO}"
- local reponame="$TARGETREPO"
- fi
-
- if [[ -z $reponame || $reponame = $replacedurl ]]; then
- echo "fail"
- else
- local fetchurl="${replacedurl}/$reponame.db"
- echo "$fetchurl"
- fi
-}
-
-# This exists to remove the need for a separate interrupt function
-finaloutput() {
- IFS=$'\n' read -r -d '' -a sortedarray < \
- <(printf '%s\n' "${timesarray[@]}" | LC_COLLATE=C sort)
-
- # Final output for mirrorfile
- numiterator="0"
- if [[ $TIMESONLY ]]; then
- echo
- echo " Servers sorted by time (seconds):"
- for line in "${sortedarray[@]}"; do
- echo "${line#* } : ${line% *}"
- ((numiterator++))
- (( NUM && numiterator >= NUM )) && break
- done
- else
- for line in "${sortedarray[@]}"; do
- echo "Server = ${line#* }"
- ((numiterator++))
- (( NUM && numiterator >= NUM )) && break
- done
- fi
- exit 0
-}
-
-
-# Argument parsing
-[[ $1 ]] || usage
-while [[ $1 ]]; do
- if [[ ${1:0:2} = -- ]]; then
- case "${1:2}" in
- help) usage ;;
- version) version ;;
- times) TIMESONLY=1 ; shift ;;
- verbose) VERBOSE=1 ; shift ;;
- url)
- CHECKURL=1;
- [[ $2 ]] || err "Must specify URL.";
- URL="$2";
- shift 2;;
- repo)
- [[ $2 ]] || err "Must specify repository name.";
- TARGETREPO="$2";
- shift 2;;
- *) err "'$1' is an invalid argument."
- esac
- elif [[ ${1:0:1} = - ]]; then
-
- if [[ ! ${1:1:1} ]]; then
- [[ -t 0 ]] && err "Stdin is empty."
- IFS=$'\n' linearray=( $(</dev/stdin) )
- STDIN=1
- shift
- else
- snum=1
- for ((i=1 ; i<${#1}; i++)); do
- case ${1:$i:1} in
- h) usage ;;
- t) TIMESONLY=1 ;;
- v) VERBOSE=1 ;;
- u)
- CHECKURL=1;
- [[ $2 ]] || err "Must specify URL.";
- URL="$2";
- snum=2;;
- r)
- [[ $2 ]] || err "Must specify repository name.";
- TARGETREPO="$2";
- snum=2;;
- n)
- [[ $2 ]] || err "Must specify number.";
- NUM="$2";
- snum=2;;
- *) err "'$1' is an invalid argument." ;;
- esac
- done
- shift $snum
- fi
- elif [[ -f $1 ]]; then
- FILE="1"
- IFS=$'\n' linearray=( $(<$1) )
- [[ $linearray ]] || err "File is empty."
- shift
- else
- err "'$1' does not exist."
- fi
-done
-
-# Some sanity checks
-[[ $NUM ]] || NUM=0
-[[ $FILE && $CHECKURL ]] && err "Cannot specify a URL and mirrorfile."
-[[ $FILE || $CHECKURL || $STDIN ]] || err "Must specify URL, mirrorfile, or stdin."
-
-# Single URL handling
-if [[ $CHECKURL ]]; then
- url="$(getfetchurl "$URL")"
- [[ $url = fail ]] && err "URL '$URL' is malformed."
- [[ $VERBOSE ]] && echo "Testing $url..."
- time=$(gettime "$url")
- echo "$URL : $time"
- exit 0
-fi
-
-# Get URL results from mirrorfile, fill up the array, and so on
-if [[ $TIMESONLY ]]; then
- echo "Querying servers. This may take some time..."
-elif [[ $FILE ]]; then
- echo "# Server list generated by rankmirrors on $(date +%Y-%m-%d)"
-fi
-
-timesarray=()
-for line in "${linearray[@]}"; do
- if [[ $line =~ ^[[:space:]]*# ]]; then
- [[ $TIMESONLY ]] || echo $line
- elif [[ $line =~ ^[[:space:]]*Server ]]; then
-
- # Getting values and times and such
- server="${line#*= }"
- server="${server%%#*}"
- url="$(getfetchurl "$server")"
- [[ $url = fail ]] && err "URL '$URL' is malformed."
- time=$(gettime "$url")
- timesarray+=("$time $server")
-
- # Output
- if [[ $VERBOSE && $TIMESONLY ]]; then
- echo "$server ... $time"
- elif [[ $VERBOSE ]]; then
- echo "# $server ... $time"
- elif [[ $TIMESONLY ]]; then
- echo -n " *"
- fi
- fi
-done
-finaloutput
-
-# vim: set noet:
diff --git a/contrib/updpkgsums.sh.in b/contrib/updpkgsums.sh.in
deleted file mode 100644
index c571d297..00000000
--- a/contrib/updpkgsums.sh.in
+++ /dev/null
@@ -1,115 +0,0 @@
-#!/bin/bash
-#
-# updpkgsums - update source checksums in-place in PKGBUILDs
-#
-# Copyright (C) 2012-2013 Dave Reisner <dreisner@archlinux.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/>.
-
-shopt -s extglob
-
-declare -r myname='updpkgsums'
-declare -r myver='@PACKAGE_VERSION@'
-
-usage() {
- printf "%s (pacman) v%s\n" "${myname}" "${myver}"
- echo
- printf "%s will perform an in place update of the checksums in the\n" "${myname}"
- echo "path specified by [build file], defaulting to PKGBUILD in the current"
- echo "working directory."
- echo
- printf "Usage: %s [options] [build file]\n" "${myname}"
- echo
- echo " -h, --help display this help message and exit"
- echo " -V, --version display version information and exit"
- echo
- echo "These options can be passed to makepkg:"
- echo " -m, --nocolor disable colorized output messages"
-}
-
-version() {
- printf "%s %s\n" "$myname" "$myver"
- echo 'Copyright (C) 2012-2013 Dave Reisner <dreisner@archlinux.org>'
-}
-
-die() {
- printf "==> ERROR: $1\n" "${@:2}" >&2
- exit 1
-}
-
-MAKEPKG_OPTS=()
-buildfile='PKGBUILD'
-
-while (( "$#" )); do
- case "$1" in
- -h|--help) usage; exit ;;
- -m|--nocolor) MAKEPKG_OPTS+=("$1"); shift ;;
- -V|--version) version; exit ;;
- *) buildfile="$1"; break 2 ;;
- esac
-done
-
-if [[ ! -f $buildfile ]]; then
- die "%s not found or is not a file" "$buildfile"
-fi
-
-# Resolve any symlinks to avoid replacing the symlink with a file. But, we
-# have to do this portably -- readlink's flags are inconsistent across OSes.
-while [[ -L $buildfile ]]; do
- buildfile=$(readlink "$buildfile")
- if [[ $buildfile = */* ]]; then
- cd "${buildfile%/*}"
- buildfile=${buildfile##*/}
- fi
-done
-
-# cd into the directory with the build file. This avoids creating random src/
-# directories scattered about the filesystem, and avoids cases where we might
-# not be able to write in the $PWD.
-if [[ $buildfile = */* ]]; then
- cd "${buildfile%/*}"
- buildfile=${buildfile##*/}
-fi
-
-# Check $PWD/ for permission to unlink the $buildfile and write a new one
-if [[ ! -w . ]]; then
- die "No write permission in '%s'" "$PWD"
-fi
-
-# Generate the new sums
-export BUILDDIR=$(mktemp -d "${TMPDIR:-/tmp}/updpkgsums.XXXXXX")
-newbuildfile=$(mktemp "${TMPDIR:-/tmp}/updpkgsums.XXXXXX")
-
-trap "rm -rf '$BUILDDIR' '$newbuildfile'" EXIT
-newsums=$(makepkg -g -p "$buildfile" "${MAKEPKG_OPTS[@]}") || die 'Failed to generate new checksums'
-awk -v newsums="$newsums" '
- /^[[:blank:]]*(md|sha)[[:digit:]]+sums(_[^=]+)?=/,/\)[[:blank:]]*(#.*)?$/ {
- if (!w) {
- print newsums
- w++
- }
- next
- }
-
- 1
- END { if (!w) print newsums }
-' "$buildfile" > "$newbuildfile" || die 'Failed to write new PKGBUILD'
-
-# Rewrite the original buildfile. Use cat instead of mv/cp to preserve
-# permissions implicitly.
-if ! cat -- "$newbuildfile" >"$buildfile"; then
- die "Failed to update %s. The file has not been modified." "$buildfile"
-fi
-
-# vim: set noet:
diff --git a/contrib/verify-pacman-repo-db.pl b/contrib/verify-pacman-repo-db.pl
deleted file mode 100755
index e0a54106..00000000
--- a/contrib/verify-pacman-repo-db.pl
+++ /dev/null
@@ -1,259 +0,0 @@
-#!/usr/bin/perl -T
-use warnings;
-use strict;
-
-
-# This is used for the usage output
-=pod
-
-=head1 SYNOPSIS
-
-verify-pacman-repo-db.pl [options] <database file> ...
-
- Options:
- --help, -h Show short help message
- --debug Enable debug output
- --checksum, -c Verify checksums of packages
- --thread, -t <num> Use num threads to verify packages. Default: 1
- NOTE: Each thread uses up to approx. 128MiB of memory
-
-=cut
-
-package main;
-use Getopt::Long;
-use Pod::Usage;
-
-exit main();
-
-sub main {
- my %opts = (
- threads => 1,
- );
-
- Getopt::Long::Configure ("bundling");
- pod2usage(-verbose => 0) if (@ARGV== 0);
- GetOptions(\%opts, "help|h", "debug", "threads|t=i", "checksum|c") or pod2usage(2);
- pod2usage(0) if $opts{help};
-
- my $verifier = Verifier->new(\%opts);
-
- for my $repodb (@ARGV) {
- $verifier->check_repodb($repodb);
- }
-
- $verifier->finalize();
- return $verifier->get_error_status();
-}
-
-package Verifier;
-use Archive::Tar;
-use Digest::MD5;
-use Digest::SHA;
-use File::Basename;
-use threads;
-use threads::shared;
-use Thread::Queue;
-
-sub new {
- my $class = shift;
- my $opts = shift;
-
- my $self :shared = shared_clone({
- opts => \%{$opts},
- package_queue => Thread::Queue->new(),
- output_queue => Thread::Queue->new(),
- workers => [],
- errors => 0,
- });
-
- bless $self, $class;
- $self->start_workers();
- return $self;
-}
-
-sub start_workers {
- my $self = shift;
-
- threads->new(\&_worker_output_queue, $self);
-
- for (my $i = 0; $i < $self->{opts}->{threads}; $i++) {
- my $thr :shared = shared_clone(threads->new(\&_worker_package_queue, $self));
- push @{$self->{workers}}, $thr;
- }
-}
-
-sub _worker_package_queue {
- my $self = shift;
- while (my $workpack = $self->{package_queue}->dequeue()) {
- my $dbdata = $self->_parse_db_entry($workpack->{db_desc_content});
- $self->{errors} += $self->_verify_db_entry($workpack->{dirname}, $dbdata);
- }
-}
-
-sub _worker_output_queue {
- my $self = shift;
- while (my $output = $self->{output_queue}->dequeue()) {
- print STDERR $output;
- }
-}
-
-sub finalize {
- my $self = shift;
-
- $self->{package_queue}->end();
- $self->_join_threads($self->{workers});
-
- $self->{output_queue}->end();
- $self->_join_threads([threads->list]);
-}
-
-sub _join_threads {
- my $self = shift;
- my $threads = shift;
-
- for my $thr (@{$threads}) {
- if ($thr->tid && !threads::equal($thr, threads->self)) {
- print "waiting for thread ".$thr->tid()." to finish\n" if $self->{opts}->{debug};
- $thr->join;
- }
- }
-}
-
-sub get_error_status {
- my $self = shift;
-
- return $self->{errors} > 0;
-}
-
-sub check_repodb {
- my $self = shift;
- my $repodb = shift;
-
- my $db = Archive::Tar->new();
- $db->read($repodb);
-
- my $dirname = dirname($repodb);
- my $pkgcount = 0;
-
- my @files = $db->list_files();
- for my $file_object ($db->get_files()) {
- if ($file_object->name =~ m/^([^\/]+)\/desc$/) {
- my $package = $1;
- $self->{package_queue}->enqueue({
- package => $package,
- db_desc_content => $file_object->get_content(),
- dirname => $dirname,
- });
- $pkgcount++;
- }
- }
-
- $self->_debug(sprintf("Queued %d package(s) from database '%s'\n", $pkgcount, $repodb));
-}
-
-sub _parse_db_entry {
- my $self = shift;
- my $content = shift;
- my %db;
- my $key;
-
- for my $line (split /\n/, $content) {
- if ($line eq '') {
- $key = undef;
- } elsif ($key) {
- push @{$db{$key}}, $line;
- } elsif ($line =~ m/^%(.+)%$/) {
- $key = $1;
- } else {
- die "\$key not set. Is the db formatted incorrectly?" unless $key;
- }
- }
- return \%db;
-}
-
-sub _output {
- my $self = shift;
- my $output = shift;
-
- return if $output eq "";
-
- $output = sprintf("Thread %s: %s", threads->self->tid(), $output);
- $self->{output_queue}->enqueue($output);
-}
-
-sub _debug {
- my $self = shift;
- my $output = shift;
- $self->_output($output) if $self->{opts}->{debug};
-}
-
-sub _verify_db_entry {
- my $self = shift;
- my $basedir = shift;
- my $dbdata = shift;
- my $ret = 0;
- my $output = "";
-
- # verify package exists
- my $pkgfile = $basedir.'/'.$dbdata->{FILENAME}[0];
- $self->_debug(sprintf("Checking package %s\n", $dbdata->{FILENAME}[0]));
- unless (-e $pkgfile) {
- $self->_output(sprintf("Package file missing: %s\n", $pkgfile));
- return 1;
- }
-
- $ret += $self->_verify_package_size($dbdata, $pkgfile);
- $ret += $self->_verify_package_checksum($dbdata, $pkgfile) if $self->{opts}->{checksum};
-
- return $ret;
-}
-
-sub _verify_package_size {
- my $self = shift;
- my $dbdata = shift;
- my $pkgfile = shift;
-
- my $csize = $dbdata->{CSIZE}[0];
- my $filesize = (stat($pkgfile))[7];
- unless ($csize == $filesize) {
- $self->_output(sprintf("Package file has incorrect size: %d vs %d: %s\n", $csize, $filesize, $pkgfile));
- return 1;
- }
- return 0;
-}
-
-sub _verify_package_checksum {
- my $self = shift;
- my $dbdata = shift;
- my $pkgfile = shift;
-
- my $md5 = Digest::MD5->new;
- my $sha = Digest::SHA->new(256);
-
- my $content;
- # 128MiB to keep random IO low when using multiple threads (only works for large packages though)
- my $chunksize = 1024*1024*128;
- open my $fh, "<", $pkgfile;
- while (read($fh, $content, $chunksize)) {
- $md5->add($content);
- $sha->add($content);
- }
-
- my $expected_sha = $dbdata->{SHA256SUM}[0];
- my $expected_md5 = $dbdata->{MD5SUM}[0];
- my $got_md5 = $md5->hexdigest;
- my $got_sha = $sha->hexdigest;
-
- unless ($expected_sha eq $got_sha and $expected_md5 eq $got_md5) {
- my $output;
- $output .= sprintf "Package file has incorrect checksum: %s\n", $pkgfile;
- $output .= sprintf "expected: SHA %s\n", $expected_sha;
- $output .= sprintf "got: SHA %s\n", $got_sha;
- $output .= sprintf "expected: MD5 %s\n", $expected_md5;
- $output .= sprintf "got: MD5 %s\n", $got_md5;
- $self->_output($output);
- return 1;
- }
- return 0;
-}
-
diff --git a/contrib/vimprojects b/contrib/vimprojects
deleted file mode 100644
index e9adfdf1..00000000
--- a/contrib/vimprojects
+++ /dev/null
@@ -1,25 +0,0 @@
-This is a project file
-for the vim-project plugin.
-Save it as ~/.vimprojects
-
-$ pacman -S vim-project
-change the pacman path below
-$ vim
-:Project
-
-Press \r in the project view
-on a project name to generate
-the list of files
-
-pacman=~/devel/pacman/ CD=. filter="*.ac *.am" flags=S {
- libalpm=lib/libalpm/ filter="*.c *.h *.am" {
- }
- pacman=src/pacman/ filter="*.c *.h *.am" {
- }
- scripts=scripts/ filter="*.sh.in *.py.in *.am" {
- }
- utils=src/util filter="*.c *.h *.am" {
- }
- contrib=contrib CD=. {
- }
-}
diff --git a/contrib/zsh_completion.in b/contrib/zsh_completion.in
deleted file mode 100644
index f74fa297..00000000
--- a/contrib/zsh_completion.in
+++ /dev/null
@@ -1,723 +0,0 @@
-#compdef pacman pacman.static=pacman pacman-key makepkg
-
-# copy this file to /usr/share/zsh/site-functions/_pacman
-
-typeset -A opt_args
-setopt extendedglob
-
-# options for passing to _arguments: main pacman commands
-_pacman_opts_commands=(
- {-D,--database}'[Modify database]'
- {-F,--files}'[Query the files database]'
- {-Q,--query}'[Query the package database]'
- {-R,--remove}'[Remove a package from the system]'
- {-S,--sync}'[Synchronize packages]'
- {-T,--deptest}'[Check if dependencies are installed]'
- {-U,--upgrade}'[Upgrade a package]'
- {-V,--version}'[Display version and exit]'
- '(-h --help)'{-h,--help}'[Display usage]'
-)
-
-# options for passing to _arguments: options common to all commands
-_pacman_opts_common=(
- '--arch[Set an alternate architecture]'
- {-b,--dbpath}'[Alternate database location]:database_location:_files -/'
- '--color[colorize the output]:color options:(always never auto)'
- {-h,--help}'[Display syntax for the given operation]'
- {-r,--root}'[Set alternate installation root]:installation root:_files -/'
- {-v,--verbose}'[Be more verbose]'
- '--cachedir[Alternate package cache location]:cache_location:_files -/'
- '--config[An alternate configuration file]:config file:_files'
- '--confirm[Always ask for confirmation]'
- '--debug[Display debug messages]'
- '--gpgdir[Set an alternate directory for GnuPG (instead of @sysconfdir@/pacman.d/gnupg)]: :_files -/'
- '--hookdir[Set an alternate hook location]: :_files -/'
- '--logfile[An alternate log file]:config file:_files'
- '--noconfirm[Do not ask for confirmation]'
- '--noprogressbar[Do not show a progress bar when downloading files]'
- '--noscriptlet[Do not execute the install scriptlet if one exists]'
-)
-
-# options for passing to _arguments: options for --upgrade commands
-_pacman_opts_pkgfile=(
- '*-d[Skip dependency checks]'
- '*--nodeps[Skip dependency checks]'
- '*--assume-installed[Add virtual package to satisfy dependencies]'
- '--dbonly[Only remove database entry, do not remove files]'
- '--force[Overwrite conflicting files]'
- '--needed[Do not reinstall up to date packages]'
- '--asdeps[mark packages as non-explicitly installed]'
- '--asexplicit[mark packages as explicitly installed]'
- {-p,--print}'[Only print the targets instead of performing the operation]'
- '*--ignore[Ignore a package upgrade]:package: _pacman_completions_all_packages'
- '*--ignoregroup[Ignore a group upgrade]:package group:_pacman_completions_all_groups'
- '--print-format[Specify how the targets should be printed]'
- '*:package file:_files -g "*.pkg.tar*~*.sig(.,@)"'
-)
-
-# options for passing to _arguments: subactions for --query command
-_pacman_opts_query_actions=(
- '(-Q --query)'{-Q,--query}
- {-g,--groups}'[View all members of a package group]:*:package groups:->query_group'
- {-o,--owns}'[Query the package that owns a file]:file:_files'
- {-p,--file}'[Package file to query]:*:package file:->query_file'
- {-s,--search}'[Search package names and descriptions]:*:search text:->query_search'
-)
-
-# options for passing to _arguments: options for --query and subcommands
-_pacman_opts_query_modifiers=(
- {-c,--changelog}'[List package changelog]'
- {-d,--deps}'[List packages installed as dependencies]'
- {-e,--explicit}'[List packages explicitly installed]'
- {\*-i,\*--info}'[View package information]'
- {\*-k,\*--check}'[Check package files]'
- {-l,--list}'[List package contents]'
- {-m,--foreign}'[List installed packages not found in sync db(s)]'
- {-n,--native}'[List installed packages found in sync db(s)]'
- {-q,--quiet}'[Show less information for query and search]'
- {-t,--unrequired}'[List packages not required by any package]'
- {-u,--upgrades}'[List packages that can be upgraded]'
-)
-
-# options for passing to _arguments: options for --remove command
-_pacman_opts_remove=(
- {-c,--cascade}'[Remove all dependent packages]'
- {-d,--nodeps}'[Skip dependency checks]'
- '*--assume-installed[Add virtual package to satisfy dependencies]'
- {-n,--nosave}'[Remove protected configuration files]'
- {-p,--print}'[Only print the targets instead of performing the operation]'
- {\*-s,\*--recursive}'[Remove dependencies not required by other packages]'
- {-u,--unneeded}'[Remove unneeded packages]'
- '--dbonly[Only remove database entry, do not remove files]'
- '--print-format[Specify how the targets should be printed]'
- '*:installed package:_pacman_completions_installed_packages'
-)
-
-_pacman_opts_database=(
- '--asdeps[mark packages as non-explicitly installed]'
- '--asexplicit[mark packages as explicitly installed]'
- '*:installed package:_pacman_completions_installed_packages'
-)
-
-_pacman_opts_files=(
- {-l,--list}'[List the files owned by the queried package]:package:_pacman_completions_all_packages'
- {-o,--owns}'[Query the package that owns]:files:_files'
- {-s,--search}'[Search package file names for matching strings]:files:_files'
- {-x,--regex}'[Enable searching using regular expressions]:regex:'
- {-y,--refresh}'[Download fresh files databases from the server]'
- '--machinereadable[Produce machine-readable output]'
- {-q,--quiet}'[Show less information for query and search]'
-)
-
-# options for passing to _arguments: options for --sync command
-_pacman_opts_sync_actions=(
- '(-S --sync)'{-S,--sync}
- {\*-c,\*--clean}'[Remove old packages from cache]:\*:clean:->sync_clean'
- {-g,--groups}'[View all members of a package group]:*:package groups:->sync_group'
- {-s,--search}'[Search package names and descriptions]:*:search text:->sync_search'
- '--dbonly[Only remove database entry, do not remove files]'
- '--needed[Do not reinstall up to date packages]'
- '--recursive[Reinstall all dependencies of target packages]'
-)
-
-# options for passing to _arguments: options for --sync command
-_pacman_opts_sync_modifiers=(
- {\*-d,\*--nodeps}'[Skip dependency checks]'
- '*--assume-installed[Add virtual package to satisfy dependencies]'
- {\*-i,\*--info}'[View package information]'
- {-l,--list}'[List all packages in a repository]'
- {-p,--print}'[Print download URIs for each package to be installed]'
- {-q,--quiet}'[Show less information for query and search]'
- {\*-u,\*--sysupgrade}'[Upgrade all out-of-date packages]'
- {-w,--downloadonly}'[Download packages only]'
- {\*-y,\*--refresh}'[Download fresh package databases]'
- '*--ignore[Ignore a package upgrade]:package: _pacman_completions_all_packages'
- '*--ignoregroup[Ignore a group upgrade]:package group:_pacman_completions_all_groups'
- '--asdeps[Install packages as non-explicitly installed]'
- '--asexplicit[Install packages as explicitly installed]'
- '--force[Overwrite conflicting files]'
- '--print-format[Specify how the targets should be printed]'
-)
-
-# handles --help subcommand
-_pacman_action_help() {
- _arguments -s : \
- "$_pacman_opts_commands[@]"
-}
-
-# handles cases where no subcommand has yet been given
-_pacman_action_none() {
- _arguments -s : \
- "$_pacman_opts_commands[@]"
-}
-
-# handles --query subcommand
-_pacman_action_query() {
- local context state line
- typeset -A opt_args
-
- case $state in
- query_file)
- _arguments -s : \
- "$_pacman_opts_common[@]" \
- "$_pacman_opts_query_modifiers[@]" \
- '*:package file:_files -g "*.pkg.tar*~*.sig(.,@)"'
- ;;
- query_group)
- _arguments -s : \
- "$_pacman_opts_common[@]" \
- "$_pacman_opts_query_modifiers[@]" \
- '*:groups:_pacman_completions_installed_groups'
- ;;
- query_owner)
- _arguments -s : \
- "$_pacman_opts_common[@]" \
- "$_pacman_opts_query_modifiers[@]" \
- '*:file:_files'
- ;;
- query_search)
- _arguments -s : \
- "$_pacman_opts_common[@]" \
- "$_pacman_opts_query_modifiers[@]" \
- '*:search text: '
- ;;
- *)
- _arguments -s : \
- "$_pacman_opts_common[@]" \
- "$_pacman_opts_query_actions[@]" \
- "$_pacman_opts_query_modifiers[@]" \
- '*:package:_pacman_completions_installed_packages'
- ;;
- esac
-}
-
-# handles --remove subcommand
-_pacman_action_remove() {
- _arguments -s : \
- '(--remove -R)'{-R,--remove} \
- "$_pacman_opts_common[@]" \
- "$_pacman_opts_remove[@]"
-}
-
-# handles --database subcommand
-_pacman_action_database() {
- _arguments -s : \
- '(--database -D)'{-D,--database} \
- "$_pacman_opts_common[@]" \
- "$_pacman_opts_database[@]"
-}
-
-# handles --files subcommand
-_pacman_action_files() {
- _arguments -s : \
- '(--files -F)'{-F,--files} \
- "$_pacman_opts_common[@]" \
- "$_pacman_opts_files[@]"
-}
-
-_pacman_action_deptest () {
- _arguments -s : \
- '(--deptest)-T' \
- "$_pacman_opts_common[@]" \
- ":packages:_pacman_all_packages"
-}
-
-
-# handles --sync subcommand
-_pacman_action_sync() {
- local context state line
- typeset -A opt_args
- if (( $+words[(r)--clean] )); then
- state=sync_clean
- elif (( $+words[(r)--groups] )); then
- state=sync_group
- elif (( $+words[(r)--search] )); then
- state=sync_search
- fi
-
- case $state in
- sync_clean)
- _arguments -s : \
- {\*-c,\*--clean}'[Remove old packages from cache]' \
- "$_pacman_opts_common[@]" \
- "$_pacman_opts_sync_modifiers[@]"
- ;;
- sync_group)
- _arguments -s : \
- "$_pacman_opts_common[@]" \
- "$_pacman_opts_sync_modifiers[@]" \
- '(-g --group)'{-g,--groups} \
- '*:package group:_pacman_completions_all_groups'
- ;;
- sync_search)
- _arguments -s : \
- "$_pacman_opts_common[@]" \
- "$_pacman_opts_sync_modifiers[@]" \
- '*:search text: '
- ;;
- *)
- _arguments -s : \
- "$_pacman_opts_common[@]" \
- "$_pacman_opts_sync_actions[@]" \
- "$_pacman_opts_sync_modifiers[@]" \
- '*:package:_pacman_completions_all_packages'
- ;;
- esac
-}
-
-# handles --upgrade subcommand
-_pacman_action_upgrade() {
- _arguments -s : \
- '(-U --upgrade)'{-U,--upgrade} \
- "$_pacman_opts_common[@]" \
- "$_pacman_opts_pkgfile[@]"
-}
-
-# handles --version subcommand
-_pacman_action_version() {
- # no further arguments
- return 0
-}
-
-# provides completions for package groups
-_pacman_completions_all_groups() {
- local -a cmd groups
- _pacman_get_command
- groups=( $(_call_program groups $cmd[@] -Sg) )
- typeset -U groups
-
- if [[ ${words[CURRENT-1]} == '--ignoregroup' ]]; then
- _sequence compadd -S ',' "$@" -a groups
- else
- compadd "$@" -a groups
- fi
-}
-
-# provides completions for packages available from repositories
-# these can be specified as either 'package' or 'repository/package'
-_pacman_completions_all_packages() {
- local -a seq sep cmd packages repositories packages_long
- _pacman_get_command
-
- if [[ ${words[CURRENT-1]} == '--ignore' ]]; then
- seq='_sequence'
- sep=(-S ',')
- else
- seq=
- sep=()
- fi
-
- if compset -P1 '*/*'; then
- packages=( $(_call_program packages $cmd[@] -Sql ${words[CURRENT]%/*}) )
- typeset -U packages
- ${seq} _wanted repo_packages expl "repository/package" compadd ${sep[@]} ${(@)packages}
- else
- packages=( $(_call_program packages $cmd[@] -Sql) )
- typeset -U packages
- ${seq} _wanted packages expl "packages" compadd ${sep[@]} - "${(@)packages}"
-
- repositories=(${(o)${${${(M)${(f)"$(<@sysconfdir@/pacman.conf)"}:#\[*}/\[/}/\]/}:#options})
- typeset -U repositories
- _wanted repo_packages expl "repository/package" compadd -S "/" $repositories
- fi
-}
-
-# provides completions for package groups
-_pacman_completions_installed_groups() {
- local -a cmd groups
- _pacman_get_command
- groups=(${(o)${(f)"$(_call_program groups $cmd[@] -Qg)"}% *})
- typeset -U groups
- compadd "$@" -a groups
-}
-
-# provides completions for installed packages
-_pacman_completions_installed_packages() {
- local -a cmd packages packages_long
- packages_long=(@localstatedir@/lib/pacman/local/*(/))
- packages=( ${${packages_long#@localstatedir@/lib/pacman/local/}%-*-*} )
- compadd "$@" -a packages
-}
-
-_pacman_all_packages() {
- _alternative : \
- 'localpkgs:local packages:_pacman_completions_installed_packages' \
- 'repopkgs:repository packages:_pacman_completions_all_packages'
-}
-
-# provides completions for repository names
-_pacman_completions_repositories() {
- local -a cmd repositories
- repositories=(${(o)${${${(M)${(f)"$(<@sysconfdir@/pacman.conf)"}:#\[*}/\[/}/\]/}:#options})
- # Uniq the array
- typeset -U repositories
- compadd "$@" -a repositories
-}
-
-# builds command for invoking pacman in a _call_program command - extracts
-# relevant options already specified (config file, etc)
-# $cmd must be declared by calling function
-_pacman_get_command() {
- # this is mostly nicked from _perforce
- cmd=( "pacman" "2>/dev/null")
- integer i
- for (( i = 2; i < CURRENT - 1; i++ )); do
- if [[ ${words[i]} = "--config" || ${words[i]} = "--root" ]]; then
- cmd+=( ${words[i,i+1]} )
- fi
- done
-}
-
-# main dispatcher
-_pacman_zsh_comp() {
- local -a args cmds;
- local tmp
- args=( ${${${(M)words:#-*}#-}:#-*} )
- for tmp in $words; do
- cmds+=("${${_pacman_opts_commands[(r)*$tmp\[*]%%\[*}#*\)}")
- done
- case $args in #$words[2] in
- h*)
- if (( ${(c)#args} <= 1 && ${(w)#cmds} <= 1 )); then
- _pacman_action_help
- else
- _message "no more arguments"
- fi
- ;;
- *h*)
- _message "no more arguments"
- ;;
- D*)
- _pacman_action_database
- ;;
- F*)
- _pacman_action_files
- ;;
- Q*g*) # ipkg groups
- _arguments -s : \
- "$_pacman_opts_common[@]" \
- "$_pacman_opts_query_modifiers[@]" \
- '*:groups:_pacman_completions_installed_groups'
- ;;
- Q*o*) # file
- _arguments -s : \
- "$_pacman_opts_common[@]" \
- "$_pacman_opts_query_modifiers[@]" \
- '*:package file:_files'
- ;;
- Q*p*) # file *.pkg.tar*
- _arguments -s : \
- "$_pacman_opts_common[@]" \
- "$_pacman_opts_query_modifiers[@]" \
- '*:package file:_files -g "*.pkg.tar*~*.sig(.,@)"'
- ;;
- T*)
- _pacman_action_deptest
- ;;
- Q*)
- _pacman_action_query
- ;;
- R*)
- _pacman_action_remove
- ;;
- S*c*) # no completion
- _arguments -s : \
- '(-c --clean)'{\*-c,\*--clean}'[Remove all files from the cache]' \
- "$_pacman_opts_common[@]"
- ;;
- S*l*) # repos
- _arguments -s : \
- "$_pacman_opts_common[@]" \
- "$_pacman_opts_sync_modifiers[@]" \
- '*:package repo:_pacman_completions_repositories' \
- ;;
- S*g*) # pkg groups
- _arguments -s : \
- "$_pacman_opts_common[@]" \
- "$_pacman_opts_sync_modifiers[@]" \
- '*:package group:_pacman_completions_all_groups'
- ;;
- S*s*)
- _arguments -s : \
- "$_pacman_opts_common[@]" \
- "$_pacman_opts_sync_modifiers[@]" \
- '*:search text: '
- ;;
- S*)
- _pacman_action_sync
- ;;
- T*)
- _arguments -s : \
- '-T' \
- "$_pacman_opts_common[@]" \
- ":packages:_pacman_all_packages"
- ;;
- U*)
- _pacman_action_upgrade
- ;;
- V*)
- _pacman_action_version
- ;;
- *)
-
- case ${(M)words:#--*} in
- *--help*)
- if (( ${(w)#cmds} == 1 )); then
- _pacman_action_help
- else
- return 0;
- fi
- ;;
- *--sync*)
- _pacman_action_sync
- ;;
- *--query*)
- _pacman_action_query
- ;;
- *--remove*)
- _pacman_action_remove
- ;;
- *--deptest*)
- _pacman_action_deptest
- ;;
- *--database*)
- _pacman_action_database
- ;;
- *--files*)
- _pacman_action_files
- ;;
- *--version*)
- _pacman_action_version
- ;;
- *--upgrade*)
- _pacman_action_upgrade
- ;;
- *)
- _pacman_action_none
- ;;
- esac
- ;;
- esac
-}
-
-_key_shortopts=(
- '-h[show help]'
- '-a[Add the specified keys (empty for stdin)]: :_files'
- '-d[Remove the Specified keyids]:*: :_keys'
- '-e[Export the specified or all keyids]:*: :_keys'
- '-f[List fingerprint for specified or all keyids]:*: :_keys'
- '-l[List the specified or all keys]:*: :_keys'
- '-r[Fetch the specified keyids]:*: :_keys'
- '-u[Update the trustdb of pacman]'
- '-v[Verify the file specified by the signature]: :_files -g "*.sig"'
- '-V[Show program version]'
-)
-
-_key_longopts=(
- '--help[show help]'
- '--add[Add the specified keys (empty for stdin)]: :_files'
- '--delete[Remove the Specified keyids]:*: :_keys'
- '--export[Export the specified or all keyids]:*: :_keys'
- '--finger[List fingerprint for specified or all keyids]:*: :_keys'
- '--list-keys[List the specified or all keys]:*: :_keys'
- '--recv-keys[Fetch the specified keyids]:*: :_keys'
- '--updatedb[Update the trustdb of pacman]'
- '--verify[Verify the file specified by the signature]: :_files -g "*.sig"'
- '--version[Show program version]'
- '--edit-key[Present a menu for key management task on keyids]:*: :_keys'
- '--import[Imports pubring.gpg from dir(s)]: :_files -g "*.gpg"'
- '--import-tb[Imports ownertrust values from trustdb.gpg in dir(s)]: :_files -g "*.gpg"'
- '--init[Ensure the keyring is properly initialized]'
- '--list-sigs[List keys and their signatures]:*: :_keys'
- '--lsign-key[Locally sign the specified keyid]:*: :_keys'
- '--populate[Reload the default keys from the (given) keyrings in '/usr/share/pacman/keyrings']: :_path_files -W /usr/share/pacman/keyrings'
- '--refresh-keys[Update specified or all keys from a keyserver]:*: :_keys'
-)
-
-_pacman_key_options=(
- '--config[Use an alternate config file (instead of @sysconfdir@/pacman.conf)]: :_files'
- '--gpgdir[Set an alternate directory for GnuPG (instead of @sysconfdir@/pacman.d/gnupg)]: :_files -/'
- '--keyserver[Specify a keyserver to use if necessary]'
-)
-
-_pacman_key() {
- case $words[CURRENT] in
- --*)
- _arguments -s : \
- "$_pacman_key_options[@]" \
- "$_key_longopts[@]"
- ;;
- -*)
- _arguments -s : \
- "$_pacman_key_options[@]" \
- "$_key_shortopts[@]" \
- "$_key_longopts[@]"
- ;;
- *)
- i=$#;
- while [[ $words[$i] != -* ]] && [[ $words[$i] != "pacman-key" ]];do
- i=$(($i-1))
- done
- case $i in
- --*)
- _arguments -s : \
- "$_pacman_key_options[@]" \
- "$_key_longopts[@]"
- ;;
- -*)
- _arguments -s : \
- "$_pacman_key_options[@]" \
- "$_key_shortopts[@]" \
- "$_key_longopts[@]"
- ;;
- *)
- return 1
- ;;
- esac
- ;;
- esac
-}
-
-_keys() {
- local keylist keys
- keylist=$(pacman-key --list-keys 2>/dev/null | awk '
- $1 == "pub" {
- # key id
- split($2, a, "/"); print a[2]
- }
- $1 == "uid" {
- # email
- if (match($NF, /<[^>]+>/))
- print substr($NF, RSTART + 1, RLENGTH - 2)
- #this adds support for names as well if that is ever added
- }
- $1 == "uid" {
- for (i=2;i<NF;i++) {printf "%s%s",sep, $i;sep=" "}; printf "\n"
- }' |sed -e 's/(.*)//g' -e 's/^\ //g' -e 's/\ *$//g' |uniq
- )
- keys=(${(s:/:)${keylist//$'\n'/\/}})
- _describe -t modules 'keys in keyring' keys && return 0
-}
-
-_makepkg_shortopts=(
- '-s[Install missing dependencies with pacman]'
- '-i[Install package after successful build]'
- '-A[Ignore incomplete arch field in PKGBUILD]'
- '-c[Clean up work files after build]'
- '-C[Remove $srcdir/ dir before building the package]'
- '-d[Skip all dependency checks]'
- '-e[Do not extract source files (use existing $srcdir/ dir)]'
- '-f[Overwrite existing package]'
- '-g[Generate integrity checks for source files]'
- '-h[Show help message and exit]'
- '-L[Log package build process]'
- '-m[Disable colorized output messages]'
- '-o[Download and extract files only]'
- '-p[Use an alternate build script (instead of 'PKGBUILD')]: :_files'
- '-r[Remove installed dependencies after a successful build]'
- '-R[Repackage contents of the package without rebuilding]'
- '-S[Generate a source-only tarball without downloading sources]'
- '-V[Show version information and exit]'
-)
-
-_makepkg_action_none(){
- _arguments \
- "$_makepkg_shortopts[@]" \
- "$_makepkg_longopts[@]"
-}
-_makepkg_longopts=(
- '--ignorearch[Ignore incomplete arch field in PKGBUILD]'
- '--clean[Clean up work files after build]'
- '--cleanbuild[Remove $srcdir/ dir before building the package]'
- '--nodeps[Skip all dependency checks]'
- '--noextract[Do not extract source files (use existing $srcdir/ dir)]'
- '--force[Overwrite existing package]'
- '--geninteg[Generate integrity checks for source files]'
- '--help[Show help message and exit]'
- '--install[Install package after successful build]'
- '--log[Log package build process]'
- '--nocolor[Disable colorized output messages]'
- '--nobuild[Download and extract files only]'
- '--rmdeps[Remove installed dependencies after a successful build]'
- '--repackage[Repackage contents of the package without rebuilding]'
- '--syncdeps[Install missing dependencies with pacman]'
- '--source[Generate a source-only tarball without downloading sources]'
- '--version[Show version information and exit]'
- '--allsource[Generate a source-only tarball including downloaded source]'
- '--check[Run check() function in the PKGBUILD]'
- '--config[Use an alternate config file instead of '@sysconfdir@/makepkg.conf']: :_files'
- '--holdver[Do not update VCS sources]'
- '--key[Specify key to use for gpg signing instead of the default]: :_keys'
- '--noarchive[Do not create package archive]'
- '--nocheck[Do not run the check() function in the PKGBUILD]'
- '--noprepare[Do not run the prepare() function in the PKGBUILD]'
- '--nosign[Do not create a signature for the package]'
- '--packagelist[Only list packages that would be produced, without PKGEXT]'
- '--printsrcinfo[Print the generated SRCINFO and exit]'
- '--sign[Sign the resulting package with gpg]'
- '--skipchecksums[Do not verify checksums of the source files]'
- '--skipinteg[do not perform any verification checks on source files]'
- '--skippgpcheck[Do not verify source files with PGP signatures]'
- '--noconfirm[Do not ask for confirmation when resolving dependencies]'
- '--asdeps[Install packages as non-explicitly installed]'
- '--noprogressbar[Do not show a progress bar when downloading files]'
- '--needed[Do not reinstall the targets that are already up to date]'
- '--verifysource[Download source files (if needed) and perform integrity checks]'
-)
-_makepkg(){
- case $words[CURRENT] in
- -*)
- _arguments -s -w : \
- "$_makepkg_shortopts[@]" \
- "$_makepkg_longopts[@]"
- ;;
- --* )
- _arguments -s \
- "$_makepkg_longopts[@]"
- ;;
- - )
- _makepkg_action_none
- ;;
- *)
- i=$#
- while [[ $words[i] != -* ]] && [[ $words[$i] != "makepkg" ]];do
- i=$((i-1));
- done
- case $words[$i] in
- -*)
- _arguments -s -w : \
- "$_makepkg_shortopts[@]" \
- "$_makepkg_longopts[@]"
- ;;
- --* )
- _arguments -s \
- "$_makepkg_longopts[@]"
- ;;
- - )
- _makepkg_action_none
- ;;
- * )
- return 1
- ;;
- esac
- ;;
- esac
-}
-_pacman_comp() {
- case "$service" in
- makepkg)
- _makepkg "$@"
- ;;
- pacman-key)
- _pacman_key "$@"
- ;;
- pacman)
- _pacman_zsh_comp "$@"
- ;;
- *)
- _message "Error"
- ;;
- esac
-}
-
-_pacman_comp "$@"