mirror of
https://github.com/outbackdingo/scratchpkg.git
synced 2026-02-05 08:28:00 +00:00
add isorphan function
This commit is contained in:
28
scratch
28
scratch
@@ -300,11 +300,32 @@ showdepends() {
|
||||
msgmiss "$dep"
|
||||
fi
|
||||
done
|
||||
}
|
||||
}
|
||||
|
||||
isorphan() {
|
||||
needarg $1
|
||||
|
||||
for pkg in $(allinstalled); do
|
||||
pkgpath=$(getportpath $pkg)
|
||||
#echo $pkgpath
|
||||
if [ $pkgpath ]; then
|
||||
depend=$(grep "^# depends[[:blank:]]*:" $pkgpath/$BUILD_SCRIPT | sed 's/^# depends[[:blank:]]*:[[:blank:]]*//' | tr ' ' '\n' | awk '!a[$0]++')
|
||||
for dep in ${depend[@]}; do
|
||||
if [ $dep = $1 ]; then
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
fi
|
||||
unset depend dep
|
||||
done
|
||||
return 0
|
||||
}
|
||||
|
||||
showdependent() {
|
||||
local port all dep pname
|
||||
|
||||
needarg $1
|
||||
|
||||
for port in ${PORT_REPO[@]}; do
|
||||
if [ -d $port ]; then
|
||||
for all in $port/*/$BUILD_SCRIPT; do
|
||||
@@ -1406,6 +1427,11 @@ main() {
|
||||
missingdep
|
||||
exit $?
|
||||
fi
|
||||
|
||||
if [ "$mode" = "isorphan" ]; then
|
||||
isorphan $1
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo "Run 'scratch help' to see available operations and options"
|
||||
exit 5
|
||||
|
||||
Reference in New Issue
Block a user