Filippo Giunchedi has submitted this change and it was merged. Change subject: use scap's embedded linking, remove lint script ......................................................................
use scap's embedded linking, remove lint script Bug: 68255 Change-Id: I44d33af1ce8591772ecc1b094ca56b842b0fbc8d --- D files/misc/scripts/asciidoc/lint.txt D files/misc/scripts/lint D files/misc/scripts/lint.php D files/misc/scripts/man/lint.1 M manifests/misc/deployment.pp M modules/contint/manifests/packages.pp 6 files changed, 11 insertions(+), 203 deletions(-) Approvals: Filippo Giunchedi: Verified; Looks good to me, approved jenkins-bot: Verified diff --git a/files/misc/scripts/asciidoc/lint.txt b/files/misc/scripts/asciidoc/lint.txt deleted file mode 100644 index d840224..0000000 --- a/files/misc/scripts/asciidoc/lint.txt +++ /dev/null @@ -1,55 +0,0 @@ -:man source: Puppet -:man version: 1.0 -:man manual: Wikimedia Manual - -lint(1) -======= -:doctype: manpage - -NAME ----- - -lint, lint.php - run a fast PHP linter against a directory content - -SYNOPSIS --------- - -[verse] -'lint' directory -'php lint.php' directory - -DESCRIPTION ------------ - -'lint' is simply a wrapper around 'php lint.php' which make sure the -PHP `parsekit` extension is loaded. The 'lint.php' accepts a directory -as argument, it will recursively look for PHP files and apply a PHP -tokenizer to it, any error is reported. - -This script is way faster than running `php -l` on a list of files since -it saves up the PHP initialization overhead. - -OPTIONS -------- -This script has no options. - -EXIT STATUS ------------ - -*0*:: -success, when all files in 'directory' are valid PHP files. - -*1*:: -failure, whenever any of the PHP file under 'directory' is not valid PHP. - -EXAMPLE -------- - ---------------------------------------- -lint /home/wikipedia/commons/wmf-config ---------------------------------------- - -// For vim users: -// Syntax file is availaible on github at: -// https://github.com/dagwieers/asciidoc-vim -// vim: set syntax=asciidoc: diff --git a/files/misc/scripts/lint b/files/misc/scripts/lint deleted file mode 100755 index eabfaa1..0000000 --- a/files/misc/scripts/lint +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -php -n -dextension=parsekit.so `dirname $0`/lint.php "$@" -exit $? diff --git a/files/misc/scripts/lint.php b/files/misc/scripts/lint.php deleted file mode 100755 index 0cc87af..0000000 --- a/files/misc/scripts/lint.php +++ /dev/null @@ -1,62 +0,0 @@ -<?php - -if ( isset( $argv[1] ) ) { - $dir = $argv[1]; - if ( !is_dir( $dir ) ) { - echo "Not a directory: $dir\n"; - exit( 1 ); - } -} else { - $dir = '.'; -} - -if ( !check_dir( $dir ) ){ - exit( 1 ); -} else { - exit( 0 ); -} - -function check_dir( $dir ) { - $handle = opendir( $dir ); - if ( !$handle ) { - return true; - } - $success = true; - while ( false !== ( $fileName = readdir( $handle ) ) ) { - if ( substr( $fileName, 0, 1 ) == '.' ) { - continue; - } - if ( is_dir( "$dir/$fileName" ) ) { - $ret = check_dir( "$dir/$fileName" ); - } elseif ( substr( $fileName, -4 ) == '.php' ) { - $ret = check_file( "$dir/$fileName" ); - } else { - $ret = true; - } - $success = $success && $ret; - } - closedir( $handle ); - return $success; -} - -function check_file( $file ) { - static $okErrors = array( - 'Redefining already defined constructor', - 'Assigning the return value of new by reference is deprecated', - ); - $errors = array(); - parsekit_compile_file( $file, $errors, PARSEKIT_SIMPLE ); - $ret = true; - if ( $errors ) { - foreach ( $errors as $error ) { - foreach ( $okErrors as $okError ) { - if ( substr( $error['errstr'], 0, strlen( $okError ) ) == $okError ) { - continue 2; - } - } - $ret = false; - print "Error in $file line {$error['lineno']}: {$error['errstr']}\n"; - } - } - return $ret; -} diff --git a/files/misc/scripts/man/lint.1 b/files/misc/scripts/man/lint.1 deleted file mode 100644 index 990710e..0000000 --- a/files/misc/scripts/man/lint.1 +++ /dev/null @@ -1,71 +0,0 @@ -'\" t -.\" Title: lint -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> -.\" Date: 10/01/2012 -.\" Manual: Wikimedia Manual -.\" Source: Puppet 1.0 -.\" Language: English -.\" -.TH "LINT" "1" "10/01/2012" "Puppet 1\&.0" "Wikimedia Manual" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.SH "NAME" -lint, lint.php \- run a fast PHP linter against a directory content -.SH "SYNOPSIS" -.sp -.nf -\fIlint\fR directory -\fIphp lint\&.php\fR directory -.fi -.SH "DESCRIPTION" -.sp -\fIlint\fR is simply a wrapper around \fIphp lint\&.php\fR which make sure the PHP parsekit extension is loaded\&. The \fIlint\&.php\fR accepts a directory as argument, it will recursively look for PHP files and apply a PHP tokenizer to it, any error is reported\&. -.sp -This script is way faster than running php \-l on a list of files since it saves up the PHP initialization overhead\&. -.SH "OPTIONS" -.sp -This script has no options\&. -.SH "EXIT STATUS" -.PP -\fB0\fR -.RS 4 -success, when all files in -\fIdirectory\fR -are valid PHP files\&. -.RE -.PP -\fB1\fR -.RS 4 -failure, whenever any of the PHP file under -\fIdirectory\fR -is not valid PHP\&. -.RE -.SH "EXAMPLE" -.sp -.if n \{\ -.RS 4 -.\} -.nf -lint /home/wikipedia/commons/wmf\-config -.fi -.if n \{\ -.RE -.\} diff --git a/manifests/misc/deployment.pp b/manifests/misc/deployment.pp index 0fee3ec..8b25320 100644 --- a/manifests/misc/deployment.pp +++ b/manifests/misc/deployment.pp @@ -11,8 +11,11 @@ class misc::deployment::common_scripts { require passwordscripts - package { ['php5-parsekit', 'libwww-perl', 'libnet-dns-perl']: + package { ['libwww-perl', 'libnet-dns-perl']: ensure => present; + } + package { 'php5-parsekit': + ensure => absent; } file { @@ -54,17 +57,9 @@ mode => '0555', source => 'puppet:///files/misc/scripts/foreachwikiindblist'; '/usr/local/bin/lint': - owner => 'root', - group => 'root', - mode => '0555', - require => Package[ 'php5-parsekit' ], # bug 37076 - source => 'puppet:///files/misc/scripts/lint'; + ensure => 'absent'; '/usr/local/bin/lint.php': - owner => 'root', - group => 'root', - mode => '0555', - require => Package[ 'php5-parsekit' ], # bug 37076 - source => 'puppet:///files/misc/scripts/lint.php'; + ensure => 'absent'; '/usr/local/bin/mwscript': owner => 'root', group => 'root', diff --git a/modules/contint/manifests/packages.pp b/modules/contint/manifests/packages.pp index 80b12af..b102eee 100644 --- a/modules/contint/manifests/packages.pp +++ b/modules/contint/manifests/packages.pp @@ -47,7 +47,6 @@ package { [ 'php5-dev', # phpize 'php5-gd', - 'php5-parsekit', 'php5-pgsql', 'php5-sqlite', 'php5-tidy', @@ -55,6 +54,11 @@ ]: ensure => present, } + package { [ + 'php5-parsekit', + ]: + ensure => absent, + } # Database related package { [ -- To view, visit https://gerrit.wikimedia.org/r/160691 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I44d33af1ce8591772ecc1b094ca56b842b0fbc8d Gerrit-PatchSet: 4 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Filippo Giunchedi <fgiunch...@wikimedia.org> Gerrit-Reviewer: Alexandros Kosiaris <akosia...@wikimedia.org> Gerrit-Reviewer: ArielGlenn <ar...@wikimedia.org> Gerrit-Reviewer: BryanDavis <bda...@wikimedia.org> Gerrit-Reviewer: Faidon Liambotis <fai...@wikimedia.org> Gerrit-Reviewer: Filippo Giunchedi <fgiunch...@wikimedia.org> Gerrit-Reviewer: Giuseppe Lavagetto <glavage...@wikimedia.org> Gerrit-Reviewer: Hashar <has...@free.fr> Gerrit-Reviewer: Krinkle <krinklem...@gmail.com> Gerrit-Reviewer: Mark Bergsma <m...@wikimedia.org> Gerrit-Reviewer: Ori.livneh <o...@wikimedia.org> Gerrit-Reviewer: Reedy <re...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits