Ñò ®XRc@sfddklZddkiZddkiiZddkZddk Z dei fd„ƒYZ dS(iÿÿÿÿ(tlint_fmri_successorNtPkgManifestCheckercBsdeZdZdZd„Zd„Zdd„Zedƒe_dd„Z ed ƒe _d d „Z ed ƒe _d d„Z edƒe _dd„Z edƒe _dd„Z edƒe _dd„Zedƒe_dd„Zedƒe_d„Zdd„Zedƒe_d d!„Zed"ƒe_d#d$„Zed%ƒe_ed&„ZRS('sA class to check manifests.spkglint.manifestcCsMtdƒ|_h|_h|_g|_h|_tt|ƒi|ƒdS(Ns8Checks for errors within the scope of a single manifest.( t_t descriptiont ref_lastnamestlint_lastnamestprocessed_lastnamest dependenciestsuperRt__init__(tselftconfig((s?/usr/lib/python2.6/vendor-packages/pkg/lint/pkglint_manifest.pyR (s     c Cs*d„}d„}|iitdƒƒxC|i|id|iƒD]&}|||iƒ|||iƒqDW|iitdƒƒxL|i|id|id|i ƒD]&}|||iƒ|||i ƒq©Wx1|i D]&}|||iƒ|||i ƒqÝW|i |i |id|i ƒdS(NcSssd|jp d|jodStii|iiƒƒ}||jo||i|iƒn|ig|||id|d | ƒ o$|itdƒ|id| ƒndS(s§Checks for correct use of variant tags. * if variant tags present, matching variant descriptions exist and are correctly specified, with the exception of variant.debug.* variants * All manifests that deliver file actions of a given architecture declare variant.arch These checks are only performed on published packages.Ns%s%s.1s%s%s.2s%s%s.3cSs |idƒS(s)check whether we can ignore this variant.s variant.debug(t startswith(tvarname((s?/usr/lib/python2.6/vendor-packages/pkg/lint/pkglint_manifest.pytignore_variant+sR#Rtfiles pkg.filetypetelftelfarchR:s%s=%sicssx|] }|VqWdS(N((t.0tv((s?/usr/lib/python2.6/vendor-packages/pkg/lint/pkglint_manifest.pys Js s*variant(s) %(vars)s not defined by %(pkg)sR>tvarsR7R9cssx|] }|VqWdS(N((RkRl((s?/usr/lib/python2.6/vendor-packages/pkg/lint/pkglint_manifest.pys Qs sGvariant(s) %(vars)s not in list of known values for variants in %(pkg)ss variant.archsvariant.arch not declared in %s(t do_pub_checksR;RCtget_all_variantsRRERFRRRGtget_variant_templatet differencet type_diffsRKt value_diffstlentsortedRBRRMR(R RR2RNtunknown_variantstundefined_variantst has_arch_filetpkg_varstundefined_lint_idtunknown_lint_idtmissing_arch_lint_idRgR#tvcttdifftkRltvlist((s?/usr/lib/python2.6/vendor-packages/pkg/lint/pkglint_manifest.pytvariantssf              # s*Variants used by packages should be valid.t004cCstii|iiƒƒ}||ijodS||ijodS|i|}|i|jodSt|i|ƒdjo[td„|Dƒƒ}|i t dƒh|d6di |ƒd6dd |i |fƒn|i d |d d |i |fƒp|ii|ƒndS( s„Warn when there's a namespace clash where the last component of the pkg name matches an existing one in the catalog.Nicssx|]}|iƒVqWdS(N(tget_fmri(RkR%((s?/usr/lib/python2.6/vendor-packages/pkg/lint/pkglint_manifest.pys ss sDlast name component %(name)s in package name clashes across %(pkgs)sRR>tpkgsR9s%s%sRR:(R R RRRRRRtRuRLRRMRRFR(R RR2RNtlastnametfmristplist((s?/usr/lib/python2.6/vendor-packages/pkg/lint/pkglint_manifest.pytnaming_s$   s1Packages are encouraged to use unique leaf names.t005c Cs=h}g}tdƒ}g}xQ|idƒD]@}d|idjoq.nd|ijo]d|i|f}|id|d|d |ƒp$|itd ƒ|id |ƒq.q.nd |i|f}|id|d|d |ƒoq.n|id} t| tƒo | g} nxL| D]D} ti | ƒ} | |jo|g|| ´s R7R>tactionsN(RRRRRFtcriticalRRRtextract_pkg_nameRRttconflicting_variantsRoRuRBRM(R RR2RNt seen_depst duplicatestdup_msgR#R:R?R$t shortnameR8RŠt conflict_varstconflict_actionstdlist((s?/usr/lib/python2.6/vendor-packages/pkg/lint/pkglint_manifest.pytduplicate_deps‚sZ            s4Packages should not have duplicate 'depend' actions.t006c Cs€h}tdƒ}g}d|i|f}x”|idƒD]ƒ}d|i|f}|id|d|d|ƒoq;n|id|jo|g||id×s R>tnamesR7R9N( RRRRFRRRtRRoRuRBRMR(R RR2RNt seen_setst dup_set_msgRR:R#R8RŠR’R“R”((s?/usr/lib/python2.6/vendor-packages/pkg/lint/pkglint_manifest.pytduplicate_sets½s6     s1Packages should not have duplicate 'set' actions.t007c CsÕg}t|iiƒƒD].}|idƒo|||i|fqq~}|oy|itdƒh|id6dig}|D]\}}|d||fq…~ƒd6dd|i|fd t ƒnd S( sqLogs an INFO message with the key/value pairs of all pkg.linted* attributes set on this manifest.s pkg.linteds6pkg.linted attributes detected for %(pkg)s: %(linted)sR7s, s%s=%sRFR9s%s%st ignore_lintedN( Rut attributestkeysRetinfoRRRMRRG( R RR2RNRUR8t linted_attrst_[2]tval((s?/usr/lib/python2.6/vendor-packages/pkg/lint/pkglint_manifest.pyRFàs1  2s*Show manifests with pkg.linted attributes.t008cCsßd|jp |iodS|i p|iiƒ o;|itdƒ|idd|i|fƒt|_dS|id|ƒ}|i d|d|ƒx=|i dƒD],}|i |||i d |i|fƒq«WdS( s7Checks that the info.classification attribute is valid.sinfo.classificationNsGUnable to perform manifest checks for info.classification attribute: %sR9s%s%s.1R#Rtvalues%s%s( tskip_classification_checktclassification_datatsectionsRBRtbad_classification_dataRRGR@RAtattrlistt _check_info_classification_valueR(R RR2RNR#titem((s?/usr/lib/python2.6/vendor-packages/pkg/lint/pkglint_manifest.pytinfo_classificationòs       s.info.classification attribute should be valid.cCsd}||jo)|itdƒtƒdd|ƒdS|i|dƒ}|iddƒ}t|ƒdjo)|itd ƒtƒdd |ƒdS|\}} t} g} y9|ii|d ƒid ƒ} | | jo t } nWnºt i j o\|ii ƒ} |itd ƒh|d6di t| ƒƒd6|d6dd|ƒdSt ij oA|itdƒh|id6|d6|d6dd|ƒdSX| odS|ii|d ƒ} |itdƒh|d6|d6|id6| d6dd|ƒdS(Nsorg.opensolaris.category.2008:sHinfo.classification attribute does not contain '%(prefix)s' for %(fmri)sR9s%s.2tt/iis^info.classification value %(value)s does not match %(prefix)s
/ for %(fmri)ss%s.3tcategoryt,sminfo.classification value %(value)s does not contain one of the valid sections %(ref_sections)s for %(fmri)s.R¤s, t ref_sectionsRs%s.4szInvalid info.classification value for %(fmri)s: data file %(file)s does not have a 'category' key for section %(section)s.Rhtsections%s.5sŒinfo.classification attribute in %(fmri)s does not contain one of the values defined for the section %(section)s: %(ref_cats)s from %(path)sR tref_catss%s.6(RBRtlocalstreplacetsplitRtRGR¦RRCt ConfigParsertNoSectionErrorR§RMRut NoOptionErrortclassification_path(R R2R¤RR9tprefixtclassificationt componentsR²R¯t valid_valuetref_categoriesR§R³((s?/usr/lib/python2.6/vendor-packages/pkg/lint/pkglint_manifest.pyRª sV             t009cCsa|idd ƒ}|idd ƒ}|djoY|id|ƒ}|id|d|ƒ|itdƒ|idd|i|fƒn|djoY|id|ƒ}|id|d|ƒ|itd ƒ|idd |i|fƒn||jo`|oY|id|ƒ}|id|d|ƒ|itd ƒ|idd |i|fƒnd S(s}Warns when a package has an empty summary or description, or a description which is identical to the summary.spkg.descriptions pkg.summaryR­R#RsEmpty pkg.description in %sR9s%s%s.1sEmpty pkg.summary in %ss%s%s.3s)pkg.description matches pkg.summary in %ss%s%s.2N(RRDR@RARLRRR(R RR2RNtdesctsummR#((s?/usr/lib/python2.6/vendor-packages/pkg/lint/pkglint_manifest.pytbogus_descriptionPs,         s5A package's description should not match its summary.t010cCsfd|jodSd|jodSd|jo1|itdƒ|idd|i|fƒndS(sçVarious checks for missing attributes * error when a package doesn't have a pkg.summary (pkg.fmri should be present too, but that would get caught before we get here) s pkg.renamedNs pkg.obsoletes pkg.summarys%Missing attribute 'pkg.summary' in %sR9s%s%s.2(RBRRR(R RR2RN((s?/usr/lib/python2.6/vendor-packages/pkg/lint/pkglint_manifest.pyt missing_attrsqs     s.Standard package attributes should be present.t011cCsög}x‡|idƒD]v}d|ijotn|id}|idƒpqn|idƒp |idƒpqn|i|ƒqW|pdSd|jodS|itdƒhd i|ƒd 6|i d 6d d |i |fƒdS(sbIf we deliver files to lib/svc/manifest or var/svc/manifest, we should include an org.opensolaris.smf.fmri attribute in the manifest. This only reports a warning, because without pkglint content-checking support, we do not know whether the file actually contains any services or instances.RhR s.xmlslib/svc/manifestsvar/svc/manifestNsorg.opensolaris.smf.fmrisSMF manifests were delivered by %(pkg)s, but no org.opensolaris.smf.fmri attribute was found. Manifests found were: %(manifests)sR>t manifestsR7R9s%s%s( RRtcontinetendswithReRRLRRMRR(R RR2RNt smf_manifestsR#R ((s?/usr/lib/python2.6/vendor-packages/pkg/lint/pkglint_manifest.pytmissing_smf_fmri†s*   sQPackages delivering SMF services should have org.opensolaris.smf.fmri attributes.c sxˆ|D]€}||jo|||| R  J I   8       D     % ( tpkg.lint.engineRtpkg.fmriRt pkg.lint.basetlintR]tos.pathR R·tManifestCheckerR(((s?/usr/lib/python2.6/vendor-packages/pkg/lint/pkglint_manifest.pyts