summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorVern Sun <s5unty@gmail.com>2015-06-17 11:23:27 +0800
committerhut <hut@lepus.uberspace.de>2015-06-19 20:32:24 +0200
commit4da0355a0e1d7bdc58a4df03409c142c5a0a6b88 (patch)
tree7f7bdf99c4abeace399a0c4cbb2fe486f03ae90f
parent864e372ce78c6e2c027bf525ea9eae1dfd0ddb0a (diff)
downloadranger-4da0355a0e1d7bdc58a4df03409c142c5a0a6b88.tar.gz
honour the TMPDIR environment variable
-rw-r--r--ranger/__init__.py3
-rw-r--r--ranger/core/main.py5
2 files changed, 5 insertions, 3 deletions
diff --git a/ranger/__init__.py b/ranger/__init__.py
index e20f55d8..8a1e7459 100644
--- a/ranger/__init__.py
+++ b/ranger/__init__.py
@@ -10,6 +10,7 @@ program you want to use to open your files with.
 
 import sys
 import os
+import tempfile
 
 # Information
 __license__ = 'GPL3'
@@ -24,7 +25,7 @@ TIME_BEFORE_FILE_BECOMES_GARBAGE = 1200
 MAX_RESTORABLE_TABS = 3
 MACRO_DELIMITER = '%'
 DEFAULT_PAGER = 'less'
-LOGFILE = '/tmp/ranger_errorlog'
+LOGFILE = tempfile.gettempdir()+'/ranger_errorlog'
 CACHEDIR = os.path.expanduser("~/.cache/ranger")
 USAGE = '%prog [options] [path]'
 VERSION = 'ranger-master %s\n\nPython %s' % (__version__, sys.version)
diff --git a/ranger/core/main.py b/ranger/core/main.py
index 524a9a19..55102dc2 100644
--- a/ranger/core/main.py
+++ b/ranger/core/main.py
@@ -5,6 +5,7 @@
 
 import os.path
 import sys
+import tempfile
 
 def main():
     """initialize objects and run the filemanager"""
@@ -133,8 +134,8 @@ def main():
             import pstats
             profile = None
             ranger.__fm = fm
-            cProfile.run('ranger.__fm.loop()', '/tmp/ranger_profile')
-            profile = pstats.Stats('/tmp/ranger_profile', stream=sys.stderr)
+            cProfile.run('ranger.__fm.loop()', tempfile.gettempdir()+'/ranger_profile')
+            profile = pstats.Stats(tempfile.gettempdir()+'/ranger_profile', stream=sys.stderr)
         else:
             fm.loop()
     except Exception:
='/danisanti/profani-tty/blame/install-all.sh?id=272e12a38b1c0ec35ed1ffc69ecacfd74f173840'>^
0a1e8d9c ^
59c9e23b ^
0a1e8d9c ^
59c9e23b ^

0a1e8d9c ^

24a60449 ^
5c97dcd7 ^

24a60449 ^

76fe37ef ^




c73d1816 ^
76fe37ef ^













bdb8ea3f ^


76fe37ef ^




8f0bc28b ^




c73d1816 ^
8f0bc28b ^














bdb8ea3f ^


8f0bc28b ^




76fe37ef ^





76fe37ef ^









0a1e8d9c ^






7f962895 ^
76fe37ef ^

7f962895 ^


04605a5f ^
7f962895 ^

24a60449 ^




76fe37ef ^


7f962895 ^

76fe37ef ^

24a60449 ^
8f0bc28b ^

24a60449 ^

8f0bc28b ^

76fe37ef ^
24a60449 ^
8f0bc28b ^

76fe37ef ^


76fe37ef ^
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168

         

                  
                








                                                          
                                                                                                                                                


 
                






                                                       
                                                                                                                                                                                                  

 





                                                       

                                                                                     


                              
                                 
                                                                                                                                                                                                                                         
        

                                                                                                                                                                                                                          

      
                                             

                                       

 




                                                     
                                                     













                                                    


                                            




                     




                                                     
                                                     














                                                               


                                            




                





                                           









                                          






                               
             

            


                                       
                                         

                   




                             


               

                                                             

                
                          

                               

                          

                               
              
                          

                                   


              
       
