]> git.donarmstrong.com Git - debhelper.git/commitdiff
r1985: cleanup
authorjoeyh <joeyh>
Thu, 12 Apr 2007 19:53:00 +0000 (19:53 +0000)
committerjoeyh <joeyh>
Thu, 12 Apr 2007 19:53:00 +0000 (19:53 +0000)
autoscripts/postinst-udev
autoscripts/preinst-udev
dh_installudev

index cbf8dbe405fb0ddad74e58991c629dc38503d24f..20cf4dcf9a869df2e3205ebcacdd7ff23873296e 100644 (file)
@@ -1,9 +1,9 @@
 if [ "$1" = configure ]; then
-       if [ -e /etc/udev/#FILE# ]; then
-               echo "Preserving user changes to /etc/udev/rules.d/#PRIO##FILE# ..."
-               if [ -e /etc/udev/rules.d/#PRIO##FILE# ]; then
-                       mv -f /etc/udev/rules.d/#PRIO##FILE# /etc/udev/rules.d/#PRIO##FILE#.dpkg-new
+       if [ -e "#OLD#" ]; then
+               echo "Preserving user changes to #RULE# ..."
+               if [ -e "#RULE" ]; then
+                       mv -f "#RULE#" "#RULE#.dpkg-new"
                fi
-               mv -f /etc/udev/#FILE# /etc/udev/rules.d/#PRIO##FILE#
+               mv -f "#OLD#" "#RULE#"
        fi
 fi
index 9c63d191af3535c53ffdad941036507869ead425..9d90a355b5bf40f0f77cc1f0f9a6787f1556ec86 100644 (file)
@@ -1,12 +1,12 @@
 if [ "$1" = install ] || [ "$1" = upgrade ]; then
-       if [ -e /etc/udev/#FILE# ]; then
-               if [ "`md5sum \"/etc/udev/#FILE#\" | sed -e \"s/ .*//\"`" = \
-                    "`sed -n -e \"/^Conffiles:/,/^[^ ]/{\\\\' /etc/udev/#FILE#'{s/.* //;p}}\" /var/lib/dpkg/status`" ]
+       if [ -e "#OLD#" ]; then
+               if [ "`md5sum \"#OLD#\" | sed -e \"s/ .*//\"`" = \
+                    "`sed -n -e \"/^Conffiles:/,/^[^ ]/{\\\\' #OLD#'{s/.* //;p}}\" /var/lib/dpkg/status`" ]
                then
-                       rm -f /etc/udev/#FILE#
+                       rm -f "#OLD#"
                fi
        fi
-       if [ -L /etc/udev/rules.d/#PRIO##FILE# ]; then
-               rm -f /etc/udev/rules.d/#PRIO##FILE#
+       if [ -L "#RULE#" ]; then
+               rm -f "#RULE#"
        fi
 fi
index 859efc8de0a32cfc818bd218f623e47e044415bd..912fecdea5486db986fed85f694f742bef5e44c1 100755 (executable)
@@ -77,8 +77,10 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
                }
                doit("install","-m","0644",$rules_file,"$tmp/etc/udev/rules.d/$dh{PRIORITY}$filename");
                if (! $dh{NOSCRIPTS}) {
-                       autoscript($package,"preinst","preinst-udev","s/#FILE#/$filename/g;s/#PRIO#/$dh{PRIORITY}/g");
-                       autoscript($package,"postinst","postinst-udev","s/#FILE#/$filename/g;s/#PRIO#/$dh{PRIORITY}/g");
+                       my $old="/etc/udev/$filename";
+                       my $rule="/etc/udev/rules.d/$dh{PRIORITY}$filename";
+                       autoscript($package,"preinst","preinst-udev","s!#OLD#!$old!/g;s!#RULE#!$rule!g");
+                       autoscript($package,"postinst","postinst-udev","s!#OLD#!$old!/g;s!#RULE#!$rule!g");
                }
        }
 }