1
0
mirror of https://codeberg.org/kiss-community/kiss synced 2024-12-25 00:20:05 -07:00

kiss: use pre_pre

This commit is contained in:
Dylan Araps 2021-07-16 10:07:04 +03:00
parent 9895a14e83
commit 268504bec8
No known key found for this signature in database
GPG Key ID: 13295DAC2CF13B5C

11
kiss
View File

@ -1465,20 +1465,17 @@ pkg_install() {
log "$pkg_name" "Installing package (${tar_file##*/})" log "$pkg_name" "Installing package (${tar_file##*/})"
# Make a backup of any etcsums if they exist.
tmp_file_copy "$pkg_name" etcsums-copy "$sys_db/$pkg_name/etcsums"
_etc_sums=$_tmp_file
# 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 and etcsums files. # backup of the manifest and etcsums files.
tmp_file_copy "$pkg_name" manifest-copy "$sys_db/$pkg_name/manifest" tmp_file_copy "$pkg_name" manifest-copy "$sys_db/$pkg_name/manifest"
tmp_file_copy "$pkg_name" etcsums-copy "$sys_db/$pkg_name/etcsums"
tmp_file "$pkg_name" manifest-diff tmp_file "$pkg_name" manifest-diff
tar_man=$tar_dir/$pkg_name/$pkg_db/$pkg_name/manifest tar_man=$tar_dir/$pkg_name/$pkg_db/$pkg_name/manifest
# Generate a list of files which exist in the currently installed manifest # Generate a list of files which exist in the currently installed manifest
# but not in the newer (to be installed) manifest. # but not in the newer (to be installed) manifest.
grep -vFxf "$tar_man" "$_tmp_file_pre" > "$_tmp_file" 2>/dev/null ||: grep -vFxf "$tar_man" "$_tmp_file_pre_pre" > "$_tmp_file" 2>/dev/null ||:
# Reverse the manifest file so that we start shallow and go deeper as we # Reverse the manifest file so that we start shallow and go deeper as we
# iterate over each item. This is needed so that directories are created # iterate over each item. This is needed so that directories are created
@ -1502,12 +1499,12 @@ pkg_install() {
# #
# This is more or less similar to Arch Linux's Pacman with the user # This is more or less similar to Arch Linux's Pacman with the user
# manually handling the .new files when and if they appear. # manually handling the .new files when and if they appear.
pkg_etc "$pkg_name" "$_etc_sums" && pkg_etc "$pkg_name" "$_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
# type has to be specially handled to ensure no system breakage occurs. # type has to be specially handled to ensure no system breakage occurs.
pkg_remove_files "$_etc_sums" < "$_tmp_file_pre" && pkg_remove_files "$_tmp_file_pre_pre" < "$_tmp_file_pre" &&
# 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.