diff options
author | Brent Eagles <brent@zeroc.com> | 2007-01-23 19:30:01 +0000 |
---|---|---|
committer | Brent Eagles <brent@zeroc.com> | 2007-01-23 19:30:01 +0000 |
commit | 4b1011f484f6c732479d469a46601a37aa07ad1a (patch) | |
tree | 5d5a1a19b36806c57f1b090c82e7bffacee520cc /cpp/makebindist.py | |
parent | merging some suse/redhat operation filtering (diff) | |
download | ice-4b1011f484f6c732479d469a46601a37aa07ad1a.tar.bz2 ice-4b1011f484f6c732479d469a46601a37aa07ad1a.tar.xz ice-4b1011f484f6c732479d469a46601a37aa07ad1a.zip |
reinserting missing initDirectory()
Diffstat (limited to 'cpp/makebindist.py')
-rwxr-xr-x | cpp/makebindist.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/cpp/makebindist.py b/cpp/makebindist.py index 3ca06dac551..e7f2a5dd303 100755 --- a/cpp/makebindist.py +++ b/cpp/makebindist.py @@ -21,6 +21,28 @@ import os, sys, shutil, re, string, getopt, glob, logging, fileinput # external programs. I haven't figured out how to get commands with # pipes or redirections to work properly. Stay tuned. # + +def initDirectory(d): + """Check for the existance of the directory. If it isn't there make + it.""" + if os.path.exists(d): + # + # Make sure its a directory and has correct permissions. + # + if not os.path.isdir(d): + print 'Path ' + d + ' exists but is not a directory.' + sys.exit(1) + + if os.access(d, os.X_OK | os.R_OK | os.W_OK): + logging.info('Path ' + d + ' exists and is ok, continuing') + else: + logging.warning('Directory ' + d + ' exists, but has incorrect permissions') + sys.exit(1) + else: + # + # This could fail due to lack of permissions. + # + os.makedirs(d, 0770) class ExtProgramError: def __init__(self, error = None): |