mirror of
https://github.com/Telecominfraproject/OpenNetworkLinux.git
synced 2025-11-20 16:24:59 +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
|
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"
|
||||||
@@ -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
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user