Commit e54ceeb5 authored by Mikhail Tergoev's avatar Mikhail Tergoev

Merge branch 'update-checksums' of github.com:Htylol/PortWINE into Htylol-update-checksums

parents 7e40a291 cfe39e74
...@@ -143,8 +143,8 @@ try_copy_file_with_checksums () { ...@@ -143,8 +143,8 @@ try_copy_file_with_checksums () {
|| [[ "${PW_FILESYSTEM}" == "f2fs" ]] \ || [[ "${PW_FILESYSTEM}" == "f2fs" ]] \
|| [[ "${PW_FILESYSTEM}" != "btrfs" ]] || [[ "${PW_FILESYSTEM}" != "btrfs" ]]
then then
checksum1=($(sha256sum "$1")) checksum1="$(sha256sum "$1")"
echo "${checksum1[0]}" > "$2.sha256sum" echo "${checksum1// */}" > "$2.sha256sum"
fi fi
return 0 return 0
else else
...@@ -155,28 +155,28 @@ try_copy_file_with_checksums () { ...@@ -155,28 +155,28 @@ try_copy_file_with_checksums () {
|| [[ "${PW_FILESYSTEM}" == "f2fs" ]] \ || [[ "${PW_FILESYSTEM}" == "f2fs" ]] \
|| [[ "${PW_FILESYSTEM}" != "btrfs" ]] || [[ "${PW_FILESYSTEM}" != "btrfs" ]]
then then
checksum1=($(sha256sum "$1")) checksum1="$(sha256sum "$1")"
if [[ ! -f "$2" ]] ; then if [[ ! -f "$2" ]] ; then
if cp -f "$1" "$2" ; then if cp -f "$1" "$2" ; then
echo "${checksum1[0]}" > "$2.sha256sum" echo "${checksum1// */}" > "$2.sha256sum"
return 0 return 0
else else
return 1 return 1
fi fi
else else
if [[ ! -f "$2.sha256sum" ]] ; then if [[ ! -f "$2.sha256sum" ]] ; then
checksum2=($(sha256sum "$2")) checksum2="$(sha256sum "$2")"
echo "${checksum2[0]}" > "$2.sha256sum" echo "${checksum2// */}" > "$2.sha256sum"
else else
checksum2=$(<"$2.sha256sum") checksum2="$(<"$2.sha256sum")"
fi fi
fi fi
if [[ "${checksum1[0]}" == "${checksum2[0]}" ]] ; then if [[ "${checksum1// */}" == "${checksum2// */}" ]] ; then
return 0 return 0
else else
try_remove_file "$2" try_remove_file "$2"
if cp -f "$1" "$2" ; then if cp -f "$1" "$2" ; then
echo "${checksum1[0]}" > "$2.sha256sum" echo "${checksum1// */}" > "$2.sha256sum"
return 0 return 0
else else
return 1 return 1
......
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