chiark
/
gitweb
/
~mdw
/
stgit
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
33e580e
)
Fix gitmergeonefile.py to deal with local installation
author
Catalin Marinas
<catalin.marinas@gmail.com>
Tue, 16 Aug 2005 13:47:33 +0000
(14:47 +0100)
committer
Catalin Marinas
<catalin.marinas@gmail.com>
Tue, 16 Aug 2005 13:47:33 +0000
(14:47 +0100)
After a previous change, this file didn't know where to find the stgit
package if it wasn't installed with the default prefix.
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
gitmergeonefile.py
patch
|
blob
|
blame
|
history
diff --git
a/gitmergeonefile.py
b/gitmergeonefile.py
index 99a6a7ce79805fbc03e7c65c76ce6ad4c2bdff17..fe416bdb8f1fafbb72c1b123c7906937f2cb7176 100755
(executable)
--- a/
gitmergeonefile.py
+++ b/
gitmergeonefile.py
@@
-20,6
+20,18
@@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
import sys, os
"""
import sys, os
+
+# Try to detect where it is run from and set prefix and the search path.
+# It is assumed that the user installed StGIT using the --prefix= option
+prefix, bin = os.path.split(sys.path[0])
+
+if bin == 'bin' and prefix != sys.prefix:
+ major, minor = sys.version_info[0:2]
+ sys.path += [os.path.join(prefix, 'lib', 'python'),
+ os.path.join(prefix, 'lib', 'python%s.%s' % (major, minor)),
+ os.path.join(prefix, 'lib', 'python%s.%s' % (major, minor),
+ 'site-packages')]
+
from stgit.config import config
from stgit.utils import append_string
from stgit.config import config
from stgit.utils import append_string