forked from kiss-community/kiss
parent
eed63b0d81
commit
993f4ee9b1
@ -1,16 +1,41 @@
|
|||||||
#!/bin/sh -e
|
#!/bin/sh -e
|
||||||
# List orphaned packages
|
# List orphaned packages
|
||||||
|
|
||||||
cd "$KISS_ROOT/var/db/kiss/installed/"
|
n='
|
||||||
|
'
|
||||||
|
|
||||||
for pkg in *; do
|
cd "$KISS_ROOT/var/db/kiss/installed"
|
||||||
case $pkg in
|
set -- *
|
||||||
# Exemptions for orphans which aren't really
|
|
||||||
# orphans. Exclude them from the list.
|
l=$n$(
|
||||||
baseinit|baselayout|gcc|e2fsprogs|musl|\
|
for pkg do shift
|
||||||
make|busybox|bzip2|grub|kiss|git)
|
set -- "$@" -e "$pkg"
|
||||||
continue
|
done
|
||||||
|
|
||||||
|
# Get a list of non-orphans.
|
||||||
|
grep -Fx "$@" -- */depends |
|
||||||
|
|
||||||
|
{
|
||||||
|
# Strip filename.
|
||||||
|
sed s,.\*/depends:,,
|
||||||
|
|
||||||
|
# Exclude packages which are not really orphans.
|
||||||
|
printf '%s\n' baseinit baselayout busybox bzip2 e2fsprogs gcc \
|
||||||
|
git grub kiss make musl
|
||||||
|
} |
|
||||||
|
|
||||||
|
# Remove duplicates.
|
||||||
|
sort -u
|
||||||
|
)$n
|
||||||
|
|
||||||
|
# Generate the list of orphans by finding the inverse of the non-orphan list.
|
||||||
|
for pkg do shift
|
||||||
|
case $l in (*"$n$pkg$n"*)
|
||||||
|
continue
|
||||||
esac
|
esac
|
||||||
|
|
||||||
grep -q "^$pkg$" ./*/depends || printf '%s\n' "$pkg"
|
set -- "$@" "$pkg"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
printf '%s\n' "$@"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user