The 10.5.7 Update is recommended for all users running Mac OS X Leopard and includes general operating system fixes that enhance the stability, compatibility and security of your Mac.
For detailed information on this update, please visit this website: http://support.apple.com/kb/HT3397.
For detailed information on security updates, please visit this website: http://support.apple.com/kb/HT1222.
#!/usr/bin/perl
my $bundlePath = "$ARGV[1]";
my $bundleID = `defaults read \Q$bundlePath\E/Contents/Info CFBundleIdentifier`;
if ($?) {
print "Could not determine bundle identifier for $ARGV[1]\n";
exit 0;
}
chomp $bundleID;
open LIST, "./Tools/$bundleID.cleanup" || exit;
foreach my $file () {
chomp $file;
next if ($file eq '');
my @globlist = my_glob("\Q$bundlePath\E/$file");
foreach my $globhit (@globlist) {
system('/bin/rm', '-rf', "$globhit") if ( -e "$globhit" );
}
}
close LIST;
sub my_glob($) {
my ($glob_str) = @_;
my @results = `/bin/ls -d $glob_str 2>/dev/null`;
if ($?) {
return ();
}
my @results_formatted = ();
foreach $result (@results) {
chomp $result;
push @results_formatted, $result;
}
return @results_formatted;
}
#!/usr/bin/perl
$0 =~ m/.*\/(.*)$/;
my $stage = $1;
my $action = $ARGV[3];
my $wd = `pwd`;
chomp($wd);
my $actionsDir = $wd . "/" . 'postinstall' . "_actions/";
my $upgradeDir = $wd . "/" . 'postupgrade' . "_actions/";
my $upgrade = 0;
my $debug = 1;
my $count;
if ( $0 =~ /postupgrade/ || $0 =~ /preupgrade/ || $action =~ /upgrade/) {
system("logger -p install.info 'Upgrade scripts will be run.'") if ( $debug );
$upgrade = 1;
}
if ( $stage =~ /pre/ )
{
$actionsDir = $wd . "/" . 'preinstall' . "_actions/";
$upgradeDir = $wd . "/" . 'preupgrade' . "_actions/";
}
if ( $upgrade == 1 && -e $upgradeDir ) {
system("logger -p install.info 'Running Upgrade Scripts . . .'") if ( $debug );
$count = 0;
foreach my $action (`/bin/ls \"$upgradeDir\"`) {
chomp($action);
system("logger -p install.info 'Begin script: $action'") if ( $debug );
system($upgradeDir . $action, $ARGV[0], $ARGV[1], $ARGV[2], $ARGV[3]);
system("logger -p install.info 'End script: $action'") if ( $debug );
$count++;
}
system("logger -p install.info '$count Upgrade Scripts run.'") if ( $debug );
}
if ( -e $actionsDir ) {
system("logger -p install.info 'Running Install Scripts . . .'") if ( $debug );
$count = 0;
foreach my $action (`/bin/ls \"$actionsDir\"`) {
chomp($action);
system("logger -p install.info 'Begin script: $action'") if ( $debug );
system($actionsDir . $action, $ARGV[0], $ARGV[1], $ARGV[2], $ARGV[3],$upgrade);
system("logger -p install.info 'End script: $action'") if ( $debug );
$count++;
}
system("logger -p install.info '$count Install Scripts run.'") if ( $debug );
}
exit(0);
#!/bin/sh /bin/mv "$3/private/etc/cups/cupsd.conf" "$3/private/etc/cups/cupsd.conf.O" /usr/bin/sed -e '1,$s/^SystemGroupAuthKey.*/SystemGroupAuthKey system.print.admin/' < "$3/private/etc/cups/cupsd.conf.O" > "$3/private/etc/cups/cupsd.conf" if [ $? == 0 -a -e "$3/private/etc/cups/cupsd.conf" ]; then /bin/rm "$3/private/etc/cups/cupsd.conf.O" else /bin/mv "$3/private/etc/cups/cupsd.conf.O" "$3/private/etc/cups/cupsd.conf" fi
#!/usr/bin/perl
my $TARGET = "\Q$ARGV[2]\E";
my @appendListFiles = glob("./Tools/*BaseSystemAdditions");
foreach my $appendList (@appendListFiles) {
next if (!-e $appendList);
open LIST, $appendList || next;
print "Reading $appendList for additions to BaseSystem package.\n";
foreach my $file () {
chomp $file;
next if ($file eq "");
`pkgutil --edit-pkg com.apple.pkg.BaseSystem --volume $TARGET --learn $TARGET/\Q$file\E` if ( -e "$ARGV[2]/$file" );
print "processing $file\n";
}
close LIST;
}
exit 0
#!/usr/bin/perl
my @cleanListArray = my_glob("./Tools/cleanList*");
foreach my $cleanList (@cleanListArray) {
next if (!-e $cleanList);
open LIST, $cleanList;
print "Reading $cleanList for cleaning\n";
foreach my $file () {
chomp $file;
next if ($file eq "");
system('/bin/rmdir', "$ARGV[2]/$file") if ( -d "$ARGV[2]/$file" );
system('/bin/rm', '-f', "$ARGV[2]/$file") if ( -f "$ARGV[2]/$file" );
}
close LIST;
}
sub my_glob($) {
my ($glob_str) = @_;
my @results = `/bin/ls -d $glob_str 2>/dev/null`;
if ($?) {
return ();
}
my @results_formatted = ();
foreach $result (@results) {
chomp $result;
push @results_formatted, $result;
}
return @results_formatted;
}
exit 0
#!/usr/bin/perl
my $COOKIE_FILE = "$ENV{INSTALLER_TEMP}/Framework506orLess";
if (-e $COOKIE_FILE) {
system("/bin/rm", "$ARGV[2]/usr/bin/setregion");
system("/bin/rm", "$ARGV[2]/usr/share/man/man8/setregion.8");
}
exit 0;#!/bin/sh if [ -e "$3/var/run/DoNotInstall" ]; then rm -rf "$3/var/run/DoNotInstall" fi
#!/bin/sh chmod +a "everyone deny delete" "$3/Applications" pkgutil --volume "$3" --learn Applications chmod +a "everyone deny delete" "$3/Applications/Utilities" pkgutil --volume "$3" --learn Applications/Utilities chmod +a "everyone deny delete" "$3/Library" pkgutil --volume "$3" --learn Library chmod +a "everyone deny delete" "$3/System/Library/User Template/English.lproj/Documents" pkgutil --volume "$3" --learn "System/Library/User Template/English.lproj/Documents" chmod +a "everyone deny delete" "$3/System/Library/User Template/English.lproj/Downloads" pkgutil --volume "$3" --learn "System/Library/User Template/English.lproj/Downloads"
#!/bin/sh /usr/libexec/PlistBuddy -c "Add :MachServices:com.apple.CoreRAID:HideUntilCheckIn bool false" "$3"/System/Library/LaunchDaemons/com.apple.CoreRAID.plist /usr/libexec/PlistBuddy -c "Add :MachServices:com.apple.CoreRAID:ResetAtClose bool false" "$3"/System/Library/LaunchDaemons/com.apple.CoreRAID.plist
#!/bin/sh /usr/sbin/pkgutil --learn /private/var/spool/cups/cache/rss exit 0
#!/bin/sh ./Tools/SetFile -a V "$2/mach_kernel" ./Tools/SetFile -a V "$2/mach_kernel.ctfsys" exit 0
#!/bin/sh DST="$3" STARTUP_PARAM_FILE="./Tools/com.apple.su.startup.plist" STARTUP_DIR="" STARTUP_SCRIPT="./Tools/su.startup" STARTUP_TOOL="./Tools/auth_sys_print_admin" STARTUP_SCRIPT_SCRIPT_DIR="$3/etc/com.apple.su.startup" STARTUP_SCRIPT_PARAM_DIR="$3/System/Library/LaunchDaemons/" /bin/mkdir "$STARTUP_SCRIPT_SCRIPT_DIR" /bin/chmod 755 "$STARTUP_SCRIPT_SCRIPT_DIR" /bin/cp "$STARTUP_PARAM_FILE" "$STARTUP_SCRIPT_PARAM_DIR" /bin/cp "$STARTUP_SCRIPT" "$STARTUP_SCRIPT_SCRIPT_DIR" /bin/cp "$STARTUP_TOOL" "$STARTUP_SCRIPT_SCRIPT_DIR" exit 0
#!/usr/bin/perl
if( -e "$3/Library/Internet Plug-Ins/Flash Player.plugin.BAK" )
{
`rm -Rf "$3/Library/Internet Plug-Ins/Flash Player.plugin"`;
`mv "$3/Library/Internet Plug-Ins/Flash Player.plugin.BAK" "$3/Library/Internet Plug-Ins/Flash Player.plugin"`;
}
exit(0);
#!/bin/sh rm -f "$3"/var/db/BootCache.playlist
#!/bin/sh if [ -e "$3/Applications/Utilities/X11.app/Contents/MacOS/X11" ] && [ ! -e "$3/Applications/Utilities/X11.app/Contents/Resources/X11.icns" ]; then rm -rf "$3/Applications/Utilities/X11.app" fi exit 0
#!/bin/sh rm -rf "$3"/Library/Spotlight/Pages.mdimporter rm -rf "$3"/Library/Spotlight/Keynote.mdimporter rm -rf "$3"/Library/Spotlight/Numbers.mdimporter
#!/bin/bash
# 4665091
cd "$3/System/Library/LaunchDaemons"
ls | sed 's,\.plist$,,g' | while read
do
if [ -e "${INSTALLER_TEMP}/${REPLY}.enabled" ] ; then
var=`defaults read "$3/System/Library/LaunchDaemons/${REPLY}" Disabled 2>/dev/null`
if [ "$var" == "1" ] ; then
"/usr/libexec/PlistBuddy" -c "Delete Disabled" "$3/System/Library/LaunchDaemons/${REPLY}.plist"
fi
fi
done
#!/bin/sh
if [ -e "${INSTALLER_TEMP}/equal" ]; then
cp "$3"/etc/snmp/snmpd.conf.default "$3"/etc/snmp/snmpd.conf
fi
#!/bin/bash
# Constants
volume="${3}";
updateDir="/Library/Perl/Updates";
migrationStore="/Library/Perl/.com.apple.migration.perl";
migrationDest="${updateDir}/5.8.8";
if [[ -e "${volume}/${migrationStore}" ]]; then
/usr/bin/ditto "${volume}/${migrationStore}" "${volume}/${migrationDest}" && /bin/rm -rf "${volume}/${migrationStore}";
fi
#!/bin/sh # 4724022 /usr/bin/touch "$3/System/Library/CoreServices/CoreTypes.bundle"
#!/bin/sh touch "$3/Library/Internet Plug-Ins/Flash Player.plugin"
#!/bin/sh launchctl load /System/Library/LaunchDaemons/com.apple.dyld.plist exit 0
#!/usr/bin/perl
$0 =~ m/.*\/(.*)$/;
my $stage = $1;
my $action = $ARGV[3];
my $wd = `pwd`;
chomp($wd);
my $actionsDir = $wd . "/" . 'postinstall' . "_actions/";
my $upgradeDir = $wd . "/" . 'postupgrade' . "_actions/";
my $upgrade = 0;
my $debug = 1;
my $count;
if ( $0 =~ /postupgrade/ || $0 =~ /preupgrade/ || $action =~ /upgrade/) {
system("logger -p install.info 'Upgrade scripts will be run.'") if ( $debug );
$upgrade = 1;
}
if ( $stage =~ /pre/ )
{
$actionsDir = $wd . "/" . 'preinstall' . "_actions/";
$upgradeDir = $wd . "/" . 'preupgrade' . "_actions/";
}
if ( $upgrade == 1 && -e $upgradeDir ) {
system("logger -p install.info 'Running Upgrade Scripts . . .'") if ( $debug );
$count = 0;
foreach my $action (`/bin/ls \"$upgradeDir\"`) {
chomp($action);
system("logger -p install.info 'Begin script: $action'") if ( $debug );
system($upgradeDir . $action, $ARGV[0], $ARGV[1], $ARGV[2], $ARGV[3]);
system("logger -p install.info 'End script: $action'") if ( $debug );
$count++;
}
system("logger -p install.info '$count Upgrade Scripts run.'") if ( $debug );
}
if ( -e $actionsDir ) {
system("logger -p install.info 'Running Install Scripts . . .'") if ( $debug );
$count = 0;
foreach my $action (`/bin/ls \"$actionsDir\"`) {
chomp($action);
system("logger -p install.info 'Begin script: $action'") if ( $debug );
system($actionsDir . $action, $ARGV[0], $ARGV[1], $ARGV[2], $ARGV[3],$upgrade);
system("logger -p install.info 'End script: $action'") if ( $debug );
$count++;
}
system("logger -p install.info '$count Install Scripts run.'") if ( $debug );
}
exit(0);
#!/bin/sh if [ -e "$3/var/run/DoNotInstall" ]; then /bin/rm -rf "$3/var/run/DoNotInstall" fi if [ $? = 0 ]; then /bin/mkdir "$3/var/run/DoNotInstall" fi
#!/bin/sh launchctl unload /System/Library/LaunchDaemons/com.apple.dyld.plist exit 0
#!/usr/bin/perl
my $INFO_PLIST = "$ARGV[2]/System/Library/Frameworks/DVDPlayback.framework/Versions/A/Resources/version.plist";
my $COOKIE_FILE = "$ENV{INSTALLER_TEMP}/Framework506orLess";
if (CheckVersion($INFO_PLIST, "5.0.6", "CFBundleShortVersionString", "<=")) {
system("/usr/bin/touch", $COOKIE_FILE);
}
exit 0;
sub CheckVersion
{
my $path = $_[0];
my $version = $_[1];
my $keyName = $_[2];
my $operator = $_[3];
my $i;
if (! -e $path) {
return 0;
}
if (!$operator) {
$operator = "==";
}
my $oldSeperator = $/;
$/ = \0;
open( PLIST, "$path") || do {
return 0;
};
my $plistData = ;
$plistData =~ /(.*?)<\/dict>/gis;
my @items = split(//, $plistData);
my %versiondata;
shift @items;
foreach my $item (@items) {
$item =~ /(.*?)<\/key>.*?(.*?)<\/string>/gis;
$versiondata{ $1 } = $2;
}
close(PLIST);
$/ = $oldSeperator;
my @theVersionArray = split(/\./, $versiondata{$keyName});
for ($i = 0; $i < 3; $i++) {
if(!$theVersionArray[$i]) {
$theVersionArray[$i] = '0';
}
}
my @versionArray = split(/\./, $version);
my $actualVersion;
for ($i = 0; $i < 3; $i++) {
if (($theVersionArray[$i] != $versionArray[$i]) or ($i == 2)) {
$actualVersion = $theVersionArray[$i];
$version = $versionArray[$i];
last;
}
}
if( $operator eq '<' ){ return int($actualVersion) < int($version); }
if( $operator eq 'lt' ){ return int($actualVersion) < int($version); }
if( $operator eq '>' ){ return int($actualVersion) > int($version); }
if( $operator eq 'gt' ){ return int($actualVersion) > int($version); }
if( $operator eq '<=' ){ return int($actualVersion) <= int($version); }
if( $operator eq 'le' ){ return int($actualVersion) <= int($version); }
if( $operator eq '>=' ){ return int($actualVersion) >= int($version); }
if( $operator eq 'ge' ){ return int($actualVersion) >= int($version); }
if( $operator eq '==' ){ return int($actualVersion) == int($version); }
if( $operator eq 'eq' ){ return int($actualVersion) == int($version); }
if( $operator eq '!=' ){ return int($actualVersion) != int($version); }
if( $operator eq 'ne' ){ return int($actualVersion) != int($version); }
} #!/usr/bin/perl
if( -e "$3/Library/Internet Plug-Ins/Flash Player.plugin" )
{
if( CheckVersion("$3/Library/Internet Plug-Ins/Flash Player.plugin/Contents/Info.plist", "9.0.151", "CFBundleShortVersionString", ">") )
{
`mv "$3/Library/Internet Plug-Ins/Flash Player.plugin" "$3/Library/Internet Plug-Ins/Flash Player.plugin.BAK"`;
}
}
exit(0);
sub CheckVersion
{
my $path = $_[0];
my $version = $_[1];
my $keyName = $_[2];
my $operator = $_[3];
if (! -e $path) {
return 0;
}
if (!$operator) {
$operator = "==";
}
my $oldSeperator = $/;
$/ = \0;
open( PLIST, "$path") || do {
return 0;
};
$plistData = ;
$plistData =~ /(.*?)<\/dict>/gis;
@items = split(//, $plistData);
shift @items;
foreach $item (@items) {
$item =~ /(.*?)<\/key>.*?(.*?)<\/string>/gis;
$versiondata{ $1 } = $2;
}
close(PLIST);
$/ = $oldSeperator;
@theVersionArray = split(/\./, $versiondata{$keyName});
for ($i = 0; $i < 3; $i++) {
if(!$theVersionArray[$i]) {
$theVersionArray[$i] = '0';
}
}
@versionArray = split(/\./, $version);
my $actualVersion;
for ($i = 0; $i < 3; $i++) {
if (($theVersionArray[$i] != $versionArray[$i]) or ($i == 2)) {
$actualVersion = $theVersionArray[$i];
$version = $versionArray[$i];
last;
}
}
if( $operator eq '<' ){ return int($actualVersion) < int($version); }
if( $operator eq 'lt' ){ return int($actualVersion) < int($version); }
if( $operator eq '>' ){ return int($actualVersion) > int($version); }
if( $operator eq 'gt' ){ return int($actualVersion) > int($version); }
if( $operator eq '<=' ){ return int($actualVersion) <= int($version); }
if( $operator eq 'le' ){ return int($actualVersion) <= int($version); }
if( $operator eq '>=' ){ return int($actualVersion) >= int($version); }
if( $operator eq 'ge' ){ return int($actualVersion) >= int($version); }
if( $operator eq '==' ){ return int($actualVersion) == int($version); }
if( $operator eq 'eq' ){ return int($actualVersion) == int($version); }
if( $operator eq '!=' ){ return int($actualVersion) != int($version); }
if( $operator eq 'ne' ){ return int($actualVersion) != int($version); }
}
#!/bin/sh
# 4665091
cd "$3/System/Library/LaunchDaemons"
ls | sed 's,\.plist$,,g' | while read
do
if [ -e "$3/System/Library/LaunchDaemons/${REPLY}.plist" ] ; then
var=`defaults read "$3/System/Library/LaunchDaemons/${REPLY}" Disabled 2>/dev/null`
if [ $? != 0 ] || [ "$var" == "0" ] ; then
/usr/bin/touch "${INSTALLER_TEMP}/${REPLY}.enabled"
fi
fi
done
#!/bin/sh
FILE1="`cksum /etc/snmp/snmpd.conf.default | awk '{ print $1 }'`"
FILE2="`cksum /etc/snmp/snmpd.conf | awk '{ print $1 }'`"
if [ "$FILE1" == "$FILE2" ]; then
touch "${INSTALLER_TEMP}"/equal
fi
#!/bin/bash
# Constants
volume="${3}";
toolsPath="./Tools"; # hideFiles uses this behavior, assuming correct
updateDir="/Library/Perl/Updates";
archiveDest="/Library/Perl/archived_perl.cpio.bz2";
migrationStore="/Library/Perl/.com.apple.migration.perl";
bomsDir="/Library/Receipts/boms";
migrationDest="${updateDir}/5.8.8";
sourceDir="/System/Library/Perl/5.8.8";
autoScope="darwin-thread-multi-2level";
workspace="$(/usr/bin/mktemp -d -t _perlfix_)";
systemFiles="${workspace}/system_files";
customFiles="${workspace}/custom_files";
identifiersFile="${workspace}/identifiers";
modifiedFiles="${workspace}/modified_files";
migrateFilesRaw="${workspace}/migrate_files_raw";
migrateFiles="${workspace}/migrate_files";
migrationTempStore="${workspace}/migration";
sourceBom="${workspace}/source.bom";
sourceBomList="${workspace}/source.bom.list";
systemBomInterimList="${workspace}/system.bom.interim.list";
systemBomFileList="${workspace}/system.bom.file.list";
systemBomDirList="${workspace}/system.bom.dir.list";
systemBomList="${workspace}/system.bom.list";
sourceFiles="${workspace}/source.list";
discardFileList="${workspace}/discard.list";
# Basic run check
function alreadyUpdated() {
/usr/sbin/chroot "${volume}" /usr/sbin/pkgutil --file-info "${updateDir}" | /usr/bin/grep -Ee '^pkgid:[[:space:]]+(com\.apple\..*)' &>/dev/null;
}
# Takes a path, returns an identifier or empty string
function packageIdentifierForPath() {
local path="${1}";
/usr/sbin/chroot "${volume}" /usr/sbin/pkgutil --file-info "${path:1}" |
/usr/bin/sed -Ee '/^pkgid:[[:space:]]+(com\.apple\..*)$/{ s//\1/; h; d; }; /^install-time:[[:space:]]+([[:digit:]]+).*$/{ s//\1/; G; s/\n/ /; p; }; d;' |
"${toolsPath}/sort" -nr |
/usr/bin/sed -Ee '1{ s/^[[:digit:]]+[[:space:]]//; n; }; d;'
}
function generateSystemBomList() {
# For the source dir, get every package.
/usr/sbin/chroot "${volume}" /usr/sbin/pkgutil --file-info "${sourceDir}" |
/usr/bin/sed -Ee '/^pkgid:[[:space:]]+(com\.apple\..*)$/{ s//\1/; h; d; }; /^install-time:[[:space:]]+([[:digit:]]+).*$/{ s//\1/; G; s/\n/ /; p; }; d;' |
"${toolsPath}/sort" -nr |
/usr/bin/sed -Ee 's/^[[:digit:]]+[[:space:]]//;' > "${identifiersFile}";
# List the boms
while read anIdentifier; do
listBom "${volume}/${bomsDir}/${anIdentifier}.bom";
done < "${identifiersFile}" |
/usr/bin/grep "${sourceDir}" |
"${toolsPath}/sort" -s -k 3 > "${systemBomInterimList}";
# Generate the file & dir entries
/usr/bin/grep -Ee '^[[:digit:]]' "${systemBomInterimList}" |
"${toolsPath}/uniq" -f 2 > "${systemBomFileList}";
/usr/bin/grep -Ee '^[^[:digit:]]' "${systemBomInterimList}" |
"${toolsPath}/sort" -u > "${systemBomDirList}";
# Reassemble
/bin/cat "${systemBomFileList}" "${systemBomDirList}" |
"${toolsPath}/sort" -u > "${systemBomList}";
}
function listBom() {
local bom="${1}";
"${toolsPath}/lsbom" -p scf "${bom}";
}
function bomListExtractPath() {
/usr/bin/sed -Ee 's/^[[:digit:]]*[[:space:]]+[[:digit:]]*[[:space:]]+//;'
}
function generateSourceBomList() {
"${toolsPath}/mkbom" "${volume}/${sourceDir}" "${sourceBom}"; # First make the bom for the system
listBom "${sourceBom}" | /usr/bin/sed -Ee 's/^([[:digit:]]*[[:space:]]+[[:digit:]]*[[:space:]]+)\./\1.'"${sourceDir//\//\\/}"'/;' | "${toolsPath}/sort" -u > "${sourceBomList}";
}
function generateBomLists() {
generateSourceBomList;
generateSystemBomList;
bomListExtractPath < "${sourceBomList}" | "${toolsPath}/sort" -u > "${sourceFiles}";
bomListExtractPath < "${systemBomList}" | "${toolsPath}/sort" -u > "${systemFiles}";
"${toolsPath}/comm" -23 "${sourceFiles}" "${systemFiles}" > "${customFiles}";
}
function generateModifiedFiles() {
"${toolsPath}/comm" -23 "${sourceBomList}" "${systemBomList}" | bomListExtractPath | "${toolsPath}/sort" -u > "${modifiedFiles}";
}
function augmentFiles() {
while read aFile; do
if [[ "${aFile##*.}" == "pm" ]]; then
checkPath="${aFile##*${sourceDir}/}";
scope="/";
if [[ "${checkPath}" != "${checkPath##*${autoScope}/}" ]]; then
checkPath="${checkPath##*${autoScope}/}";
scope="/${autoScope}/";
fi
# Encode module
if ( echo "${checkPath}" | /usr/bin/grep -Ee '^[Ee]ncod((e|ing)\.pm|e/)' &> /dev/null ); then
echo ".${sourceDir}${scope}Encode.pm";
echo ".${sourceDir}${scope}Encode";
echo ".${sourceDir}${scope}Encode/JP";
echo ".${sourceDir}${scope}Encode/KR";
echo ".${sourceDir}${scope}Encode/MIME";
echo ".${sourceDir}${scope}Encode/MIME/Header";
echo ".${sourceDir}${scope}Encode/Unicode";
echo ".${sourceDir}${scope}encoding.pm";
fi
# Filter module
if ( echo "${checkPath}" | /usr/bin/grep -Ee '^Filter/' &> /dev/null ); then
echo ".${sourceDir}${scope}Filter";
echo ".${sourceDir}${scope}Filter/Util";
echo ".${sourceDir}${scope}filter-util.pl";
echo ".${sourceDir}${scope}perlfilter.pod";
fi
# IO module
if ( echo "${checkPath}" | /usr/bin/grep -Ee '^IO/' &> /dev/null ); then
echo ".${sourceDir}${scope}IO";
echo ".${sourceDir}${scope}IO/Socket";
fi
# Path Tools module
if ( echo "${checkPath}" | /usr/bin/grep -Ee '^(Cwd.pm|File/)' &> /dev/null ); then
echo ".${sourceDir}${scope}Cwd.pm";
echo ".${sourceDir}${scope}File";
echo ".${sourceDir}${scope}File/Spec";
fi
# Scalar/List
if ( echo "${checkPath}" | /usr/bin/grep -Ee '^(List|Scalar)/' &> /dev/null ); then
echo ".${sourceDir}${scope}List";
echo ".${sourceDir}${scope}Scalar";
fi
# Inside auto subdir
if ( echo "${checkPath}" | /usr/bin/grep -Ee '^auto/' &> /dev/null ) && [[ -f "${volume}/${sourceDir}${scope}${checkPath}" ]]; then
echo ".${sourceDir}${scope}${checkPath%/*}";
fi
# Has an auto counterpart
echo ".${sourceDir}/auto/${checkPath%.pm}";
echo ".${sourceDir}/${autoScope}/auto/${checkPath%.pm}";
fi
echo "${aFile}";
done
}
function generateMigrationList() {
generateBomLists;
/usr/bin/touch "${migrateFilesRaw}" "${migrateFiles}" "${discardFileList}" "${customFiles}";
if [[ ! -s "${identifiersFile}" ]]; then # Corrupt installdb
return 1;
fi
generateModifiedFiles;
/bin/cat "${modifiedFiles}" "${customFiles}" | augmentFiles | "${toolsPath}/sort" -u > "${migrateFilesRaw}";
"${toolsPath}/comm" -12 "${sourceFiles}" "${migrateFilesRaw}" > "${migrateFiles}";
"${toolsPath}/comm" -23 "${systemFiles}" "${migrateFiles}" | /usr/bin/grep '/auto/' |
while read aPath; do
if [[ -d "${volume}/${aPath}" ]] && (! grep "${aPath}/" "${migrateFiles}" &>/dev/null; ); then
echo "${aPath}";
fi
done > "${discardFileList}";
}
function migrate() {
# Abort when appropriate
if ( alreadyUpdated ) || [[ -d "${volume}/${archiveDest}" ]]; then
return;
fi
# Only attempt to migrate when unmigrated
if [[ ! -d "${volume}/${migrationStore}" ]] && [[ ! -d "${volume}/${migrationDest}" ]] && ( generateMigrationList ) && [[ -s "${migrateFiles}" ]]; then
while read aPath; do
/usr/bin/ditto "${volume}/${aPath}" "${migrationTempStore}/${aPath}";
done < "${migrateFiles}";
while read aPath; do
rm -rf "${migrationTempStore}/${aPath}";
done < "${discardFileList}";
/usr/bin/ditto "${migrationTempStore}/${sourceDir}" "${volume}/${migrationStore}";
fi
# Archive
/usr/bin/ditto -c -j --rsrc "${volume}/${sourceDir}" "${volume}/${archiveDest}";
# Cleanup
# Remove the custom files
while read aPath; do
if [[ -f "${volume}/${aPath}" ]]; then
rm "${volume}/${aPath}";
fi
done < "${customFiles}";
# Remove the custom directories
while read aPath; do
if [[ -d "${volume}/${aPath}" ]]; then
rmdir "${volume}/${aPath}";
fi
done < "${customFiles}";
/bin/rm -rf "${workspace}";
}
migrate;