From: Thanh Ha Date: Thu, 24 Aug 2017 16:00:53 +0000 (-0400) Subject: DO NOT archive if filename is longer than 255 X-Git-Tag: v0.9.0~4 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=aebf39501d6d2c12f025f9dc9b8746b4b1ea5f84;p=releng%2Flftools.git 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 --- 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"