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/015795.html | 136 ++++++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 zarb-ml/mageia-dev/2012-May/015795.html (limited to 'zarb-ml/mageia-dev/2012-May/015795.html') diff --git a/zarb-ml/mageia-dev/2012-May/015795.html b/zarb-ml/mageia-dev/2012-May/015795.html new file mode 100644 index 000000000..64d145420 --- /dev/null +++ b/zarb-ml/mageia-dev/2012-May/015795.html @@ -0,0 +1,136 @@ + + + + [Mageia-dev] [soft-commits] [4584] (systemd_unit_exists) factorize + + + + + + + + + +

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

+ Colin Guthrie + mageia at colin.guthr.ie +
+ Wed May 23 20:38:09 CEST 2012 +

+
+ +
'Twas brillig, and Thierry Vignaud at 23/05/12 19:29 did gyre and gimble:
+> 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...)
+
+NAK. No it's not redundant it's very important. The symlinks *will* be
+broken when run via the installer due to the $::prefix as they will
+point to "non-existent" paths in /lib/systemd/ (not to
+/mnt/lib/systemd...) so I treat any symlink that exists (even if it
+points to an invalid unit) as "valid" here.
+
+I think I even said as much in a comment or the commit log that it's
+important :)
+
+Col
+
+
+-- 
+
+Colin Guthrie
+colin(at)mageia.org
+http://colin.guthr.ie/
+
+Day Job:
+  Tribalogic Limited http://www.tribalogic.net/
+Open Source:
+  Mageia Contributor http://www.mageia.org/
+  PulseAudio Hacker http://www.pulseaudio.org/
+  Trac Hacker http://trac.edgewall.org/
+
+ + + + + + + + + + + + + +
+

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