From 811ffb498e3cac58981aa930839b03ea0c445561 Mon Sep 17 00:00:00 2001
From: Jan Busa Jr <busa@jinr.ru>
Date: Wed, 24 Nov 2021 10:23:01 +0300
Subject: [PATCH 1/2] Added semiautomatic check of external scripts from
 alibuild. To run it, call in the root directory command
 scripts/refreshAlidistMaster.sh

---
 .gitignore                      |  2 +
 scripts/refreshAlidistMaster.sh | 89 +++++++++++++++++++++++++++++++++
 2 files changed, 91 insertions(+)
 create mode 100755 scripts/refreshAlidistMaster.sh

diff --git a/.gitignore b/.gitignore
index 1320f90..1291119 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,3 @@
 site
+tmp*/
+
diff --git a/scripts/refreshAlidistMaster.sh b/scripts/refreshAlidistMaster.sh
new file mode 100755
index 0000000..949b53c
--- /dev/null
+++ b/scripts/refreshAlidistMaster.sh
@@ -0,0 +1,89 @@
+#!/bin/bash
+
+# These are NICA provided scripts, don't check them
+# defaults-mpd-dev.sh
+# mpddev.sh
+# mpdroot.sh
+
+TEMP_DIR=tmpAlidistMaster
+ALIDIST_DIR=alidist
+
+mkdir -p $TEMP_DIR
+rm -rf $TEMP_DIR/* 
+git clone https://github.com/alisw/alidist.git $TEMP_DIR/$ALIDIST_DIR
+
+scripts="alibuild-recipe-tools.sh
+         asiofi.sh
+         asio.sh
+         autotools.sh
+         boost.sh
+         bz2.sh
+         clang.sh
+         cmake.sh
+         dds.sh
+         defaults-release.sh
+         faircmakemodules.sh
+         fairlogger.sh
+         fairmq.sh
+         fairroot.sh
+         flatbuffers.sh
+         fmt.sh
+         freetype.sh
+         gcc-toolchain.sh
+         geant3.sh
+         geant4.sh
+         geant4_vmc.sh
+         generators.sh
+         gsl.sh
+         hepmc.sh
+         lhapdf.sh
+         libffi.sh
+         libpng.sh
+         libxml2.sh
+         lzma.sh
+         make.sh
+         ninja.sh
+         ofi.sh
+         opengl.sh
+         openssl.sh
+         protobuf.sh
+         pythia6.sh
+         pythia.sh
+         python-modules-list.sh
+         python-modules.sh
+         python.sh
+         root.sh
+         rsync.sh
+         simulation.sh
+         sqlite.sh
+         system-curl.sh
+         termcap.sh
+         uuid.sh
+         vgm.sh
+         xdevel.sh
+         xrootd.sh
+         yacc-like.sh
+         zeromq.sh
+         zlib.sh"
+
+CHANGED_FILES=0
+for script in $scripts
+do
+  DIFF=$(diff $script $TEMP_DIR/alidist/$script) 
+  if [ "$DIFF" != "" ]
+  then
+    mv $TEMP_DIR/$ALIDIST_DIR/$script $TEMP_DIR/$script
+    (( CHANGED_FILES++ ))
+  fi
+done
+
+rm -rf $TEMP_DIR/$ALIDIST_DIR
+
+if [[ $CHANGED_FILES == 0 ]]; then
+  echo "There are no changed files"
+else
+  echo "Files that changed:"
+  cd $TEMP_DIR
+  ls *.sh
+  cd ..
+fi
-- 
GitLab


From 210988b262a5302b4c78468217adc936008a3cf1 Mon Sep 17 00:00:00 2001
From: Jan Busa Jr <busa@jinr.ru>
Date: Wed, 24 Nov 2021 10:32:41 +0300
Subject: [PATCH 2/2] Little change in scripts logic. If no files were changed,
 remove temporary directory entirely.

---
 scripts/refreshAlidistMaster.sh | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/scripts/refreshAlidistMaster.sh b/scripts/refreshAlidistMaster.sh
index 949b53c..a2e8d0e 100755
--- a/scripts/refreshAlidistMaster.sh
+++ b/scripts/refreshAlidistMaster.sh
@@ -77,13 +77,14 @@ do
   fi
 done
 
-rm -rf $TEMP_DIR/$ALIDIST_DIR
-
 if [[ $CHANGED_FILES == 0 ]]; then
-  echo "There are no changed files"
+  rm -rf $TEMP_DIR
+  echo "There are no changed scripts."
 else
-  echo "Files that changed:"
+  rm -rf $TEMP_DIR/$ALIDIST_DIR
+  echo "All scripts that changed:"
   cd $TEMP_DIR
   ls *.sh
+  echo "can be found inside the directory $TEMP_DIR/"
   cd ..
 fi
-- 
GitLab