mò HU²Ic@sšdZdkZdkZdkZdkZd„Zd„ZeiidƒeiidƒgZ d„Z d„Z dd„Z ed jo eƒndS( sý %(program)s: Create a target directory from a skeleton directory. usage: %(program)s [options] Options: -h/--help -- print this help text -s/--sourcedir -- the skeleton source directory -t/--targetdir -- the directory to which the skeleton files will be copied -u/--uid -- the username/uid of the user who will own the target files -g/--gid -- the groupname/gid of the group who will own the target files -r/--replace -- specify replacement value for .in file This script may be used to install a custom Zope instance home skeleton directory. It is most useful when used to install a skeleton which does not follow the standard 'one-directory-as-instance-home' paradigm used by the stock Zope source install. The value of --targetdir should be the directory where you would like to copy the skeleton hierarchy. For many packagers, this will be "/" or "/usr" or "/usr/local". The value of --sourcedir should be a directory which contains a custom skeleton hierarchy. For many packagers, the skeleton source directory may contain directories like "usr" and "bin" and these directories will contain files and other directories, comprising an installation hierarchy suitable for your platform. The skeleton source hierarchy may contain any kind of file. Files in the skeleton hierarchy that end with a ".in" extension will go through textual substitution before they are placed in the target directory. When they are placed in the target directory, the ".in" extension is removed. Specify textual replacement values by passing one or more --replace= options to the script. The value of each replace option needs to be in the following format: --replace=key:value. 'key' is the value that will be replaced (minus the "<<" and ">>" values expected by the replacement). 'value' is the value that should be used for replacement. Files which do not have an ".in" extension are copied without substitution. All file mode bits from files/dirs in the skeleton source directory are copied along with the file/directory itself. If the --uid and/or --gid flags are used, all directories and files created by this script will be provided with this owner and/or group. Otherwise, the uid and group owner of the files will be the executing user's. Existing directory structures and files are left unchanged. If a file already exists in the target directory, it is left unchanged and the source file is not copied. If a directory already exists in the target directory, its ownership information and mode bit settings are left unchanged. Nc Cs‹y8titiddddddddgƒ\} }Wn5tij o&}tti|ƒti d ƒnXt i i tid ƒ}d}d} d}d}h}xw| D]o\}}|d$jottiƒti ƒn|d%joJt i i t i i|ƒƒ}|p!ttidƒti d ƒq9n|d&joJt i i t i i|ƒƒ} | p!ttidƒti d ƒqn|d'jo(|p!ttidƒti d ƒnyÃt iƒd jo!ttidƒti d ƒnyt|ƒ}Wnxy>dk} | i|ƒd }|p| i|ƒd}nWq‡tj o$ttidƒti d ƒq‡XnXWqÅttfj o$ttidƒti d ƒqÅXn|d(jo |p!ttidƒti d ƒny¥t iƒd jo!ttidƒti d ƒnyt|ƒ}WnZy dk} | i|ƒd}Wqžtj o$ttidƒti d ƒqžXnXWqÜttfj o$ttidƒti d ƒqÜXn|d)jo4|pq®n|id!dƒ\} } | || z)tii ti t ||||fƒWdti|ƒXWn5ttfj o#}ti|IJtidƒnXdS(sa This is an independent function because we'd like to import and call it from mkzopeinstance Ni(R R texistsRtmakedirstgetcwdRtchdirRtwalktcurdirtcopydirRRRtIOErrortOSErrorRRR R (RRRRRRR((R%R$§s   tCVSs.svnc Cs/|\}}}}x|D] } tii| ƒt jo|i | ƒqtii tii || ƒƒo<tii| ƒ\} } tii| ƒdjotii ||| ƒ} tii| ƒoqnttii || ƒ| |||ƒ|dj oti| ||ƒq¤q'tii || ƒ}tii ||ƒ} tii| ƒoqnti|| ƒti|| ƒ|dj oti| ||ƒq'qtii ||| ƒ}tii|ƒpTti|ƒtitii || ƒ|ƒ|dj oti|||ƒq'qqWdS(Ns.in(RRRRtnamestnameR R tnormcasetCVS_DIRStremovetisfiletjoinRtsplitexttsntexttdstR'tcopyinRtchowntsrctshutiltcopyfiletcopymodetdntmkdir( t.0RR1RRRRR>RBR;R9R2R:((R%R-¿s8"    c Cs«t|ƒ}|iƒ}|iƒx(|D] }|id|||ƒ}q)Wt|dƒ}|i |ƒ|iƒt i ||ƒ|dj oti|||ƒndS(Ns<<%s>>tw(topenR>tifptreadttexttcloseRR"treplaceR;tofptwriteR?RARRR R=R( R>R;RRRRGRIRLR"((R%R<ás      c CsM|o||IJ|Jntiitidƒ}|thd|<IJdS(Nitprogram( RtstreamR R tbasenameRRRNt__doc__(RORRN((R%R îs  t__main__(RQR R?RRR&R$R R3R4R-R<RR t__name__( R&RR-R<R4R$R RR?R ((R%t??s     a $ "