summaryrefslogtreecommitdiffstats
path: root/urpm/cfg.pm
diff options
context:
space:
mode:
authorMandrake <mandrake@mandriva.com>2007-01-04 17:46:08 +0000
committerMandrake <mandrake@mandriva.com>2007-01-04 17:46:08 +0000
commit4f539479dbdef5b9847758bf8fee0844dbdb6259 (patch)
tree2ad1d97f48d0d21de148adc9dcf258e0f16f3c8d /urpm/cfg.pm
parent6b5e1ae393f8550f36f6b0c70e2cfb7193fb321a (diff)
downloadurpmi-4f539479dbdef5b9847758bf8fee0844dbdb6259.tar
urpmi-4f539479dbdef5b9847758bf8fee0844dbdb6259.tar.gz
urpmi-4f539479dbdef5b9847758bf8fee0844dbdb6259.tar.bz2
urpmi-4f539479dbdef5b9847758bf8fee0844dbdb6259.tar.xz
urpmi-4f539479dbdef5b9847758bf8fee0844dbdb6259.zip
%repsys markrelease
version: 0.10 release: 1mdv2007.1 revision: 104210 Copying 0.10-1mdv2007.1 to releases/ directory.
Diffstat (limited to 'urpm/cfg.pm')
-rw-r--r--urpm/cfg.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/urpm/cfg.pm b/urpm/cfg.pm
index 5522a999..06f3c7ef 100644
--- a/urpm/cfg.pm
+++ b/urpm/cfg.pm
@@ -51,7 +51,9 @@ Returns 1 on success, 0 on failure.
my ($arch, $release);
sub _init_arch_release () {
if (!$arch && !$release) {
- my $l = cat_('/etc/release') or return undef;
+ open my $f, '/etc/release' or return undef;
+ my $l = <$f>;
+ close $f;
($release, $arch) = $l =~ /release (\d+\.\d+).*for (\w+)/;
$release = 'cooker' if $l =~ /cooker/i;
}
@@ -107,8 +109,7 @@ sub load_config ($;$) {
my $priority = 1;
my $medium;
$err = '';
- -r $file or do { $err = N("unable to read config file [%s]", $file); return };
- my @conf_lines = cat_($file);
+ my @conf_lines = cat_($file) or do { $err = N("unable to read config file [%s]", $file); return };
foreach (@conf_lines) {
chomp;
next if /^\s*#/; #- comments