scripts/feeds: add support for optionally using a full clone of git repositories

Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 45668
This commit is contained in:
Felix Fietkau 2015-05-10 15:51:19 +00:00
parent b33752051f
commit 08436887fb

View file

@ -51,7 +51,7 @@ sub parse_config() {
$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;
@src = split /\s+/, $line[2]; @src = split /\s+/, $line[2];
$valid or die "Syntax error in feeds.conf, line: $line\n"; $valid or die "Syntax error in feeds.conf, line: $line\n";
@ -128,6 +128,13 @@ my %update_method = (
'update' => "git pull --ff", 'update' => "git pull --ff",
'controldir' => ".git", 'controldir' => ".git",
'revision' => "git show --abbrev-commit HEAD | head -n 1 | cut -d ' ' -f 2 | tr -d '\n'"}, 'revision' => "git show --abbrev-commit HEAD | head -n 1 | cut -d ' ' -f 2 | tr -d '\n'"},
'src-git-full' => {
'init' => "git clone '%s' '%s'",
'init_branch' => "git clone --branch '%s' '%s' '%s'",
'init_commit' => "git clone '%s' '%s' && cd '%s' && git checkout -b '%s' '%s' && cd -",
'update' => "git pull --ff",
'controldir' => ".git",
'revision' => "git show --abbrev-commit HEAD | head -n 1 | cut -d ' ' -f 2 | tr -d '\n'"},
'src-gitsvn' => { 'src-gitsvn' => {
'init' => "git svn clone -r HEAD '%s' '%s'", 'init' => "git svn clone -r HEAD '%s' '%s'",
'update' => "git svn rebase", 'update' => "git svn rebase",