aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2008-01-27 15:08:58 +0000
committerFelix Fietkau <nbd@openwrt.org>2008-01-27 15:08:58 +0000
commite01479aca01f8036fa4934ccfe8fb97f0d04165d (patch)
treeb018c6013ab91d42fc89ec5520fc6fe745a5523e
parentc9125a8bf537df78527b70283cbb32ca4a5c7425 (diff)
downloadupstream-e01479aca01f8036fa4934ccfe8fb97f0d04165d.tar.gz
upstream-e01479aca01f8036fa4934ccfe8fb97f0d04165d.tar.bz2
upstream-e01479aca01f8036fa4934ccfe8fb97f0d04165d.zip
scripts/feeds: Add support for git feeds.
Invokes 'git clone' on initial feed-update and 'git pull' later on. Signed-off-by: Michel Marti <mcdmx@users.sf.net> SVN-Revision: 10280
-rwxr-xr-xscripts/feeds23
1 files changed, 22 insertions, 1 deletions
diff --git a/scripts/feeds b/scripts/feeds
index 6fda84e00e..4d3211727b 100755
--- a/scripts/feeds
+++ b/scripts/feeds
@@ -86,6 +86,26 @@ sub update_link($$) {
return 0;
}
+sub update_git($$) {
+ my $name = shift;
+ my $src = shift;
+
+ if ( ! -d "./feeds/$name" ) {
+ system("git clone $src ./feeds/$name") == 0 or return 1;
+ } else {
+ system("GIT_DIR=./feeds/$name/.git git pull") == 0 or return 1;
+ }
+
+ -d "./feeds/$name.tmp" or mkdir "./feeds/$name.tmp" or return 1;
+ -d "./feeds/$name.tmp/info" or mkdir "./feeds/$name.tmp/info" or return 1;
+
+ system("make -s prepare-mk TMP_DIR=\"$ENV{TOPDIR}/feeds/$name.tmp\"");
+ system("make -s -f include/scan.mk IS_TTY=1 SCAN_TARGET=\"packageinfo\" SCAN_DIR=\"feeds/$name\" SCAN_NAME=\"package\" SCAN_DEPS=\"$ENV{TOPDIR}/include/package*.mk\" SCAN_DEPTH=4 SCAN_EXTRA=\"\" TMP_DIR=\"$ENV{TOPDIR}/feeds/$name.tmp\"");
+ system("ln -sf $name.tmp/.packageinfo ./feeds/$name.index");
+
+ return 0;
+}
+
sub get_feed($) {
my $feed = shift;
@@ -344,7 +364,8 @@ EOF
my %update_method = (
'src-svn' => \&update_svn,
'src-cpy' => \&update_cpy,
- 'src-link' => \&update_link
+ 'src-link' => \&update_link,
+ 'src-git' => \&update_git
);
my %commands = (