echo "Creating a new SANA-II ARCHIVE"
echo "Please Wait . . ."

;bumprev >nil: 0 disk_rev

delete >nil: t:buildnumberfile#?

date >env:sana2Date
type >env:sana2Revision disk_rev.rev

echo >t:buildnumberfile "This Disk is revision V2.$sana2Revision."
echo >>t:buildnumberfile "It was built on $sana2Date by $username."

copy >nil: t:buildnumberfile ReadMe.BuildNumber
delete >nil: t:buildnumberfile#?

if EXISTS SANA2:BuildArchive
    cd SANA2:
    if EXISTS SANA2Developer.lzh
        echo "Old archive being renamed to sana2developer.lzh.old"
        if EXISTS SANA2developer_src.lzh.old
            delete sana2developer_src.lzh.old
        endif
        rename sana2developer_src.lzh sana2developer_src.lzh.old
    endif
    echo "building as sana2developer.lzh"

    if NOT EXISTS ram:s2archive
        makedir ram:s2archive
    endif

    assign s2dd: ram:s2archive
    if NOT EXISTS s2dd:include
        makedir s2dd:include
    endif
    if NOT EXISTS s2dd:include/devices
        makedir s2dd:include/devices
    endif
    if NOT EXISTS s2dd:devs
        makedir s2dd:devs
    endif
    if NOT EXISTS s2dd:devs/networks
        makedir s2dd:devs/networks
    endif
    if NOT EXISTS s2dd:driver_docs
        makedir s2dd:driver_docs
    endif
    if NOT EXISTS s2dd:utils
        makedir s2dd:utils
    endif
    if NOT EXISTS s2dd:src
        makedir s2dd:src
    endif
    if NOT EXISTS s2dd:src/slip
        makedir s2dd:src/slip
    endif

; Sigh.  I'd really like these to be included.  -kcd
;
    if NOT EXISTS s2dd:src/a2065
        makedir s2dd:src/a2065
    endif
    if NOT EXISTS s2dd:src/a2060
        makedir s2dd:src/a2060
    endif

    copy ReadMe.BuildNumber s2dd:
    copy src/slip/#? s2dd:src/slip
    copy src/slip/odu s2dd:src/slip/odu all
    copy src/a2065/#? s2dd:src/a2065
    copy src/a2060/#? s2dd:src/a2060
    copy include/devices/#? s2dd:include/devices QUIET CLONE
    copy bin/devs/#? s2dd:devs/networks QUIET CLONE
    copy driver_docs/#? s2dd:driver_docs QUIET CLONE
    copy bin/devs/utils/#? s2dd:utils QUIET CLONE
    delete s2dd:devs/networks/rs485.device QUIET
    echo "!Warning!  All drivers in SANA2:bin/devs are being archived, with"
    echo "           the exception of the rs485.device, which is currently"
    echo "           being ignored."
    copy bin/devs/readme.devs s2dd:devs QUIET CLONE

    copy txt/arcnet.txt txt/changes.txt txt/ethernet.txt txt/standard.txt s2dd: QUIET CLONE
    copy doc/copybuff.doc doc/sana2device.doc txt/standard.addenda s2dd: QUIET CLONE
    copy readme s2dd: QUIET CLONE

    echo "Tree build in RAM:"
    echo "Now going to lharc it . . ."

    lharc -r -m a sana2:sana2developer_src.lzh s2dd:*

    echo "Done!"

    echo "Nuking the ram image . . ."
    delete s2dd:#? ALL QUIET
    assign s2dd: REMOVE
    delete ram:s2archive QUIET
ELSE
    echo "You need to have SANA2: assigned to the base of the"
    echo "SANA-II area on the server to use this script."
ENDIF

