2019-10-30 04:51:48 -06:00
|
|
|
#!/bin/sh -e
|
2020-05-01 00:07:20 -06:00
|
|
|
# List orphaned packages
|
2019-10-30 04:51:48 -06:00
|
|
|
|
2021-09-26 06:00:38 -06: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
|
2020-11-05 23:14:46 -07:00
|
|
|
esac
|
2019-10-30 04:51:48 -06:00
|
|
|
|
2021-09-26 06:00:38 -06:00
|
|
|
set -- "$@" "$pkg"
|
2020-11-05 23:14:46 -07:00
|
|
|
done
|
2021-09-26 06:00:38 -06:00
|
|
|
|
|
|
|
printf '%s\n' "$@"
|
|
|
|
|