summaryrefslogtreecommitdiff
path: root/devel/eric6/files/extra-patch-install-i18n.py
blob: fa0b56e8aa53ffff9e39b8d51c9c0137f19f47c2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
--- install-i18n.py.orig	2013-08-19 13:16:47.862300000 +0400
+++ install-i18n.py	2013-10-05 17:55:20.162267518 +0400
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
 # Copyright (c) 2004 - 2015 Detlev Offenbach <detlev@die-offenbachs.de>
@@ -45,6 +45,7 @@
 # Define the globals.
 progName = None
 configDir = getConfigDir()
+distDir = None
 privateInstall = False
 
 def usage(rcode = 2):
@@ -71,7 +72,9 @@
     global privateInstall, configDir
     
     if privateInstall:
-        targetDir = configDir
+        targetDir = distDir + getConfig('ericTranslationsDir')
+        if not os.path.exists(targetDir):
+            os.makedirs(targetDir, 493) # 0o755
     else:
         targetDir = getConfig('ericTranslationsDir')
     
@@ -97,11 +100,12 @@
     progName = os.path.basename(argv[0])
 
     try:
-        optlist, args = getopt.getopt(argv[1:], "hp")
+        optlist, args = getopt.getopt(argv[1:], "hp:")
     except getopt.GetoptError:
         usage()
 
     global platBinDir
+    global distDir
     
     depChecks = 1
 
@@ -110,6 +114,7 @@
             usage(0)
         elif opt == "-p":
             privateInstall = 1
+            distDir = os.path.normpath(arg)
         
     installTranslations()