Skip to content
Snippets Groups Projects
Commit b5229d5511cf authored by Houzefa Abbasbhay's avatar Houzefa Abbasbhay :slight_smile:
Browse files

create_documentation: Fix paths of per-module doc

In the loop:
- Rename the "module" variable to "module_path".
- Set up a new "module" variable that contains nothing but the actual module
  name.
parent 1fc1a46843b6
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
History History
======= =======
- create_documentation: Fix paths of per-module documentation.
2.10 2.10
---- ----
......
...@@ -56,5 +56,5 @@ ...@@ -56,5 +56,5 @@
done done
odoo_modules="$($python -B -c "import ConfigParser ; c = ConfigParser.ConfigParser() ; c.read('${project_home}/setup.cfg') ; print(c.has_section('odoo_scripts') and c.has_option('odoo_scripts', 'modules') and ' '.join(c.get('odoo_scripts', 'modules', '').split()) or ' '.join('%s/*' % mod for mod in c.get('odoo_scripts', 'addon_dirs').split()) )")" odoo_modules="$($python -B -c "import ConfigParser ; c = ConfigParser.ConfigParser() ; c.read('${project_home}/setup.cfg') ; print(c.has_section('odoo_scripts') and c.has_option('odoo_scripts', 'modules') and ' '.join(c.get('odoo_scripts', 'modules', '').split()) or ' '.join('%s/*' % mod for mod in c.get('odoo_scripts', 'addon_dirs').split()) )")"
for module in $(eval echo $odoo_modules) ; for module_path in $(eval echo $odoo_modules) ;
do do
...@@ -60,7 +60,8 @@ ...@@ -60,7 +60,8 @@
do do
if [[ -d "$module" ]] ; then if [[ -d "$module_path" ]] ; then
pushd $module pushd $module_path
module=$(basename $module_path)
has_doc="" has_doc=""
for doc_dir in doc docs ; do for doc_dir in doc docs ; do
if [[ -d $doc_dir && -e $doc_dir/Makefile ]]; then if [[ -d $doc_dir && -e $doc_dir/Makefile ]]; then
has_doc=True has_doc=True
...@@ -63,8 +64,8 @@ ...@@ -63,8 +64,8 @@
has_doc="" has_doc=""
for doc_dir in doc docs ; do for doc_dir in doc docs ; do
if [[ -d $doc_dir && -e $doc_dir/Makefile ]]; then if [[ -d $doc_dir && -e $doc_dir/Makefile ]]; then
has_doc=True has_doc=True
echo ${YELLOW}INFO ${RESET} - Makefile found in $dir/$module/$doc_dir echo ${YELLOW}INFO ${RESET} - Makefile found in $dir/$module_path/$doc_dir
if [ -e ".git" ]; then if [ -e ".git" ]; then
branch="$(git rev-parse --abbrev-ref HEAD)" branch="$(git rev-parse --abbrev-ref HEAD)"
elif [ -e ".hg" ]; then elif [ -e ".hg" ]; then
...@@ -80,7 +81,7 @@ ...@@ -80,7 +81,7 @@
builddir=_build builddir=_build
dest_dir=$out_dir/$module/$language/$branch dest_dir=$out_dir/$module/$language/$branch
if [[ $? -eq 0 ]] ; then if [[ $? -eq 0 ]] ; then
echo ${YELLOW}INFO ${RESET} - Documentation generation done for $dir/$module/$doc_dir, copy to $dest_dir echo ${YELLOW}INFO ${RESET} - Documentation generation done for $dir/$module_path/$doc_dir, copy to $dest_dir
mkdir -p $dest_dir mkdir -p $dest_dir
cp -r $builddir/$format/. $dest_dir cp -r $builddir/$format/. $dest_dir
else else
...@@ -84,10 +85,10 @@ ...@@ -84,10 +85,10 @@
mkdir -p $dest_dir mkdir -p $dest_dir
cp -r $builddir/$format/. $dest_dir cp -r $builddir/$format/. $dest_dir
else else
echo ${RED}ERROR${RESET} - Documentation generation failed for $dir/$module/$doc_dir echo ${RED}ERROR${RESET} - Documentation generation failed for $dir/$module_path/$doc_dir
fi fi
done done
popd popd
fi fi
done done
if [[ -z "$has_doc" ]] ; then if [[ -z "$has_doc" ]] ; then
...@@ -88,10 +89,10 @@ ...@@ -88,10 +89,10 @@
fi fi
done done
popd popd
fi fi
done done
if [[ -z "$has_doc" ]] ; then if [[ -z "$has_doc" ]] ; then
echo ${RED}ERROR${RESET} - Missing documentation for $dir/$module echo ${RED}ERROR${RESET} - Missing documentation for $dir/$module_path
fi fi
popd popd
fi fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment