unpack: added --skip-xattr for get_base_pfx

This commit is contained in:
Mikhail Tergoev
2025-06-27 15:30:39 +03:00
parent f39911b1be
commit 62497c94c4

View File

@ -239,6 +239,12 @@ create_new_dir () {
} }
unpack () { unpack () {
if [[ $1 == "--skip-xattr" ]] ; then
local skip_xattr="1"
shift
else
unset skip_xattr
fi
print_info "Запуск распаковки архива $1" print_info "Запуск распаковки архива $1"
local command outarg local command outarg
case $1 in case $1 in
@ -249,12 +255,14 @@ unpack () {
*.zip|*.exe|*.rar) command="7z x -y -bso0" ; outarg="-o" ;; *.zip|*.exe|*.rar) command="7z x -y -bso0" ; outarg="-o" ;;
esac esac
create_new_dir "$2" create_new_dir "$2"
if $command "$1" ${outarg}"$2" ; then if [[ $skip_xattr == "1" ]] \
print_ok "Файл $1 распакован." && $command "$1" ${outarg}"$2" 2>&1 | grep -v "xattr"
return 0 then print_ok "Файл $1 распакован."
else elif $command "$1" ${outarg}"$2"
fatal "Распаковать файл $1 не удалось!" then print_ok "Файл $1 распакован."
else fatal "Распаковать файл $1 не удалось!"
fi fi
return 0
} }
try_get_page () { try_get_page () {
@ -870,11 +878,11 @@ get_base_pfx () {
if [[ ! -f "$PFX_TMP/$FILE_NAME_PFX.tar.xz" ]] ; then if [[ ! -f "$PFX_TMP/$FILE_NAME_PFX.tar.xz" ]] ; then
print_info "Загрузка базового префикса: ${FILE_NAME_PFX}" print_info "Загрузка базового префикса: ${FILE_NAME_PFX}"
if try_download "$PFX_URL" "$PFX_TMP/$FILE_NAME_PFX.tar.xz" check256sum if try_download "$PFX_URL" "$PFX_TMP/$FILE_NAME_PFX.tar.xz" check256sum
then unpack "$PFX_TMP/$FILE_NAME_PFX.tar.xz" "$WINEPREFIX/" then unpack --skip-xattr "$PFX_TMP/$FILE_NAME_PFX.tar.xz" "$WINEPREFIX/"
else try_remove_file "$PFX_TMP/$FILE_NAME_PFX.tar.xz" else try_remove_file "$PFX_TMP/$FILE_NAME_PFX.tar.xz"
fi fi
else else
if ! unpack "$PFX_TMP/$FILE_NAME_PFX.tar.xz" "$WINEPREFIX/" ; then if ! unpack --skip-xattr "$PFX_TMP/$FILE_NAME_PFX.tar.xz" "$WINEPREFIX/" ; then
try_remove_file "${PFX_TMP}/${FILE_NAME_PFX}.tar.xz" try_remove_file "${PFX_TMP}/${FILE_NAME_PFX}.tar.xz"
get_base_pfx "$FILE_NAME_PFX" get_base_pfx "$FILE_NAME_PFX"
fi fi