Mock 'Directory not empty' error during --clean

Greg Trahair Greg.Trahair at tomtom.com
Mon Mar 7 09:17:57 UTC 2011


Hi,

I've recently setup a build machine for staging builds to go into our
in-house koji.  I installed mock and setup the build scratch space in
/data/mock (perms set to 2775, root:mock).

I setup an alias for all users for mock so that everybody gets there own
buildroot:

alias mock='mock -r dist-rhel5-x86_64 --uniqueext $LOGNAME'

Creating a buildroot is fine:

$ mock -r dist-rhel5-x86_64 --uniqueext $LOGNAME --init
INFO: mock.py version 1.0.7 starting...
State Changed: init plugins
State Changed: start
State Changed: lock buildroot
State Changed: clean
State Changed: init
State Changed: lock buildroot
Mock Version: 1.0.7
INFO: Mock Version: 1.0.7
INFO: enabled root cache
State Changed: unpacking root cache
INFO: enabled yum cache
State Changed: cleaning yum metadata
INFO: enabled ccache
State Changed: running yum


But when I attempt to clean it, this happens:

$ mock -r dist-rhel5-x86_64 --uniqueext $LOGNAME --clean
INFO: mock.py version 1.0.7 starting...
State Changed: init plugins
State Changed: start
State Changed: lock buildroot
State Changed: clean
Traceback (most recent call last):
  File "/usr/sbin/mock", line 693, in ?
    main(retParams)
  File "/usr/sbin/mock", line 567, in main
    chroot.clean()
  File "<peak.util.decorators.rewrap wrapping mock.backend.clean at
0x0A926848>", line 3, in clean
  File "/usr/lib/python2.4/site-packages/mock/trace_decorator.py", line
70, in trace
    result = func(*args, **kw)
  File "/usr/lib/python2.4/site-packages/mock/backend.py", line 134, in
clean
    mock.util.rmtree(self.basedir)
  File "<peak.util.decorators.rewrap wrapping mock.util.rmtree at
0x0A91A2A8>", line 3, in rmtree
  File "/usr/lib/python2.4/site-packages/mock/trace_decorator.py", line
70, in trace
    result = func(*args, **kw)
  File "/usr/lib/python2.4/site-packages/mock/util.py", line 82, in
rmtree
    shutil.rmtree(path, *args, **kargs)
  File "/usr/lib64/python2.4/shutil.py", line 172, in rmtree
    onerror(os.rmdir, path, sys.exc_info())
  File "/usr/lib64/python2.4/shutil.py", line 170, in rmtree
    os.rmdir(path)
OSError: [Errno 39] Directory not empty: '/data/mock/dist-rhel5-greg'


My mock config looks like this for dist-rhel5-x86_64:
config_opts['chroothome'] = '/builddir'
config_opts['use_host_resolv'] = False
config_opts['basedir'] = '/data/mock'
config_opts['rpmbuild_timeout'] = 86400
config_opts['yum.conf'] =
'[main]\ncachedir=/var/cache/yum\ndebuglevel=1\nlogfile=/var/log/yum.log
\nreposdir=/dev/null\nretries=20\nobsoletes=1\ngpgcheck=0\nassumeyes=1\n
\n#
repos\n\n[build]\nname=build\nbaseurl=http://my-koji-server/repos/dist-r
hel5-build/latest/$basearch\n'
config_opts['chroot_setup_cmd'] = 'groupinstall build'
config_opts['target_arch'] = 'x86_64'
config_opts['root'] = 'dist-rhel5'

Has anyone else encountered/fixed this?


Thanks in advance,
Greg


This e-mail message contains information which is confidential and may be privileged. It is intended for use by the addressee only. If you are not the intended addressee, we request that you notify the sender immediately and delete or destroy this e-mail message and any attachment(s), without copying, saving, forwarding, disclosing or using its contents in any other way. TomTom N.V., TomTom International BV or any other company belonging to the TomTom group of companies will not be liable for damage relating to the communication by e-mail of data, documents or any other information.


More information about the buildsys mailing list