forked from CastroFidel/PortWINE
Update try_copy_file_with_checksums, spellcheck fix
This commit is contained in:
parent
43162d036c
commit
cfe39e74e7
@ -145,8 +145,8 @@ try_copy_file_with_checksums () {
|
||||
|| [[ "${PW_FILESYSTEM}" == "f2fs" ]] \
|
||||
|| [[ "${PW_FILESYSTEM}" != "btrfs" ]]
|
||||
then
|
||||
checksum1=($(sha256sum "$1"))
|
||||
echo "${checksum1[0]}" > "$2.sha256sum"
|
||||
checksum1="$(sha256sum "$1")"
|
||||
echo "${checksum1// */}" > "$2.sha256sum"
|
||||
fi
|
||||
return 0
|
||||
else
|
||||
@ -157,28 +157,28 @@ try_copy_file_with_checksums () {
|
||||
|| [[ "${PW_FILESYSTEM}" == "f2fs" ]] \
|
||||
|| [[ "${PW_FILESYSTEM}" != "btrfs" ]]
|
||||
then
|
||||
checksum1=($(sha256sum "$1"))
|
||||
checksum1="$(sha256sum "$1")"
|
||||
if [[ ! -f "$2" ]] ; then
|
||||
if cp -f "$1" "$2" ; then
|
||||
echo "${checksum1[0]}" > "$2.sha256sum"
|
||||
echo "${checksum1// */}" > "$2.sha256sum"
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
else
|
||||
if [[ ! -f "$2.sha256sum" ]] ; then
|
||||
checksum2=($(sha256sum "$2"))
|
||||
echo "${checksum2[0]}" > "$2.sha256sum"
|
||||
checksum2="$(sha256sum "$2")"
|
||||
echo "${checksum2// */}" > "$2.sha256sum"
|
||||
else
|
||||
checksum2=$(<"$2.sha256sum")
|
||||
checksum2="$(<"$2.sha256sum")"
|
||||
fi
|
||||
fi
|
||||
if [[ "${checksum1[0]}" == "${checksum2[0]}" ]] ; then
|
||||
if [[ "${checksum1// */}" == "${checksum2// */}" ]] ; then
|
||||
return 0
|
||||
else
|
||||
try_remove_file "$2"
|
||||
if cp -f "$1" "$2" ; then
|
||||
echo "${checksum1[0]}" > "$2.sha256sum"
|
||||
echo "${checksum1// */}" > "$2.sha256sum"
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
|
Loading…
Reference in New Issue
Block a user