��
�[c@s-dZeZddkZddkZddkZddkZddkZddkZddk Z ddk
lZlZy@ddk
lZddklZlZlZddklZWnej
o
eZnXep0ddklZlZlZddklZnddkZddkZddkZddklZlZeZeZd e fd
��YZ!d�Z"de!fd
��YZ#de!fd��YZ$de#fd��YZ%de!fd��YZ&de&fd��YZ'de!fd��YZ(de!fd��YZ)de!fd��YZ*de!fd��YZ+de+fd��YZ,d e!fd!��YZ-d"e-fd#��YZ.d$e fd%��YZ/d&e/fd'��YZ0d(e0fd)��YZ1d*e/fd+��YZ2d,e/fd-��YZ3d.�Z4d/�Z5d0d1�Z6d2�Z7d3�Z8d4�Z9dd5�Z;dS(6s2
Configuration parser and default values for yum.
i����N(tConfigPreProcessort
varReplace(t INIConfig(tNoSectionErrort
NoOptionErrortParsingError(tRawConfigParser(tConfigParser(tget_uuidtread_in_items_from_dot_dirtOptioncBs\eZdZd ed�Zd�Zd�Zd�Zd�Z d�Z
d�Zd�ZRS(
s�
This class handles a single Yum configuration file option. Create
subclasses for each type of supported configuration option.
Python descriptor foo (__get__ and __set__) is used to make option
definition easy and consise.
cCs:|i�t|_|o|i|�}n||_dS(N(t_setattrnametFalsetinherittparsetdefault(tselfRt
parse_default((s./usr/lib/python2.6/site-packages/yum/config.pyt__init__:s
cCsdt|�|_dS(smCalculate the internal attribute name used to store option state in
configuration instances.
s__opt%dN(tidt _attrname(R((s./usr/lib/python2.6/site-packages/yum/config.pyRAscCs%|djo|St||id�S(sCCalled when the option is read (via the descriptor protocol).
@param obj: The configuration instance to modify.
@param objtype: The type of the config instance (not used).
@return: The parsed option value or the default value if the value
wasn't set in the configuration file.
N(tNonetgetattrR(Rtobjtobjtype((s./usr/lib/python2.6/site-packages/yum/config.pyt__get__Gs
cCsxt|t�oQy|i|�}Wqatj
o+}td|i|t|�f��qaXnt||i|�dS(s�Called when the option is set (via the descriptor protocol).
@param obj: The configuration instance to modify.
@param value: The value to set the option to.
@return: Nothing.
sError parsing "%s = %r": %sN(t
isinstancet
basestringRt
ValueErrort_optnametstrtsetattrR(RRtvaluete((s./usr/lib/python2.6/site-packages/yum/config.pyt__set__UscCs,||_t||iti|i��dS(s�Initialise the option for a config instance.
This must be called before the option can be set or retrieved.
@param obj: BaseConfig (or subclass) instance.
@param name: Name of the option.
N(RRRtcopyR(RRtname((s./usr/lib/python2.6/site-packages/yum/config.pytsetupfs cCsti|�}|i�|S(s3Return a safe copy of this Option instance
(R#R(Rtnew((s./usr/lib/python2.6/site-packages/yum/config.pytcloneps
cCs|S(sParse the string value to the Option's native value.
@param s: Raw string value to parse.
@return: Validated native value.
Will raise ValueError if there was a problem parsing the string.
Subclasses should override this.
((Rts((s./usr/lib/python2.6/site-packages/yum/config.pyRws cCs
t|�S(sConvert the Option's native value to a string value.
@param value: Native option value.
@return: String representation of input.
This does the opposite of the parse() method above.
Subclasses should override this.
(R(RR ((s./usr/lib/python2.6/site-packages/yum/config.pyttostring�s N(
t__name__t
__module__t__doc__RRRRRR"R%R'RR)(((s./usr/lib/python2.6/site-packages/yum/config.pyR
1s
cCs|i�}t|_|S(s]Clone an Option instance for the purposes of inheritance. The returned
instance has all the same properties as the input Option and shares items
such as the default value. Use this to avoid redefinition of reused
options.
@param option_obj: Option instance to inherit.
@return: New Option instance inherited from the input.
(R'tTrueR
(t
option_objt
new_option((s./usr/lib/python2.6/site-packages/yum/config.pytInherit�s t
ListOptioncBs/eZdZded�Zd�Zd�ZRS(s1
An option containing a list of strings.
cCs4|djo
g}ntt|�i||�dS(N(RtsuperR1R(RRR((s./usr/lib/python2.6/site-packages/yum/config.pyR�s
cCs�|idd�}|idd�}g}x]|i�D]O}|id�o,|idd�}|it|��q7n|i|�q7W|S(s�Converts a string from the config file to a workable list, parses
globdir: paths as foo.d-style dirs
Commas and spaces are used as separators for the list
s
t t,sglob:t(treplacetsplitt
startswithtextendR tappend(RR(tresultstitemtthisglob((s./usr/lib/python2.6/site-packages/yum/config.pyR�s
cCs
di|�S(Ns
(tjoin(RR ((s./usr/lib/python2.6/site-packages/yum/config.pyR)�sN(R*R+R,RRRRR)(((s./usr/lib/python2.6/site-packages/yum/config.pyR1�s t UrlOptioncBs2eZdZdd ed�Zd�Zd�ZRS(
sN
This option handles lists of URLs with validation of the URL scheme.
thttptftptfilethttpscCs,tt|�i|�||_||_dS(N(R2R?Rtschemest
allow_none(RRRDRE((s./usr/lib/python2.6/site-packages/yum/config.pyR�s cCs�|i�}|i�djo|iodStd��nti|�\}}}}}}||ijo td|i�|f��n|S(Nt_none_s"_none_" is not a valid valuesURL must be %s not "%s"(tstriptlowerRERturlparseRDt_schemelist(RturlR(tbtptqtfto((s./usr/lib/python2.6/site-packages/yum/config.pyR�s
! cCsft|i�djodSt|i�djo|idSddi|id �|idfSdS(s;Return a user friendly list of the allowed schemes
itemptyis%s or %ss, i����N(tlenRDR>(R((s./usr/lib/python2.6/site-packages/yum/config.pyRJ�s
N(R@RAsfileRC(R*R+R,RRRRRJ(((s./usr/lib/python2.6/site-packages/yum/config.pyR?�s
t
UrlListOptioncBs)eZdZdded�Zd�ZRS( sN
Option for handling lists of URLs with validation of the URL scheme.
R@RARBRCcCs/tt|�i||�td|�|_dS(NRD(R2RSRR?t
_urloption(RRRDR((s./usr/lib/python2.6/site-packages/yum/config.pyR�sc Cs g}|idd�}|idd�}g}ti|�D]}||idd�q>~}g}xW|D]O}|id�o,|idd�}|it|��qmn|i|�qmWxBtt|�i di
|��D]}|i|ii |��q�W|S(Ns
R3R4s%20sglob:R5(R6tshlexR7R8R9R R:R2RSRR>RT( RR(toutt_[1]R<titemsttmpR=RK((s./usr/lib/python2.6/site-packages/yum/config.pyR�s 6"N(shttpsftpsfileshttps(R*R+R,RRRR(((s./usr/lib/python2.6/site-packages/yum/config.pyRS�st IntOptioncBs)eZdZdddd�Zd�ZRS(s2
An option representing an integer value.
cCs,tt|�i|�||_||_dS(N(R2RZRt
_range_mint
_range_max(RRt range_mint range_max((s./usr/lib/python2.6/site-packages/yum/config.pyRs cCs�yt|�}Wn'ttfj
o}td��nX|idj o ||ijotd��n|idj o ||ijotd��n|S(Nsinvalid integer valuesout of range integer value(tintRt TypeErrorR\RR[(RR(tvalR!((s./usr/lib/python2.6/site-packages/yum/config.pyRs N(R*R+R,RRR(((s./usr/lib/python2.6/site-packages/yum/config.pyRZstPositiveIntOptioncBs,eZdZddddd�Zd�ZRS(sg
An option representing a positive integer value, where 0 can have a special
represention.
icCs)tt|�i|||�||_dS(N(R2RbRt_names0(RRR]R^t
names_of_0((s./usr/lib/python2.6/site-packages/yum/config.pyRscCs+||ijodStt|�i|�S(Ni(RcR2RbR(RR(((s./usr/lib/python2.6/site-packages/yum/config.pyR"sN(R*R+R,RRR(((s./usr/lib/python2.6/site-packages/yum/config.pyRbs t
SecondsOptioncBs9eZdZhd
d6dd6dd6dd6Zd�ZRS(s�
An option representing an integer value of seconds, or a human readable
variation specifying days, hours, minutes or seconds until something
happens. Works like BytesOption.
Note that due to historical president -1 means "never", so this accepts
that and allows the word never too.
Valid inputs: 100, 1.5m, 90s, 1.2d, 1d, 0xF, 0.1, -1, never
Invalid inputs: -10, -0.1, 45.6Z, 1d6h, 1day, 1y
Return value will always be an integer
i<itdthtmiR(cCst|�djotd��n|djp
|djodS|di�oN|d }|di�}|ii|d�}|ptd|��q�n
|}d}yt|�}Wn'ttfj
o}td��nX|djotd ��nt ||�S(
Nisno value specifieds-1tneveri����sunknown unit '%s's
invalid valueis!seconds value may not be negative(
RRRtisalphaRHtMULTStgetRtfloatR`R_(RR(tntunittmultR!((s./usr/lib/python2.6/site-packages/yum/config.pyR7s&
ii�Qi(R*R+R,RkR(((s./usr/lib/python2.6/site-packages/yum/config.pyRe's
"t
BoolOptioncBs eZdZd�Zd�ZRS(sm
An option representing a boolean value.
The value can be one of 0, 1, yes, no, true, or false.
cCs@|i�}|djotS|d jotStd��dS(
Nt0tnotfalset1tyesttruesinvalid boolean value(RrRsRt(RuRvRw(RHRR-R(RR(((s./usr/lib/python2.6/site-packages/yum/config.pyRYs
cCs|odSdSdS(NRuRr((RR ((s./usr/lib/python2.6/site-packages/yum/config.pyR)bs(R*R+R,RR)(((s./usr/lib/python2.6/site-packages/yum/config.pyRqQs tFloatOptioncBseZdZd�ZRS(s7
An option representing a numeric float value.
cCs@yt|i��SWn%ttfj
otd��nXdS(Nsinvalid float value(RmRGRR`(RR(((s./usr/lib/python2.6/site-packages/yum/config.pyRls(R*R+R,R(((s./usr/lib/python2.6/site-packages/yum/config.pyRxhstSelectionOptioncBs)eZdZddhd�Zd�ZRS(sAHandles string values where only specific values are allowed
cCs,tt|�i|�||_||_dS(N(R2RyRt_allowedt_mapper(RRtallowedtmapper((s./usr/lib/python2.6/site-packages/yum/config.pyRus cCsI||ijo|i|}n||ijotd|��n|S(Ns"%s" is not an allowed value(R{RzR(RR(((s./usr/lib/python2.6/site-packages/yum/config.pyRzs
N((R*R+R,RRR(((s./usr/lib/python2.6/site-packages/yum/config.pyRyrstCaselessSelectionOptioncBseZdZd�ZRS(s_ Mainly for compat. with BoolOption, works like SelectionOption but
lowers input case. cCstt|�i|i��S(N(R2R~RRH(RR(((s./usr/lib/python2.6/site-packages/yum/config.pyR�s(R*R+R,R(((s./usr/lib/python2.6/site-packages/yum/config.pyR~�stBytesOptioncBs2eZdZhdd6dd6dd6Zd�ZRS( s|
An option representing a value in bytes.
The value may be given in bytes, kilobytes, megabytes, or gigabytes.
itkRhtgcCs�t|�djotd��n|di�oN|d }|di�}|ii|d�}|ptd|��q�n
|}d}yt|�}Wn#tj
otd|��nX|djotd��nt||�S( s�Parse a friendly bandwidth option to bytes
The input should be a string containing a (possibly floating point)
number followed by an optional single character unit. Valid units are
'k', 'M', 'G'. Case is ignored.
Valid inputs: 100, 123M, 45.6k, 12.4G, 100K, 786.3, 0
Invalid inputs: -10, -0.1, 45.6L, 123Mb
Return value will always be an integer
1k = 1024 bytes.
ValueError will be raised if the option couldn't be parsed.
isno value specifiedi����sunknown unit '%s'scouldn't convert '%s' to numberisbytes value may not be negativeN( RRRRjRHRkRlRRmR_(RR(RnRoRp((s./usr/lib/python2.6/site-packages/yum/config.pyR�s"
iii@(R*R+R,RkR(((s./usr/lib/python2.6/site-packages/yum/config.pyR�s
tThrottleOptioncBseZdZd�ZRS(sv
An option representing a bandwidth throttle value. See
ThrottleOption.parse for acceptable input values.
cCs�t|�djotd��n|ddjos|d }yt|�}Wn#tj
otd|��nX|djp
|djotd��n|d Sti||�Sd
S(s�Get a throttle option.
Input may either be a percentage or a "friendly bandwidth value" as
accepted by the BytesOption.
Valid inputs: 100, 50%, 80.5%, 123M, 45.6k, 12.4G, 100K, 786.0, 0
Invalid inputs: 100.1%, -4%, -500
Return value will be a int if a bandwidth value was specified or a
float if a percentage was given.
ValueError will be raised if input couldn't be parsed.
isno value specifiedi����t%scouldn't convert '%s' to numberiidspercentage is out of rangegY@N(RRRRmRR(RR(Rn((s./usr/lib/python2.6/site-packages/yum/config.pyR�s
(R*R+R,R(((s./usr/lib/python2.6/site-packages/yum/config.pyR��st
BaseConfigcBs�eZdZd�Zd�Zdd�Zed�Ze e�Zd�Z
e e
�Z
d�Zd�Zddd�Z
dd �Zd
�ZRS(
sk
Base class for storing configuration definitions. Subclass when creating
your own definitons.
cCsCd|_x3|i�D]%}|i|�}|i||�qWdS(N(Rt_sectiontiterkeyst optionobjR%(RR$toption((s./usr/lib/python2.6/site-packages/yum/config.pyR�s
cCs[g}|id|i�x1|i�D]#\}}|id||f�q'Wdi|�S(Ns[%s]s%s: %rs
(R:R�t iteritemsR>(RRVR$R ((s./usr/lib/python2.6/site-packages/yum/config.pyt__str__�s
cCs�||_||_|i|�ot|i|��}n
t�}x�|i�D]�}|i|�}d}||jo|i||�}n%|o|i ot
||�}n|dj ot|||�qQqQWdS(s$Set option values from a INI file section.
@param parser: ConfParser instance (or subclass)
@param section: INI file section to read use.
@param parent: Optional parent BaseConfig (or subclass) instance to use
when doing option value inheritance.
N(tcfgR�thas_sectiontsettoptionsR�R�RRlR
RR(RtparsertsectiontparenttoptsR$R�R ((s./usr/lib/python2.6/site-packages/yum/config.pytpopulate�s
cCs@t||d�}t|t�o|S|o
t�ndSdS(s6Return the Option instance for the given name
N(RRRR
tKeyError(tclsR$t
exceptionsR((s./usr/lib/python2.6/site-packages/yum/config.pyR�s
cCs|i|dt�dj S(sBReturn True if the given name refers to a defined option
R�N(R�RR(R�R$((s./usr/lib/python2.6/site-packages/yum/config.pytisoptionsccs4x-t|�D]}|i|�o |Vq
q
WdS(s@Yield the names of all defined options in the instance.
N(tdirR�(RR$((s./usr/lib/python2.6/site-packages/yum/config.pyR�#s
ccs/x(|i�D]}|t||�fVq
WdS(s�Yield (name, value) pairs for every option in the instance.
The value returned is the parsed, validated option value.
N(R�R(RR$((s./usr/lib/python2.6/site-packages/yum/config.pyR�*s
cCs�|djo-|idjotd��n|i}n|ii|�}x�|i�D]u\}}|i|�}|djp*||jp|i|jp
||jo#|ii|||i |��qYqYW|ii
|�dS(s�Write out the configuration to a file-like object
@param fileobj: File-like object to write to
@param section: Section name to use. If not-specified the section name
used during parsing will be used.
@param always: A sequence of option names to always write out.
Options not listed here will only be written out if they are at
non-default values. Set to None to dump out all options.
s!not populated, don't know sectionN(RR�RR�R�R�R�RR�R)twrite(RtfileobjR�talwayst
cfgOptionsR$R R�((s./usr/lib/python2.6/site-packages/yum/config.pyR�3s
7'cCs2tidt�t||�ot||�S|S(NsxgetConfigOption() will go away in a future version of Yum.
Please access option values as attributes or using getattr().(twarningstwarntDeprecationWarningthasattrR(RR�R((s./usr/lib/python2.6/site-packages/yum/config.pytgetConfigOptionLs
cCsHtidt�t||�ot|||�ntid|�dS(NsusetConfigOption() will go away in a future version of Yum.
Please set option values as attributes or using setattr().sNo such option %s(R�R�R�R�RtErrorstConfigError(RR�R ((s./usr/lib/python2.6/site-packages/yum/config.pytsetConfigOptionTs
N((R*R+R,RR�RR�R-R�tclassmethodR�R�R�R�R�R�(((s./usr/lib/python2.6/site-packages/yum/config.pyR��s
tStartupConfcBs�eZdZeddd�Zeddd�Zed�Zed�Zed�Z e
e�Ze
ddg�Ze
d g�Ze
e�Ze�Zed
�Zed�Zed�ZRS(
s�
Configuration option definitions for yum.conf's [main] section that are
required early in the initialisation process or before the other [main]
options can be parsed.
iii
sredhat-releaset/s/etc/yum/yum.confs/usr/share/yum-pluginss/usr/lib/yum-pluginss/etc/yum/pluginconf.dtLOG_USERs/dev/logs/var/lib/yum(R*R+R,RZt
debuglevelt
errorlevelR
tdistroverpkgtinstallroottconfig_file_pathRqRtpluginsR1t
pluginpathtpluginconfpatht
gaftonmodetsyslog_identtsyslog_facilityt
syslog_devicet
persistdir(((s./usr/lib/python2.6/site-packages/yum/config.pyR�]s tYumConfc
Bs�eZdZedddg�Zeddd�Zee�Z e
d�Zee�Ze
d�Z
ed d
g�Ze�Ze�Ze
d�Zeded
dMde�Ze
�Ze
�Ze
�Ze
�Zeddddddddddddg�Zeddddd d!g�Zeddddd"ddg�Zeg�Ze�Zee�Zee�Z ee�Z!ee�Z"ee�Z#ee�Z$ee�Z%ee�Z&ee'�Z(ee)�Z*ee'�Z+ee�Z,ee�Z-ee�Z.ee�Z/ee�Z0ee�Z1ed#dg�Z2e3d$�Z4e5d�Z6e7d�Z8ee�Z9e:d%dN�Z;e<dP�Z=e<dR�Z>ee�Z?e�Z@ee�ZAee�ZBed+g�ZCe:d,dS�ZDe
d-�ZEe:d.dTd1h
d0d26d0d36d0d46d0d56d/d66d/d76d/d 6d/d86d.d96d.d:6�ZFe
d;�ZGe
d<�ZHe
d=�ZIe
d>�ZJe
d?�ZKe
d@�ZLe
dA�ZMe
d=�ZNe
d=�ZOe
d;�ZPe
d=�ZQe
d;�ZRe
�ZSee�ZTe
�ZUe
�ZVee�ZWee�ZXedBdCg�ZYe
dD�ZZedEdFe�Z[ee�Z\ee�Z]ee�Z^ee�Z_ee�Z`e:dGdUd1hdIdJ6dGd6�ZaedKddg�Zbee�ZcgZddL�ZeRS(Vs�
Configuration option definitions for yum.conf's [main] section.
Note: see also options inherited from StartupConf
i
Rds <forever>iR]is/var/cache/yums/var/log/yum.logs/etc/yum/repos.ds/etc/yum.repos.dtpriorityRRDR@RARCREtkernels
kernel-bigmemsinstallonlypkg(kernel-module)sinstallonlypkg(vm)skernel-enterprises
kernel-smpskernel-debugskernel-unsupporteds
kernel-sourceskernel-devels
kernel-PAEskernel-PAE-debugiiRrs<off>skernel-BOOTt mandatoryg>@talltnonetpackagesi<iis
group:primarytbestsbhttps://bugzilla.redhat.com/enter_bug.cgi?product=Red%20Hat%20Enterprise%20Linux%206&component=yumtautoRiR�R}tonRvRuRwtoffRsRttttysif-ttytboldsbold,yellowtnormalsbold,reds bold,bluesdim,cyansbold,underline,greentyumtrpmtinfos%yum, glob:/etc/yum/protected.d/*.confRtusersssingle-user-commandstcommandstcmdsidcCs�d}d}x�t|�D]�}|id
�oqn||joqntt||�ti�oqnt||�}|o/t|�tt�td�fjo
d}nt|�tijod
i |�}n|d||f}qW|S(Ns[main]
R�tuidtyumvartprogress_objtfailure_objtdisable_excludestconfig_file_ageR�t_iR5s,
s%s = %s
(scfgsuidsyumvarR�R�sdisable_excludessconfig_file_agesconfig_file_path(
R�R8RRttypest
MethodTypettypeRtListTypeR>(Rtoutputt
excluded_varstattrtres((s./usr/lib/python2.6/site-packages/yum/config.pytdump�s$
-
(shttpsftpshttps(R�R�sallii`Tii�Q(R�sall(R�sneversalways(ssingle-user-commandsR�scommands(fR*R+R,RbtretriesRZtrecentRqR-t
reset_niceR
tcachedirt keepcachetlogfileR1treposdirR�texcludetfailovermethodR?Rtproxytproxy_usernametproxy_passwordtusernametpasswordtinstallonlypkgstinstallonly_limittkernelpkgnamest
exactarchlistttsflagst assumeyestassumenotalwayspromptt exactarchttoleranttdiskspacechecktoverwrite_groupst keepalivet__pkgs_gpgcheck_default__tgpgcheckt__repo_gpgcheck_default__t
repo_gpgchecktlocalpkg_gpgcheckt obsoletestshowdupesfromrepostenabledtenablegroupstenable_group_conditionalstgroupremove_leaf_onlytgroup_package_typesRxttimeoutRt bandwidthR�tthrottletftp_disable_epsvRythttp_cachingRetmetadata_expiretmirrorlist_expiretrpm_check_debugR�tquery_install_excludestskip_brokentmdpolicytmultilib_policytbugtracker_urltcolortcolor_list_installed_oldertcolor_list_installed_newertcolor_list_installed_reinstalltcolor_list_installed_extratcolor_list_available_upgradetcolor_list_available_downgradetcolor_list_available_reinstalltcolor_list_available_installtcolor_update_installedtcolor_update_localtcolor_update_remotetcolor_search_matcht sslcacertt sslverifyt
sslclientcerttsslclientkeytssl_check_cert_permissionsthistory_recordthistory_record_packagestrpmverbositytprotected_packagestprotected_multilibtexit_on_locktloadts_ignoremissingtloadts_ignorerpmtclean_requirements_on_removethistory_list_viewtdepsolve_loop_limittrecheck_installed_requirest
_reposlistR�(((s./usr/lib/python2.6/site-packages/yum/config.pyR�ss�
tRepoConfcBseZdZe�Zd�Ze�Zee i
�Z
e�Ze
�Ze
�Ze�Ze�Ze�Ze�Ze�Zee i�Zee i�Zee i�Zee i�Zee i�Zee i�Zee i�Zee i�Zee i�Zee i�Zee i �Z ee i!�Z!ee i"�Z"ee i#�Z#ee i$�Z$ee i%�Z%ee i&�Z&ee i'�Z'e(d�Z)ee i*�Z*ee i+�Z+ee i,�Z,ee i-�Z-ee i.�Z.ee i/�Z/e0e1�Z2RS(s>
Option definitions for repository INI file sections.
ccsj|i}t|t�p
t�}n|p |itti|���nx|iD]}|VqWWdS(s@Yield the names of all defined options in the instance.
N(t_RepoConf__cached_keysRR-R�tupdatetlistR�R�(RtckR$((s./usr/lib/python2.6/site-packages/yum/config.pyR�s
i�(3R*R+R,R�R.R�R
R$R0R�R�RStbaseurlR?t
mirrorlisttmetalinktmediaidtgpgkeytgpgcakeyR1R�tincludepkgsR�R�R�R�R�R�R�R�R�R�R�RRRRRRRRZtcostRRRRRRRqRtskip_if_unavailable(((s./usr/lib/python2.6/site-packages/yum/config.pyR-sN tVersionGroupConfcBseZe�Zee�ZRS((R*R+R1tpkglistRqRtrun_with_packages(((s./usr/lib/python2.6/site-packages/yum/config.pyR;Ts c Cs|ti_t�}||_t�}t|�}t�}||_||_y|i |�Wn(t
j
o}tid|��nX|i
|d�x5|iD]*}|ddjptid��q�q�W||_t|i|i�|_d|i|if}t|�|_|S(s�
Parse Yum's main configuration file and return a StartupConf instance.
This is required in order to access configuration settings required as Yum
starts up.
@param configfile: The path to yum.conf.
@param root: The base path to use for installation (typically '/')
@return: A StartupConf instance.
May raise Errors.ConfigError if a problem is detected with while parsing.
sParsing file failed: %stmainiR�s(All plugin search paths must be absolutes
%s/%s/uuid(R�R�RR�RRt
_getEnvVart_varstyumvarstreadfpRR�R�R�R�t_parsert
_getsysverR�t
releaseverR�Rtuuid( t
configfiletroottstartupconfR�t
confpp_objRAR!tpathtuuidfile((s./usr/lib/python2.6/site-packages/yum/config.pytreadStartupConfigYs,
cs�|i�|i�d<|i�d<|i�d<|i�d<t�}|i|id��fd�}y |id}t i
|�}Wntj
o
g}nXx�|D]�}t ii
||�oq�ny@t||�i�}|o|dd jo|d }nWnttfj
o
q�nX|�|<q�WxdD]}|||�qCW�|_d
|_d
|_d|_|i|_t ii|i�ot i|i�d|_n
d
|_|i|_|i|_|S(s�
Parse Yum's main configuration file
@param startupconf: StartupConf instance as returned by readStartupConfig()
@return: Populated YumConf instance.
tbasearchtarchRERFR>csQt||�}|i|}|idd�}t|��}t|||�dS(Ns//R�(RR�R6RR(tyumconfR�RKtir_path(RA(s./usr/lib/python2.6/site-packages/yum/config.pyt_apply_installroot�s
s/etc/yum/vars/i����s
R�R�R�ii(scachedirslogfiles
persistdirN(RARNRORERFR�R�RCR�tostlistdirtOSErrorRKtislinktopentreadlinetIOErrorR�R�tcacheRtprogess_objR�texistststatR�R�R�(RIRPRRt
dir_fsvarstfsvarstfsvarRaR�((RAs./usr/lib/python2.6/site-packages/yum/config.pytreadMainConfig�sL
s/etc/yum/version-groups.confcCs�t�}t|�}y|i|�Wn(tj
o}tid|��nXh}x5|i�D]'}t�||<||i||�qdW|S(NsParsing file failed: %s( RRRBRR�R�tsectionsR;R�(RGR�RJR!tretR�((s./usr/lib/python2.6/site-packages/yum/config.pytreadVersionGroupsConfig�s
cCsCy|i||�}Wnttfj
o|iSX|i|�S(s�Convenience function to retrieve a parsed and converted value from a
ConfigParser.
@param conf: ConfigParser instance or similar
@param section: Section name
@param name: Option name
@param option: Option instance to use for conversion.
@return: The parsed value or default if value was not present.
Will raise ValueError if the option could not be parsed.
(RlRRRR(tconfR�R$R�Ra((s./usr/lib/python2.6/site-packages/yum/config.pyt getOption�s
cCs^h}xQtdd�D]@}d|}tii|d�}|o|||i�<qqW|S(s�Return variable replacements from the environment variables YUM0 to YUM9
The result is intended to be used with parser.varReplace()
ii
sYUM%dR5(trangeRStenvironRlRH(R�tnumtenvRa((s./usr/lib/python2.6/site-packages/yum/config.pyR?�s
cCsAtiid|�}|ititiB�y|id|�}Wn�tj
o}t i
djoMt|d�o ti
dt|i���q�ti
dt|���nti
dt|���n2tij
o"}ti
dt|���nX|i�djo
d}n|i�}|d}~~~|S( s�Calculate the release version for the system.
@param installroot: The value of the installroot option.
@param distroverpkg: The value of the distroverpkg option.
@return: The release version as a string (eg. '4' for FC4)
RHtprovidesitmessagesError: is$releasevertversion(trpmUtilsttransactiontinitReadOnlyTransactiontpushVSFlagsR�t_RPMVSF_NOSIGNATURESt_RPMVSF_NODIGESTStdbMatchR`tsyst
hexversionR�R�tYumBaseErrorRRlterrortcounttnext(R�R�ttstidxR!REthdr((s./usr/lib/python2.6/site-packages/yum/config.pyRD�s(
c
CsKtpdStt|i��}|i}|i|ijoDxA|ii�D],}t||i�|ijo
|}qMqMWn|i i
|i�}x|i�D]q\}}|i|�}|i
|jp
||jo9|djp
||jo|i|�|||<qq�q�Wt|id�} | it|��| i�dS(s
Writes changes in a repo object back to a .repo file.
@param repo: Repo Object
@param only: List of attributes to work on (None = All)
It work by reading the repo file, changes the values there shall be changed and write it back to disk.
Ntw(t
_use_iniparseRRWtrepofileRt _sectionstkeysRR�R�R�R�R�RRR)RBR�Rtclose(
trepotonlytinit
section_idtsectR�R$R R�tfp((s./usr/lib/python2.6/site-packages/yum/config.pytwriteRawRepoFiles&
#(<R,R-RRSRuR�R�R#RIRUR�RRtiniparseRtiniparse.compatRRRRRtImportErrorRtrpmUtils.transactionRnR�R�tmiscRR R�R�tobjectR
R0R1R?RSRZRbReRqRxRyR~RR�R�R�R�R-R;RMRaRdRfR?RDRR�(((s./usr/lib/python2.6/site-packages/yum/config.pyt<module>sd\
"&*
5$|�? - H
#