aboutsummaryrefslogtreecommitdiffstats
path: root/add-syslog
diff options
context:
space:
mode:
authorDexter Morgan <dmorgan@mageia.org>2011-10-27 22:47:46 +0000
committerDexter Morgan <dmorgan@mageia.org>2011-10-27 22:47:46 +0000
commitc64fa938609c6bee9dd02adc1a37df89a9ebd116 (patch)
tree20da84dbd8cc32fb518e4bf777359664dba63a88 /add-syslog
parentb1c56622b1c4a3e390de269e8c28af133f2472c9 (diff)
downloadrpm-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-xadd-syslog11
1 files changed, 6 insertions, 5 deletions
diff --git a/add-syslog b/add-syslog
index b17cfa7..7fc1836 100755
--- a/add-syslog
+++ b/add-syslog
@@ -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 {