File 02-osc_editor.patch of Package osc

diff --git a/osc/core.py b/osc/core.py
index 965ec24..ad61b10 100644
--- a/osc/core.py
+++ b/osc/core.py
@@ -4037,11 +4037,15 @@ def get_default_editor():
     if system == 'Linux':
         dist = _get_linux_distro()
         if dist == 'debian':
-            return 'editor'
+            editor = os.getenv('OSC_EDITOR', os.getenv('EDITOR', default='editor'))
+            return editor
         elif dist == 'fedora':
-            return 'vi'
-        return 'vim'
-    return 'vi'
+            editor = os.getenv('OSC_EDITOR', os.getenv('EDITOR', default='vi'))
+            return editor
+        editor = os.getenv('OSC_EDITOR', os.getenv('EDITOR', default='vim'))
+        return editor
+    editor = os.getenv('OSC_EDITOR', os.getenv('EDITOR', default='vi'))
+    return editor
 
 def get_default_pager():
     system = platform.system()
@@ -4050,9 +4054,12 @@ def get_default_pager():
     if system == 'Linux':
         dist = _get_linux_distro()
         if dist == 'debian':
+            pager = os.getenv('OSC_PAGER', os.getenv('PAGER', default='pager'))
             return 'pager'
-        return 'less'
-    return 'more'
+        pager = os.getenv('OSC_PAGER', os.getenv('PAGER', default='less'))
+        return pager
+    pager = os.getenv('OSC_PAGER', os.getenv('PAGER', default='more'))
+    return pager
 
 def run_pager(message, tmp_suffix=''):
     import tempfile, sys
openSUSE Build Service is sponsored by