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