Permalink
Browse files

rpg-leaves shows installed packages no other package depends on

  • Loading branch information...
1 parent 437460a commit dec24f23c62b3a069dc7943126d63fa06c2b17e2 @rtomayko committed Mar 19, 2010
Showing with 25 additions and 2 deletions.
  1. +4 −2 Makefile
  2. +21 −0 rpg-leaves.sh
View
@@ -32,7 +32,8 @@ SOURCES = \
rpg-resolve.sh rpg-upgrade.sh rpg-steal.sh rpg-fsck.sh rpg-outdated.sh \
rpg-package-register.sh rpg-package-install.sh rpg-solve.sh rpg-unpack.sh \
rpg-package-spec.rb rpg-parse-index.rb rpg-shit-list.sh rpg-prepare.sh \
- rpg-help.sh rpg-package-index.sh rpg-list.sh rpg-dependencies.sh
+ rpg-help.sh rpg-package-index.sh rpg-list.sh rpg-dependencies.sh \
+ rpg-leaves.sh
DOCHTML = \
rpg-sh-setup.html rpg.html rpg-fetch.html rpg-version-test.html \
@@ -45,7 +46,8 @@ PROGRAMPROGRAMS = \
rpg-env rpg-sync rpg-resolve rpg-upgrade rpg-steal rpg-fsck rpg-list \
rpg-outdated rpg-package-list rpg-package-register rpg-package-install \
rpg-solve rpg-unpack rpg-package-spec rpg-parse-index rpg-shit-list \
- rpg-prepare rpg-complete rpg-help rpg-package-index rpg-dependencies
+ rpg-prepare rpg-complete rpg-help rpg-package-index rpg-dependencies \
+ rpg-leaves
USERPROGRAMS = rpg rpg-sh-setup
PROGRAMS = $(USERPROGRAMS) $(PROGRAMPROGRAMS)
View
@@ -0,0 +1,21 @@
+#!/bin/sh
+set -e
+. rpg-sh-setup
+
+ARGV="$@"
+USAGE '${PROGNAME}
+List installed packages that no other package depends on.'
+
+: ${TMPDIR:=/tmp}
+
+index=$(mktemp -t $PROGNAME)
+trap "rm -f $index" 0
+
+rpg-package-index |
+cut -d ' ' -f 1 |
+sort > "$index"
+
+rpg-dependencies -a |
+cut -d ' ' -f 2 |
+sort |
+comm -31 - "$index"

0 comments on commit dec24f2

Please sign in to comment.