[Kimchi-devel] [PATCH][Kimchi] Issue #962: Suggestion to check spec guidelines

Aline Manera alinefm at linux.vnet.ibm.com
Wed Sep 28 14:43:11 UTC 2016



On 09/22/2016 03:34 PM, Ramon Medeiros wrote:
> Run rpmlint on check-local
>
> Signed-off-by: Ramon Medeiros <ramonn at linux.vnet.ibm.com>
> ---
>   Makefile.am           |  5 ++++-
>   check_spec_errors.sh  | 36 ++++++++++++++++++++++++++++++++++++
>   configure.ac          |  1 +
>   docs/fedora-deps.md   |  2 +-
>   docs/opensuse-deps.md |  2 +-
>   5 files changed, 43 insertions(+), 3 deletions(-)
>   create mode 100755 check_spec_errors.sh
>
> diff --git a/Makefile.am b/Makefile.am
> index b39f9e3..dee6aae 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -82,7 +82,10 @@ check-local:
>   			&& echo "ERROR: Whitespaces found" || echo "Ok"; \
>   		echo "IBM copyright year verification ..." ;              \
>   		/bin/bash ../../../../check-IBM-license-header.sh ;       \
> -	fi
> +	fi;
> +	@if [ -f $(RPMLINT) ]; then \
> +		./check_spec_errors.sh; \
> +	fi;
>
>   # Link built mo files in the source tree to enable use of translations from
>   # within the source tree
> diff --git a/check_spec_errors.sh b/check_spec_errors.sh
> new file mode 100755
> index 0000000..5e43d8b
> --- /dev/null
> +++ b/check_spec_errors.sh
> @@ -0,0 +1,36 @@
> +#!/bin/bash
> +
> +#

> +# Project Wok
> +#

Is this file copied from Wok project? If so, please add a note for it. 
"Code derived from Wok Project" and the copyright should be set to Kimchi

> +# Copyright IBM Corp, 2016
> +#
> +# This library is free software; you can redistribute it and/or
> +# modify it under the terms of the GNU Lesser General Public
> +# License as published by the Free Software Foundation; either
> +# version 2.1 of the License, or (at your option) any later version.
> +#
> +# This library is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +# Lesser General Public License for more details.
> +#
> +# You should have received a copy of the GNU Lesser General Public
> +# License along with this library; if not, write to the Free Software
> +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
> +
> +echo "Checking spec guidelines"
> +
> +# create links
> +cp contrib/kimchi.spec.fedora contrib/kimchi_fedora.spec
> +cp contrib/kimchi.spec.suse contrib/kimchi_suse.spec
> +
> +# run checking
> +rpmlint contrib/kimchi_fedora.spec
> +rpmlint contrib/kimchi_suse.spec
> +
> +# remove links
> +rm contrib/kimchi_fedora.spec
> +rm contrib/kimchi_suse.spec
> +
> +
> diff --git a/configure.ac b/configure.ac
> index 870ac0c..cafff0c 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -36,6 +36,7 @@ AM_INIT_AUTOMAKE([-Wno-portability])
>   AM_PATH_PYTHON([2.6])
>   AC_PATH_PROG([PEP8], [pep8], [/usr/bin/pep8])
>   AC_PATH_PROG([GIT], [git], [/usr/bin/git])
> +AC_PATH_PROG([RPMLINT], [rpmlint], [/usr/bin/rpmlint])
>   AC_PYTHON_MODULE([unittest])
>   AC_SUBST([HAVE_PYMOD_UNITTEST])
>   AC_SUBST([PYTHON_VERSION])
> diff --git a/docs/fedora-deps.md b/docs/fedora-deps.md
> index ca24994..65ad987 100644
> --- a/docs/fedora-deps.md
> +++ b/docs/fedora-deps.md
> @@ -47,7 +47,7 @@ Packages required for UI development
>   Packages required for tests
>   ---------------------------
>
> -    $ sudo yum install pyflakes python-pep8 python-requests python-mock
> +    $ sudo yum install pyflakes python-pep8 python-requests python-mock rpmlint
>
>       # For RHEL systems, install the additional packages:
>       $ sudo yum install python-unittest2
> diff --git a/docs/opensuse-deps.md b/docs/opensuse-deps.md
> index a69dacd..1c5fc23 100644
> --- a/docs/opensuse-deps.md
> +++ b/docs/opensuse-deps.md
> @@ -45,4 +45,4 @@ Packages required for UI development
>   Packages required for tests
>   ---------------------------
>
> -    $ sudo zypper install python-pyflakes python-pep8 python-requests python-mock
> +    $ sudo zypper install python-pyflakes python-pep8 python-requests python-mock rpmlint




More information about the Kimchi-devel mailing list