mirror of
https://codeberg.org/kiss-community/kiss
synced 2024-11-04 22:15:36 -07:00
993f4ee9b1
Closes #275
42 lines
718 B
Bash
Executable File
42 lines
718 B
Bash
Executable File
#!/bin/sh -e
|
|
# List orphaned packages
|
|
|
|
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
|
|
|
|
set -- "$@" "$pkg"
|
|
done
|
|
|
|
printf '%s\n' "$@"
|
|
|