summarylogtreecommitdiffstats
path: root/geant4.install
diff options
context:
space:
mode:
Diffstat (limited to 'geant4.install')
-rw-r--r--geant4.install49
1 files changed, 49 insertions, 0 deletions
diff --git a/geant4.install b/geant4.install
new file mode 100644
index 000000000000..970c6c17090f
--- /dev/null
+++ b/geant4.install
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+_init() {
+ variables=("G4LEDATA" \
+ "G4LEVELGAMMADATA" \
+ "G4NEUTRONHPDATA" \
+ "G4NEUTRONXSDATA" \
+ "G4PIIDATA" \
+ "G4RADIOACTIVEDATA" \
+ "G4REALSURFACEDATA" \
+ "G4SAIDXSDATA" \
+ "G4ABLADATA" )
+
+shell=("sh" "csh")
+
+existing="existing"
+path="/etc/profile.d"
+}
+_clean(){
+ for _ext in ${shell[*]}
+ do
+ rm -f $existing.${_ext}
+ done
+}
+_read() {
+ _init
+ for _varname in ${variables[*]}
+ do
+ for _ext in ${shell[*]}
+ do
+ sed -n /${_varname}/p ${path}/geant4.${_ext} >> $existing.${_ext}
+ done
+ done
+}
+_keep() {
+ _init
+ for _ext in ${shell[*]}
+ do
+ cat $existing.${_ext} >> ${path}/geant4.${_ext}
+ done
+ _clean
+}
+
+pre_upgrade() {
+ _read
+}
+post_upgrade() {
+ _keep
+}