summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Saunier <tsaunier@igalia.com>2018-11-12 20:23:14 -0300
committerThibault Saunier <tsaunier@igalia.com>2019-05-13 11:42:15 -0400
commitfda837941179fc384489883a8492aaf15c4ab609 (patch)
tree57909edd71364c9513493adde969c202f5c5bd9c
parentfbb81c6c78e098550687fd3758e9a6e515c5e00e (diff)
downloadgstreamer-fda837941179fc384489883a8492aaf15c4ab609.tar.gz
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.
-rwxr-xr-xcheckout-branch-worktree8
-rwxr-xr-xgit-update6
-rwxr-xr-xgst-uninstalled.py6
-rw-r--r--meson.build9
-rw-r--r--msys2_setup.py2
-rw-r--r--scripts/__init__.py0
-rwxr-xr-xscripts/check-clean-repos.py27
-rw-r--r--scripts/common.py (renamed from common.py)0
-rwxr-xr-xsetup.py4
9 files changed, 47 insertions, 15 deletions
diff --git a/checkout-branch-worktree b/checkout-branch-worktree
index 7f2dbd5185..8afb39333f 100755
--- a/checkout-branch-worktree
+++ b/checkout-branch-worktree
@@ -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__))
diff --git a/git-update b/git-update
index 71c6d038a1..ae90567d45 100755
--- a/git-update
+++ b/git-update
@@ -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__))
diff --git a/gst-uninstalled.py b/gst-uninstalled.py
index bb9143da3a..59fecaecd2 100755
--- a/gst-uninstalled.py
+++ b/gst-uninstalled.py
@@ -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')
diff --git a/meson.build b/meson.build
index c007e42341..a2156b4c24 100644
--- a/meson.build
+++ b/meson.build
@@ -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()
diff --git a/msys2_setup.py b/msys2_setup.py
index 8153f07724..0ea17e5a37 100644
--- a/msys2_setup.py
+++ b/msys2_setup.py
@@ -11,7 +11,7 @@ import shutil
import subprocess
import tempfile
-from common import git
+from scripts.common import git
from setup import GstBuildConfigurer
diff --git a/scripts/__init__.py b/scripts/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/scripts/__init__.py
diff --git a/scripts/check-clean-repos.py b/scripts/check-clean-repos.py
new file mode 100755
index 0000000000..2b50fd938b
--- /dev/null
+++ b/scripts/check-clean-repos.py
@@ -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) \ No newline at end of file
diff --git a/common.py b/scripts/common.py
index 5cea742027..5cea742027 100644
--- a/common.py
+++ b/scripts/common.py
diff --git a/setup.py b/setup.py
index fccf416f5c..27766781db 100755
--- a/setup.py
+++ b/setup.py
@@ -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"