Chameleon

Chameleon Commit Details

Date:2012-01-10 20:12:58 (12 years 3 months ago)
Author:JrCs
Commit:1787
Parents: 1786
Message:Some small modifications on installer scripts
Changes:
M/trunk/package/Scripts.templates/Pre/preinstall
M/trunk/package/buildpkg.sh

File differences

trunk/package/Scripts.templates/Pre/preinstall
77
88
99
10
10
1111
1212
13
13
1414
1515
1616
1717
18
19
2018
2119
2220
......
4139
4240
4341
44
45
42
43
44
45
4646
47
48
4947
5048
49
5150
5251
5352
......
6261
6362
6463
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
64
65
66
67
8168
69
70
71
72
73
74
75
8276
8377
8478
echo ""
# Creates text file named '@LOG_FILENAME@'
# at the root of the target volume. This is to give the user
# at the root of the target volume. This is to give the user
# a record of the installation process and also to show why
# possibly the installation process failed (even though the
# package installer ends reading 'Installation Successful'.
# package installer ends reading 'Installation Successful').
# This script also prepares, then backs up any previous
# stage2 boot file, /Extra folder and install log if they exist.
# Find location of this script in the package installer
# so we know where all the other scripts are located.
# Preparing Backing up of Chameleon files
# ---------------------------------------------
backupDir="${targetVolume}/Chameleon.Backups/"$( date -j "+%F-%Hh%M" )
if [[ -f "$logFile" ]];then
# Only make backupDir if required
# Only make backupDir if required
if [[ ! -d "$backupDir" && \
( -f "$logFile" || -f "${targetVolume}/boot" || -d "${targetVolume}/Extra" ) ]];then
mkdir -p "$backupDir"
# Backup old log file
mv "$logFile" "${backupDir}/${logName}"
fi
[[ -f "$logFile" ]] && mv "$logFile" "${backupDir}/${logName}" # Backup old log file
# Setup Chameleon Log file
# by writing header and diskutil list
# ---------------------------------------------
# Backing up Chameleon files
# ---------------------------------------------
if [[ -f "${targetVolume}/boot" ]] || [[ -d "${targetVolume}/Extra" ]];then
if [[ ! -d "$backupDir" ]];then
mkdir -p "$backupDir"
fi
# Backup stage2
if [[ -f "${targetVolume}/boot" ]];then
echo "Backing up stage2 file ${targetVolume}/boot to ${backupDir}/boot" >>"${logFile}"
cp -p "${targetVolume}/boot" "${backupDir}/boot"
fi
# Backup /Extra directory
if [[ -d "${targetVolume}/Extra" ]];then
echo "Moving ${targetVolume}/Extra folder to ${backupDir}/Extra" >>"${logFile}"
cp -pR "${targetVolume}/Extra" "${backupDir}/Extra"
fi
chflags -R nohidden "$backupDir" # Remove the invisible flag of files in the backups
echo "======================================================" >>"${logFile}"
# Backup stage2
if [[ -f "${targetVolume}/boot" ]];then
echo "Backing up stage2 file ${targetVolume}/boot to ${backupDir}/boot" >>"${logFile}"
cp -p "${targetVolume}/boot" "${backupDir}/boot"
fi
# Backup /Extra directory
if [[ -d "${targetVolume}/Extra" ]];then
echo "Moving ${targetVolume}/Extra folder to ${backupDir}/Extra" >>"${logFile}"
cp -pR "${targetVolume}/Extra" "${backupDir}/Extra"
fi
chflags -R nohidden "$backupDir" # Remove the invisible flag of files in the backups
echo "======================================================" >>"${logFile}"
echo "==============================================="
echo "END - Pre-Install Script"
trunk/package/buildpkg.sh
166166
167167
168168
169
170
171
172
173
169
170
171
174172
175173
176174
$ownSubst"
for file in "$@";do
if [[ ! $file == *.svn* ]]; then
cp -pf "$file" "${file}.in"
sed "$allSubst" "${file}.in" > "${file}"
rm -f "${file}.in"
fi
cp -pf "$file" "${file}.in"
sed "$allSubst" "${file}.in" > "${file}"
rm -f "${file}.in"
done
}

Archive Download the corresponding diff file

Revision: 1787