kiss: simplify install
This commit is contained in:
parent
1b3260b891
commit
428a388c39
15
kiss
15
kiss
|
@ -939,7 +939,7 @@ pkg_install() {
|
||||||
|
|
||||||
# If the package is already installed (and this is an upgrade) make a
|
# If the package is already installed (and this is an upgrade) make a
|
||||||
# backup of the manifest file.
|
# backup of the manifest file.
|
||||||
old_manifest=$(cat "$sys_db/$pkg_name/manifest" 2>/dev/null ||:)
|
cp -f "$sys_db/$pkg_name/manifest" "$mak_dir/m" 2>/dev/null ||:
|
||||||
|
|
||||||
# This is repeated multiple times. Better to make it a function.
|
# This is repeated multiple times. Better to make it a function.
|
||||||
pkg_rsync() {
|
pkg_rsync() {
|
||||||
|
@ -987,18 +987,14 @@ pkg_install() {
|
||||||
)
|
)
|
||||||
|
|
||||||
# Remove any leftover files if this is an upgrade.
|
# Remove any leftover files if this is an upgrade.
|
||||||
[ "$old_manifest" ] && {
|
"$grep" -vFxf "$sys_db/$pkg_name/manifest" "$mak_dir/m" 2>/dev/null |
|
||||||
printf '%s\n' "$old_manifest" |
|
|
||||||
"$grep" -vFxf "$sys_db/$pkg_name/manifest" - |
|
|
||||||
|
|
||||||
while read -r file; do
|
while read -r file; do
|
||||||
# Skip deleting some leftover files.
|
|
||||||
case $file in
|
|
||||||
/etc/*|*bin/rm|*bin/busybox|*bin/rsync) continue
|
|
||||||
esac
|
|
||||||
|
|
||||||
file=$KISS_ROOT/$file
|
file=$KISS_ROOT/$file
|
||||||
|
|
||||||
|
# Skip deleting some leftover files.
|
||||||
|
case $file in /etc/*) continue; esac
|
||||||
|
|
||||||
# Remove files.
|
# Remove files.
|
||||||
if [ -f "$file" ] && [ ! -L "$file" ]; then
|
if [ -f "$file" ] && [ ! -L "$file" ]; then
|
||||||
rm -f "$file"
|
rm -f "$file"
|
||||||
|
@ -1015,7 +1011,6 @@ pkg_install() {
|
||||||
rmdir "$file" 2>/dev/null ||:
|
rmdir "$file" 2>/dev/null ||:
|
||||||
fi
|
fi
|
||||||
done ||:
|
done ||:
|
||||||
}
|
|
||||||
|
|
||||||
# Install the package again to fix any non-leftover files being
|
# Install the package again to fix any non-leftover files being
|
||||||
# removed above.
|
# removed above.
|
||||||
|
|
Loading…
Reference in New Issue