mirror of
https://github.com/keylase/nvidia-patch.git
synced 2024-11-26 15:37:18 +00:00
Fix https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...
This commit is contained in:
parent
b356c879d7
commit
d10c45c232
24
patch.sh
24
patch.sh
@ -89,25 +89,25 @@ if [[ ( ! "$patch" ) || ( ! "$object" ) ]]; then
|
||||
fi
|
||||
|
||||
if [[ $rollback_flag ]]; then
|
||||
if [[ -f $backup_path/"$object".$driver_version ]]; then
|
||||
cp -p $backup_path/"$object".$driver_version \
|
||||
$driver_dir/"$object".$driver_version
|
||||
if [[ -f "$backup_path/$object.$driver_version" ]]; then
|
||||
cp -p "$backup_path/$object.$driver_version" \
|
||||
"$driver_dir/$object.$driver_version"
|
||||
echo "Restore from backup $object.$driver_version"
|
||||
else
|
||||
echo "Backup not found. Try to patch first."
|
||||
exit 1;
|
||||
fi
|
||||
else
|
||||
if [[ ! -f $backup_path/"$object".$driver_version ]]; then
|
||||
echo "Attention! Backup not found. Copy current libnvidia-encode to backup."
|
||||
mkdir -p $backup_path
|
||||
cp -p $driver_dir/"$object".$driver_version \
|
||||
$backup_path/"$object".$driver_version
|
||||
if [[ ! -f "$backup_path/$object.$driver_version" ]]; then
|
||||
echo "Attention! Backup not found. Copy current $object to backup."
|
||||
mkdir -p "$backup_path"
|
||||
cp -p "$driver_dir/$object.$driver_version" \
|
||||
"$backup_path/$object.$driver_version"
|
||||
fi
|
||||
sha1sum $backup_path/"$object".$driver_version
|
||||
sed "$patch" $backup_path/"$object".$driver_version > \
|
||||
$driver_dir/"$object".$driver_version
|
||||
sha1sum $driver_dir/"$object".$driver_version
|
||||
sha1sum "$backup_path/$object.$driver_version"
|
||||
sed "$patch" "$backup_path/$object.$driver_version" > \
|
||||
"$driver_dir/$object.$driver_version"
|
||||
sha1sum "$driver_dir/$object.$driver_version"
|
||||
ldconfig
|
||||
echo "Patched!"
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user