]>
Commit | Line | Data |
---|---|---|
81e9387d MM |
1 | # vi: encoding=utf-8 ts=8 sts=4 sw=4 et |
2 | ||
d9b3388c | 3 | import os, sys, config |
6ebc8df7 | 4 | |
81e9387d MM |
5 | def fileexists(path): |
6 | if path[0]=='/': | |
7 | fullpath=path | |
8 | else: | |
9 | fullpath=config.ftp_dir+path | |
e3aced8e | 10 | return os.path.exists(fullpath) |
6ebc8df7 MM |
11 | |
12 | def checkdir(dir): | |
637d76b9 | 13 | if not fileexists(dir): |
749b120d | 14 | print 'ERR: ' + config.value['ftp_dir']+'/' + dir + " does not exist" |
81e9387d | 15 | sys.exit(1) |
6ebc8df7 | 16 | |
6992b18d | 17 | if 'HOME' in os.environ: |
88d4cb67 | 18 | ftpadmdir=os.environ['HOME']+'/pld-ftp-admin/' |
6992b18d | 19 | else: |
88d4cb67 MM |
20 | ftpadmdir='../' |
21 | noarchcachedir=ftpadmdir+'var/noarch-cache/' | |
22 | tmpdir=ftpadmdir+'var/tmp/' | |
151d31cc | 23 |