[openwrt/openwrt] scripts/feeds: add support for git feeds with submodules

LEDE Commits lede-commits at lists.infradead.org
Fri Apr 27 06:20:17 PDT 2018


nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.lede-project.org/41ab276fe4d6a18f7bf875b4727474104fc4e136

commit 41ab276fe4d6a18f7bf875b4727474104fc4e136
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Wed Apr 25 11:31:48 2018 +0200

    scripts/feeds: add support for git feeds with submodules
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 scripts/feeds | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/scripts/feeds b/scripts/feeds
index f49cdb3..437af03 100755
--- a/scripts/feeds
+++ b/scripts/feeds
@@ -133,6 +133,7 @@ my %update_method = (
 		'init_commit'   => "git clone '%s' '%s' && cd '%s' && git checkout -b '%s' '%s' && cd -",
 		'update'	=> "git pull --ff",
 		'update_force'	=> "git pull --ff || (git reset --hard HEAD; git pull --ff; exit 1)",
+		'post_update'	=> "git submodule update --init --recursive",
 		'controldir'	=> ".git",
 		'revision'	=> "git rev-parse --short HEAD | tr -d '\n'"},
 	'src-git-full' => {
@@ -141,6 +142,7 @@ my %update_method = (
 		'init_commit'   => "git clone '%s' '%s' && cd '%s' && git checkout -b '%s' '%s' && cd -",
 		'update'	=> "git pull --ff",
 		'update_force'	=> "git pull --ff || (git reset --hard HEAD; git pull --ff; exit 1)",
+		'post_update'	=> "git submodule update --init --recursive",
 		'controldir'	=> ".git",
 		'revision'	=> "git rev-parse --short HEAD | tr -d '\n'"},
 	'src-gitsvn' => {
@@ -197,6 +199,10 @@ sub update_feed_via($$$$$) {
 		}
 		system("cd '$safepath'; $update_cmd") == 0 or return 1;
 	}
+	if ($m->{'post_update'}) {
+		my $cmd = $m->{'post_update'};
+		system("cd '$safepath'; $cmd") == 0 or return 1;
+	}
 
 	return 0;
 }



More information about the lede-commits mailing list