diff options
Diffstat (limited to 'subprojects')
25 files changed, 0 insertions, 1177 deletions
diff --git a/subprojects/gst-devtools/hooks/multi-pre-commit.hook b/subprojects/gst-devtools/hooks/multi-pre-commit.hook deleted file mode 100755 index 98ae380932..0000000000 --- a/subprojects/gst-devtools/hooks/multi-pre-commit.hook +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh -# Git pre-commit hook that runs multiple hooks specified in $HOOKS. -# Make sure this script is executable. Bypass hooks with git commit --no-verify. - -# This file is inspired by a set of unofficial pre-commit hooks available -# at github. -# Link: https://github.com/githubbrowser/Pre-commit-hooks -# Contact: David Martin, david.martin.mailbox@googlemail.com - - -########################################################### -# SETTINGS: -# pre-commit hooks to be executed. They should be in the same .git/hooks/ folder -# as this script. Hooks should return 0 if successful and nonzero to cancel the -# commit. They are executed in the order in which they are listed. -########################################################### - -HOOKS="hooks/pre-commit.hook hooks/pre-commit-python.hook" - -# exit on error -set -e - -echo $PWD - -for hook in $HOOKS -do - echo "Running hook: $hook" - # run hook if it exists - # if it returns with nonzero exit with 1 and thus abort the commit - if [ -f "$PWD/$hook" ]; then - "$PWD/$hook" - if [ $? != 0 ]; then - exit 1 - fi - else - echo "Error: file $hook not found." - echo "Aborting commit. Make sure the hook is at $PWD/$hook and executable." - echo "You can disable it by removing it from the list" - echo "You can skip all pre-commit hooks with --no-verify (not recommended)." - exit 1 - fi -done - diff --git a/subprojects/gst-devtools/hooks/pre-commit-python.hook b/subprojects/gst-devtools/hooks/pre-commit-python.hook deleted file mode 100755 index 14fbc63bfd..0000000000 --- a/subprojects/gst-devtools/hooks/pre-commit-python.hook +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/env python3 -import os -import subprocess -import sys -import tempfile - -NOT_PYCODESTYLE_COMPLIANT_MESSAGE_PRE = \ - "Your code is not fully pycodestyle compliant and contains"\ - " the following coding style issues:\n\n" - -NOT_PYCODESTYLE_COMPLIANT_MESSAGE_POST = \ - "Please fix these errors and commit again, you can do so "\ - "from the root directory automatically like this, assuming the whole "\ - "file is to be commited:" - -NO_PYCODESTYLE_MESSAGE = \ - "You should install the pycodestyle style checker to be able"\ - " to commit in this repo.\nIt allows us to garantee that "\ - "anything that is commited respects the pycodestyle coding style "\ - "standard.\nYou can install it:\n"\ - " * on ubuntu, debian: $sudo apt-get install pycodestyle \n"\ - " * on fedora: #yum install python3-pycodestyle \n"\ - " * on arch: #pacman -S python-pycodestyle \n"\ - " * or `pip install --user pycodestyle`" - - -def system(*args, **kwargs): - kwargs.setdefault('stdout', subprocess.PIPE) - proc = subprocess.Popen(args, **kwargs) - out, err = proc.communicate() - if isinstance(out, bytes): - out = out.decode() - return out - - -def copy_files_to_tmp_dir(files): - tempdir = tempfile.mkdtemp() - for name in files: - filename = os.path.join(tempdir, name) - filepath = os.path.dirname(filename) - if not os.path.exists(filepath): - os.makedirs(filepath) - with open(filename, 'w') as f: - system('git', 'show', ':' + name, stdout=f) - - return tempdir - - -def main(): - modified_files = system('git', 'diff-index', '--cached', - '--name-only', 'HEAD', '--diff-filter=ACMR').split("\n")[:-1] - non_compliant_files = [] - output_message = None - - for modified_file in modified_files: - try: - if not modified_file.endswith(".py"): - continue - pycodestyle_errors = system('pycodestyle', '--repeat', '--ignore', 'E402,E501,E128,W605,W503', modified_file) - if pycodestyle_errors: - if output_message is None: - output_message = NOT_PYCODESTYLE_COMPLIANT_MESSAGE_PRE - output_message += pycodestyle_errors - non_compliant_files.append(modified_file) - except OSError as e: - output_message = NO_PYCODESTYLE_MESSAGE - break - - if output_message: - print(output_message) - if non_compliant_files: - print(NOT_PYCODESTYLE_COMPLIANT_MESSAGE_POST) - for non_compliant_file in non_compliant_files: - print("autopep8 -i ", non_compliant_file, "; git add ", - non_compliant_file) - print("git commit") - sys.exit(1) - - -if __name__ == '__main__': - main() diff --git a/subprojects/gst-devtools/hooks/pre-commit.hook b/subprojects/gst-devtools/hooks/pre-commit.hook deleted file mode 100755 index 3c1062b9e0..0000000000 --- a/subprojects/gst-devtools/hooks/pre-commit.hook +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/sh -# -# Check that the code follows a consistant code style -# - -# Check for existence of indent, and error out if not present. -# On some *bsd systems the binary seems to be called gnunindent, -# so check for that first. - -version=`gnuindent --version 2>/dev/null` -if test "x$version" = "x"; then - version=`gindent --version 2>/dev/null` - if test "x$version" = "x"; then - version=`indent --version 2>/dev/null` - if test "x$version" = "x"; then - echo "GStreamer git pre-commit hook:" - echo "Did not find GNU indent, please install it before continuing." - exit 1 - else - INDENT=indent - fi - else - INDENT=gindent - fi -else - INDENT=gnuindent -fi - -case `$INDENT --version` in - GNU*) - ;; - default) - echo "GStreamer git pre-commit hook:" - echo "Did not find GNU indent, please install it before continuing." - echo "(Found $INDENT, but it doesn't seem to be GNU indent)" - exit 1 - ;; -esac - -INDENT_PARAMETERS="--braces-on-if-line \ - --case-brace-indentation0 \ - --case-indentation2 \ - --braces-after-struct-decl-line \ - --line-length80 \ - --no-tabs \ - --cuddle-else \ - --dont-line-up-parentheses \ - --continuation-indentation4 \ - --honour-newlines \ - --tab-size8 \ - --indent-level2 \ - --leave-preprocessor-space" - -echo "--Checking style--" -for file in `git diff-index --cached --name-only HEAD --diff-filter=ACMR| grep "\.c$"` ; do - # nf is the temporary checkout. This makes sure we check against the - # revision in the index (and not the checked out version). - nf=`git checkout-index --temp ${file} | cut -f 1` - newfile=`mktemp /tmp/${nf}.XXXXXX` || exit 1 - $INDENT ${INDENT_PARAMETERS} \ - $nf -o $newfile 2>> /dev/null - # FIXME: Call indent twice as it tends to do line-breaks - # different for every second call. - $INDENT ${INDENT_PARAMETERS} \ - $newfile 2>> /dev/null - diff -u -p "${nf}" "${newfile}" - r=$? - rm "${newfile}" - rm "${nf}" - if [ $r != 0 ] ; then -echo "=================================================================================================" -echo " Code style error in: $file " -echo " " -echo " Please fix before committing. Don't forget to run git add before trying to commit again. " -echo " If the whole file is to be committed, this should work (run from the top-level directory): " -echo " " -echo " gst-indent $file; git add $file; git commit" -echo " " -echo "=================================================================================================" - exit 1 - fi -done -echo "--Checking style pass--" diff --git a/subprojects/gst-editing-services/hooks/pre-commit.hook b/subprojects/gst-editing-services/hooks/pre-commit.hook deleted file mode 100755 index 3c1062b9e0..0000000000 --- a/subprojects/gst-editing-services/hooks/pre-commit.hook +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/sh -# -# Check that the code follows a consistant code style -# - -# Check for existence of indent, and error out if not present. -# On some *bsd systems the binary seems to be called gnunindent, -# so check for that first. - -version=`gnuindent --version 2>/dev/null` -if test "x$version" = "x"; then - version=`gindent --version 2>/dev/null` - if test "x$version" = "x"; then - version=`indent --version 2>/dev/null` - if test "x$version" = "x"; then - echo "GStreamer git pre-commit hook:" - echo "Did not find GNU indent, please install it before continuing." - exit 1 - else - INDENT=indent - fi - else - INDENT=gindent - fi -else - INDENT=gnuindent -fi - -case `$INDENT --version` in - GNU*) - ;; - default) - echo "GStreamer git pre-commit hook:" - echo "Did not find GNU indent, please install it before continuing." - echo "(Found $INDENT, but it doesn't seem to be GNU indent)" - exit 1 - ;; -esac - -INDENT_PARAMETERS="--braces-on-if-line \ - --case-brace-indentation0 \ - --case-indentation2 \ - --braces-after-struct-decl-line \ - --line-length80 \ - --no-tabs \ - --cuddle-else \ - --dont-line-up-parentheses \ - --continuation-indentation4 \ - --honour-newlines \ - --tab-size8 \ - --indent-level2 \ - --leave-preprocessor-space" - -echo "--Checking style--" -for file in `git diff-index --cached --name-only HEAD --diff-filter=ACMR| grep "\.c$"` ; do - # nf is the temporary checkout. This makes sure we check against the - # revision in the index (and not the checked out version). - nf=`git checkout-index --temp ${file} | cut -f 1` - newfile=`mktemp /tmp/${nf}.XXXXXX` || exit 1 - $INDENT ${INDENT_PARAMETERS} \ - $nf -o $newfile 2>> /dev/null - # FIXME: Call indent twice as it tends to do line-breaks - # different for every second call. - $INDENT ${INDENT_PARAMETERS} \ - $newfile 2>> /dev/null - diff -u -p "${nf}" "${newfile}" - r=$? - rm "${newfile}" - rm "${nf}" - if [ $r != 0 ] ; then -echo "=================================================================================================" -echo " Code style error in: $file " -echo " " -echo " Please fix before committing. Don't forget to run git add before trying to commit again. " -echo " If the whole file is to be committed, this should work (run from the top-level directory): " -echo " " -echo " gst-indent $file; git add $file; git commit" -echo " " -echo "=================================================================================================" - exit 1 - fi -done -echo "--Checking style pass--" diff --git a/subprojects/gst-editing-services/meson.build b/subprojects/gst-editing-services/meson.build index 81fc109d5b..199e8e41e4 100644 --- a/subprojects/gst-editing-services/meson.build +++ b/subprojects/gst-editing-services/meson.build @@ -327,5 +327,3 @@ if gio_dep.version().version_compare('< 2.67.4') endif configure_file(output: 'config.h', configuration: cdata) - -run_command(python3, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")') diff --git a/subprojects/gst-libav/hooks/pre-commit.hook b/subprojects/gst-libav/hooks/pre-commit.hook deleted file mode 100755 index 3c1062b9e0..0000000000 --- a/subprojects/gst-libav/hooks/pre-commit.hook +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/sh -# -# Check that the code follows a consistant code style -# - -# Check for existence of indent, and error out if not present. -# On some *bsd systems the binary seems to be called gnunindent, -# so check for that first. - -version=`gnuindent --version 2>/dev/null` -if test "x$version" = "x"; then - version=`gindent --version 2>/dev/null` - if test "x$version" = "x"; then - version=`indent --version 2>/dev/null` - if test "x$version" = "x"; then - echo "GStreamer git pre-commit hook:" - echo "Did not find GNU indent, please install it before continuing." - exit 1 - else - INDENT=indent - fi - else - INDENT=gindent - fi -else - INDENT=gnuindent -fi - -case `$INDENT --version` in - GNU*) - ;; - default) - echo "GStreamer git pre-commit hook:" - echo "Did not find GNU indent, please install it before continuing." - echo "(Found $INDENT, but it doesn't seem to be GNU indent)" - exit 1 - ;; -esac - -INDENT_PARAMETERS="--braces-on-if-line \ - --case-brace-indentation0 \ - --case-indentation2 \ - --braces-after-struct-decl-line \ - --line-length80 \ - --no-tabs \ - --cuddle-else \ - --dont-line-up-parentheses \ - --continuation-indentation4 \ - --honour-newlines \ - --tab-size8 \ - --indent-level2 \ - --leave-preprocessor-space" - -echo "--Checking style--" -for file in `git diff-index --cached --name-only HEAD --diff-filter=ACMR| grep "\.c$"` ; do - # nf is the temporary checkout. This makes sure we check against the - # revision in the index (and not the checked out version). - nf=`git checkout-index --temp ${file} | cut -f 1` - newfile=`mktemp /tmp/${nf}.XXXXXX` || exit 1 - $INDENT ${INDENT_PARAMETERS} \ - $nf -o $newfile 2>> /dev/null - # FIXME: Call indent twice as it tends to do line-breaks - # different for every second call. - $INDENT ${INDENT_PARAMETERS} \ - $newfile 2>> /dev/null - diff -u -p "${nf}" "${newfile}" - r=$? - rm "${newfile}" - rm "${nf}" - if [ $r != 0 ] ; then -echo "=================================================================================================" -echo " Code style error in: $file " -echo " " -echo " Please fix before committing. Don't forget to run git add before trying to commit again. " -echo " If the whole file is to be committed, this should work (run from the top-level directory): " -echo " " -echo " gst-indent $file; git add $file; git commit" -echo " " -echo "=================================================================================================" - exit 1 - fi -done -echo "--Checking style pass--" diff --git a/subprojects/gst-libav/meson.build b/subprojects/gst-libav/meson.build index 0abc52824a..2ef892b77c 100644 --- a/subprojects/gst-libav/meson.build +++ b/subprojects/gst-libav/meson.build @@ -212,6 +212,3 @@ if gst_version_nano == 0 endif configure_file(output: 'config.h', configuration: cdata) - -python3 = import('python').find_installation() -run_command(python3, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")') diff --git a/subprojects/gst-omx/hooks/pre-commit.hook b/subprojects/gst-omx/hooks/pre-commit.hook deleted file mode 100755 index 3c1062b9e0..0000000000 --- a/subprojects/gst-omx/hooks/pre-commit.hook +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/sh -# -# Check that the code follows a consistant code style -# - -# Check for existence of indent, and error out if not present. -# On some *bsd systems the binary seems to be called gnunindent, -# so check for that first. - -version=`gnuindent --version 2>/dev/null` -if test "x$version" = "x"; then - version=`gindent --version 2>/dev/null` - if test "x$version" = "x"; then - version=`indent --version 2>/dev/null` - if test "x$version" = "x"; then - echo "GStreamer git pre-commit hook:" - echo "Did not find GNU indent, please install it before continuing." - exit 1 - else - INDENT=indent - fi - else - INDENT=gindent - fi -else - INDENT=gnuindent -fi - -case `$INDENT --version` in - GNU*) - ;; - default) - echo "GStreamer git pre-commit hook:" - echo "Did not find GNU indent, please install it before continuing." - echo "(Found $INDENT, but it doesn't seem to be GNU indent)" - exit 1 - ;; -esac - -INDENT_PARAMETERS="--braces-on-if-line \ - --case-brace-indentation0 \ - --case-indentation2 \ - --braces-after-struct-decl-line \ - --line-length80 \ - --no-tabs \ - --cuddle-else \ - --dont-line-up-parentheses \ - --continuation-indentation4 \ - --honour-newlines \ - --tab-size8 \ - --indent-level2 \ - --leave-preprocessor-space" - -echo "--Checking style--" -for file in `git diff-index --cached --name-only HEAD --diff-filter=ACMR| grep "\.c$"` ; do - # nf is the temporary checkout. This makes sure we check against the - # revision in the index (and not the checked out version). - nf=`git checkout-index --temp ${file} | cut -f 1` - newfile=`mktemp /tmp/${nf}.XXXXXX` || exit 1 - $INDENT ${INDENT_PARAMETERS} \ - $nf -o $newfile 2>> /dev/null - # FIXME: Call indent twice as it tends to do line-breaks - # different for every second call. - $INDENT ${INDENT_PARAMETERS} \ - $newfile 2>> /dev/null - diff -u -p "${nf}" "${newfile}" - r=$? - rm "${newfile}" - rm "${nf}" - if [ $r != 0 ] ; then -echo "=================================================================================================" -echo " Code style error in: $file " -echo " " -echo " Please fix before committing. Don't forget to run git add before trying to commit again. " -echo " If the whole file is to be committed, this should work (run from the top-level directory): " -echo " " -echo " gst-indent $file; git add $file; git commit" -echo " " -echo "=================================================================================================" - exit 1 - fi -done -echo "--Checking style pass--" diff --git a/subprojects/gst-omx/meson.build b/subprojects/gst-omx/meson.build index d37fc7bd77..37cdecb63f 100644 --- a/subprojects/gst-omx/meson.build +++ b/subprojects/gst-omx/meson.build @@ -427,6 +427,3 @@ if gst_version_nano == 0 endif configure_file(output: 'config.h', configuration: cdata) - -python3 = find_program('python3') -run_command(python3, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")') diff --git a/subprojects/gst-plugins-bad/hooks/pre-commit.hook b/subprojects/gst-plugins-bad/hooks/pre-commit.hook deleted file mode 100755 index 6f177402b3..0000000000 --- a/subprojects/gst-plugins-bad/hooks/pre-commit.hook +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/sh -# -# Check that the code follows a consistent code style -# - -# Check for existence of indent, and error out if not present. -# On some *bsd systems the binary seems to be called gnunindent, -# so check for that first. - -version=`gnuindent --version 2>/dev/null` -if test "x$version" = "x"; then - version=`gindent --version 2>/dev/null` - if test "x$version" = "x"; then - version=`indent --version 2>/dev/null` - if test "x$version" = "x"; then - echo "GStreamer git pre-commit hook:" - echo "Did not find GNU indent, please install it before continuing." - exit 1 - else - INDENT=indent - fi - else - INDENT=gindent - fi -else - INDENT=gnuindent -fi - -case `$INDENT --version` in - GNU*) - ;; - default) - echo "GStreamer git pre-commit hook:" - echo "Did not find GNU indent, please install it before continuing." - echo "(Found $INDENT, but it doesn't seem to be GNU indent)" - exit 1 - ;; -esac - -INDENT_PARAMETERS="--braces-on-if-line \ - --case-brace-indentation0 \ - --case-indentation2 \ - --braces-after-struct-decl-line \ - --line-length80 \ - --no-tabs \ - --cuddle-else \ - --dont-line-up-parentheses \ - --continuation-indentation4 \ - --honour-newlines \ - --tab-size8 \ - --indent-level2 \ - --leave-preprocessor-space" - -echo "--Checking style--" -for file in `git diff-index --cached --name-only HEAD --diff-filter=ACMR| grep "\.c$"` ; do - # nf is the temporary checkout. This makes sure we check against the - # revision in the index (and not the checked out version). - nf=`git checkout-index --temp ${file} | cut -f 1` - newfile=`mktemp /tmp/${nf}.XXXXXX` || exit 1 - $INDENT ${INDENT_PARAMETERS} \ - $nf -o $newfile 2>> /dev/null - # FIXME: Call indent twice as it tends to do line-breaks - # different for every second call. - $INDENT ${INDENT_PARAMETERS} \ - $newfile 2>> /dev/null - diff -u -p "${nf}" "${newfile}" - r=$? - rm "${newfile}" - rm "${nf}" - if [ $r != 0 ] ; then -echo "=================================================================================================" -echo " Code style error in: $file " -echo " " -echo " Please fix before committing. Don't forget to run git add before trying to commit again. " -echo " If the whole file is to be committed, this should work (run from the top-level directory): " -echo " " -echo " gst-indent $file; git add $file; git commit" -echo " " -echo "=================================================================================================" - exit 1 - fi -done -echo "--Checking style pass--" diff --git a/subprojects/gst-plugins-bad/meson.build b/subprojects/gst-plugins-bad/meson.build index 7cab556e0c..c693ee7b7e 100644 --- a/subprojects/gst-plugins-bad/meson.build +++ b/subprojects/gst-plugins-bad/meson.build @@ -543,8 +543,6 @@ endif configure_file(output : 'config.h', configuration : cdata) -run_command(python3, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")') - subdir('docs') if meson.version().version_compare('>= 0.54') diff --git a/subprojects/gst-plugins-base/hooks/pre-commit.hook b/subprojects/gst-plugins-base/hooks/pre-commit.hook deleted file mode 100755 index 6f177402b3..0000000000 --- a/subprojects/gst-plugins-base/hooks/pre-commit.hook +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/sh -# -# Check that the code follows a consistent code style -# - -# Check for existence of indent, and error out if not present. -# On some *bsd systems the binary seems to be called gnunindent, -# so check for that first. - -version=`gnuindent --version 2>/dev/null` -if test "x$version" = "x"; then - version=`gindent --version 2>/dev/null` - if test "x$version" = "x"; then - version=`indent --version 2>/dev/null` - if test "x$version" = "x"; then - echo "GStreamer git pre-commit hook:" - echo "Did not find GNU indent, please install it before continuing." - exit 1 - else - INDENT=indent - fi - else - INDENT=gindent - fi -else - INDENT=gnuindent -fi - -case `$INDENT --version` in - GNU*) - ;; - default) - echo "GStreamer git pre-commit hook:" - echo "Did not find GNU indent, please install it before continuing." - echo "(Found $INDENT, but it doesn't seem to be GNU indent)" - exit 1 - ;; -esac - -INDENT_PARAMETERS="--braces-on-if-line \ - --case-brace-indentation0 \ - --case-indentation2 \ - --braces-after-struct-decl-line \ - --line-length80 \ - --no-tabs \ - --cuddle-else \ - --dont-line-up-parentheses \ - --continuation-indentation4 \ - --honour-newlines \ - --tab-size8 \ - --indent-level2 \ - --leave-preprocessor-space" - -echo "--Checking style--" -for file in `git diff-index --cached --name-only HEAD --diff-filter=ACMR| grep "\.c$"` ; do - # nf is the temporary checkout. This makes sure we check against the - # revision in the index (and not the checked out version). - nf=`git checkout-index --temp ${file} | cut -f 1` - newfile=`mktemp /tmp/${nf}.XXXXXX` || exit 1 - $INDENT ${INDENT_PARAMETERS} \ - $nf -o $newfile 2>> /dev/null - # FIXME: Call indent twice as it tends to do line-breaks - # different for every second call. - $INDENT ${INDENT_PARAMETERS} \ - $newfile 2>> /dev/null - diff -u -p "${nf}" "${newfile}" - r=$? - rm "${newfile}" - rm "${nf}" - if [ $r != 0 ] ; then -echo "=================================================================================================" -echo " Code style error in: $file " -echo " " -echo " Please fix before committing. Don't forget to run git add before trying to commit again. " -echo " If the whole file is to be committed, this should work (run from the top-level directory): " -echo " " -echo " gst-indent $file; git add $file; git commit" -echo " " -echo "=================================================================================================" - exit 1 - fi -done -echo "--Checking style pass--" diff --git a/subprojects/gst-plugins-base/meson.build b/subprojects/gst-plugins-base/meson.build index 9b00253a0f..a87b24bfc2 100644 --- a/subprojects/gst-plugins-base/meson.build +++ b/subprojects/gst-plugins-base/meson.build @@ -534,8 +534,6 @@ endif # Use core_conf after all subdirs have set values configure_file(output : 'config.h', configuration : core_conf) -run_command(python3, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")') - if meson.version().version_compare('>= 0.54') plugin_names = [] foreach plugin: plugins diff --git a/subprojects/gst-plugins-good/hooks/pre-commit.hook b/subprojects/gst-plugins-good/hooks/pre-commit.hook deleted file mode 100755 index 6f177402b3..0000000000 --- a/subprojects/gst-plugins-good/hooks/pre-commit.hook +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/sh -# -# Check that the code follows a consistent code style -# - -# Check for existence of indent, and error out if not present. -# On some *bsd systems the binary seems to be called gnunindent, -# so check for that first. - -version=`gnuindent --version 2>/dev/null` -if test "x$version" = "x"; then - version=`gindent --version 2>/dev/null` - if test "x$version" = "x"; then - version=`indent --version 2>/dev/null` - if test "x$version" = "x"; then - echo "GStreamer git pre-commit hook:" - echo "Did not find GNU indent, please install it before continuing." - exit 1 - else - INDENT=indent - fi - else - INDENT=gindent - fi -else - INDENT=gnuindent -fi - -case `$INDENT --version` in - GNU*) - ;; - default) - echo "GStreamer git pre-commit hook:" - echo "Did not find GNU indent, please install it before continuing." - echo "(Found $INDENT, but it doesn't seem to be GNU indent)" - exit 1 - ;; -esac - -INDENT_PARAMETERS="--braces-on-if-line \ - --case-brace-indentation0 \ - --case-indentation2 \ - --braces-after-struct-decl-line \ - --line-length80 \ - --no-tabs \ - --cuddle-else \ - --dont-line-up-parentheses \ - --continuation-indentation4 \ - --honour-newlines \ - --tab-size8 \ - --indent-level2 \ - --leave-preprocessor-space" - -echo "--Checking style--" -for file in `git diff-index --cached --name-only HEAD --diff-filter=ACMR| grep "\.c$"` ; do - # nf is the temporary checkout. This makes sure we check against the - # revision in the index (and not the checked out version). - nf=`git checkout-index --temp ${file} | cut -f 1` - newfile=`mktemp /tmp/${nf}.XXXXXX` || exit 1 - $INDENT ${INDENT_PARAMETERS} \ - $nf -o $newfile 2>> /dev/null - # FIXME: Call indent twice as it tends to do line-breaks - # different for every second call. - $INDENT ${INDENT_PARAMETERS} \ - $newfile 2>> /dev/null - diff -u -p "${nf}" "${newfile}" - r=$? - rm "${newfile}" - rm "${nf}" - if [ $r != 0 ] ; then -echo "=================================================================================================" -echo " Code style error in: $file " -echo " " -echo " Please fix before committing. Don't forget to run git add before trying to commit again. " -echo " If the whole file is to be committed, this should work (run from the top-level directory): " -echo " " -echo " gst-indent $file; git add $file; git commit" -echo " " -echo "=================================================================================================" - exit 1 - fi -done -echo "--Checking style pass--" diff --git a/subprojects/gst-plugins-good/meson.build b/subprojects/gst-plugins-good/meson.build index f8e1299333..bc9e53b325 100644 --- a/subprojects/gst-plugins-good/meson.build +++ b/subprojects/gst-plugins-good/meson.build @@ -497,8 +497,6 @@ endif configure_file(output : 'config.h', configuration : cdata) -run_command(python3, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")') - if meson.version().version_compare('>= 0.54') plugin_names = [] foreach plugin: plugins diff --git a/subprojects/gst-plugins-ugly/hooks/pre-commit.hook b/subprojects/gst-plugins-ugly/hooks/pre-commit.hook deleted file mode 100755 index 6f177402b3..0000000000 --- a/subprojects/gst-plugins-ugly/hooks/pre-commit.hook +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/sh -# -# Check that the code follows a consistent code style -# - -# Check for existence of indent, and error out if not present. -# On some *bsd systems the binary seems to be called gnunindent, -# so check for that first. - -version=`gnuindent --version 2>/dev/null` -if test "x$version" = "x"; then - version=`gindent --version 2>/dev/null` - if test "x$version" = "x"; then - version=`indent --version 2>/dev/null` - if test "x$version" = "x"; then - echo "GStreamer git pre-commit hook:" - echo "Did not find GNU indent, please install it before continuing." - exit 1 - else - INDENT=indent - fi - else - INDENT=gindent - fi -else - INDENT=gnuindent -fi - -case `$INDENT --version` in - GNU*) - ;; - default) - echo "GStreamer git pre-commit hook:" - echo "Did not find GNU indent, please install it before continuing." - echo "(Found $INDENT, but it doesn't seem to be GNU indent)" - exit 1 - ;; -esac - -INDENT_PARAMETERS="--braces-on-if-line \ - --case-brace-indentation0 \ - --case-indentation2 \ - --braces-after-struct-decl-line \ - --line-length80 \ - --no-tabs \ - --cuddle-else \ - --dont-line-up-parentheses \ - --continuation-indentation4 \ - --honour-newlines \ - --tab-size8 \ - --indent-level2 \ - --leave-preprocessor-space" - -echo "--Checking style--" -for file in `git diff-index --cached --name-only HEAD --diff-filter=ACMR| grep "\.c$"` ; do - # nf is the temporary checkout. This makes sure we check against the - # revision in the index (and not the checked out version). - nf=`git checkout-index --temp ${file} | cut -f 1` - newfile=`mktemp /tmp/${nf}.XXXXXX` || exit 1 - $INDENT ${INDENT_PARAMETERS} \ - $nf -o $newfile 2>> /dev/null - # FIXME: Call indent twice as it tends to do line-breaks - # different for every second call. - $INDENT ${INDENT_PARAMETERS} \ - $newfile 2>> /dev/null - diff -u -p "${nf}" "${newfile}" - r=$? - rm "${newfile}" - rm "${nf}" - if [ $r != 0 ] ; then -echo "=================================================================================================" -echo " Code style error in: $file " -echo " " -echo " Please fix before committing. Don't forget to run git add before trying to commit again. " -echo " If the whole file is to be committed, this should work (run from the top-level directory): " -echo " " -echo " gst-indent $file; git add $file; git commit" -echo " " -echo "=================================================================================================" - exit 1 - fi -done -echo "--Checking style pass--" diff --git a/subprojects/gst-plugins-ugly/meson.build b/subprojects/gst-plugins-ugly/meson.build index c5c78fc2bf..f9fff1dff7 100644 --- a/subprojects/gst-plugins-ugly/meson.build +++ b/subprojects/gst-plugins-ugly/meson.build @@ -300,8 +300,6 @@ endif configure_file(output : 'config.h', configuration : cdata) -run_command(python3, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")') - if meson.version().version_compare('>= 0.54') plugin_names = [] foreach plugin: plugins diff --git a/subprojects/gst-python/hooks/pre-commit.hook b/subprojects/gst-python/hooks/pre-commit.hook deleted file mode 100755 index 3c1062b9e0..0000000000 --- a/subprojects/gst-python/hooks/pre-commit.hook +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/sh -# -# Check that the code follows a consistant code style -# - -# Check for existence of indent, and error out if not present. -# On some *bsd systems the binary seems to be called gnunindent, -# so check for that first. - -version=`gnuindent --version 2>/dev/null` -if test "x$version" = "x"; then - version=`gindent --version 2>/dev/null` - if test "x$version" = "x"; then - version=`indent --version 2>/dev/null` - if test "x$version" = "x"; then - echo "GStreamer git pre-commit hook:" - echo "Did not find GNU indent, please install it before continuing." - exit 1 - else - INDENT=indent - fi - else - INDENT=gindent - fi -else - INDENT=gnuindent -fi - -case `$INDENT --version` in - GNU*) - ;; - default) - echo "GStreamer git pre-commit hook:" - echo "Did not find GNU indent, please install it before continuing." - echo "(Found $INDENT, but it doesn't seem to be GNU indent)" - exit 1 - ;; -esac - -INDENT_PARAMETERS="--braces-on-if-line \ - --case-brace-indentation0 \ - --case-indentation2 \ - --braces-after-struct-decl-line \ - --line-length80 \ - --no-tabs \ - --cuddle-else \ - --dont-line-up-parentheses \ - --continuation-indentation4 \ - --honour-newlines \ - --tab-size8 \ - --indent-level2 \ - --leave-preprocessor-space" - -echo "--Checking style--" -for file in `git diff-index --cached --name-only HEAD --diff-filter=ACMR| grep "\.c$"` ; do - # nf is the temporary checkout. This makes sure we check against the - # revision in the index (and not the checked out version). - nf=`git checkout-index --temp ${file} | cut -f 1` - newfile=`mktemp /tmp/${nf}.XXXXXX` || exit 1 - $INDENT ${INDENT_PARAMETERS} \ - $nf -o $newfile 2>> /dev/null - # FIXME: Call indent twice as it tends to do line-breaks - # different for every second call. - $INDENT ${INDENT_PARAMETERS} \ - $newfile 2>> /dev/null - diff -u -p "${nf}" "${newfile}" - r=$? - rm "${newfile}" - rm "${nf}" - if [ $r != 0 ] ; then -echo "=================================================================================================" -echo " Code style error in: $file " -echo " " -echo " Please fix before committing. Don't forget to run git add before trying to commit again. " -echo " If the whole file is to be committed, this should work (run from the top-level directory): " -echo " " -echo " gst-indent $file; git add $file; git commit" -echo " " -echo "=================================================================================================" - exit 1 - fi -done -echo "--Checking style pass--" diff --git a/subprojects/gst-python/meson.build b/subprojects/gst-python/meson.build index 483ff6cbea..a1e4c39749 100644 --- a/subprojects/gst-python/meson.build +++ b/subprojects/gst-python/meson.build @@ -99,5 +99,3 @@ endif subdir('gi') subdir('plugin') subdir('testsuite') - -run_command(python, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")') diff --git a/subprojects/gst-rtsp-server/hooks/pre-commit.hook b/subprojects/gst-rtsp-server/hooks/pre-commit.hook deleted file mode 100755 index 6f177402b3..0000000000 --- a/subprojects/gst-rtsp-server/hooks/pre-commit.hook +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/sh -# -# Check that the code follows a consistent code style -# - -# Check for existence of indent, and error out if not present. -# On some *bsd systems the binary seems to be called gnunindent, -# so check for that first. - -version=`gnuindent --version 2>/dev/null` -if test "x$version" = "x"; then - version=`gindent --version 2>/dev/null` - if test "x$version" = "x"; then - version=`indent --version 2>/dev/null` - if test "x$version" = "x"; then - echo "GStreamer git pre-commit hook:" - echo "Did not find GNU indent, please install it before continuing." - exit 1 - else - INDENT=indent - fi - else - INDENT=gindent - fi -else - INDENT=gnuindent -fi - -case `$INDENT --version` in - GNU*) - ;; - default) - echo "GStreamer git pre-commit hook:" - echo "Did not find GNU indent, please install it before continuing." - echo "(Found $INDENT, but it doesn't seem to be GNU indent)" - exit 1 - ;; -esac - -INDENT_PARAMETERS="--braces-on-if-line \ - --case-brace-indentation0 \ - --case-indentation2 \ - --braces-after-struct-decl-line \ - --line-length80 \ - --no-tabs \ - --cuddle-else \ - --dont-line-up-parentheses \ - --continuation-indentation4 \ - --honour-newlines \ - --tab-size8 \ - --indent-level2 \ - --leave-preprocessor-space" - -echo "--Checking style--" -for file in `git diff-index --cached --name-only HEAD --diff-filter=ACMR| grep "\.c$"` ; do - # nf is the temporary checkout. This makes sure we check against the - # revision in the index (and not the checked out version). - nf=`git checkout-index --temp ${file} | cut -f 1` - newfile=`mktemp /tmp/${nf}.XXXXXX` || exit 1 - $INDENT ${INDENT_PARAMETERS} \ - $nf -o $newfile 2>> /dev/null - # FIXME: Call indent twice as it tends to do line-breaks - # different for every second call. - $INDENT ${INDENT_PARAMETERS} \ - $newfile 2>> /dev/null - diff -u -p "${nf}" "${newfile}" - r=$? - rm "${newfile}" - rm "${nf}" - if [ $r != 0 ] ; then -echo "=================================================================================================" -echo " Code style error in: $file " -echo " " -echo " Please fix before committing. Don't forget to run git add before trying to commit again. " -echo " If the whole file is to be committed, this should work (run from the top-level directory): " -echo " " -echo " gst-indent $file; git add $file; git commit" -echo " " -echo "=================================================================================================" - exit 1 - fi -done -echo "--Checking style pass--" diff --git a/subprojects/gst-rtsp-server/meson.build b/subprojects/gst-rtsp-server/meson.build index 0e55878b33..465011dc20 100644 --- a/subprojects/gst-rtsp-server/meson.build +++ b/subprojects/gst-rtsp-server/meson.build @@ -212,6 +212,3 @@ if gst_version_nano == 0 endif configure_file(output: 'config.h', configuration: cdata) - -python3 = import('python').find_installation() -run_command(python3, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")') diff --git a/subprojects/gstreamer-vaapi/hooks/pre-commit.hook b/subprojects/gstreamer-vaapi/hooks/pre-commit.hook deleted file mode 100755 index 6f177402b3..0000000000 --- a/subprojects/gstreamer-vaapi/hooks/pre-commit.hook +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/sh -# -# Check that the code follows a consistent code style -# - -# Check for existence of indent, and error out if not present. -# On some *bsd systems the binary seems to be called gnunindent, -# so check for that first. - -version=`gnuindent --version 2>/dev/null` -if test "x$version" = "x"; then - version=`gindent --version 2>/dev/null` - if test "x$version" = "x"; then - version=`indent --version 2>/dev/null` - if test "x$version" = "x"; then - echo "GStreamer git pre-commit hook:" - echo "Did not find GNU indent, please install it before continuing." - exit 1 - else - INDENT=indent - fi - else - INDENT=gindent - fi -else - INDENT=gnuindent -fi - -case `$INDENT --version` in - GNU*) - ;; - default) - echo "GStreamer git pre-commit hook:" - echo "Did not find GNU indent, please install it before continuing." - echo "(Found $INDENT, but it doesn't seem to be GNU indent)" - exit 1 - ;; -esac - -INDENT_PARAMETERS="--braces-on-if-line \ - --case-brace-indentation0 \ - --case-indentation2 \ - --braces-after-struct-decl-line \ - --line-length80 \ - --no-tabs \ - --cuddle-else \ - --dont-line-up-parentheses \ - --continuation-indentation4 \ - --honour-newlines \ - --tab-size8 \ - --indent-level2 \ - --leave-preprocessor-space" - -echo "--Checking style--" -for file in `git diff-index --cached --name-only HEAD --diff-filter=ACMR| grep "\.c$"` ; do - # nf is the temporary checkout. This makes sure we check against the - # revision in the index (and not the checked out version). - nf=`git checkout-index --temp ${file} | cut -f 1` - newfile=`mktemp /tmp/${nf}.XXXXXX` || exit 1 - $INDENT ${INDENT_PARAMETERS} \ - $nf -o $newfile 2>> /dev/null - # FIXME: Call indent twice as it tends to do line-breaks - # different for every second call. - $INDENT ${INDENT_PARAMETERS} \ - $newfile 2>> /dev/null - diff -u -p "${nf}" "${newfile}" - r=$? - rm "${newfile}" - rm "${nf}" - if [ $r != 0 ] ; then -echo "=================================================================================================" -echo " Code style error in: $file " -echo " " -echo " Please fix before committing. Don't forget to run git add before trying to commit again. " -echo " If the whole file is to be committed, this should work (run from the top-level directory): " -echo " " -echo " gst-indent $file; git add $file; git commit" -echo " " -echo "=================================================================================================" - exit 1 - fi -done -echo "--Checking style pass--" diff --git a/subprojects/gstreamer-vaapi/meson.build b/subprojects/gstreamer-vaapi/meson.build index d069f4089c..73fe950c94 100644 --- a/subprojects/gstreamer-vaapi/meson.build +++ b/subprojects/gstreamer-vaapi/meson.build @@ -213,6 +213,3 @@ if gmodule_dep.version().version_compare('< 2.67.4') endif configure_file(output: 'config.h', configuration: cdata) - -python3 = import('python').find_installation() -run_command(python3, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")') diff --git a/subprojects/gstreamer/hooks/pre-commit.hook b/subprojects/gstreamer/hooks/pre-commit.hook deleted file mode 100755 index a295d2b42a..0000000000 --- a/subprojects/gstreamer/hooks/pre-commit.hook +++ /dev/null @@ -1,115 +0,0 @@ -#!/bin/sh -# -# Check that the code follows a consistant code style -# - -# Check for existence of indent, and error out if not present. -# On some *bsd systems the binary seems to be called gnunindent, -# so check for that first. - -version=`gnuindent --version 2>/dev/null` -if test "x$version" = "x"; then - version=`gindent --version 2>/dev/null` - if test "x$version" = "x"; then - version=`indent --version 2>/dev/null` - if test "x$version" = "x"; then - echo "GStreamer git pre-commit hook:" - echo "Did not find GNU indent, please install it before continuing." - exit 1 - else - INDENT=indent - fi - else - INDENT=gindent - fi -else - INDENT=gnuindent -fi - -case `$INDENT --version` in - GNU*) - ;; - default) - echo "GStreamer git pre-commit hook:" - echo "Did not find GNU indent, please install it before continuing." - echo "(Found $INDENT, but it doesn't seem to be GNU indent)" - exit 1 - ;; -esac - -INDENT_PARAMETERS="--braces-on-if-line \ - --case-brace-indentation0 \ - --case-indentation2 \ - --braces-after-struct-decl-line \ - --line-length80 \ - --no-tabs \ - --cuddle-else \ - --dont-line-up-parentheses \ - --continuation-indentation4 \ - --honour-newlines \ - --tab-size8 \ - --indent-level2 \ - --leave-preprocessor-space" - -echo "--Checking style--" -for file in `git diff-index --cached --name-only HEAD --diff-filter=ACMR| grep "\.c$"` ; do - # nf is the temporary checkout. This makes sure we check against the - # revision in the index (and not the checked out version). - nf=`git checkout-index --temp ${file} | cut -f 1` - newfile=`mktemp /tmp/${nf}.XXXXXX` || exit 1 - $INDENT ${INDENT_PARAMETERS} \ - $nf -o $newfile 2>> /dev/null - # FIXME: Call indent twice as it tends to do line-breaks - # different for every second call. - $INDENT ${INDENT_PARAMETERS} \ - $newfile 2>> /dev/null - diff -u -p "${nf}" "${newfile}" - r=$? - rm "${newfile}" - rm "${nf}" - if [ $r != 0 ] ; then -echo "=================================================================================================" -echo " Code style error in: $file " -echo " " -echo " Please fix before committing. Don't forget to run git add before trying to commit again. " -echo " If the whole file is to be committed, this should work (run from the top-level directory): " -echo " " -echo " gst-indent $file; git add $file; git commit" -echo " " -echo "=================================================================================================" - exit 1 - fi -done -echo "--Checking style pass--" - -# This is an opt-in check, and can only be run from gst-build's devenv, -# as outside of it MESON_BUILD_ROOT will not be set. -# -# The idea is to build the cache, and check if it has unstaged changes. -# To accomodate for the git add -p case, where the developer will break -# down a large change set into multiple commits, this hook will only -# fail when there are no unstaged changes left to commit, in other -# cases it will only print a reminder that the cache needs committing. -if [ -v MESON_BUILD_ROOT ] && [ "$GST_CACHE_HOOK" == "enabled" ]; then - echo "--Checking plugin cache--" - toplevel=`git rev-parse --show-toplevel` - repo_name=`basename $toplevel` - target_name=`ninja -C $MESON_BUILD_ROOT -t targets all | grep "\/\<$repo_name\>\/.*\/gst_plugins_cache.json" | cut -d ":" -f 1` - ninja -C $MESON_BUILD_ROOT $target_name - cache_path=`git ls-files $toplevel/**gst_plugins_cache.json` - git diff --quiet --exit-code -- $cache_path - has_unstaged_cache_changes=$? - git diff --quiet --exit-code -- ':!'$cache_path - has_unstaged_non_cache_changes=$? - - if [ $has_unstaged_non_cache_changes != 0 ] ; then - if [ $has_unstaged_cache_changes != 0 ]; then - echo -e "\033[1;33mUnstaged cache changes, but working directory isn't clean, don't forget to commit the cache when you're done\033[0m" - fi - elif [ $has_unstaged_cache_changes != 0 ]; then - echo -e "\033[1;31mUnstaged cache changes, but the working directory is clean, you must commit the cache\033[0m" - exit 1 - else - echo "--Checking plugin cache pass--" - fi -fi diff --git a/subprojects/gstreamer/meson.build b/subprojects/gstreamer/meson.build index bed8c4e1aa..e4252b6bb4 100644 --- a/subprojects/gstreamer/meson.build +++ b/subprojects/gstreamer/meson.build @@ -618,7 +618,6 @@ if gst_version_nano == 0 endif configure_file(output : 'config.h', configuration : cdata) -run_command(python3, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")') install_data('gst-element-check-1.0.m4', install_dir : join_paths(get_option('datadir'), 'aclocal')) if meson.version().version_compare('>= 0.54') |