From 1be510f9529cb082f802408b472a77d074b394c0 Mon Sep 17 00:00:00 2001 From: Nicolas Vigier Date: Sun, 14 Apr 2013 13:46:12 +0000 Subject: Add zarb MLs html archives --- zarb-ml/mageia-dev/2012-May/015794.html | 110 ++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 zarb-ml/mageia-dev/2012-May/015794.html (limited to 'zarb-ml/mageia-dev/2012-May/015794.html') diff --git a/zarb-ml/mageia-dev/2012-May/015794.html b/zarb-ml/mageia-dev/2012-May/015794.html new file mode 100644 index 000000000..9e6fc4046 --- /dev/null +++ b/zarb-ml/mageia-dev/2012-May/015794.html @@ -0,0 +1,110 @@ + + + + [Mageia-dev] [soft-commits] [4584] (systemd_unit_exists) factorize + + + + + + + + + +

[Mageia-dev] [soft-commits] [4584] (systemd_unit_exists) factorize

+ Thierry Vignaud + thierry.vignaud at gmail.com +
+ Wed May 23 20:29:04 CEST 2012 +

+
+ +
On 23 May 2012 20:25,  <root at mageia.org> wrote:
+> Revision 4584 Author tv Date 2012-05-23 20:25:15 +0200 (Wed, 23 May 2012)
+>
+> Log Message
+>
+> (systemd_unit_exists) factorize
+>
+> Modified Paths
+>
+> drakx/trunk/perl-install/services.pm
+>
+> Modified: drakx/trunk/perl-install/services.pm
+> ===================================================================
+> --- drakx/trunk/perl-install/services.pm	2012-05-23 18:02:37 UTC (rev 4583)
+> +++ drakx/trunk/perl-install/services.pm	2012-05-23 18:25:15 UTC (rev 4584)
+> @@ -433,7 +433,7 @@
+>          if (my ($name, $l) = m!^(\S+)\s+(0:(on|off).*)!) {
+>              # If we expect to use systemd (i.e. installer) only show those
+>              # sysvinit scripts which are not masked by a native systemd
+> unit.
+> -            my $has_systemd_unit = (-e "$::prefix/lib/systemd/system/$name.service" or -l "$::prefix/lib/systemd/system/$name.service");
+> +            my $has_systemd_unit = systemd_unit_exists($name);
+>              if (!$has_systemd || !$has_systemd_unit) {
+>                  if ($::isInstall) {
+>                      $on_off = $l =~ /\d+:on/g;
+> @@ -466,12 +466,14 @@
+>
+>
+>
+> +sub systemd_unit_exists {
+> +    my ($name) = @_;
+> +    -e "$::prefix/lib/systemd/system/$name.service" or -l "$::prefix/lib/systemd/system/$name.service";
+> +}
+>
+> -
+> -
+>  sub service_exists {
+>      my ($service) = @_;
+> -    -x "$::prefix/etc/rc.d/init.d/$service" or -e "$::prefix/lib/systemd/system/$service.service" or -l "$::prefix/lib/systemd/system/$service.service";
+> +    -x "$::prefix/etc/rc.d/init.d/$service" or systemd_unit_exists($service);
+>  }
+
+BTW Colin your test is redundant. -e returns true for symlinks too
+(unless target doesn't exist in which case we don't care much anyway...)
+
+ + + + + + + + + + + + + +
+

+ +
+More information about the Mageia-dev +mailing list
+ -- cgit v1.2.1