about summary refs log tree commit diff
diff options
context:
space:
mode:
-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