diff options
author | Dexter Morgan <dmorgan@mageia.org> | 2011-10-27 22:47:46 +0000 |
---|---|---|
committer | Dexter Morgan <dmorgan@mageia.org> | 2011-10-27 22:47:46 +0000 |
commit | c64fa938609c6bee9dd02adc1a37df89a9ebd116 (patch) | |
tree | 20da84dbd8cc32fb518e4bf777359664dba63a88 /add-syslog | |
parent | b1c56622b1c4a3e390de269e8c28af133f2472c9 (diff) | |
download | rpm-helper-c64fa938609c6bee9dd02adc1a37df89a9ebd116.tar rpm-helper-c64fa938609c6bee9dd02adc1a37df89a9ebd116.tar.gz rpm-helper-c64fa938609c6bee9dd02adc1a37df89a9ebd116.tar.bz2 rpm-helper-c64fa938609c6bee9dd02adc1a37df89a9ebd116.tar.xz rpm-helper-c64fa938609c6bee9dd02adc1a37df89a9ebd116.zip |
Add systemd support ( mdv )
Diffstat (limited to 'add-syslog')
-rwxr-xr-x | add-syslog | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -1,6 +1,6 @@ #!/usr/bin/perl # rpm helper scriptlet to add an entry into default syslog implementation -# $Id: add-syslog 265807 2010-02-04 19:58:23Z guillomovitch $ +# $Id: add-syslog 271805 2011-01-25 14:57:43Z nanardon $ use Getopt::Std; use strict; @@ -44,15 +44,16 @@ EOF die "maximum priority '$max' lower than minimum priority '$min'" if $min && $max && ($priorities{$max} < $priorities{$min}); - open(my $fh, '<', '/etc/mandriva-release') - or die "can't open /etc/mandriva-release: $!"; + my $release_file = '/etc/release'; + open(my $fh, '<', $release_file) + or die "can't open $release_file: $!"; my $line = <$fh>; - $line =~ /^Mandriva Linux release (\d\d\d\d\.\d)/; + $line =~ /^Mageia release (\d\d\d\d\.\d)/; my $release = $1; close($fh); # add an entry to default syslog implementation, if installed - if (version->parse($release) < version->parse("2010.1")) { + if ($release && version->parse($release) < version->parse("2010.1")) { add_sysklogd_entry($package, $source, $dest, $facility, $min, $max) if -f '/etc/init.d/syslog'; } else { |