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() ...@@ -45,21 +45,28 @@ is_abs_path()
echo "$1" | grep -q "^/" echo "$1" | grep -q "^/"
} }
# Remove file from the file system and from spec # Remove file(s) from the file system and from spec
# Usage: remove_file <path_to_file> # Usage: remove_file <path_to_file_or_pattern>
remove_file() remove_file()
{ {
local file="$1" local file_pattern="$1"
[ -n "$file" ] || return [ -n "$file_pattern" ] || return
[ -e "$BUILDROOT$file" ] || [ -L "$BUILDROOT$file" ] || return
rm -v "$BUILDROOT$file" for file in $(eval echo "$BUILDROOT$file_pattern"); do
subst "s|^$file$||" $SPEC [ -e "$file" ] || [ -L "$file" ] || continue
subst "s|^\"$file\"$||" $SPEC
subst "s|^\(%config.*\) $file$||" $SPEC rm -v "$file"
subst "s|^\(%config.*\) \"$file\"$||" $SPEC
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() is_dir_empty()
{ {
[ -z "$(ls -A "$1")" ] [ -z "$(ls -A "$1")" ]
......
...@@ -24,9 +24,7 @@ remove_file $PRODUCTDIR/office6/wpscloudsvr ...@@ -24,9 +24,7 @@ remove_file $PRODUCTDIR/office6/wpscloudsvr
remove_file $PRODUCTDIR/office6/addons/pdfbatchcompression/libpdfbatchcompressionapp.so remove_file $PRODUCTDIR/office6/addons/pdfbatchcompression/libpdfbatchcompressionapp.so
# Fix for icu>=71.1 # 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
remove_file $PRODUCTDIR/office6/libstdc++.so.6.0.28
# hack to fix bug somewhere in linking # hack to fix bug somewhere in linking
ignore_lib_requires "libc++.so" 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