dev/core#1393, dev/core#1990 - Assert that Drupal-style tarballs have no symlinks
authorTim Otten <totten@civicrm.org>
Tue, 15 Sep 2020 03:59:01 +0000 (20:59 -0700)
committerTim Otten <totten@civicrm.org>
Tue, 15 Sep 2020 04:03:12 +0000 (21:03 -0700)
distmaker/dists/backdrop_php5.sh
distmaker/dists/common.sh
distmaker/dists/drupal6_php5.sh
distmaker/dists/drupal_php5.sh
distmaker/dists/drupal_sk_php5.sh

index 65d8fb899d9f5a49ae33b0c57fabc2c08b7118bf..59f85c14e1107a48fb03a94a1b203ff21c91515f 100644 (file)
@@ -28,6 +28,7 @@ dm_install_cvext com.iatspayments.civicrm "$TRG/ext/iatspayments"
 
 # gen tarball
 cd $TRG/..
+dm_assert_no_symlinks civicrm
 tar czf $DM_TARGETDIR/civicrm-$DM_VERSION-backdrop.tar.gz civicrm
 
 # clean up
index cf6bcd9350a9d60e4022fc8e6aeff0093cab1368..dc2cd9a65a418078f695fe858d432a09a347e527 100644 (file)
@@ -10,6 +10,18 @@ function dm_reset_dirs() {
   mkdir -p "$@"
 }
 
+## Assert that a folder contains no symlinks
+##
+## ex: dev/core#1393, dev/core#1990
+## usage: dm_assert_no_symlinks <basedir>
+function dm_assert_no_symlinks() {
+  local SYMLINKS=$( find "$1" -type l )
+  if [ -n "$SYMLINKS" ]; then
+    echo "ERROR: Folder $1 contains unexpected symlink(s): $SYMLINKS"
+    exit 10
+  fi
+}
+
 ## Copy files from one dir into another dir
 ## usage: dm_install_dir <from-dir> <to-dir>
 function dm_install_dir() {
index 2ecb1a2b14477faa3a59428b322e365e106bbd8d..6c9d94cc7893be251a9530e5559f4e352ac687f1 100755 (executable)
@@ -28,6 +28,7 @@ dm_install_cvext com.iatspayments.civicrm "$TRG/ext/iatspayments"
 
 # gen tarball
 cd $TRG/..
+dm_assert_no_symlinks civicrm
 tar czf $DM_TARGETDIR/civicrm-$DM_VERSION-drupal6.tar.gz civicrm
 
 # clean up
index 7245be3fe8473490520e87878a2f09bc5120690c..64e5f9aa4bbbf8d440eafb55db78db990295bff1 100755 (executable)
@@ -28,6 +28,7 @@ dm_install_cvext com.iatspayments.civicrm "$TRG/ext/iatspayments"
 
 # gen tarball
 cd $TRG/..
+dm_assert_no_symlinks civicrm
 tar czf $DM_TARGETDIR/civicrm-$DM_VERSION-drupal.tar.gz civicrm
 
 # clean up
index b375d2ad28376b9572fe52678fc7f8b0ceb71064..4419053ac0a54aeb02cf83997fcf074c1d6368c6 100755 (executable)
@@ -36,6 +36,7 @@ rm -rf $TRG/packages/tinymce
 
 # gen tarball
 cd $TRG/..
+dm_assert_no_symlinks civicrm
 tar czf $DM_TARGETDIR/civicrm-$DM_VERSION-starterkit.tgz civicrm
 
 # clean up