Remove publish_www and simplify www_touched

Because of I2f0c61006ef8885e157eb2b800080407f2bae393 it is not
longer necessary to publish the files inside the www directory.

Because of the removal of publish_www it's now only necessary
to check if only files inside the www directory are changed.

Change-Id: Ic28ba9251ecb47967de2e7b6816788828e3bbb14
This commit is contained in:
Christian Berendt 2014-08-11 21:20:33 +02:00
parent 483122f1fd
commit b654d61d16
1 changed files with 4 additions and 27 deletions

View File

@ -258,12 +258,8 @@ def error_message(error_log):
return "\n".join(errs)
def www_touched(check_only_www):
"""Check whether files in www directory are touched.
If check_only_www is True: Check that only files in www are touched.
Otherwise check that files in www are touched.
"""
def www_touched():
"""Check whether files in www directory are touched."""
try:
git_args = ["git", "diff", "--name-only", "HEAD~1", "HEAD"]
@ -280,9 +276,7 @@ def www_touched(check_only_www):
else:
other_changed = True
if check_only_www:
return www_changed and not other_changed
return www_changed
return www_changed and not other_changed
def check_modified_affects_all(rootdir):
@ -651,17 +645,6 @@ def get_publish_path():
return os.path.join(get_gitroot(), 'publish-docs')
def publish_www():
"""Copy www files."""
publish_path = get_publish_path()
www_path = os.path.join(publish_path, 'www')
shutil.rmtree(www_path, ignore_errors=True)
source = os.path.join(get_gitroot(), 'www')
shutil.copytree(source, www_path)
def ignore_for_publishing(_, names):
"""Return list of files that should be ignored for publishing."""
@ -1405,13 +1388,7 @@ def doctest():
elif not CONF.api_site:
doc_path = os.path.join(doc_path, 'doc')
# Do not publish www directory if we build for external
# publishing
if (CONF.check_build and
(www_touched(False) and not CONF.publish)):
publish_www()
if not CONF.force and www_touched(True):
if not CONF.force and www_touched():
print("Only files in www directory changed, nothing to do.\n")
return