streamline portage pythonpath handling and add an override analog to how the bash...
authorMarius Mauch <genone@gentoo.org>
Thu, 26 Oct 2006 13:49:45 +0000 (13:49 -0000)
committerMarius Mauch <genone@gentoo.org>
Thu, 26 Oct 2006 13:49:45 +0000 (13:49 -0000)
svn path=/main/trunk/; revision=4822

18 files changed:
NEWS
bin/archive-conf
bin/chkcontents
bin/clean_locks
bin/dispatch-conf
bin/ebuild
bin/emaint
bin/emerge
bin/env-update
bin/fix-db.py
bin/fixpackages
bin/md5check.py
bin/pkgname
bin/portageq
bin/regenworld
bin/repoman
bin/xpak
pym/dispatch_conf.py

diff --git a/NEWS b/NEWS
index 4d203ab7ba10274acfddbf0c5e21ffd5fcbbf101..64cd1da6a5ea3be6e8a39824d1dfd77d1f8fa31c 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -19,6 +19,8 @@ portage-2.1.2
   order and detection of circular dependencies.
 * The world and system sets allow automatic update of all installed slots.
 * DEPEND atoms support SLOT dependencies of the form ${CATEGORY}/${PN}:${SLOT}.
+* Development: Extend PORTAGE_PYM_PATH support to allow overriding the hardcoded 
+  /usr/lib/portage/pym for development/testing purposes
 
 portage-2.1.1
 ------------
index 24f0b626d26dbebbf55cc14cc6e2cab4e6d84f07..0417e97cc293e245739498e58ec04d0e6c73bc26 100755 (executable)
@@ -11,7 +11,7 @@
 #
 
 import os, sys, string
-sys.path = ["/usr/lib/portage/pym"]+sys.path
+sys.path.insert(0, os.environ.get("PORTAGE_PYM_PATH", "/usr/lib/portage/pym"))
 
 import portage, dispatch_conf
 
index bff77d0da80f54838c4b8e62808a129d0631bf71..4523b63064b041370ec7d247e50b02776904511c 100755 (executable)
@@ -9,7 +9,7 @@
 # the right files).
 
 import string, os.path, os, sys
-sys.path = ["/usr/lib/portage/pym"]+sys.path
+sys.path.insert(0, os.environ.get("PORTAGE_PYM_PATH", "/usr/lib/portage/pym"))
 import portage
 
 def CONTENTScheck(path):
index 0ecb624245a2b6c1ca929e3168b8eafcd5a30145..9c7e110ce472a9fdc10fd00af1f5e326dda4950c 100755 (executable)
@@ -4,7 +4,7 @@
 # $Id$
 
 import os,sys,errno
-sys.path = ["/usr/lib/portage/pym"]+sys.path
+sys.path.insert(0, os.environ.get("PORTAGE_PYM_PATH", "/usr/lib/portage/pym"))
 
 import portage_locks
 
index 960a38312f543b745cf86d12670b052776ca9eca..de937425cbd933608d2eb244425b5d984e7335a8 100755 (executable)
@@ -15,7 +15,7 @@
 from stat import *
 from random import *
 import atexit, commands, os, re, shutil, stat, string, sys
-sys.path = ["/usr/lib/portage/pym"]+sys.path
+sys.path.insert(0, os.environ.get("PORTAGE_PYM_PATH", "/usr/lib/portage/pym"))
 
 import portage, dispatch_conf
 from portage_exec import find_binary
index 773910929ffed3e2bf7cf51c5727d9081265a37b..0160fa039b5db1e01ae9c2df4509b8e68a0d072d 100755 (executable)
@@ -21,7 +21,7 @@ if "merge" in pargs:
        os.environ["FEATURES"] = os.environ.get("FEATURES", "") + " -noauto"
 
 os.environ["PORTAGE_CALLER"]="ebuild"
-sys.path = ["/usr/lib/portage/pym"]+sys.path
+sys.path.insert(0, os.environ.get("PORTAGE_PYM_PATH", "/usr/lib/portage/pym"))
 
 import portage, portage_util, portage_const
 
index fc15485272f88acbea34de4d423549c3a7bf4890..016c64ea4d8ffd6633ddb13478105757c2a868ae 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/python -O
 
-import sys
-sys.path.insert(0, "/usr/lib/portage/pym")
+import sys, os
+sys.path.insert(0, os.environ.get("PORTAGE_PYM_PATH", "/usr/lib/portage/pym"))
 from optparse import OptionParser, OptionValueError
 
 import re
index 8b69617ca1a551e791f8ec100f097c4338ce138d..e98ea6211c6e47dfaef4de9689a4aa913c84f1fd 100755 (executable)
@@ -21,7 +21,7 @@ except KeyboardInterrupt:
        sys.exit(1)
 
 import os, stat
-sys.path = ["/usr/lib/portage/pym"]+sys.path
+sys.path.insert(0, os.environ.get("PORTAGE_PYM_PATH", "/usr/lib/portage/pym"))
 
 os.environ["PORTAGE_LEGACY_GLOBALS"] = "false"
 import portage
