Bugzilla – Attachment 109845 Details for
Bug 26384
Missing test to catch for execution flags
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26384: Add test to catch for missing or extra execution flags
Bug-26384-Add-test-to-catch-for-missing-or-extra-e.patch (text/plain), 2.24 KB, created by
Martin Renvoize (ashimema)
on 2020-09-10 12:02:52 UTC
(
hide
)
Description:
Bug 26384: Add test to catch for missing or extra execution flags
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-09-10 12:02:52 UTC
Size:
2.24 KB
patch
obsolete
>From b82ecc0677a70acedb4f737f343a43904f2c65f1 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 7 Sep 2020 11:31:52 +0200 >Subject: [PATCH] Bug 26384: Add test to catch for missing or extra execution > flags > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > xt/find-misplaced-executables | 52 +++++++++++++++++++++++------------ > 1 file changed, 34 insertions(+), 18 deletions(-) > >diff --git a/xt/find-misplaced-executables b/xt/find-misplaced-executables >index 3a64e5aad3..50044aa05e 100755 >--- a/xt/find-misplaced-executables >+++ b/xt/find-misplaced-executables >@@ -1,8 +1,9 @@ >-#!/bin/sh >-# >+#!/usr/bin/perl >+ > # Script to find files that probably should not be executed. > # > # Copyright 2010 Catalyst IT Ltd >+# Copyright 2020 Koha Development Team > # > # This file is part of Koha. > # >@@ -19,20 +20,35 @@ > # You should have received a copy of the GNU General Public License > # along with Koha; if not, see <http://www.gnu.org/licenses>. > >-set -e >+use Modern::Perl; >+use File::Find; >+use Data::Dumper; >+use Test::More tests => 1; >+ >+my @files; >+sub wanted { >+ my $name = $File::Find::name; >+ # Ignore files in .git, blib and node_modules >+ return if $name =~ m[^\./(.git|blib|node_modules)]; >+ # Ignore directories >+ return if -d $name; # Skip dir >+ >+ # Search for missing x in svc, xt and t >+ if ( $name =~ m[^\./(svc|xt)] && $name ne './xt/perltidyrc' >+ || $name =~ m[^\./t/.*\.t$] ) >+ { >+ push @files, $name unless -x $name; >+ } >+ >+ # Search for missing x for .pl and .sh >+ if ( $name =~ m[\.(pl|sh)$] ) { >+ push @files, $name unless -x $name; >+ } > >-find . \ >- -name misc -prune \ >- -o -name svc -prune \ >- -o -name xt -prune \ >- -o -name t -prune \ >- -o -name .git -prune \ >- -o -name blib -prune \ >- -o -name scripts -prune \ >- -o -name debian -prune \ >- -o -executable -type f \ >- '!' -name '*.pl' \ >- '!' -name '*.sh' \ >- '!' -name '*.plugin' \ >- '!' -name unapi \ >- -print >+ # Search for extra x flag for .pm >+ if ( $name =~ m[\.pm$] ) { >+ push @files, $name if -x $name; >+ } >+} >+find({ wanted => \&wanted, no_chdir => 1}, '.' ); >+is(@files, 0) or diag(Dumper @files) ; >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 26384
:
109691
|
109692
|
109845
|
109847
|
109848
|
109884
|
109885
|
109886
|
110834