You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by mp...@apache.org on 2016/03/04 22:39:13 UTC

[2/4] incubator-kudu git commit: dist_test: re-copy system dependencies if modification time changes

dist_test: re-copy system dependencies if modification time changes

If the user installs a new version of a system library dependency,
we should probably re-copy it when submitting a dist-test.

Change-Id: If76d1bfe239e0ff827bc362be5f926e4d7e2fbb7
Reviewed-on: http://gerrit.cloudera.org:8080/2440
Tested-by: Kudu Jenkins
Reviewed-by: Adar Dembo <ad...@cloudera.com>


Project: http://git-wip-us.apache.org/repos/asf/incubator-kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kudu/commit/f12748f8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kudu/tree/f12748f8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kudu/diff/f12748f8

Branch: refs/heads/master
Commit: f12748f8d5c6f26940cec4a1e647ff8048ab8919
Parents: 394d6ce
Author: Todd Lipcon <to...@apache.org>
Authored: Thu Mar 3 08:19:55 2016 -0800
Committer: Todd Lipcon <to...@apache.org>
Committed: Fri Mar 4 19:39:48 2016 +0000

----------------------------------------------------------------------
 build-support/dist_test.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/f12748f8/build-support/dist_test.py
----------------------------------------------------------------------
diff --git a/build-support/dist_test.py b/build-support/dist_test.py
index 2f53293..c03dad2 100755
--- a/build-support/dist_test.py
+++ b/build-support/dist_test.py
@@ -164,7 +164,9 @@ def copy_system_library(lib):
   if not os.path.exists(sys_lib_dir):
     os.makedirs(sys_lib_dir)
   dst = os.path.join(sys_lib_dir, os.path.basename(lib))
-  if not os.path.exists(dst):
+  # Copy if it doesn't exist, or the mtimes don't match.
+  # Using shutil.copy2 preserves the mtime after the copy (like cp -p)
+  if not os.path.exists(dst) or os.stat(dst).st_mtime != os.stat(lib).st_mtime:
     logging.info("Copying system library %s to %s...", lib, dst)
     shutil.copy2(rel_to_abs(lib), dst)
   return dst