[svn] r5407 - trunk/tools/mrepo

packagers at lists.rpmforge.net packagers at lists.rpmforge.net
Wed May 16 22:43:15 CEST 2007


Author: dag
Date: 2007-05-16 22:43:13 +0200 (Wed, 16 May 2007)
New Revision: 5407

Modified:
   trunk/tools/mrepo/ChangeLog
   trunk/tools/mrepo/mrepo
Log:
Check for directory when creating before symlinking into it (Bruno Cornec)

Modified: trunk/tools/mrepo/ChangeLog
===================================================================
--- trunk/tools/mrepo/ChangeLog	2007-05-15 11:34:55 UTC (rev 5406)
+++ trunk/tools/mrepo/ChangeLog	2007-05-16 20:43:13 UTC (rev 5407)
@@ -9,6 +9,7 @@
 - Added rhel5s.conf and rhel5c.conf (Oliver Falk)
 - Added amd64 as alias for x86_64 to accomodate Sun's Java packages (Tom G. Christensen)
 - Check whether version of createrepo is older than 0.4.6 (Francois Aucamp)
+- Check for directory when creating before symlinking into it (Bruno Cornec)
 
 * 0.8.4 - Sint-Jacobsplein - released 13/12/2006
 - Renamed Yam to mrepo (Matthew Hannigan)

Modified: trunk/tools/mrepo/mrepo
===================================================================
--- trunk/tools/mrepo/mrepo	2007-05-15 11:34:55 UTC (rev 5406)
+++ trunk/tools/mrepo/mrepo	2007-05-16 20:43:13 UTC (rev 5407)
@@ -1014,15 +1014,15 @@
         if os.path.samefile(src, dst):
             return
         os.rename(dst, dst+'.mrepobak')
+
 ### Not using filecmp increases speed with 15%
 #   if os.path.isfile(dst) and filecmp.cmp(src, dst) == 0:
 
     src = relpath(src, dst)
 
-    ### FIXME: This check should not be required
-    if not os.path.exists(dst):
+    if not os.path.isdir(os.path.dirname(dst)):
         mkdir(os.path.dirname(dst))
-        os.symlink(src, dst)
+    os.symlink(src, dst)
 
 def copy(src, dst):
     "Copy a file, force if dst exists"




More information about the commits mailing list