mirror of
https://github.com/Telecominfraproject/OpenNetworkLinux.git
synced 2025-11-02 03:08:17 +00:00
The submodule post-update hooks are now specified via environment variables.
This commit is contained in:
@@ -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"
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user