diff options
author | Guillaume Rousse <guillomovitch@mandriva.org> | 2010-02-04 18:43:31 +0000 |
---|---|---|
committer | Guillaume Rousse <guillomovitch@mandriva.org> | 2010-02-04 18:43:31 +0000 |
commit | 93ad9acc6486cf57d39e6f625de13c44fede8444 (patch) | |
tree | 719444569551c4096e85dd15e2b40f461cb37769 | |
parent | 1545edc45a64462d9dc139230b7274e6157f870d (diff) | |
download | rpm-helper-93ad9acc6486cf57d39e6f625de13c44fede8444.tar rpm-helper-93ad9acc6486cf57d39e6f625de13c44fede8444.tar.gz rpm-helper-93ad9acc6486cf57d39e6f625de13c44fede8444.tar.bz2 rpm-helper-93ad9acc6486cf57d39e6f625de13c44fede8444.tar.xz rpm-helper-93ad9acc6486cf57d39e6f625de13c44fede8444.zip |
check the file exists before deleting it
-rwxr-xr-x | del-syslog | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -32,6 +32,7 @@ sub del_sysklogd_entry { my ($package) = @_; my $file = "/etc/syslog.conf"; + my $content; open(my $in, '<', $file) or die "Can't open $file for reading: $!"; @@ -58,6 +59,9 @@ sub del_rsyslog_entry { my $file = "/etc/rsyslog.d/$package.conf"; + # check the file exists + return unless -f $file; + # check the file is the one created by package installation open(my $in, '<', $file) or die "Can't open $file for reading: $!"; |