kiss/contrib/kiss-orphans

42 lines
718 B
Plaintext
Raw Normal View History

2019-10-30 10:51:48 +00:00
#!/bin/sh -e
2020-05-01 06:07:20 +00:00
# List orphaned packages
2019-10-30 10:51:48 +00:00
n='
'
cd "$KISS_ROOT/var/db/kiss/installed"
set -- *
l=$n$(
for pkg do shift
set -- "$@" -e "$pkg"
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
2019-10-30 10:51:48 +00:00
set -- "$@" "$pkg"
done
printf '%s\n' "$@"