Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

rpg-leaves shows installed packages no other package depends on

  • Loading branch information...
commit dec24f23c62b3a069dc7943126d63fa06c2b17e2 1 parent 437460a
Ryan Tomayko authored March 19, 2010

Showing 2 changed files with 25 additions and 2 deletions. Show diff stats Hide diff stats

  1. 6  Makefile
  2. 21  rpg-leaves.sh
6  Makefile
@@ -32,7 +32,8 @@ SOURCES = \
32 32
 	rpg-resolve.sh rpg-upgrade.sh rpg-steal.sh rpg-fsck.sh rpg-outdated.sh \
33 33
 	rpg-package-register.sh rpg-package-install.sh rpg-solve.sh rpg-unpack.sh \
34 34
 	rpg-package-spec.rb rpg-parse-index.rb rpg-shit-list.sh rpg-prepare.sh \
35  
-	rpg-help.sh rpg-package-index.sh rpg-list.sh rpg-dependencies.sh
  35
+	rpg-help.sh rpg-package-index.sh rpg-list.sh rpg-dependencies.sh \
  36
+	rpg-leaves.sh
36 37
 
37 38
 DOCHTML = \
38 39
 	rpg-sh-setup.html rpg.html rpg-fetch.html rpg-version-test.html \
@@ -45,7 +46,8 @@ PROGRAMPROGRAMS = \
45 46
 	rpg-env rpg-sync rpg-resolve rpg-upgrade rpg-steal rpg-fsck rpg-list \
46 47
 	rpg-outdated rpg-package-list rpg-package-register rpg-package-install \
47 48
 	rpg-solve rpg-unpack rpg-package-spec rpg-parse-index rpg-shit-list \
48  
-	rpg-prepare rpg-complete rpg-help rpg-package-index rpg-dependencies
  49
+	rpg-prepare rpg-complete rpg-help rpg-package-index rpg-dependencies \
  50
+	rpg-leaves
49 51
 
50 52
 USERPROGRAMS = rpg rpg-sh-setup
51 53
 PROGRAMS     = $(USERPROGRAMS) $(PROGRAMPROGRAMS)
21  rpg-leaves.sh
... ...
@@ -0,0 +1,21 @@
  1
+#!/bin/sh
  2
+set -e
  3
+. rpg-sh-setup
  4
+
  5
+ARGV="$@"
  6
+USAGE '${PROGNAME}
  7
+List installed packages that no other package depends on.'
  8
+
  9
+: ${TMPDIR:=/tmp}
  10
+
  11
+index=$(mktemp -t $PROGNAME)
  12
+trap "rm -f $index" 0
  13
+
  14
+rpg-package-index   |
  15
+cut -d ' ' -f 1     |
  16
+sort > "$index"
  17
+
  18
+rpg-dependencies -a |
  19
+cut -d ' ' -f 2     |
  20
+sort                |
  21
+comm -31 - "$index"

0 notes on commit dec24f2

Please sign in to comment.
Something went wrong with that request. Please try again.