7 Commits
1.2.9 ... 1.3.0

3 changed files with 157 additions and 64 deletions

View File

@@ -36,6 +36,22 @@ adtproDir=$commDir/ADTPro
gsosURL="http://download.info.apple.com/Apple_Support_Area/Apple_Software_Updates/English-North_American/Apple_II/Apple_IIGS_System_6.0.1/"
gsosBackupURL="http://archive.org/download/download.info.apple.com.2012.11/download.info.apple.com.2012.11.zip/download.info.apple.com%2FApple_Support_Area%2FApple_Software_Updates%2FEnglish-North_American%2FApple_II%2FApple_IIGS_System_6.0.1%2F"
cpAD () {
# copy a file with its AppleDouble component in ./.AppleDouble
# arg1 = source path, # arg2 = destination directory (not filename)
afpsync=
if [[ $1 == "-s" ]]; then
afpsync=1
shift
fi
arg1="$1"
[[ "$arg1" == *"/"* ]] || arg1="./$arg1"
cp -p "$arg1" "$2"
mkdir -p "$2"/.AppleDouble
cp -p "${arg1%/*}"/.AppleDouble/"${arg1##*/}" "$2"/.AppleDouble
[[ $afpsync ]] && afpsync -v > /dev/null
}
updateP8YearTables () {
# Geoff Body and Andrew Roughan helped Joseph Carter with this one
# Update ProDOS 8 year table (and spalsh date because may as well)
@@ -51,15 +67,6 @@ updateP8YearTables () {
cd "$wd"
}
cpAD () {
# copy a file with its AppleDouble component in ./.AppleDouble
# arg1 = source path, # arg2 = destination directory (not filename)
cp -p "$1" "$2"
mkdir -p "$2"/.AppleDouble
cp -p "${1%/*}"/.AppleDouble/"${1##*/}" "$2"/.AppleDouble
[[ $3 == "-s" ]] && afpsync -v > /dev/null
}
# bail out on automated netboot setup unless -b is also specified
[[ -f /tmp/a2server-autoAnswerYes ]] && autoAnswerYes=1 || autoAnswerYes=
if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then
@@ -558,16 +565,19 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then
if [[ -f $spectrumDir/Spectrum ]]; then
echo " is already installed."
else
mkdir -p $spectrumDir
echo
mkdir -p $spectrumDir
# remove images that might have been installed by 1.2.5
cd $spectrumDir
rm SPECTRUM.HDV MANUALS.HDV SOUNDS.HDV EXTRAS.HDV &> /dev/null
# install Spectrum into GS/OS
mkdir -p /tmp/netboot/spectrum
cd /tmp/netboot/spectrum
# install Spectrum into GS/OS
if [[ $useExternalURL ]]; then
wget -qO spectrum_gold_2mg.zip http://www.speccie.co.uk/speccie/software/spectrum_gold_2mg.zip
unzip -p spectrum_gold_2mg.zip 2> /dev/null | dd bs=64 skip=1 of=Spectrum.Gold.HDV 2> /dev/null
fi
if [[ ! -f Spectrum.Gold.2mg ]]; then
if [[ ! -f Spectrum.Gold.HDV || $(wc -c < Spectrum.Gold.HDV) -eq 0 ]]; then
wget -qO spectrum_gold_2mg.zip ${binaryURL}external/appleii/spectrum_gold_2mg.zip
unzip -p spectrum_gold_2mg.zip 2> /dev/null | dd bs=64 skip=1 of=Spectrum.Gold.HDV 2> /dev/null
fi
@@ -591,9 +601,69 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then
mkdir -p $gsosDir/"${thisFolder##*^}"/.AppleDouble
cp -R Spectrum.Gold/${thisFolder%%^*}/.AppleDouble/* $gsosDir/"${thisFolder##*^}"/.AppleDouble
done
mv Spectrum.Gold/Installer/SoundPatch Spectrum.Gold/Spectrum.2.5.4/Spectrum $spectrumDir
mkdir -p $spectrumDir/.AppleDouble
mv Spectrum.Gold/Installer/.AppleDouble/SoundPatch Spectrum.Gold/Spectrum.2.5.4/.AppleDouble/Spectrum $spectrumDir/.AppleDouble
cpAD Spectrum.Gold/Installer/SoundPatch $spectrumDir
cpAD Spectrum.Gold/Spectrum.2.5.4/Spectrum $spectrumDir
afpsync -v $gsosDir > /dev/null
fi
echo -n "Marinetti 3.0b8"
if [[ -f $gsosDir/System/CDevs/TCPIP ]]; then
echo " is already installed."
else
echo
mkdir -p /tmp/netboot/marinetti
cd /tmp/netboot/marinetti
# Marinetti 3.0b1
wget -qO MarinettiB1.SHK ${binaryURL}appleii/MarinettiB1.SHK
cppo -ad -s -n MarinettiB1.SHK $gsosDir > /dev/null
# TCP/IP update (3.0b8)
if [[ $useExternalURL ]]; then
wget -qO Marinetti3.0b8.po http://www.a2retrosystems.com/downloads/Marinetti3.0b8.po
fi
if [[ $? != 0 || ! -f Marinetti3.0b8.po || $(wc -c < Marinetti3.0b8.po) != "819200" ]]; then
wget -qO Marinetti3.0b8.po ${binaryURL}external/appleii/Marinetti3.0b8.po
fi
cppo -ad Marinetti3.0b8.po /MARINETTI3.0B8/TCPIP $gsosDir/System/System.Setup > /dev/null
cppo -ad Marinetti3.0b8.po /MARINETTI3.0B8/CHANGELOG.3.0B8 $commDir/Marinetti > /dev/null
# PPP Scripted Link Layer update (1.3d4)
if [[ $useExternalURL ]]; then
wget -qO PPPX.1.3d4.SHK http://www.apple2.org/marinetti/PPPX.1.3d4.SHK
fi
if [[ $? != 0 || ! -f PPPX.1.3d4.SHK || $(wc -c < PPPX.1.3d4.SHK) != "22068" ]]; then
wget -qO PPPX.1.3d4.SHK ${binaryURL}external/appleii/PPPX.1.3d4.SHK
fi
cppo -ad -s PPPX.1.3d4.SHK . &> /dev/null
cd PPPX.1.3d4
cpAD PPP.scripted $gsosDir/System/TCPIP
cpAD PPP.Script.DOC $commDir/Marinetti/Documentation
mkdir -p $commDir/Marinetti/PPP.scripted
cpAD Connect.Script $commDir/Marinetti/PPP.scripted
cpAD ChangeLog $commDir/Marinetti/PPP.scripted
# Uthernet Link Layer
if [[ $useExternalURL ]]; then
wget -qO uthernetll.bxy http://www.speccie.co.uk/speccie/software/uthernetll.bxy
fi
if [[ $? != 0 || ! -f uthernetll.bxy || $(wc -c < uthernetll.bxy) -eq 0 ]]; then
wget -qO uthernetll.bxy ${binaryURL}external/appleii/uthernetll.bxy
fi
cppo -ad -s -n uthernetll.bxy $gsosDir/System/TCPIP > /dev/null
# Uthernet II Link Layer
if [[ $useExternalURL ]]; then
wget -qO uthernet2ll.bxy http://www.speccie.co.uk/speccie/software/uthernet2ll.bxy
fi
if [[ $? != 0 || ! -f uthernet2ll.bxy || $(wc -c < uthernet2ll.bxy) -eq 0 ]]; then
wget -qO uthernet2ll.bxy ${binaryURL}external/appleii/uthernet2ll.bxy
fi
cppo -ad -s -n uthernet2ll.bxy $gsosDir/System/TCPIP > /dev/null
# MacIP Link Layer settings for A2SERVER
wget -qO- ${binaryURL}macip-prefs.tgz | tar Pxz
afpsync -v $gsosDir > /dev/null
fi
fi
@@ -603,13 +673,13 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then
if [[ -f $protermDir/PROTERM ]]; then
echo " are already installed."
else
echo
mkdir -p $protermDir
mkdir -p $protermDir/.AppleDouble
mkdir -p $zlinkDir
mkdir -p $zlinkDir/.AppleDouble
echo
cd /tmp/netboot
wget -qO A2CLOUD.HDV "${binaryURL}A2CLOUD.HDV"
wget -qO A2CLOUD.HDV "${binaryURL}appleii/A2CLOUD.HDV"
cppo -ad A2CLOUD.HDV . &> /dev/null
cd A2CLOUD
mv *PT3* *PROTERM* $protermDir
@@ -660,7 +730,7 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then
if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then
# Farallon bridge patch for GS/OS courtesy of Geoff Body
echo "A2SERVER: Downloading Farallon bridge patch..."
wget -O /tmp/FARALLON.PO "${binaryURL}FARALLON.B1.PO" &> /dev/null
wget -qO /tmp/FARALLON.PO "${binaryURL}appleii/FARALLON.B1.PO" &> /dev/null
if [[ -d $gsosDir/SYSTEM/SYSTEM.SETUP ]]; then
cppo -s -ad /tmp/FARALLON.PO /ATALKPATCH/ATALKIRQ $gsosDir/SYSTEM/SYSTEM.SETUP &> /dev/null
echo

View File

@@ -2,12 +2,11 @@
# vim: set tabstop=4 shiftwidth=4 expandtab filetype=python:
"""cppo: Copy/catalog files from a ProDOS/DOS 3.3/ShrinkIt image/archive.
copy all files:
cppo [options] imagefile target_directory
copy one file:
cppo [options] imagefile /extract/path target_path
catalog image:
cppo -cat [options] imagefile
copy all files: cppo [options] imagefile target_directory
copy one file : cppo [options] imagefile /extract/path target_path
catalog image : cppo -cat [options] imagefile
options:
-shk: ShrinkIt archive as source (also auto-enabled by filename).
-ad : Netatalk-compatible AppleDouble metadata files and resource forks.
@@ -20,9 +19,9 @@ options:
"MY FILENAME" (DOS 3.3 image source)
Dir:SubDir:FileName (ShrinkIt archive source)
+ after a file name indicates a GS/OS or Mac OS extended (forked) file.
Wildcard matching (*) is not supported and images are not validated.
ShrinkIt support requires Nulib2. cppo requires Python 2.6+ or 3.0+.
"""
ShrinkIt support requires Nulib2. cppo requires Python 2.6+ or 3.0+."""
# cppo by Ivan X, ivan@ivanx.com, ivanx.com/appleii
@@ -75,14 +74,15 @@ g.imageFile = None
g.extractFile = None
# runtime options
g.AD = 0 # -ad (AppleDouble headers + resource forks)
g.EX = 0 # -e (extended filenames + resource forks)
g.DIR = 0 # -cat (catalog only, no extract)
g.UC = 0 # -uc (GS/OS mixed case filenames extract as uppercase)
g.SHK = 0 # -shk (ShrinkIt archive source)
g.D33 = 0 # (DOS 3.3 image source, selected automatically)
g.PNAME = 0 # -pro (adapt DOS 3.3 names to ProDOS)
g.nomsg = 0 # -s (suppress afpsync message at end)
g.AD = 0 # -ad (AppleDouble headers + resource forks)
g.EX = 0 # -e (extended filenames + resource forks)
g.CAT = 0 # -cat (catalog only, no extract)
g.UC = 0 # -uc (GS/OS mixed case filenames extract as uppercase)
g.SHK = 0 # -shk (ShrinkIt archive source)
g.PNAME = 0 # -pro (adapt DOS 3.3 names to ProDOS)
g.nomsg = 0 # -s (suppress afpsync message at end)
g.nodir = 0 # -n (don't create parent dir for SHK, extract files in place)
g.D33 = 0 # (DOS 3.3 image source, selected automatically)
# functions
@@ -489,7 +489,8 @@ def processDir(arg1, arg2=None, arg3=None, arg4=None, arg5=None):
g.DIRPATH = (g.DIRPATH + "/" + workingDirName)
if g.PDOSPATH_INDEX:
if (g.PDOSPATH_INDEX == 1):
if (("/" + g.PDOSPATH_SEGMENT) != g.DIRPATH):
if (("/" + g.PDOSPATH_SEGMENT.lower()) !=
g.DIRPATH.lower()):
print("ProDOS volume name does not match disk image.")
sys.exit(2)
else:
@@ -527,6 +528,8 @@ def processEntry(arg1, arg2):
g.outFileData = bytearray(b'')
if g.SHK: # ShrinkIt archive
g.activeFileName = (arg2 if g.EX else arg2.split('#')[0])
if g.UC:
g.activeFileName = g.activeFileName.upper()
origFileName = g.activeFileName
else: # ProDOS or DOS 3.3 image
g.activeFileName = getFileName(arg1 ,arg2).decode("L1")
@@ -543,9 +546,9 @@ def processEntry(arg1, arg2):
if not g.PDOSPATH_INDEX:
g.targetDir = (g.targetDir + "/" + g.activeFileName)
g.ADdir = (g.targetDir + "/.AppleDouble")
if not (g.DIR or os.path.isdir(g.targetDir)):
if not (g.CAT or os.path.isdir(g.targetDir)):
makedirs(g.targetDir)
if not (g.DIR or (not g.AD) or os.path.isdir(g.ADdir)):
if not (g.CAT or (not g.AD) or os.path.isdir(g.ADdir)):
makedirs(g.ADdir)
if g.PDOSPATH_SEGMENT:
g.PDOSPATH_INDEX += 1
@@ -557,8 +560,8 @@ def processEntry(arg1, arg2):
g.ADdir = (g.targetDir + "/.AppleDouble")
else: # ProDOS or DOS 3.3 file either from image or ShrinkIt archive
if (not g.extractFile or
(os.path.basename(g.extractFile) ==
origFileName.split('#')[0])):
(os.path.basename(g.extractFile.lower()) ==
origFileName.split('#')[0].lower())):
print(" " + g.activeFileName.split("#")[0] +
("+" if (g.shk_hasrf or
(not g.SHK and getStorageType(arg1, arg2) == 5))
@@ -566,7 +569,7 @@ def processEntry(arg1, arg2):
((" [" + origFileName + "] ")
if (g.PNAME and (origFileName != g.activeFileName))
else ""))
if g.DIR:
if g.CAT:
return
if not g.targetName:
g.targetName = g.activeFileName
@@ -616,7 +619,9 @@ def processEntry(arg1, arg2):
if (g.exFileData != None):
saveFile((saveName + "r"), g.exFileData)
touch((saveName + "r"), modifiedDate)
if g.PDOSPATH_SEGMENT or (g.extractFile == origFileName):
if (g.PDOSPATH_SEGMENT or
(g.extractFile and
(g.extractFile.lower() == origFileName.lower()))):
syncExit()
g.targetName = None
#else:
@@ -1080,22 +1085,26 @@ def isnumber(number):
args = sys.argv
while True: # breaks when there are no more arguments starting with dash
if (len(args) == 1):
usage()
if (slyce(args[1],0,1) != "-"):
break
if (args[1] == "-s"):
g.nomsg = 1
args = args[1:] #shift
elif (args[1] == "-n"):
g.nodir = 1
args = args[1:] #shift
elif (args[1] == "-uc"):
g.UC = 1
args = args[1:] #shift
elif (args[1] == "-ad"):
if g.EX: usage()
g.AD = 1
g.PNAME = 1
args = args[1:] #shift
@@ -1109,21 +1118,25 @@ while True: # breaks when there are no more arguments starting with dash
args = args[1:] #shift
elif (args[1] == "-e"):
if g.AD: usage()
g.EX = 1
g.PNAME = 1
args = args[1:] #shift
elif (args[1] == "-cat"):
if g.AD or g.EX: usage()
g.DIR = 1
g.CAT = 1
args = args[1:] #shift
else:
usage()
if not ((g.DIR and len(args) >= 2) or (len(args) >= 3)):
usage()
if g.EX:
if g.AD: usage()
if g.AD:
if g.EX: usage()
if g.CAT:
if not (len(args) == 2): usage()
else:
if not ((len(args) == 3) or (len(args) == 4)): usage()
g.imageFile = args[1]
if not os.path.isfile(g.imageFile):
@@ -1152,19 +1165,25 @@ if (len(args) == 4):
if g.SHK:
g.PNAME = 0
if not g.DIR:
if not g.CAT:
targetDir = (args[3] if g.extractFile else args[2])
unshkdir = ("/tmp/cppo-" + str(uuid.uuid4()))
makedirs(unshkdir)
if not os.system("cd " + unshkdir + "; " +
"nulib2 -xse " +
os.path.abspath(g.imageFile) + " " +
(args[2].replace('/', ':') if g.extractFile else "") +
" | grep -q 'no records match' > /dev/null"):
result = os.system("/bin/bash -c 'cd " + unshkdir + "; " +
"result=$(nulib2 -xse " + os.path.abspath(g.imageFile) +
((" " + args[2].replace('/', ':'))
if g.extractFile else "") + " 2> /dev/null); " +
"if [[ $result == \"Failed.\" ]]; then exit 3; " +
"else if grep -q \"no records match\" <<< \"$result\"" +
" > /dev/null; then exit 2; else exit 0; fi; fi'")
if (result == 512):
print(
"File not found in ShrinkIt archive. Try cppo -cat to get the path,")
print(" and omit any leading slash or colon.")
sys.exit(1)
elif (result != 0):
print("ShrinkIt archive is invalid, or some other problem happened.")
sys.exit(1)
if g.extractFile:
g.extractFile = g.extractFile.replace(':', '/')
extractPath = (unshkdir + "/" + g.extractFile)
@@ -1179,7 +1198,9 @@ if g.SHK:
fileNames = [name for name in os.listdir(unshkdir)
if not name.startswith(".")]
if (len(fileNames) == 1 and os.path.isdir(unshkdir + "/" + fileNames[0])):
if g.nodir:
oneDir = True # force extract in place
elif (len(fileNames) == 1 and os.path.isdir(unshkdir + "/" + fileNames[0])):
oneDir = True
volumeName = toProdosName(fileNames[0])
else:
@@ -1189,17 +1210,19 @@ if g.SHK:
volumeName[-4:].lower() == ".sdk" or
volumeName[-4:].lower() == ".bxy"):
volumeName = volumeName[0:-4]
if not g.DIR and not g.extractFile:
if not g.CAT and not g.nodir and not g.extractFile:
print("Extracting into " + volumeName)
# recursively process unshrunk archive hierarchy
for dirName, subdirList, fileList in os.walk(unshkdir):
subdirList.sort()
if not g.DIR:
if not g.CAT:
g.targetDir = (targetDir + ("" if oneDir else ("/" + volumeName)) +
("/" if (dirName.count('/') > 2) else "") +
("/".join(dirName.split('/')[3:]))) # chop tempdir
if g.extractFile: # solo item, so don't put it in the tree
g.targetDir = targetDir
if g.UC:
g.targetDir = g.targetDir.upper()
g.ADdir = (g.targetDir + "/.AppleDouble")
makedirs(g.targetDir)
if g.AD:
@@ -1306,7 +1329,7 @@ if g.extractFile:
print("Target directory not found.")
sys.exit(2)
else:
if not g.DIR:
if not g.CAT:
if not os.path.isdir(args[2]):
print("Target directory not found.")
sys.exit(2)
@@ -1319,7 +1342,7 @@ if g.D33:
diskName = os.path.splitext(diskName)[0]
if g.PNAME:
diskName = toProdosName(diskName)
if not g.DIR:
if not g.CAT:
g.targetDir = (args[3] if g.extractFile
else (args[2] + "/" + diskName))
g.ADdir = (g.targetDir + "/.AppleDouble")
@@ -1357,7 +1380,7 @@ if g.extractFile:
print("ProDOS file not found within image file.")
sys.exit(2)
else:
if not g.DIR:
if not g.CAT:
# print(args[0], args[1], args[2])
g.targetDir = (args[2] + "/" + getVolumeName().decode("L1"))
g.ADdir = (g.targetDir + "/.AppleDouble")
@@ -1366,6 +1389,6 @@ else:
if not ((not g.AD) or os.path.isdir(g.ADdir)):
makedirs(g.ADdir)
processDir(2)
if not g.DIR:
if not g.CAT:
syncExit()

View File

@@ -9,7 +9,7 @@
# to download and execute, type:
# wget ivanx.com/a2server/setup; source setup
a2serverVersion="1.2.9"
a2serverVersion="130"
# Ensure URL we'll use ends in a /
case "$A2SERVER_SCRIPT_URL" in