summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClark Williams <williams@redhat.com>2009-01-08 14:51:32 -0600
committerClark Williams <williams@redhat.com>2009-01-08 14:51:32 -0600
commitfd41e6e363e0a08ba1f71670ad9a1206b7982ed0 (patch)
tree75c8ac6e8034dfe91e16563357689b3fea265955
parent490dc2a043d940602ad1679cd3f8e075fc35a636 (diff)
parent3e9969f8c50b85f8380c3fe00155ae5b9970fac2 (diff)
downloadmock-fd41e6e363e0a08ba1f71670ad9a1206b7982ed0.tar.gz
mock-fd41e6e363e0a08ba1f71670ad9a1206b7982ed0.tar.xz
mock-fd41e6e363e0a08ba1f71670ad9a1206b7982ed0.zip
Merge branch 'master' of git+ssh://jcwillia@git.fedoraproject.org/git/hosted/mock
-rwxr-xr-xpy/mock.py5
-rw-r--r--py/mock/backend.py5
-rw-r--r--py/mock/exception.py14
3 files changed, 22 insertions, 2 deletions
diff --git a/py/mock.py b/py/mock.py
index f528efa..19af14c 100755
--- a/py/mock.py
+++ b/py/mock.py
@@ -653,6 +653,11 @@ if __name__ == '__main__':
exitStatus = 7
log.error("Exiting on user interrupt, <CTRL>-C")
+ except (mock.exception.ResultDirNotAccessible,), exc:
+ exitStatus = exc.resultcode
+ log.error(str(exc))
+ killOrphans = 0
+
except (mock.exception.BadCmdline, mock.exception.BuildRootLocked), exc:
exitStatus = exc.resultcode
log.error(str(exc))
diff --git a/py/mock/backend.py b/py/mock/backend.py
index f5f7ab4..f259afe 100644
--- a/py/mock/backend.py
+++ b/py/mock/backend.py
@@ -170,8 +170,9 @@ class Root(object):
self.uidManager.dropPrivsTemp()
try:
mock.util.mkdirIfAbsent(self.resultdir)
- except OSError:
- pass
+ except (OSError,), e:
+ if e.errno == 13:
+ raise mock.exception.ResultDirNotAccessible( ResultDirNotAccessible.__doc__ % self.resultdir )
self.uidManager.restorePrivs()
# lock this buildroot so we dont get stomped on.
diff --git a/py/mock/exception.py b/py/mock/exception.py
index d02bddb..3c84606 100644
--- a/py/mock/exception.py
+++ b/py/mock/exception.py
@@ -35,6 +35,7 @@ class Error(Exception):
# 40 = some error in the pkg we're building
# 50 = tried to fork a subcommand and it errored out
# 60 = buildroot locked
+# 70 = result dir could not be created
class BuildError(Error):
"rpmbuild failed."
@@ -77,3 +78,16 @@ class BadCmdline(Error):
Error.__init__(self, msg)
self.msg = msg
self.resultcode = 05
+
+class ResultDirNotAccessible(Error):
+ """
+Could not create output directory for built rpms. The directory specified was:
+ %s
+
+Try using the --resultdir= option to select another location. Recommended location is --resultdir=~/mock/.
+"""
+ def __init__(self, msg):
+ Error.__init__(self, msg)
+ self.msg = msg
+ self.resultcode = 70
+