Skip to content

Commit b1fea73

Browse files
authored
Do convert multiple libpath references
This is on top of MR #221, so each step can be well tested, separately
1 parent dda3f1a commit b1fea73

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/tools/pm_apply

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,16 @@ mangle_libpath() {
122122
pr=$(printf '%s' "$p" | sed 's@/usr/lib/@/usr/lib64/@')
123123
fi
124124
# doit
125-
mkdir -p "$PM_PATCH_BACKUP_DIR"
126-
patch_edited_path="$PM_PATCH_BACKUP_DIR"/"$PATCH_EDITED_NAME"
127-
printf '#\n# Patch converted to %sbit library paths from its original by Patchmanager > 3.1\n# Date: %s\n#\n' $SYS_BITNESS $(date -Iseconds) > "$patch_edited_path"
128-
sed "s@^+++ $p@+++ $pr@;s@^--- $p@--- $pr@" "$PATCH_PATH" >> "$patch_edited_path"
125+
if [ $found -eq $cand_lines ]; then # first run in loop
126+
mkdir -p "$PM_PATCH_BACKUP_DIR"
127+
patch_edited_path="$PM_PATCH_BACKUP_DIR"/"$PATCH_EDITED_NAME"
128+
printf '#\n# Patch converted to %sbit library paths from its original by Patchmanager > 3.1\n# Date: %s\n#\n' $SYS_BITNESS $(date -Iseconds) > "$patch_edited_path"
129+
cat "$PATCH_PATH" >> "$patch_edited_path"
130+
fi
131+
sed -i "s@^+++ $p@+++ $pr@;s@^--- $p@--- $pr@" "$patch_edited_path" # patch the Patch
129132
if [ $? -ne 0 ]; then
130133
failure
131134
fi
132-
break
133135
done
134136
if [ $found -eq 0 ]; then
135137
log

0 commit comments

Comments
 (0)