Re@sddlmZddljjZddlZddlZddlZddl Z ddl m Z ddl m Z ddlZeZdddZGd d d e ejZdS) )logN)six)sdist_add_defaultsccs@x9tjdD](}x|j|D] }|Vq)WqWdS)z%Find all files under revision controlzsetuptools.file_findersN) pkg_resourcesiter_entry_pointsload)dirnameepitemr /builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/command/sdist.py walk_revctrlsrcs<eZdZdZd-ddddfd.gZiZd/ZddZddZddZ ddZ e e j ddZddZejd0kpd1ejkod2knpd3ejkod4knZereZd!d"Zfd#d$Zd%d&Zd'd(Zd)d*Zd+d,ZS)5sdistz=Smart sdist that finds anything supported by revision controlformats=N6formats for source distribution (comma-separated list)z keep-tempkz1keep the distribution tree around after creating zarchive file(s) dist-dir=dFdirectory to put the source distribution archive(s) in [default: dist]README README.rst README.txtcCs|jd|jd}|j|_|jjtjj|jd|jx!|j D]}|j|qaWddl }d|j j kr|j |jt|jdg}x9|jD].}dd|f}||kr|j|qWdS)Negg_infoz SOURCES.txtrcheck dist_filesrr) run_commandget_finalized_commandfilelistappendospathjoinr check_readmeget_sub_commandsdistutils.commandcommand__all__Zcheck_metadatamake_distributiongetattr distributionZ archive_files)selfZei_cmdcmd_name distutilsrfiledatar r rrun*s   "     z sdist.runcCstjj||jdS)N)origrinitialize_options_default_to_gztar)r,r r rr3Dszsdist.initialize_optionscCs#tjdkrdSdg|_dS)Nrbetargztar)r5r6rr7r)sys version_infoformats)r,r r rr4Iszsdist._default_to_gztarc Cs(|jtjj|WdQRXdS)z% Workaround for #516 N)_remove_os_linkr2rr))r,r r rr)Os zsdist.make_distributionccsqGddd}ttd|}y t`Wntk rCYnXz dVWd||k rlttd|XdS)zG In a context, remove and restore os.link if it exists c@seZdZdS)z&sdist._remove_os_link..NoValueN)__name__ __module__ __qualname__r r r rNoValue]s r@linkN)r*r!rA Exceptionsetattr)r@Zorig_valr r rr<Vs    zsdist._remove_os_linkc Cs\ytjj|WnAtk rWtj\}}}|jjjdj YnXdS)Ntemplate) r2r read_templaterBr9exc_infotb_nexttb_framef_localsclose)r,_tbr r rZ__read_template_hackks  zsdist.__read_template_hackr5rrcs|jjr|jd}|jj|j|jjsx@|jD]5\}}}|jjfdd|DqJWdS)zgetting python filesbuild_pycs%g|]}tjj|qSr )r!r"r#).0filename)src_dirr r s z.sdist._add_defaults_python..N)r+has_pure_modulesrrextendZget_source_filesZinclude_package_data data_files)r,rPrK filenamesr )rSr_add_defaults_pythons zsdist._add_defaults_pythonc sPy*tjrtj|n tjWntk rKtjdYnXdS)Nz&data_files contains unexpected objects)rPY2r_add_defaults_data_filessuper TypeErrorrwarn)r,) __class__r rr[s   zsdist._add_defaults_data_filescCsKxD|jD]}tjj|r dSq W|jddj|jdS)Nz,standard file not found: should have one of z, )READMESr!r"existsr^r#)r,fr r rr$s zsdist.check_readmecCstjj|||tjj|d}ttdritjj|ritj||j d||j dj |dS)Nz setup.cfgrAr) r2rmake_release_treer!r"r#hasattrraunlink copy_filerZsave_version_info)r,base_dirfilesdestr r rrcs ! zsdist.make_release_treec CsTtjj|jsdStj|jd}|j}WdQRX|djkS)NFrbz+# file GENERATED by distutils, do NOT edit )r!r"isfilemanifestioopenreadlineencode)r,fp first_liner r r_manifest_is_not_generateds z sdist._manifest_is_not_generatedc Cstjd|jt|jd}x|D]}tjrwy|jd}Wn&tk rvtjd|w,YnX|j }|j ds,| rq,|j j |q,W|j dS)zRead the manifest file (named by 'self.manifest') and use it to fill in 'self.filelist', the list of files to include in the source distribution. zreading manifest file '%s'rjzUTF-8z"%r not UTF-8 decodable -- skipping#N)rinforlrnrPY3decodeUnicodeDecodeErrorr^strip startswithrr rJ)r,rlliner r r read_manifests    zsdist.read_manifest)rNr)rrr)rrr)rMrNrM)r5r)r5rrO)r5rM)r5rMr)r=r>r?__doc__ user_options negative_optr`r1r3r4r) staticmethod contextlibcontextmanagerr<Z_sdist__read_template_hackr9r:Zhas_leaky_handlerErYr[r$rcrsr|r r )r_rrs8         r)r.rZdistutils.command.sdistr'rr2r!r9rmrZsetuptools.externrZ py36compatrrlistZ_default_revctrlrr r r rs