forked from kiss-community/kiss
kiss: use fd for etcsums. Removes last awk
This commit is contained in:
parent
c4481c9283
commit
ce2f4c8f9a
13
kiss
13
kiss
@ -1208,7 +1208,7 @@ pkg_install_files() {
|
|||||||
#
|
#
|
||||||
# This is more or less similar to Arch Linux's Pacman with the
|
# This is more or less similar to Arch Linux's Pacman with the
|
||||||
# user manually handling the .new files when and if they appear.
|
# user manually handling the .new files when and if they appear.
|
||||||
pkg_etc "$_tmp_file_pre_pre" || continue
|
pkg_etc || continue
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [ -h "$_file" ]; then
|
if [ -h "$_file" ]; then
|
||||||
@ -1231,8 +1231,6 @@ pkg_install_files() {
|
|||||||
mv -f "$__tmp" "$_file"
|
mv -f "$__tmp" "$_file"
|
||||||
fi
|
fi
|
||||||
esac || return 1; done
|
esac || return 1; done
|
||||||
|
|
||||||
unset _etc_cnt
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pkg_remove_files() {
|
pkg_remove_files() {
|
||||||
@ -1277,13 +1275,12 @@ pkg_remove_files() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pkg_etc() {
|
pkg_etc() {
|
||||||
_etc_cnt=$((_etc_cnt + 1))
|
|
||||||
|
|
||||||
sh256 "$tar_dir/$_pkg$file" "$KISS_ROOT$file" >/dev/null
|
sh256 "$tar_dir/$_pkg$file" "$KISS_ROOT$file" >/dev/null
|
||||||
|
|
||||||
sum_new=${hash%%"$newline"*}
|
sum_new=${hash%%"$newline"*}
|
||||||
sum_sys=${hash#*"$newline"}
|
sum_sys=${hash#*"$newline"}
|
||||||
sum_old=$(awk "NR == $_etc_cnt" "$1") >/dev/null 2>&1 ||:
|
|
||||||
|
read -r sum_old <&3 2>&1 ||:
|
||||||
|
|
||||||
# Compare the three checksums to determine what to do.
|
# Compare the three checksums to determine what to do.
|
||||||
case ${sum_old:-null}${sum_sys:-null}${sum_new} in
|
case ${sum_old:-null}${sum_sys:-null}${sum_new} in
|
||||||
@ -1480,7 +1477,7 @@ pkg_install() {
|
|||||||
|
|
||||||
if
|
if
|
||||||
# Install the package's files by iterating over its manifest.
|
# Install the package's files by iterating over its manifest.
|
||||||
pkg_install_files -z "$PWD" < "$_tmp_file" &&
|
pkg_install_files -z "$PWD" < "$_tmp_file" 3< "$_tmp_file_pre_pre" &&
|
||||||
|
|
||||||
# This is the aforementioned step removing any files from the old
|
# This is the aforementioned step removing any files from the old
|
||||||
# version of the package if the installation is an update. Each file
|
# version of the package if the installation is an update. Each file
|
||||||
@ -1489,7 +1486,7 @@ pkg_install() {
|
|||||||
|
|
||||||
# Install the package's files a second time to fix any mess caused by
|
# Install the package's files a second time to fix any mess caused by
|
||||||
# the above removal of the previous version of the package.
|
# the above removal of the previous version of the package.
|
||||||
pkg_install_files -e "$PWD" < "$_tmp_file"
|
pkg_install_files -e "$PWD" < "$_tmp_file" 3< "$_tmp_file_pre_pre"
|
||||||
|
|
||||||
then
|
then
|
||||||
# Reset 'trap' to its original value. Installation is done so we no longer
|
# Reset 'trap' to its original value. Installation is done so we no longer
|
||||||
|
Loading…
Reference in New Issue
Block a user