index 286996341838f198092f56ec4c4d41119ea76342..1026b1fc10ad237aed454a6b8a79bf44963953c3 100755 (executable)
@@ -4,7 +4,7 @@
 # $Id$
 
 import os,sys
-sys.path = ["/usr/lib/portage/pym"]+sys.path
+sys.path.insert(0, os.environ.get("PORTAGE_PYM_PATH", "/usr/lib/portage/pym"))
 
 def usage(status):
        print "Usage: env-update [--no-ldconfig]"
index 16a151502bffb7f4d3deb5a0448e910dc6277d38..fef1a4d443bcb79af9c621d34536da9c5a395b6f 100755 (executable)
@@ -4,7 +4,7 @@
 # $Id$
 
 import os,sys,re
-sys.path = ["/usr/lib/portage/pym"]+sys.path
+sys.path.insert(0, os.environ.get("PORTAGE_PYM_PATH", "/usr/lib/portage/pym"))
 
 from stat import *
 from output import *
index 5eddb1c3415ef28f8b172ef954d7aae66e0ff067..f9d09dec2bd896a052d6c25030569800c7badaca 100755 (executable)
@@ -5,7 +5,7 @@
 
 import os,sys
 os.environ["PORTAGE_CALLER"]="fixpackages"
-sys.path = ["/usr/lib/portage/pym"]+sys.path
+sys.path.insert(0, os.environ.get("PORTAGE_PYM_PATH", "/usr/lib/portage/pym"))
 
 import portage
 
index 04a76ab4396f5a978b6be9d9370667e030b2fd81..98f3c81077fa74077f63c619a74e4f536ef91af6 100755 (executable)
@@ -5,7 +5,7 @@
 
 import os,sys,string
 os.environ["FEATURES"]="mirror cvs"
-sys.path = ["/usr/lib/portage/pym"]+sys.path
+sys.path.insert(0, os.environ.get("PORTAGE_PYM_PATH", "/usr/lib/portage/pym"))
 
 import portage
 from threading import *
index d1ba2f3dd86f36fe1d2410b124e070b68621755a..546b05d3c97aa02e654694bdd1e0b430876772b2 100755 (executable)
@@ -3,8 +3,8 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
-import sys
-sys.path = ["/usr/lib/portage/pym"]+sys.path
+import sys, os
+sys.path.insert(0, os.environ.get("PORTAGE_PYM_PATH", "/usr/lib/portage/pym"))
 
 import portage
 
index ffbc13f62d4c5d031dda7dd57747cb0253038951..0424647b75c50b72aff603200cff7b25c454c28c 100755 (executable)
@@ -20,7 +20,7 @@ except KeyboardInterrupt:
        sys.exit(1)
 
 import os
-sys.path = ["/usr/lib/portage/pym"]+sys.path
+sys.path.insert(0, os.environ.get("PORTAGE_PYM_PATH", "/usr/lib/portage/pym"))
 
 import types,string
 
index 7b14c2131e78ba1a52edff1f018c1a034fd75137..d5e28dd7f34e76872279db3e05a96d6d33ed0ae4 100755 (executable)
@@ -3,9 +3,8 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
-import sys
-sys.path.insert(0, "/usr/lib/portage/pym")
-import os
+import sys, os
+sys.path.insert(0, os.environ.get("PORTAGE_PYM_PATH", "/usr/lib/portage/pym"))
 import portage, string, re
 
 __candidatematcher__ = re.compile("^[0-9]+: \\*\\*\\* emerge ")
index ba4e62415539449f7af699cc020f1fce41b67ab0..c05ae9e404b24896242510d839122d47415b0e2d 100755 (executable)
@@ -11,7 +11,7 @@ import errno, os, shutil, sys
 if not hasattr(__builtins__, "set"):
        from sets import Set as set
 exename=os.path.basename(sys.argv[0])  
-sys.path = ["/usr/lib/portage/pym"]+sys.path
+sys.path.insert(0, os.environ.get("PORTAGE_PYM_PATH", "/usr/lib/portage/pym"))
 version="1.2"  
 
 allowed_filename_chars="a-zA-Z0-9._-+:"
index 4910245605dc199c3433cdb36788f03104db671b..1a0743773de90535e5a189c958698ea3588fbfc4 100755 (executable)
--- a/bin/xpak
+++ b/bin/xpak
@@ -3,12 +3,12 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
-import sys
+import sys, os
 if len(sys.argv)!=3:
        print "xpak: expecting three arguments."
        sys.exit(1)
 
-sys.path = ["/usr/lib/portage/pym"]+sys.path
+sys.path.insert(0, os.environ.get("PORTAGE_PYM_PATH", "/usr/lib/portage/pym"))
 
 import xpak
 xpak.xpak(sys.argv[1],sys.argv[2])
index 9e2c0bd2d89d7074de402954cdec42dcc0b07940..e4c512c459c1216d96a5b6c983078e535ab58c61 100644 (file)
@@ -10,7 +10,7 @@
 from stat import *
 import os, sys, commands, shutil
 
-sys.path = ["/usr/lib/portage/pym"]+sys.path
+sys.path.insert(0, os.environ.get("PORTAGE_PYM_PATH", "/usr/lib/portage/pym"))
 import portage
 
 RCS_BRANCH = '1.1.1'