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 if [ ! -f $ONL/.git/hooks/post-merge ] && [ -d $ONL/.git ]; then
cp $ONL/tools/scripts/post-merge.hook $ONL/.git/hooks/post-merge cp $ONL/tools/scripts/post-merge.hook $ONL/.git/hooks/post-merge
fi 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. # Removing the manifest causes it to be regenerated.
rm -rf $ONL/.manifest.mk rm -rf $ONL/make/module-manifest.mk
# Rebuild pkg cache # Rebuild pkg cache
onlpm.py --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. # Run any repository-specific post-submodule-init scripts.
# #
script = os.path.join(self.root, 'tools', 'scripts', 'submodule-updated.sh') for script in os.getenv("ONL_SUBMODULE_UPDATED_SCRIPTS", "").split(':'):
if os.path.exists(script): if os.path.exists(script):
try: try:
check_call([script, path], cwd=self.root) print "Calling %s..." % script
except subprocess.CalledProcessError: check_call([script, path], cwd=self.root)
# Target doesn't exists except subprocess.CalledProcessError:
raise OnlSubmoduleError("The repository post-init script %s failed." % script) raise OnlSubmoduleError("The repository post-init script %s failed." % script)
def require(self, path, depth=None, recursive=False): def require(self, path, depth=None, recursive=False):
self.get_status() self.get_status()