DrTrigon has submitted this change and it was merged.

Change subject: bug fix; solve bug introduced by r11524 and reported by 
totoazero and xqt
......................................................................


bug fix; solve bug introduced by r11524 and reported by totoazero and xqt

Externals: add support for other platforms than windows/linux
- Any OS without explicit support will now trigger download_install
- SunOS now has explicit non-support (i.e. a function that will trigger 
download_install)

Change-Id: I30c0efab5cb2c3dfc0cb574792e7a17a5a00e2a3
---
M externals/__init__.py
1 file changed, 15 insertions(+), 4 deletions(-)

Approvals:
  DrTrigon: Verified; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/externals/__init__.py b/externals/__init__.py
index 89baed3..97a193e 100644
--- a/externals/__init__.py
+++ b/externals/__init__.py
@@ -282,14 +282,21 @@
         return False
     else:
         files = dependency_dictionary[distro]
-        if files and show_question(files):
-            callable_ = globals()[distro.replace('-', '_') + '_install']
+        func = distro.replace('-', '_') + '_install'
+        if files and (func in globals()) and show_question(files):
+            callable_ = globals()[func]
             return callable_(files)
         else:
             return False
 
 
+def sunos_install(dependency_dictionary):
+    lowlevel_warning(u'Not implemented yet, download mode will be used.')
+    return False    # skip this in order to trigger 'download_install' next
+
+
 def windows_install(dependency_dictionary):
+    lowlevel_warning(u'Not available in windows OS, download mode will be 
used.')
     return False    # skip this in order to trigger 'download_install' next
 
 ### END of VisTrails inspired and copied code   ### ### ### ### ### ### ### ###
@@ -376,11 +383,15 @@
         return
 
     # install the missing module
-    dist = guess_system().split(u'-')
-    if globals()[dist[0] + '_install'](modules_needed[m][0]):
+    dist = guess_system()
+    func = dist.split(u'-')[0] + '_install'
+    lowlevel_warning(u'Trying to install by use of "%s" package management 
system:' % dist)
+    if (func in globals()) and globals()[func](modules_needed[m][0]):
         return
+    lowlevel_warning(u'Trying to install by download from source URL:')
     if download_install(modules_needed[m][1], m, path):
         return
+    lowlevel_warning(u'Trying to install by use of mercurial:')
     if (len(modules_needed[m]) > 2) and\
        mercurial_repo_install(modules_needed[m][2], m, path):
         return

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I30c0efab5cb2c3dfc0cb574792e7a17a5a00e2a3
Gerrit-PatchSet: 4
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: DrTrigon <[email protected]>
Gerrit-Reviewer: DrTrigon <[email protected]>
Gerrit-Reviewer: Ladsgroup <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Merlijn van Deen <[email protected]>
Gerrit-Reviewer: PywikibotCommitWatcher <[email protected]>
Gerrit-Reviewer: Toto AzĂ©ro <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to