]>
Commit | Line | Data |
---|---|---|
81e9387d MM |
1 | # vi: encoding=utf-8 ts=8 sts=4 sw=4 et |
2 | ||
2ec96333 JR |
3 | from __future__ import print_function |
4 | ||
d9b3388c | 5 | import os, sys, config |
6ebc8df7 | 6 | |
81e9387d | 7 | def fileexists(path): |
8911f226 ER |
8 | if path[0] == '/': |
9 | fullpath = path | |
81e9387d | 10 | else: |
8911f226 | 11 | fullpath = config.ftp_dir + path |
e3aced8e | 12 | return os.path.exists(fullpath) |
6ebc8df7 MM |
13 | |
14 | def checkdir(dir): | |
637d76b9 | 15 | if not fileexists(dir): |
2ec96333 | 16 | print('ERR: ' + config.value['ftp_dir']+'/' + dir + " does not exist", file=sys.stderr) |
81e9387d | 17 | sys.exit(1) |
6ebc8df7 | 18 | |
6992b18d | 19 | if 'HOME' in os.environ: |
304fcc79 | 20 | ftpadmdir = os.environ['HOME'] + '/pld-ftp-admin' |
6992b18d | 21 | else: |
304fcc79 | 22 | ftpadmdir = '..' |
151d31cc | 23 | |
8911f226 ER |
24 | # noarchcachedir is dir where noarch files contents are stored for AI |
25 | # XXX: file reference where the AI resides | |
304fcc79 | 26 | noarchcachedir = ftpadmdir + '/var/noarch-cache/' |
8911f226 | 27 | |
304fcc79 | 28 | tmpdir = ftpadmdir + '/var/tmp/' |