about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2014-09-15 00:20:06 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2014-09-15 00:20:06 +0200
commitc457ffe6df1f8defaef4a8514d7fdab3f7ebfe92 (patch)
treeb72a00824c4d9762ef9e253e9b015e115f2d9171
parente89eaeb6efdd8280410be29a292543dd7d8ffdfc (diff)
downloadxtools-c457ffe6df1f8defaef4a8514d7fdab3f7ebfe92.tar.gz
xtools-c457ffe6df1f8defaef4a8514d7fdab3f7ebfe92.tar.xz
xtools-c457ffe6df1f8defaef4a8514d7fdab3f7ebfe92.zip
xmindep: rename from mindep, simply a lot using xbps 0.38
-rw-r--r--README2
-rwxr-xr-xmindep33
-rwxr-xr-xxmindep10
3 files changed, 11 insertions, 34 deletions
diff --git a/README b/README
index b86915f..288a259 100644
--- a/README
+++ b/README
@@ -4,7 +4,6 @@ These are a few small utilities for use with XBPS:
 https://github.com/voidlinux/xbps
 
   gensum [-i] TEMPLATE - update SHA256 sums in templates
-  mindep PKGS... - minimize list of PKGS by removing implicit dependencies
   xbump PKGNAME [git commit options] - git commit a version bump
   xdiff [DIR] - merge XBPS .new-* files
   xgrep PATTERN PKGS... - search files limited to XBPS package contents
@@ -12,6 +11,7 @@ https://github.com/voidlinux/xbps
   xlocate PATTERN - locate files in all XBPS packages
   xlog PKG - open commit log for XBPS template
   xls PKGS... - list files contained in PKGS (including binpkgs)
+  xmindep PKGS... - minimize list of PKGS by removing implicit dependencies
   xnuxnu PKG - upstream version checker for XBPS templates
   xq PKGS... - query information about XBPS package
   xsrc PKG - list source files for XBPS template
diff --git a/mindep b/mindep
deleted file mode 100755
index 27aa22f..0000000
--- a/mindep
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/sh
-# mindep PKGS... - minimize list of PKGS by removing implicit dependencies
-
-rdeps() {
-	for pkg; do
-		echo "$pkg>=0"
-		xbps-query -Rx $pkg
-	done | xargs -d'\n' -rn1 xbps-uhelper getpkgdepname | sort -u
-}
-
-RDEPS="$@"
-ORDEPS=
-
-while [ "$RDEPS" != "$ORDEPS" ]; do
-	ORDEPS=$RDEPS
-	RDEPS=$(rdeps $RDEPS)
-	echo RDEPS $RDEPS
-done	
-
-ORDEPS=
-while [ "$RDEPS" != "$ORDEPS" ]; do
-	ORDEPS=$RDEPS
-	SAT=
-	for pkg in $RDEPS; do
-		SAT=$({
-		printf '%s\n' $SAT
-		rdeps $pkg | grep -vx $pkg
-		} | sort -u)
-	done
-	RDEPS=$(echo "$RDEPS" | grep -Fvx -e "$SAT" | sort -u)
-done	
-
-echo $RDEPS
diff --git a/xmindep b/xmindep
new file mode 100755
index 0000000..cada61e
--- /dev/null
+++ b/xmindep
@@ -0,0 +1,10 @@
+#!/bin/sh
+# xmindep PKGS... - minimize list of PKGS by removing implicit dependencies
+
+rdeps() {
+	for pkg; do
+		xbps-query --fulldeptree -Rx $pkg
+	done | xargs -d'\n' -rn1 xbps-uhelper getpkgname | sort -u
+}
+
+printf '%s\n' "$@" | grep -Fvx -e "$(rdeps "$@")" | fmt