--- Repo.py.~1.24.~ 2006-05-20 16:46:57.000000000 +0200 +++ Repo.py 2006-05-20 16:47:08.000000000 +0200 @@ -196,6 +196,14 @@ def _update_repo(self): """ Copy new RPMS to the repo, and updates the repo at the end """ + # Lock repo lockfile. + lockfilename = '.repo-update.lock' + lockfile = open(os.path.join(self._repodir,lockfilename),'w') + try: + rc = fcntl.flock(lockfile,fcntl.LOCK_EX) + except IOError (errno, strerr): + print 'ERROR: %s: %s' % (strerr,lockfilename) + for buildjob in self._repo_additions: # Ensure all the files are accessible success = True @@ -228,6 +236,9 @@ (s, o) = commands.getstatusoutput('/usr/bin/createrepo -q -c %s -x "*.src.rpm" -x "*-debuginfo-*" %s' % (self._repo_cache_dir, self._repodir)) if s != 0: print "Repo Error (%s): createrepo failed with exit status %d! Output: '%s'" % (self._target_cfg.target_string(), s, o) + # Unlock repo lockfile. + fcntl.flock(lockfile,fcntl.LOCK_UN) + lockfile.close() def _start_repo_script(self): target_str = self._target_cfg.target_string()