#!/bin/sh

STATUS=development

debian_prepare()
{
    echo
    echo Profanity installer ... updating apt repositories
    echo
    sudo apt-get update

    echo
    echo Profanity installer... installing dependencies
    echo
    sudo apt-get -y install git automake autoconf libssl-dev libexpat1-dev libncursesw5-dev libglib2.0-dev libnotify-dev libcurl3-dev libxss-dev

}

fedora_prepare()
{
    echo
    echo Profanity installer... installing dependencies
    echo

    ARCH=`arch`
    
    sudo yum -y install gcc git autoconf automake openssl-devel.$ARCH expat-devel.$ARCH ncurses-devel.$ARCH  glib2-devel.$ARCH libnotify-devel.$ARCH libcurl-devel.$ARCH libXScrnSaver-devel.$ARCH
}

cygwin_prepare()
{
    echo
    echo Profanity installer... installing dependencies
    echo

    wget --no-check-certificate https://raw.github.com/boothj5/apt-cyg/master/apt-cyg
    #wget http://apt-cyg.googlecode.com/svn/trunk/apt-cyg
    chmod +x apt-cyg
    mv apt-cyg /usr/local/bin/

    if [ -n "$CYG_MIRROR" ]; then
        apt-cyg -m $CYG_MIRROR install git make gcc-core m4 automake autoconf pkg-config openssl-devel libexpat-devel zlib-devel libncursesw-devel libglib2.0-devel libcurl-devel libidn-devel libssh2-devel libkrb5-devel openldap-devel
    else
        apt-cyg install git make gcc-core m4 automake autoconf pkg-config openssl-devel libexpat-devel zlib-devel libncursesw-devel libglib2.0-devel libcurl-devel libidn-devel libssh2-devel libkrb5-devel openldap-devel

    fi

    ln -s /usr/bin/gcc-3.exe /usr/bin/gcc.exe

    export LIBRARY_PATH=/usr/local/lib/
}

install_lib_strophe()
{
    echo
    echo Profanity installer... installing libstrophe
    echo
    git clone git://github.com/strophe/libstrophe.git
    cd libstrophe
    ./bootstrap.sh
    ./configure
    make
    sudo make install

    cd ..
}

install_profanity()
{
    echo
    echo Profanity installer... installing Profanity
    echo
    if [ "${STATUS}" = "development" ]; then
        ./bootstrap.sh
    fi
    ./configure
    make
    sudo make install
}

cyg_install_lib_strophe()
{
    echo
    echo Profanity installer... installing libstrophe
    echo
    git clone git://github.com/strophe/libstrophe.git
    cd libstrophe
    ./bootstrap.sh
    ./bootstrap.sh # second call seems to fix problem on cygwin
    ./configure
    make
    make install

    cd ..
}

cyg_install_profanity()
{
    echo
    echo Profanity installer... installing Profanity
    echo
    if [ "${STATUS}" = "development" ]; then
        ./bootstrap.sh
    fi
    ./configure
    make
    make install
}

cleanup()
{
    echo
    echo Profanity installer... cleaning up
    echo

    echo Removing libstrophe repository...
    rm -rf libstrophe

    echo
    echo Profanity installer... complete!
    echo
    echo Type \'profanity\' to run.
    echo
}

while getopts m: opt
do
    case "$opt" in
        m) CYG_MIRROR=$OPTARG;;
    esac
done

OS=`uname -s`
DIST=unknown

if [ "${OS}" = "Linux" ]; then
    if [ -f /etc/fedora-release ]; then
        DIST=fedora
    elif [ -f /etc/debian_version ]; then
        DIST=debian
    fi
else
    echo $OS | grep -i cygwin
    if [ "$?" -eq 0 ]; then
        DIST=cygwin
    fi
fi

case "$DIST" in
unknown)    echo The install script will not work on this OS.
            echo Try a manual install instead.
            exit
            ;;
fedora)     fedora_prepare
            install_lib_strophe
            install_profanity
            ;;
debian)     debian_prepare
            install_lib_strophe
            install_profanity
            ;;
cygwin)     cygwin_prepare
            cyg_install_lib_strophe
            cyg_install_profanity
            ;;
esac

cleanup