# vi: encoding=utf-8 ts=8 sts=4 sw=4 et from __future__ import print_function import os, sys, config def fileexists(path): if path[0] == '/': fullpath = path else: fullpath = config.ftp_dir + path return os.path.exists(fullpath) def checkdir(dir): if not fileexists(dir): print('ERR: ' + config.value['ftp_dir']+'/' + dir + " does not exist", file=sys.stderr) sys.exit(1) if 'HOME' in os.environ: ftpadmdir = os.environ['HOME'] + '/tld-ftp-admin' else: ftpadmdir = '..' # noarchcachedir is dir where noarch files contents are stored for AI # XXX: file reference where the AI resides noarchcachedir = ftpadmdir + '/var/noarch-cache/' tmpdir = ftpadmdir + '/var/tmp/'