b-Qc@sxdZddlZddlZddlZddlmZddlTddlmZddl m Z ddl m Z ddl mZdd lmZdd lmZmZmZmZmZmZmZmZdd l mZd efd YZdefdYZde fdYZdZdZdZ dZ!dZ"dZ#e$dZ%dZ&dZ'dS(sUsetuptools.command.egg_info Create a distribution's .egg-info directory and contentsiN(tCommand(t*(tlog(tsdist(t basestring(t convert_path(tFileList(tparse_requirementst safe_namet parse_versiont safe_versiont yield_linest EntryPointtiter_entry_pointst to_filename(t walk_revctrltegg_infocBseZdZdd d!d"d#d$gZddgZidd 6dd6ZdZdZdZe dZ dZ dZ dZ dZdZedZdZdZRS(%s+create a distribution's .egg-info directorys egg-base=tesLdirectory containing .egg-info directories (default: top of the source tree)stag-svn-revisiontrs,Add subversion revision ID to version numberstag-datetds0Add date stamp (e.g. 20050528) to version numbers tag-build=tbs-Specify explicit tag to add to version numbersno-svn-revisiontRs*Don't add subversion revision ID [default]sno-datetDs"Don't include date stamp [default]cCsUd|_d|_d|_d|_d|_d|_d|_t|_ d|_ dS(Ni( tNonetegg_namet egg_versiontegg_baseRt tag_buildttag_svn_revisionttag_datetFalsetbroken_egg_infotvtags(tself((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pytinitialize_options+s        cCsCddlm}||iidd6dd6|jd6d6dS(Ni(t edit_configiRRRR(tsetuptools.command.setoptR#ttags(R!tfilenameR#((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pytsave_version_info6s cCst|jj|_|j|_|j|_y$tt d|j|jfWn-t k rt d|j|jfnX|j dkr|jj}|pijdtj|_ n|jdt|jd|_|j tjkrtjj|j |j|_nd|jkr8|jn|j|jj_|jj}|dk r|j|jjkr|j|_t|j|_d|j_ndS(Ns%s==%ss2Invalid distribution name or version syntax: %s-%stRs .egg-infot-( Rt distributiontget_nameRR%R ttagged_versionRtlistRt ValueErrortDistutilsOptionErrorRRt package_dirtgettostcurdirtensure_dirnameRRtpathtjointcheck_broken_egg_infotmetadatatversiont _patched_disttkeytlowert_versionR t_parsed_version(R!tdirstpd((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pytfinalize_optionsTs2!  ! !  $ cCsl|r|j|||nLtjj|rh|dkrX| rXtjd||dS|j|ndS(sWrite `data` to `filename` or delete if empty If `data` is non-empty, this routine is the same as ``write_file()``. If `data` is empty but not ``None``, this is the same as calling ``delete_file(filename)`. If `data` is ``None``, then this is a no-op unless `filename` exists, in which case a warning is issued about the orphaned file (if `force` is false), or deleted (if `force` is true). s$%s not set in setup(), but %s existsN(t write_fileR2R5texistsRRtwarnt delete_file(R!twhatR&tdatatforce((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pytwrite_or_delete_file}s  cCsjtjd||tjdkr4|jd}n|jsft|d}|j||jndS(sWrite `data` to `filename` (if not a dry run) after announcing it `what` is used in a log message to identify what is being written to the file. swriting %s to %sisutf-8twbN(i( Rtinfotsyst version_infotencodetdry_runtopentwritetclose(R!RFR&RGtf((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRBs  cCs-tjd||js)tj|ndS(s8Delete `filename` (if not a dry run) after announcing its deleting %sN(RRKROR2tunlink(R!R&((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyREs cCsE|jj}|jr4|j|jr4t|St||jS(N(R*t get_versionR tendswithR (R!R9((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyR,s cCs|j|j|jj}xNtdD]@}|jd|}|||jtjj |j|jq)Wtjj |jd}tjj |r|j |n|j dS(Nsegg_info.writerst installersnative_libs.txt( tmkpathRR*tfetch_build_eggR tloadtnameR2R5R6RCREt find_sources(R!RWteptwritertnl((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pytruns ,cCsd}|jr||j7}n|jrctjjdsLtjjdrc|d|j7}n|jrddl}||jd7}n|S(NR(s.svnsPKG-INFOs-r%sis-%Y%m%d( RRR2R5RCtget_svn_revisionRttimetstrftime(R!R9Rb((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyR%s  $  cCs?d}tjd}tjd}xtjtjD]\}}}d|kr_g|(q7n|jdttjj|dd}|j }|j |j dr|j |j d}tg|j|D]} t| j d^qdg} nyt|jd} Wn d} nX| d kr[tjd |g|(q7ntttj|jd }|dd=|dd }tg|D]2} t| d kr| d rt| d ^qdg} |tjkr|d} n|j | sg|(q7nt|| }q7Wt|p;tS(Nis url="([^"]+)"scommitted-rev="(\d+)"s.svntentriesss.$ :J