[Mageia-dev] [soft-commits] [2134] Do not include chroot path in symlink.

Colin Guthrie cguthrie at mandriva.org
Mon Nov 7 17:17:41 CET 2011


'Twas brillig, and Thierry Vignaud at 07/11/11 15:31 did gyre and gimble:
> On 7 November 2011 13:58,  <root at mageia.org> wrote:
>> Modified: drakx-kbd-mouse-x11/trunk/lib/Xconfig/various.pm
>> ===================================================================
>> --- drakx-kbd-mouse-x11/trunk/lib/Xconfig/various.pm	2011-11-07 12:48:52 UTC
>> (rev 2133)
>> +++ drakx-kbd-mouse-x11/trunk/lib/Xconfig/various.pm	2011-11-07 12:58:09 UTC
>> (rev 2134)
>> @@ -227,8 +227,8 @@
>>      -r $f or log::l("missing inittab!!!"), return;
>>      if ($o_runlevel) {
>>  	substInFile { s/^id:\d:initdefault:\s*$/id:$o_runlevel:initdefault:\n/ }
>> $f if !$::testing;
>> -	my $t = "$::prefix/lib/systemd/system/runlevel$o_runlevel.target";
>> -	if (!$::testing && -f $t) {
>> +	my $t = "/lib/systemd/system/runlevel$o_runlevel.target";
>> +	if (!$::testing && -f "$::prefix$t") {
>>  	    my $d = "$::prefix/etc/systemd/system/default.target";
>>  	    unlink($d);
>>  	    symlink($t, $d);
> 
> BTW, you could have come with better names instead of 't' & 'd'....

I was just following the "convention" that was in the surrounding code
that used a single letter name for the file variable.

As I don't code on this stuff (and certainly am not a perl coder) I
didn't want to change things too much to suite my own preferences for
coding style (which would have been to use more descriptive names) and
followed what appeared to be the status quo.

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