Package: dkms / 2.2.0.3-2

757758.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
--- a/dkms
+++ b/dkms
@@ -761,16 +766,17 @@
     # do all the changes at once, record the diffs for posterity
     for file in "$@"; do
 	[[ $file && -w $file ]] || continue
+	_tmpf="$temp_dir_name/${file##*/}.new"
 	if [[ $file = /etc/sysconfig/kernel ]]; then
-	    sed "${sa_sck_o[@]}" "$file" > "$temp_dir_name/${file##*/}.new"
+	    [ -z "${sa_sck_o[@]}" ] || sed "${sa_sck_o[@]}" "$file" > "$_tmpf"
 	else
-	    sed "${sa_mc_o[@]}" "$file" > "$temp_dir_name/${file##*/}.new"
+	    [ -z "${sa_mc_o[@]}" ] || sed "${sa_mc_o[@]}" "$file" > "$_tmpf"
 	fi
-	if ! mod_diff=$(diff -u "$temp_dir_name/${file##*/}.new" "$file"); then
+	if [ -f "$_tmpf" ] && ! mod_diff=$(diff -u "$_tmpf" "$file"); then
 	    echo $"$file updated to replace obsoleted module references:"
 	    echo "$mod_diff"
-	    cp -fp "$temp_dir_name/${file##*/}.new" "$file"
-	    rm -f "$temp_dir_name/${file##*/}.new"
+	    cp -fp "$_tmpf" "$file"
+	    rm -f "$_tmpf"
 	fi
     done
 }