mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-11-27 17:55:55 +02:00
scripts/feeds: allow multiple alternative urls for a single feed. this will be useful for maintaining release branch forks of /packages
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@12746 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
014f9c6b03
commit
1120fcc463
@ -31,18 +31,19 @@ sub parse_config() {
|
|||||||
s/#.+$//;
|
s/#.+$//;
|
||||||
next unless /\S/;
|
next unless /\S/;
|
||||||
my @line = split /\s+/, $_, 3;
|
my @line = split /\s+/, $_, 3;
|
||||||
|
my @src;
|
||||||
$line++;
|
$line++;
|
||||||
|
|
||||||
my $valid = 1;
|
my $valid = 1;
|
||||||
$line[0] =~ /^src-\w+$/ or $valid = 0;
|
$line[0] =~ /^src-\w+$/ or $valid = 0;
|
||||||
$line[1] =~ /^\w+$/ or $valid = 0;
|
$line[1] =~ /^\w+$/ or $valid = 0;
|
||||||
$line[2] =~ /\s/ and $valid = 0;
|
@src = split /\s+/, $line[2];
|
||||||
$valid or die "Syntax error in feeds.list, line: $line\n";
|
$valid or die "Syntax error in feeds.list, line: $line\n";
|
||||||
|
|
||||||
$name{$line[1]} and die "Duplicate feed name '$line[1]', line: $line\n";
|
$name{$line[1]} and die "Duplicate feed name '$line[1]', line: $line\n";
|
||||||
$name{$line[1]} = 1;
|
$name{$line[1]} = 1;
|
||||||
|
|
||||||
push @feeds, [@line];
|
push @feeds, [$line[0], $line[1], \@src];
|
||||||
}
|
}
|
||||||
close FEEDS;
|
close FEEDS;
|
||||||
}
|
}
|
||||||
@ -192,7 +193,7 @@ sub list {
|
|||||||
}
|
}
|
||||||
if ($opts{s}) {
|
if ($opts{s}) {
|
||||||
foreach my $feed (@feeds) {
|
foreach my $feed (@feeds) {
|
||||||
printf "\%-32s\tURL: %s\n", $feed->[1], $feed->[2];
|
printf "\%-32s\tURL: %s\n", $feed->[1], join(", ", @{$feed->[2]});
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -419,8 +420,14 @@ sub update_feed($$$$)
|
|||||||
return 1;
|
return 1;
|
||||||
};
|
};
|
||||||
$perform_update and do {
|
$perform_update and do {
|
||||||
warn "Updating feed '$name' from '$src' ...\n";
|
my $failed = 1;
|
||||||
&{$update_method{$type}}($name, $src) == 0 or do {
|
foreach my $feedsrc (@$src) {
|
||||||
|
warn "Updating feed '$name' from '$feedsrc' ...\n";
|
||||||
|
next unless &{$update_method{$type}}($name, $feedsrc) == 0;
|
||||||
|
$failed = 0;
|
||||||
|
last;
|
||||||
|
}
|
||||||
|
$failed and do {
|
||||||
warn "failed.\n";
|
warn "failed.\n";
|
||||||
return 1;
|
return 1;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user