The submodule post-update hooks are now specified via environment variables.

This commit is contained in:
Jeffrey Townsend
2016-07-07 17:20:02 +00:00
parent 4918fee87b
commit 3d21d491e0
3 changed files with 11 additions and 9 deletions

View File

@@ -44,3 +44,6 @@ export ONL_DEBIAN_SUITE=$(lsb_release -c -s)
if [ ! -f $ONL/.git/hooks/post-merge ] && [ -d $ONL/.git ]; then
cp $ONL/tools/scripts/post-merge.hook $ONL/.git/hooks/post-merge
fi
# submodule post update scripts.
export ONL_SUBMODULE_UPDATED_SCRIPTS="$ONL/tools/scripts/submodule-updated.sh"

View File

@@ -13,7 +13,7 @@
############################################################
# Removing the manifest causes it to be regenerated.
rm -rf $ONL/.manifest.mk
rm -rf $ONL/make/module-manifest.mk
# Rebuild pkg cache
onlpm.py --rebuild-pkg-cache

View File

@@ -101,14 +101,13 @@ class OnlSubmoduleManager(object):
#
# Run any repository-specific post-submodule-init scripts.
#
script = os.path.join(self.root, 'tools', 'scripts', 'submodule-updated.sh')
if os.path.exists(script):
try:
check_call([script, path], cwd=self.root)
except subprocess.CalledProcessError:
# Target doesn't exists
raise OnlSubmoduleError("The repository post-init script %s failed." % script)
for script in os.getenv("ONL_SUBMODULE_UPDATED_SCRIPTS", "").split(':'):
if os.path.exists(script):
try:
print "Calling %s..." % script
check_call([script, path], cwd=self.root)
except subprocess.CalledProcessError:
raise OnlSubmoduleError("The repository post-init script %s failed." % script)
def require(self, path, depth=None, recursive=False):
self.get_status()