Home Home > GIT Browse > scripts
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2018-11-05 11:05:43 +0100
committerJiri Slaby <jslaby@suse.cz>2018-11-05 11:05:43 +0100
commitcd4eb98f1fb8c6e228b6b3704cab8d08267f9fba (patch)
treece490fbc4a0b8d849ba24f5fb43807310cf91b0a
parent379ad30a30c0851d6a7528e5c4c286f810491e85 (diff)
scripts/lib/SUSE/MyBS.pm: new osc stores oscrc in .config
So enumerate both possibilities before giving up.
-rw-r--r--scripts/lib/SUSE/MyBS.pm11
1 files changed, 10 insertions, 1 deletions
diff --git a/scripts/lib/SUSE/MyBS.pm b/scripts/lib/SUSE/MyBS.pm
index 654c788ae1..da42f3d9c7 100644
--- a/scripts/lib/SUSE/MyBS.pm
+++ b/scripts/lib/SUSE/MyBS.pm
@@ -26,7 +26,16 @@ sub new {
}
$self->{url} = URI->new($api_url);
- my $cfgfile = "$ENV{HOME}/.oscrc";
+ my $cfgfile;
+ foreach ("$ENV{HOME}/.oscrc", "$ENV{HOME}/.config/osc/oscrc") {
+ if (-f) {
+ $cfgfile = $_;
+ last;
+ }
+ }
+
+ defined $cfgfile or die "oscrc not found";
+
# replace name: value with name= value that Config::IniFiles can parse
open(my $fh, '<', $cfgfile) or die "$cfgfile: $!\n";
my $data = "";