From 5bbd6b6ee3218de0f1cc2e27ddd72644b6a742d9 Mon Sep 17 00:00:00 2001 From: Davide Madrisan Date: Sun, 20 May 2012 22:30:07 +0200 Subject: [PATCH] pck-update, test/*: update/add the code to check for the required external tools Signed-off-by: Davide Madrisan --- ChangeLog | 3 +++ plugins/pck-update.in | 2 +- tests/test00_specsyntax.in | 6 ++++++ tests/test01_pkgquality.in | 3 +-- tests/test02_pkgsecurity.in | 6 ++++++ 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1deb6b6..3537193 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,9 @@ Changes in version 1.12.1 * conf/02-specfile-formatting-rules.conf - Davide Madrisan: Update 'source0_name_structure' to allow *.tar.xz archives. + * test/*, pck-update - Davide Madrisan: + Update/add the code to check for the required external tools. + ------------------------------------------------------------------------------- Changes in version 1.12.0 diff --git a/plugins/pck-update.in b/plugins/pck-update.in index 12fc4f5..2af0602 100644 --- a/plugins/pck-update.in +++ b/plugins/pck-update.in @@ -310,7 +310,7 @@ fi # check if all the needed tools are available for tool in cat chmod cpio date file find fold ftp getopt grep \ - mktemp objdump readlink rpm rpmbuild rpm2cpio sed seq sort strings; do + mktemp readlink rpm rpmbuild rpm2cpio sed seq sort strings; do [ "$(type -p $tool)" ] || notify.error $"utility not found"": \`$tool'" done diff --git a/tests/test00_specsyntax.in b/tests/test00_specsyntax.in index 06114ed..60f51fa 100644 --- a/tests/test00_specsyntax.in +++ b/tests/test00_specsyntax.in @@ -17,6 +17,12 @@ if [[ -z "$LANG" && -r /etc/sysconfig/i18n ]]; then fi TEXTDOMAIN="test00_specsyntax"; export TEXTDOMAIN +# check if all the needed tools are available +for tool in cat file getopt grep sed; do + [ "$(type -p $tool)" ] || + notify.error $"utility not found"": \`$tool'" +done + # function specfile.checksyntax() # do some syntax checks in the specfile of the building package # args: diff --git a/tests/test01_pkgquality.in b/tests/test01_pkgquality.in index 7cc2359..6e0f858 100644 --- a/tests/test01_pkgquality.in +++ b/tests/test01_pkgquality.in @@ -18,8 +18,7 @@ fi TEXTDOMAIN="test01_pkgquality"; export TEXTDOMAIN # check if all the needed tools are available -for tool in cat chmod cpio date file find fold ftp getopt grep \ - mktemp ldd objdump; do +for tool in file find getopt grep ls ldd; do [ "$(type -p $tool)" ] || notify.error $"utility not found"": \`$tool'" done diff --git a/tests/test02_pkgsecurity.in b/tests/test02_pkgsecurity.in index 0c17889..f1fbe15 100644 --- a/tests/test02_pkgsecurity.in +++ b/tests/test02_pkgsecurity.in @@ -17,6 +17,12 @@ if [[ -z "$LANG" && -r /etc/sysconfig/i18n ]]; then fi TEXTDOMAIN="test02_pkgsecurity"; export TEXTDOMAIN +# check if all the needed tools are available +for tool in file find getopt grep objdump sed; do + [ "$(type -p $tool)" ] || + notify.error $"utility not found"": \`$tool'" +done + function alltests() { # FIXME: add to 'po' file notify.note " ${NOTE}"$"performing security checks""${NORM}""..."