From c8a0fdaa96c1366ee25229419bfb5a42c27c5bbb Mon Sep 17 00:00:00 2001 From: lxnay Date: Sun, 30 Mar 2008 22:07:12 +0000 Subject: [PATCH] create unpack dir and work dir if not found git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@1544 cd1c1023-2f26-0410-ae45-c471fc1f0318 --- libraries/entropyConstants.py | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/libraries/entropyConstants.py b/libraries/entropyConstants.py index 250cba5d9..c3e48530a 100644 --- a/libraries/entropyConstants.py +++ b/libraries/entropyConstants.py @@ -1085,18 +1085,27 @@ def const_createWorkingDirectories(): /var/lib/entropy /var/tmp/entropy ''' + if not os.path.isdir(etpConst['entropyworkdir']): + try: + os.makedirs(etpConst['entropyworkdir']) + except OSError: + pass w_gid = os.stat(etpConst['entropyworkdir'])[5] if w_gid != gid: const_setup_perms(etpConst['entropyworkdir'],gid) - w_gid = os.stat(etpConst['entropyunpackdir'])[5] - if w_gid != gid: - if not os.path.isdir(etpConst['entropyunpackdir']): - try: - os.makedirs(etpConst['entropyunpackdir']) - except OSError: - pass - if os.path.isdir(etpConst['entropyunpackdir']): - const_setup_perms(etpConst['entropyunpackdir'],gid) + + if not os.path.isdir(etpConst['entropyunpackdir']): + try: + os.makedirs(etpConst['entropyunpackdir']) + except OSError: + pass + try: + w_gid = os.stat(etpConst['entropyunpackdir'])[5] + if w_gid != gid: + if os.path.isdir(etpConst['entropyunpackdir']): + const_setup_perms(etpConst['entropyunpackdir'],gid) + except OSError: + pass # always setup /var/lib/entropy/client permissions const_setup_perms(etpConst['etpdatabaseclientdir'],gid)