From aebf39501d6d2c12f025f9dc9b8746b4b1ea5f84 Mon Sep 17 00:00:00 2001 From: Thanh Ha Date: Thu, 24 Aug 2017 12:00:53 -0400 Subject: [PATCH] DO NOT archive if filename is longer than 255 Most Unix filesystems do not allow files being created that are longer than 255 characters. The LF Infra VMs are built with XFS and seem to have the extended attribute allowing longer filenames. This unfortuantely creates zip that when we copy to Nexus which does not have this to fail to unpack. Limit archive files to 255 characters or less to avoid this. Issue: RELENG-322 Change-Id: I9c70a67d69559b834ec1c1bce0c2b909e61127dd Signed-off-by: Thanh Ha --- shell/deploy | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/shell/deploy b/shell/deploy index 8b60b78d..9bbf7208 100755 --- a/shell/deploy +++ b/shell/deploy @@ -45,6 +45,13 @@ copy_archives() { for pattern in $archive_pattern; do [[ -e $pattern ]] || continue # handle the case of no files to archive echo "Archiving $pattern" >> "$workspace/archives.log" + + filename=$(basename $pattern) + if [ "${#filename}" -gt 255 ]; then + echo "Filename too long: $pattern" | tee -a "$workspace/archives-missed.log" + continue + fi + dir=$(dirname "$pattern") mkdir -p "$dest_dir/$dir" mv "$pattern" "$dest_dir/$pattern" -- 2.16.6