[Buildbot-devel] Patch to fix Buildbot copy mode issue with symlinks in Subversion on FreeBSD

Pete Curry mail at petecurry.net
Sun Aug 19 23:55:50 UTC 2007


Hi,

Below is a patch that seems to fix a Buildbot copy mode issue on
FreeBSD with symlinks in a Subversion working tree, where files'
contents are copied instead of the symlinks, leaving files in the
Subversion ``~'' state. The patch explicitly sets the -R -P flags
which are defined in POSIX and should have the same behavior as GNU
cp -r across all POSIX OSes.

I have tested it on FreeBSD and GNU/Linux, but I do not have access
to other platforms.

Thanks,
- Pete Curry

Index: buildbot/slave/commands.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/commands.py,v
retrieving revision 1.84
diff -u -r1.84 commands.py
--- buildbot/slave/commands.py	7 Aug 2007 23:50:40 -0000	1.84
+++ buildbot/slave/commands.py	19 Aug 2007 22:30:29 -0000
@@ -1326,7 +1326,7 @@
         if runtime.platformType != "posix":
             shutil.copytree(fromdir, todir)
             return defer.succeed(0)
-        command = ['cp', '-r', '-p', fromdir, todir]
+        command = ['cp', '-R', '-P', '-p', fromdir, todir]
         c = ShellCommand(self.builder, command, self.builder.basedir,
                          sendRC=False, timeout=self.timeout)
         self.command = c
Index: buildbot/steps/source.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/steps/source.py,v
retrieving revision 1.7
diff -u -r1.7 source.py
--- buildbot/steps/source.py	3 Jul 2007 19:17:49 -0000	1.7
+++ buildbot/steps/source.py	19 Aug 2007 22:30:30 -0000
@@ -47,8 +47,8 @@
              should be maintained in a separate directory (called the
              'copydir'), using checkout or update as necessary. For each
              build, a new workdir is created with a copy of the source
-             tree (rm -rf workdir; cp -r copydir workdir). This doubles
-             the disk space required, but keeps the bandwidth low
+             tree (rm -rf workdir; cp -R -P -p copydir workdir). This
+             doubles the disk space required, but keeps the bandwidth low
              (update instead of a full checkout). A full 'clean' build
              is performed each time.  This avoids any generated-file
              build problems, but is still occasionally vulnerable to





More information about the devel mailing list