All pastes #33666 Raw Edit

patch to pkg_rmleaves

public shellscript v1 · immutable
#33666 ·published 2005-12-14 16:32 UTC
rendered paste body
--- pkg_rmleaves	2005-12-14 16:28:09.000000000 +0000+++ pkg_rmleaves.orig	2005-12-14 16:25:21.000000000 +0000@@ -34,7 +34,6 @@ #	-x: Use Xdialog #	-X: Use Xdialog in high compatibility mode #	-k: Use kdialog-#	-a: Act only on automatically installed packages  TMPDIR=`mktemp -dt pkg_rmleaves`	#Directory where i keep the temporary files TMPFILE="$TMPDIR/tmp"				#Generic use temporary file@@ -61,7 +60,7 @@ # update leaf files checkLeafs() { 	find -s /var/db/pkg/ -type d -mindepth 1 | while read i; do-		if [ ! -s "$i/+REQUIRED_BY" ] && ( [ -z $AUTOMATIC_ONLY ] || [ ! -z `pkg_info -Qautomatic $i` ] ); then+		if [ ! -s "$i/+REQUIRED_BY" ]; then  			basename "$i" >> "$PKGFILE" 		fi 	done@@ -86,7 +85,7 @@ 		awk '{printf "%s%s%s ", "\"", $0, "\" \"\" \"off\""}' "$TMPFILE" > "$LEAFS" 	fi 	-	eval "$DIALOG" --title \"Welcome to pkg_rmleaves\" --checklist \"`printf "These are the leaf packages installed on your system\nChose the packages to deinstall"`\" `expr $LINES + $LINES - 1` 60 $LINES "`cat "$LEAFS"`" 2>"$TMPFILE"+	eval "$DIALOG" --title \"Welcome to pkg_rmleaves\" --checklist \"`printf "These are the leaf packages installed on your system\nChose the packages to deinstall"`\" $MAX $MAX $LINES "`cat "$LEAFS"`" 2>"$TMPFILE"  	if [ $? = 255 ]; then 		esci "Dialog Error, try to resize your terminal to at least 80x24" 1@@ -109,7 +108,7 @@ # Use dialog as default DIALOG DIALOG=dialog -args=`getopt ldxXka $*`+args=`getopt ldxXk $*` set -- $args for i; do 	case "$i" in@@ -131,9 +130,6 @@ 		-k) 			DIALOG=kdialog 			break;;-		-a)-			AUTOMATIC_ONLY=yes-			break;; 	esac done @@ -142,7 +138,7 @@ 	LINES=0 elif [ "$DIALOG" = "dialog" ]; then 	MAX=-1-	LINES=9+	LINES=15 fi  checkLeafs