about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2015-01-02 12:14:17 +0100
committerChristian Neukirchen <chneukirchen@gmail.com>2015-01-02 12:14:17 +0100
commitc820f72b1af215bdb4dd73377ac734722e8ad124 (patch)
tree41bc07e790155b3917aef156a3e48288f989d728
parent73d3cecc0959e00449c5125d7bc1c1d7d5c8ab26 (diff)
downloadxtools-c820f72b1af215bdb4dd73377ac734722e8ad124.tar.gz
xtools-c820f72b1af215bdb4dd73377ac734722e8ad124.tar.xz
xtools-c820f72b1af215bdb4dd73377ac734722e8ad124.zip
add xdowngrade
-rw-r--r--README1
-rwxr-xr-xxdowngrade13
2 files changed, 14 insertions, 0 deletions
diff --git a/README b/README
index 68ebe2d..bca493e 100644
--- a/README
+++ b/README
@@ -8,6 +8,7 @@ https://github.com/voidlinux/xbps
   xclash - detect file conflicts between XBPS packages
   xdiff [-u] [DIR] - merge XBPS .new-* files
   xdistdir - figure out XBPS_DISTDIR
+  xdowngrade PKGS.xbps... - install XBPS package directly from .xbps file
   xgensum [-i] TEMPLATE - update SHA256 sums in templates
   xgrep PATTERN PKGS... - search files limited to XBPS package contents
   xlg PKG - open short commit log for XBPS template
diff --git a/xdowngrade b/xdowngrade
new file mode 100755
index 0000000..5467842
--- /dev/null
+++ b/xdowngrade
@@ -0,0 +1,13 @@
+#!/bin/sh -e
+# xdowngrade PKGS.xbps... - install XBPS package directly from .xbps file
+
+T=$(mktemp --tmpdir -d xdowngrade-$(date -I).XXXXXXXX)
+ln -s -t $T/ "$@"
+xbps-rindex -a $T/*
+pkg=
+for f; do
+	f=${f##*/}
+	pkg="$pkg ${f%-*}"
+done
+xbps-install -i -R $T -f $pkg
+rm -r $T