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

kiss: use temporary file for fix-deps

This commit is contained in:
Dylan Araps 2021-07-16 15:14:36 +03:00
parent f644275c62
commit a68608dfd1
No known key found for this signature in database
GPG Key ID: 13295DAC2CF13B5C

15
kiss
View File

@ -593,9 +593,8 @@ pkg_fix_deps() {
set +f set +f
set -f -- "$sys_db/"*/manifest set -f -- "$sys_db/"*/manifest
: >> depends tmp_file_copy "${PWD##*/}" depends depends
tmp_file "${PWD##*/}" depends-fixed
tmp_file "${PWD##*/}" fix-depends
find "$pkg_dir/${PWD##*/}/" -type f 2>/dev/null | find "$pkg_dir/${PWD##*/}/" -type f 2>/dev/null |
@ -647,16 +646,14 @@ pkg_fix_deps() {
done <<EOF || : done <<EOF || :
$elf_buf $elf_buf
EOF EOF
done | sort -uk1,1 depends - > "$_tmp_file" done | sort -uk1,1 "$_tmp_file_pre" - > "$_tmp_file"
# If the depends file was modified, show a diff and replace it. # If the depends file was modified, show a diff and replace it.
if [ -s "$_tmp_file" ]; then ! [ -s "$_tmp_file" ] || {
diff -U 3 depends - < "$_tmp_file" 2>/dev/null || : diff -U 3 "$_tmp_file_pre" "$_tmp_file" 2>/dev/null || :
mv -f "$_tmp_file" depends mv -f "$_tmp_file" depends
pkg_manifest "${PWD##*/}" pkg_manifest "${PWD##*/}"
else }
rm -f depends
fi
} }
pkg_manifest() { pkg_manifest() {