Commit 3670b31e authored by Boris Yumankulov's avatar Boris Yumankulov Committed by Vitaly Lipatov

epm repack common: add wildcard support to remove_file (eterbug #17812)

parent 5dbadcbd
......@@ -45,21 +45,28 @@ is_abs_path()
echo "$1" | grep -q "^/"
}
# Remove file from the file system and from spec
# Usage: remove_file <path_to_file>
# Remove file(s) from the file system and from spec
# Usage: remove_file <path_to_file_or_pattern>
remove_file()
{
local file="$1"
[ -n "$file" ] || return
[ -e "$BUILDROOT$file" ] || [ -L "$BUILDROOT$file" ] || return
local file_pattern="$1"
[ -n "$file_pattern" ] || return
rm -v "$BUILDROOT$file"
subst "s|^$file$||" $SPEC
subst "s|^\"$file\"$||" $SPEC
subst "s|^\(%config.*\) $file$||" $SPEC
subst "s|^\(%config.*\) \"$file\"$||" $SPEC
for file in $(eval echo "$BUILDROOT$file_pattern"); do
[ -e "$file" ] || [ -L "$file" ] || continue
rm -v "$file"
local relative_file="${file#"$BUILDROOT"}"
subst "s|^$relative_file$||" $SPEC
subst "s|^\"$relative_file\"$||" $SPEC
subst "s|^\(%config.*\) $relative_file$||" $SPEC
subst "s|^\(%config.*\) \"$relative_file\"$||" $SPEC
done
}
is_dir_empty()
{
[ -z "$(ls -A "$1")" ]
......
......@@ -24,9 +24,7 @@ remove_file $PRODUCTDIR/office6/wpscloudsvr
remove_file $PRODUCTDIR/office6/addons/pdfbatchcompression/libpdfbatchcompressionapp.so
# Fix for icu>=71.1
# TODO: add wildcard support to remove_file
remove_file $PRODUCTDIR/office6/libstdc++.so.6
remove_file $PRODUCTDIR/office6/libstdc++.so.6.0.28
remove_file $PRODUCTDIR/office6/libstdc++.so.6*
# hack to fix bug somewhere in linking
ignore_lib_requires "libc++.so"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment