diff options
| author | Michael E Brown <michael_e_brown@dell.com> | 2007-10-18 16:50:24 -0500 |
|---|---|---|
| committer | Michael E Brown <michael_e_brown@dell.com> | 2007-10-18 16:50:24 -0500 |
| commit | 48ef9fd3d2ad3f0645add224f5774ffecda5d840 (patch) | |
| tree | 9dc80f48ca3f63a127db6c4c72b48dcb15c1465f /src | |
| parent | 8be871673b46296b532df02b6e976c61b10fcb41 (diff) | |
| download | mock-48ef9fd3d2ad3f0645add224f5774ffecda5d840.tar.gz mock-48ef9fd3d2ad3f0645add224f5774ffecda5d840.tar.xz mock-48ef9fd3d2ad3f0645add224f5774ffecda5d840.zip | |
disallow rebuild without 'rebuild' parameter. add banner on startup.
Diffstat (limited to 'src')
| -rwxr-xr-x | src/mock.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/mock.py b/src/mock.py index 97c0fc2..8060f11 100755 --- a/src/mock.py +++ b/src/mock.py @@ -190,6 +190,8 @@ def main(): # uidManager saves current real uid/gid which are unpriviledged (callers) # due to suid helper, our current effective uid is 0 chroot = mock.backend.Root(config_opts, mock.uid.uidManager(os.getuid(), os.getgid())) + log.info("mock.py version %s starting..." % __VERSION__) + os.umask(002) if config_opts['clean']: chroot.clean() @@ -228,15 +230,11 @@ def main(): chroot.init() chroot.installSrpmDeps(*srpms) - else: - if args[0] == 'rebuild': - if len(args) > 1: - srpms = args[1:] - else: - log.critical("No package specified to rebuild command.") - sys.exit(50) - else: - srpms = args[0:] + elif args[0] == 'rebuild': + srpms = args[1:] + if len(srpms) < 1: + log.critical("No package specified to rebuild command.") + sys.exit(50) # check that everything is kosher. Raises exception on error for hdr in mock.util.yieldSrpmHeaders(srpms): pass @@ -249,6 +247,9 @@ def main(): log.info("Results and/or logs in: %s" % chroot.resultdir) + else: + log.error("Unknown command specified: %s" % args[0] + except (mock.exception.Error), e: log.error(str(e)) |
