³ò ØÏHc@sdZddkZddkZddkZddkZddkZddkZddkZde fd„ƒYZ e d„Z d„Z d„Zdd„Zed joie d d eƒd joe d ƒ‚nddgZeid eideidgZeejo>e ddieeeƒƒdieeeƒƒfƒ‚neeiƒdjoIeiidƒeiideid idƒdƒeidƒneidZei dƒo1eiidƒeiidƒeidƒnededeƒndS(sQ Introduction ------------ This script makes a self-contained, standalone executable that can be used to install any package from an ATLAS release without requiring Pacman or a network connection. The executable includes a Pacman snapshot of a single ATLAS release including externals, CMT, Pacman, KV, requirements encoded into Pacman, etc. This kind of file is intended as both an archive of a release at a particular moment in time and as a file that can be treated like just another kind of input file used by Panda, DQ2, etc. Usage ----- Usage: makePacball.py RELEASE_NUMBER, where RELEASE_NUMBER is a release in the ATLAS cache. This creates an executable called RELEASE_NUMBER_KV.time-TIME.md5-MD5SUM.sh, where TIME is the UTC time at creation, formatted with %Y-%m-%d-%H-%M-%S, and MD5SUM is its md5 checksum. Run the executable to install RELEASE_NUMBER, or, to install any other package that's included with RELEASE_NUMBER+KV, run the executable with one argument specifying the name of that package. Details ------- This python script makes a tarball archive of a Pacman snapshot of the ATLAS release specified on the command line, including Kit Validation. It then generates a shell script and appends it to the front of the archive, making the executable. Running the executable runs this script. The script is able to extract and unpack the tarball that is attached to itself and install a package from the resulting snapshot. (The tarball is not gzipped, since, for an ATLAS release, gzipping only reduces the tarball's size by about 1%. Plus this, eliminates the extra depedency on gunzip at the installation location.) Note that the script at the front of the executable may be manually removed (up to and including the line `exit 0'), resulting in a standard tarball containing the ATLAS snapshot and a copy of Pacman. iÿÿÿÿNtPacballExceptioncBseZRS((t__name__t __module__(((spacman-3.29/src/makePacball.pyR-scCsyti|ƒ\}}Wn,tj o ‚ntd|ƒ‚nX|o¯|djo¢d}ti|ƒod|iƒ}|djoG|d7}d|jo|d7}n |d7}|d|iƒ7}qän|d |7}|d 7}t|ƒ‚n|S( s-Run the given sh code and return the wait status. Output is ignored, except when building an exception message. Note that the returned status is like that returned by wait(), not just a simple exit status. If checkStatus is True, this method raises an exception if the status is not zero. s"Unable to run helper command [%s].isError making pacballtt:s t s%ss!: helper command [%s] interruptedt.(tcommandstgetstatusoutputtKeyboardInterruptRtost WIFEXITEDtstrip(tcmdt checkStatuststatustoutputtmsg((spacman-3.29/src/makePacball.pytruncmd/s(      cCsd|iddƒS(s"Quote the text for use in sh code.s'%s't's'\''(treplace(ttext((spacman-3.29/src/makePacball.pytquoteIscCs3|titidddjodSn|SdS(s?Return a (very) sh code safe interpretation of the character c.t_Rt-N(tstringt ascii_letterstdigits(tc((spacman-3.29/src/makePacball.pytencodeMs#cCs|d2jo |}nd}d}d}d}d}xJ||||gD]6}|i|ƒdjotd||fƒ‚qHqHWzXtiƒ} tdt|ƒƒtd t|ƒƒti|ƒd GHtd t|ƒt|ƒfƒd ig} |D]} | t | ƒqü~ ƒ} d GHtdt| ƒƒdGHy)t |dƒi t i |ƒiƒƒWn,tj o ‚ntd|ƒ‚nXtdt|ƒƒtdt|ƒƒd2} xctidƒD]R}|idƒo<yt|tdƒƒWntj o qÏnX|} PqÏqÏW| d2jotdƒ‚ndht|ƒd<t|ƒd<|d<t| ƒd<t| ƒd<}|i|t|idƒdƒƒ}t |dƒi |ƒdGHtd t|ƒƒtd t| d!ƒt| ƒt|ƒfƒtd"t|ƒt| d!ƒt|ƒt| ƒt|ƒfƒd#GHtiƒ}t |d$ƒ}d%}xztor|id&ƒ}|d joPn|i|ƒ|d'}|d(d%jo%tii d)|ƒtiiƒqzqzWtii d*ƒtiiƒ|iƒ|iƒ}d+| t i!d,t i"ƒƒ|f}td-t|ƒt|ƒfƒtd.t|ƒƒtd/t|ƒt| ƒfƒti| ƒtdt|ƒƒd0|GHd1||fGHWd2ti| ƒtdt|ƒƒXd2S(3sˆCreate a pacball of cache:snapshot_package. The pacball will install snapshot_package, or, if given, install_package, by default. sGhttp://physics.bu.edu/pacman/sample_cache/tarballs/pacman-latest.tar.gzs o..tmp..os o..SKIP..os pacball.shspacman-latest.tar.gziÿÿÿÿs.Parameter [%s] cannot contain the phrase [%s].s rm -rf %ssmkdir %ssFetching dependent packages...sOpacman -allow trust-all-caches unsupported-platforms tar-overwrite -fetch %s:%sRsCollecting downloads...spacman -snap -o %ssGetting latest Pacman...twsUnable to download [%s].sgunzip -c %s | tar xsrm %sRspacman-sUnable to get Pacman.s#!/bin/sh targs='-n' echo '' | tail $targs +0 >/dev/null 2>&1 if [ $? -ne 0 ]; then targs=''; fi #SunOS set -e install_package="$1" if [ -z "$install_package" ]; then install_package=%(install_package)s; fi rm -fr %(TMPDIR)s printf "Untarring..." tail $targs +%(SKIP)s "$0" | tar xf - printf "done.\n" cd %(TMPDIR)s/%(pacman_untarred)s; . ./setup.sh; cd ../.. pacman -allow trust-all-caches unsupported-platforms tar-overwrite -get %(TMPDIR)s/%(snapshot_name)s.snapshot:"$install_package" rm -fr %(TMPDIR)s exit 0 tinstall_packagetTMPDIRtSKIPtpacman_untarredt snapshot_names isAssembling Pacball...s mv %s %s %s/s .snapshotstar c %s/%s %s/%s >> %ssComputing md5 checksum...trbii€–˜i ids %d MB...s s%s.time-%s.md5-%s.shs%Y-%m-%d-%H-%M-%Ssmv %s %ss chmod 755 %ss mv %s %s/s"Pacball [%s] successfully created.sUse %% %s to install %s.N(#tNonetfindRR tgetcwdRRtchdirtjoinRtopentwriteturllibXturlopentreadR tlistdirt startswithtfloattlent ValueErrorRtstrtcounttmd5tTruetupdatetsyststdouttflushtcloset hexdigestttimetstrftimetgmtime(tcachetsnapshot_packageRt PACMAN_URLR R!t PACBALLTMPt PACMANTMPtparamtorigcwdt_[1]RR#R"tfnametheadertmd5sumtftmegstxt pacballfname((spacman-3.29/src/makePacball.pyt makePacballRs¤    0)   %-?       %     t__main__swhich pacman &> /dev/nullRis!Making a pacball requires Pacman.iis<You are using Python %s. This script requires Python >= %s.Rs*** ERROR *** susage: %s RELEASE_NUMBER t/s+KVsJThe RELEASE_NUMBER should not include `+KV'. It's handled automatically. tATLAS(!t__doc__R9R RR6RR>turllib2R,t ExceptionRR7RRRR%RPRtFalsetverReqt version_infotverSysR)tmapR4R2targvtstderrR+tsplittexittRELEASEtendswith(((spacman-3.29/src/makePacball.pys)s.T    †  $ >(