Ori.livneh has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/169635

Change subject: Fix-up for I777ae49ca
......................................................................

Fix-up for I777ae49ca

I'm not sure why require_package() didn't work here, but I want to fix this
first and worry about that later.

Change-Id: I2812be33199b684851902e3f5778c3d305992540
---
M modules/admin/files/home/ori/.binned/mw
M modules/hhvm/manifests/init.pp
M modules/hhvm/manifests/packages.pp
3 files changed, 24 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/35/169635/1

diff --git a/modules/admin/files/home/ori/.binned/mw 
b/modules/admin/files/home/ori/.binned/mw
index 50ea7c3..f286654 100755
--- a/modules/admin/files/home/ori/.binned/mw
+++ b/modules/admin/files/home/ori/.binned/mw
@@ -1,13 +1,34 @@
 #!/usr/bin/env php
 <?php
+/**
+ * mw -- execute a script or run a shell in MediaWiki context.
+ *
+ * Usage: mw [SCRIPT] [WIKI]
+ *  SCRIPT   Path of script to be executed. Defaults to eval.php.
+ *  WIKI     DB name of wiki to execute in. Defaults to enwiki.
+ *
+ */
+$__cwd = getcwd();
 @list( $__script, $__wiki ) = array_slice( $argv, 1 );
+
+// Allow the arguments to be swapped.
 if ( strpos( $__script, '.php' ) === false ) {
        list( $__wiki, $__script ) = array( $__script, $__wiki );
 }
 
 require_once '/srv/mediawiki/multiversion/MWVersion.php';
 require_once getMediaWiki( 'maintenance/commandLine.inc', $__wiki ?: 'enwiki' 
);
-require_once $__script ?: $IP . '/maintenance/eval.php';
 
-unset( $__script );
+if ( !is_string( $__script ) ) {
+       // The command-line invocation did not specify a script. Load the REPL.
+       $__script = $IP . '/maintenance/eval.php';
+} else if ( strpos( $__script, '/' ) !== 0 ) {
+       // The script path is relative to the working directory.
+       // We need to make it absolute, because loading MediaWiki changed the 
cwd.
+       $__script = $__cwd . '/' . $__script;
+}
 unset( $__wiki );
+unset( $__cwd );
+
+require_once $__script;
+unset( $__script );
diff --git a/modules/hhvm/manifests/init.pp b/modules/hhvm/manifests/init.pp
index d6fa760..74db065 100644
--- a/modules/hhvm/manifests/init.pp
+++ b/modules/hhvm/manifests/init.pp
@@ -210,8 +210,6 @@
 
     # Install HHVM's source files to /usr/local/src/hhvm.
 
-    require_package('dpkg-dev')
-
     exec { 'install_hhvm_source_files':
         command  => template('hhvm/install_hhvm_source_files.sh.erb'),
         creates  => '/usr/local/src/hhvm',
diff --git a/modules/hhvm/manifests/packages.pp 
b/modules/hhvm/manifests/packages.pp
index bbd5fd3..5c64511 100644
--- a/modules/hhvm/manifests/packages.pp
+++ b/modules/hhvm/manifests/packages.pp
@@ -51,6 +51,7 @@
     ## Profiling and debugging tools
 
     package { [
+        'dpkg-dev',
         'google-perftools',
         'graphviz',
         'gv',

-- 
To view, visit https://gerrit.wikimedia.org/r/169635
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2812be33199b684851902e3f5778c3d305992540
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to