scripts: Add a script to check that all repos are clean

This is useful to check that a build didn't result in changes in the
code/generated files

This will be used to check that the plugins documentation cache file is
properly commited, and that necessary workaround for particular case
are adopted.
This commit is contained in:
Thibault Saunier 2018-11-12 20:23:14 -03:00
parent fbb81c6c78
commit fda8379411
9 changed files with 47 additions and 15 deletions

View file

@ -7,10 +7,10 @@ import subprocess
import xml.etree.ElementTree as ET
import sys
from common import git
from common import Colors
from common import get_meson
from common import accept_command
from scripts.common import git
from scripts.common import Colors
from scripts.common import get_meson
from scripts.common import accept_command
SCRIPTDIR = os.path.normpath(os.path.dirname(__file__))

View file

@ -5,9 +5,9 @@ import subprocess
import xml.etree.ElementTree as ET
import sys
from common import git
from common import Colors
from common import accept_command
from scripts.common import git
from scripts.common import Colors
from scripts.common import accept_command
SCRIPTDIR = os.path.normpath(os.path.dirname(__file__))

View file

@ -16,9 +16,9 @@ import pathlib
from distutils.sysconfig import get_python_lib
from distutils.util import strtobool
from common import get_meson
from common import git
from common import win32_get_short_path_name
from scripts.common import get_meson
from scripts.common import git
from scripts.common import win32_get_short_path_name
SCRIPTDIR = os.path.dirname(os.path.realpath(__file__))
PREFIX_DIR = os.path.join(SCRIPTDIR, 'prefix')

View file

@ -105,8 +105,13 @@ foreach custom_subproj: get_option('custom_subprojects').split(',')
endif
endforeach
if build_machine.system() == 'windows'
message('Disabling hotdoc while building on Windows')
if meson.is_cross_build() or build_machine.system() == 'windows'
if get_option('doc').enabled()
error('Documentation enabled but building the doc while cross building or building on windows is not supported yet.')
endif
message('Documentation not built as building the docmentation while cross building or building on windows is not supported yet.')
subdir_done()
else
hotdoc_p = find_program('hotdoc', required : get_option('doc'))
if hotdoc_p.found()

View file

@ -11,7 +11,7 @@ import shutil
import subprocess
import tempfile
from common import git
from scripts.common import git
from setup import GstBuildConfigurer

0
scripts/__init__.py Normal file
View file

27
scripts/check-clean-repos.py Executable file
View file

@ -0,0 +1,27 @@
#!/usr/bin/env python3
import os
import subprocess
import sys
from common import git
SCRIPTDIR = os.path.realpath(os.path.dirname(__file__))
if __name__ == "__main__":
subprojects_dir = os.path.join(SCRIPTDIR, "..", "subprojects")
exitcode = 0
for repo_name in os.listdir(subprojects_dir):
repo_dir = os.path.normpath(os.path.join(SCRIPTDIR, subprojects_dir, repo_name))
if not os.path.exists(os.path.join(repo_dir, '.git')):
continue
diff = git('diff', repository_path=repo_dir).strip('\n')
if diff:
print('ERROR: Repository %s is not clean' % repo_dir)
print('NOTE: Make sure to commit necessary changes in the gst_plugins_cache.json files')
print(diff)
exitcode += 1
sys.exit(exitcode)

View file

@ -7,8 +7,8 @@ import sys
import shutil
import subprocess
from common import get_meson
from common import accept_command
from scripts.common import get_meson
from scripts.common import accept_command
PROJECTNAME = "GStreamer build"