summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rw-r--r--contrib/Makefile.am5
-rw-r--r--contrib/README3
-rwxr-xr-xcontrib/pacscripts.in2
-rwxr-xr-xcontrib/wget-xdelta.sh.in70
4 files changed, 2 insertions, 78 deletions
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
index 827d9ec0..e9f77940 100644
--- a/contrib/Makefile.am
+++ b/contrib/Makefile.am
@@ -3,8 +3,7 @@ OURSCRIPTS = \
pacdiff \
paclist \
pacscripts \
- pacsearch \
- wget-xdelta.sh
+ pacsearch
OURFILES = \
bash_completion \
@@ -19,7 +18,6 @@ EXTRA_DIST = \
pacscripts.in \
pacsearch.in \
vimprojects \
- wget-xdelta.sh.in \
zsh_completion.in \
README
@@ -55,7 +53,6 @@ paclist: $(srcdir)/paclist.in
pacscripts: $(srcdir)/pacscripts.in
pacsearch: $(srcdir)/pacsearch.in
pactree: $(srcdir)/pactree.in
-wget-xdelta.sh: $(srcdir)/wget-xdelta.sh.in
zsh_completion: $(srcdir)/zsh_completion.in
# vim:set ts=2 sw=2 noet:
diff --git a/contrib/README b/contrib/README
index 4f591012..04b656f3 100644
--- a/contrib/README
+++ b/contrib/README
@@ -28,6 +28,3 @@ database entries. Useful for reuse, or possible config file extension.
vimprojects - a project file for the vim project plugin.
-wget-xdelta.sh - A download script for pacman which allows binary deltas
-generated with makepkg to be used instead of downloading full binary packages.
-This should cut download sizes for some package upgrades significantly.
diff --git a/contrib/pacscripts.in b/contrib/pacscripts.in
index d3664091..8ad5173b 100755
--- a/contrib/pacscripts.in
+++ b/contrib/pacscripts.in
@@ -61,7 +61,7 @@ spacman() {
if [ $EUID -eq 0 ]; then
pacman "$@"
else
- if [ ! "$(type -p sudo)" ]; then
+ if ! type -p sudo; then
error "Cannot find the sudo binary! Is sudo installed?"
error "Otherwise try to run the program as root"
exit 1
diff --git a/contrib/wget-xdelta.sh.in b/contrib/wget-xdelta.sh.in
deleted file mode 100755
index f2ac1c87..00000000
--- a/contrib/wget-xdelta.sh.in
+++ /dev/null
@@ -1,70 +0,0 @@
-#!@BASH_SHELL@
-
-if [ -r "@sysconfdir@/makepkg.conf" ]; then
- source @sysconfdir@/makepkg.conf
-else
- echo "wget-xdelta: Unable to find makepkg.conf"
- exit 1
-fi
-
-if [ -r ~/.makepkg.conf ]; then
- source ~/.makepkg.conf
-fi
-
-out_file=$(basename $1)
-file_url=$2
-
-if ! [[ "$out_file" =~ "pkg.tar.gz" ]]; then
- # If it's not a package file download as normal and exit.
- #wget --passive-ftp -c -O "$out_file" "$file_url"
- exit $?
-fi
-
-
-# Get the package name and version
-[[ "$out_file" =~ "$CARCH" ]] && arch="-$CARCH" || arch=""
-pkg_data=$(echo $out_file | \
- sed "s|^\(.*\)-\([[:alnum:]_\.]*-[[:alnum:]_\.]*\)${arch}${PKGEXT}.part|\1 \2|")
-pkgname=$(echo $pkg_data | cut -d ' ' -f 1)
-new_version=$(echo $pkg_data | cut -d ' ' -f 2)
-base_url=${file_url%/*}
-
-# Look for the last version
-for file in $(ls -r @localstatedir@/cache/pacman/pkg/${pkgname}-*-*{,-$CARCH}$PKGEXT 2>/dev/null); do
- [[ "$file" =~ "$CARCH" ]] && arch="-$CARCH" || arch=""
- check_version=$(echo $file | \
- sed "s|^.*/${pkgname}-\([[:alnum:]_\.]*-[[:alnum:]_\.]*\)${arch}$PKGEXT$|\1|" | \
- grep -v "^@localstatedir@/cache/pacman/pkg")
-
- [ "$check_version" = "" ] && continue
-
- vercmp=$(vercmp "$check_version" "$old_version")
- if [ "$check_version" != "$new_version" -a $vercmp -gt 0 ]; then
- old_version=$check_version
- old_file=$file
- fi
-done
-
-if [ "$old_version" != "" -a "$old_version" != "$new_version" ]; then
- # Great, we have a cached file, now calculate a patch name from it
- delta_name="$pkgname-${old_version}_to_${new_version}-${CARCH}.delta"
-
- echo "wget-xdelta: Attempting to download delta $delta_name..." >&2
- if wget --passive-ftp -c "$base_url/$delta_name"; then
- echo "wget-xdelta: Applying delta..."
- if xdelta patch "$delta_name" "$old_file" "$out_file"; then
- echo "wget-xdelta: Delta applied successfully!"
- rm "$delta_name"
- exit 0
- else
- echo "wget-xdelta: Failed to apply delta!"
- rm $delta_name
- fi
- fi
- fi
-
-echo "wget-xdelta: Downloading new package..."
-wget --passive-ftp -c -O "$out_file" "$file_url"
-exit $?
-
-# vim:set ts=4 sw=4 noet: