extras-buildsys/utils extras-push-new, 1.62, 1.63 ExtrasPushUtils.py, 1.12, 1.13
Michael Schwendt (mschwendt)
fedora-extras-commits at redhat.com
Tue Sep 26 17:32:43 UTC 2006
Author: mschwendt
Update of /cvs/fedora/extras-buildsys/utils
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv23394
Modified Files:
extras-push-new ExtrasPushUtils.py
Log Message:
move is_repo_changed() function so it can be reused
Index: extras-push-new
===================================================================
RCS file: /cvs/fedora/extras-buildsys/utils/extras-push-new,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -r1.62 -r1.63
--- extras-push-new 20 Sep 2006 12:33:02 -0000 1.62
+++ extras-push-new 26 Sep 2006 17:32:40 -0000 1.63
@@ -151,36 +151,6 @@
return srcrpms
-def is_repo_changed(repodir):
- """Checks if the repository has changed and needs to be reindexed"""
- ref_file = os.path.join(repodir, 'repodata', 'repomd.xml')
- if not os.path.exists(ref_file):
- return True
- ref_mtime = os.path.getmtime(ref_file)
- if os.path.getmtime(repodir) > ref_mtime:
- return True
- ignored_dirs = (
- os.path.join(repodir, 'repodata'),
- os.path.join(repodir, 'debug'),
- )
- for root, dirs, files in os.walk(repodir):
- next = False
- for ignored in ignored_dirs:
- if (root + "/").find(ignored + "/") == 0:
- next = True
- if next:
- continue
- for d in map(lambda x: os.path.join(root, x), dirs):
- if d in ignored_dirs:
- continue
- elif os.path.getmtime(d) > ref_mtime:
- return True
- for f in fnmatch.filter(files, '*.rpm'):
- if os.path.getmtime(os.path.join(root, f)) > ref_mtime:
- return True
- return False
-
-
def mark_pkg_pushed(pkgrelroot):
fname = os.path.join(pkgrelroot,'PUSHED')
if os.path.isfile(fname):
Index: ExtrasPushUtils.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/utils/ExtrasPushUtils.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- ExtrasPushUtils.py 20 Sep 2006 18:39:59 -0000 1.12
+++ ExtrasPushUtils.py 26 Sep 2006 17:32:40 -0000 1.13
@@ -150,6 +150,36 @@
create_repository( os.path.join(treedir,dist,'SRPMS') )
+def is_repo_changed(repodir):
+ """Checks if the repository has changed and needs to be reindexed"""
+ ref_file = os.path.join(repodir, 'repodata', 'repomd.xml')
+ if not os.path.exists(ref_file):
+ return True
+ ref_mtime = os.path.getmtime(ref_file)
+ if os.path.getmtime(repodir) > ref_mtime:
+ return True
+ ignored_dirs = (
+ os.path.join(repodir, 'repodata'),
+ os.path.join(repodir, 'debug'),
+ )
+ for root, dirs, files in os.walk(repodir):
+ next = False
+ for ignored in ignored_dirs:
+ if (root + "/").find(ignored + "/") == 0:
+ next = True
+ if next:
+ continue
+ for d in map(lambda x: os.path.join(root, x), dirs):
+ if d in ignored_dirs:
+ continue
+ elif os.path.getmtime(d) > ref_mtime:
+ return True
+ for f in fnmatch.filter(files, '*.rpm'):
+ if os.path.getmtime(os.path.join(root, f)) > ref_mtime:
+ return True
+ return False
+
+
def fix_mdcache_access(workdir,cachedir):
# Work around explicit directory mode 0755 in yum/repos.py (that
# is too restrictive for our extras_signers group) and an utime
More information about the fedora-extras-commits
mailing list