[Exherbo-dev] systemd paludis uninstall phase

Vasiliy G Tolstov v.tolstov at selfip.ru
Tue Jan 18 16:19:50 GMT 2011


On Tue, 2011-01-18 at 17:08 +0100, Wulf C. Krueger wrote:
> > Patch like this?
> 
> Please either attach patches to your emails or add them in-line.
> 
> --- /var/db/paludis/repositories/arbor/exlibs/systemd-service.exlib.orig 2011-01-17 23:07:29.000000000 +0300
> 
> +++ /var/db/paludis/repositories/arbor/exlibs/systemd-service.exlib	2011-01-18 13:37:55.000000000 +0300
> [...]
> +uninstall_systemd_files() {
> +    local eclectic_init= systemd_files object=
> +    exparam -v systemd_files systemd_files[@] eclectic_init
> +
> +    eclectic_init=$(eclectic init show)
> +
> +    if [ "x${eclectic_init}" == "xsystemd" ] ; then
> Please always use [[ ]]. 
> Best regards, Wulf
> 


Ok. Thank You for suggestions:

--- /var/db/paludis/repositories/arbor/exlibs/systemd-service.exlib.orig
2011-01-17 23:07:29.000000000 +0300
+++ /var/db/paludis/repositories/arbor/exlibs/systemd-service.exlib
2011-01-18 13:37:55.000000000 +0300
@@ -14,7 +14,7 @@
     exparam -v systemd_files systemd_files[@]
 
     if option systemd ; then
-        insinto /$(get_libdir)/systemd/system
+        insinto ${ROOT}/$(get_libdir)/systemd/system
 
         for object in "${systemd_files[@]}"; do
             if [[ -d ${object} ]]; then
@@ -24,5 +24,21 @@
             fi
         done
     fi
+}
+
+uninstall_systemd_files() {
+    local eclectic_init= systemd_files object=
+    exparam -v systemd_files systemd_files[@] eclectic_init
+
+    eclectic_init=$(eclectic init show)
+
+    if [[ "x${eclectic_init}" == "xsystemd" ]]; then
+        for object in "${systemd_files[@]}"; do
+            if [[ -e ${ROOT}/$(get_libdir)/systemd/system/${object} ]];
then
+                systemctl disable "${object}"
+                systemctl stop "${object}"
+            fi
+        done
+    fi
 }
 
Does i need full paths for systemctl and eclectic?




More information about the Exherbo-dev mailing list