Fix https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...

This commit is contained in:
Vladislav Yarmak 2019-01-04 23:59:29 +02:00
parent b356c879d7
commit d10c45c232
No known key found for this signature in database
GPG Key ID: F6C5633BE5DE7127

View File

@ -89,25 +89,25 @@ if [[ ( ! "$patch" ) || ( ! "$object" ) ]]; then
fi fi
if [[ $rollback_flag ]]; then if [[ $rollback_flag ]]; then
if [[ -f $backup_path/"$object".$driver_version ]]; then if [[ -f "$backup_path/$object.$driver_version" ]]; then
cp -p $backup_path/"$object".$driver_version \ cp -p "$backup_path/$object.$driver_version" \
$driver_dir/"$object".$driver_version "$driver_dir/$object.$driver_version"
echo "Restore from backup $object.$driver_version" echo "Restore from backup $object.$driver_version"
else else
echo "Backup not found. Try to patch first." echo "Backup not found. Try to patch first."
exit 1; exit 1;
fi fi
else else
if [[ ! -f $backup_path/"$object".$driver_version ]]; then if [[ ! -f "$backup_path/$object.$driver_version" ]]; then
echo "Attention! Backup not found. Copy current libnvidia-encode to backup." echo "Attention! Backup not found. Copy current $object to backup."
mkdir -p $backup_path mkdir -p "$backup_path"
cp -p $driver_dir/"$object".$driver_version \ cp -p "$driver_dir/$object.$driver_version" \
$backup_path/"$object".$driver_version "$backup_path/$object.$driver_version"
fi fi
sha1sum $backup_path/"$object".$driver_version sha1sum "$backup_path/$object.$driver_version"
sed "$patch" $backup_path/"$object".$driver_version > \ sed "$patch" "$backup_path/$object.$driver_version" > \
$driver_dir/"$object".$driver_version "$driver_dir/$object.$driver_version"
sha1sum $driver_dir/"$object".$driver_version sha1sum "$driver_dir/$object.$driver_version"
ldconfig ldconfig
echo "Patched!" echo "Patched!"
fi fi