qfc@sdZddlmZddlmZmZddlZddlZddlZdefdYZ dZ dZ d Z dS( sdistutils.command.install_egg_info Implements the Distutils 'install_egg_info' command, for installing a package's PKG-INFO metadata.i(tCommand(tlogtdir_utilNtinstall_egg_infocBsAeZdZdZd gZdZdZdZdZRS( s)Install an .egg-info file for the packages8Install package's PKG-INFO metadata as an .egg-info files install-dir=tdsdirectory to install tocCs d|_dS(N(tNonet install_dir(tself((s:/usr/lib64/python2.7/distutils/command/install_egg_info.pytinitialize_optionsscCs|jdddtt|jjtt|jjtjd f}t j j |j ||_ |j g|_dS(Nt install_libRs%s-%s-py%s.egg-infoi(s install_dirs install_dir(tset_undefined_optionst to_filenamet safe_namet distributiontget_namet safe_versiont get_versiontsystversiontostpathtjoinRttargettoutputs(Rtbasename((s:/usr/lib64/python2.7/distutils/command/install_egg_info.pytfinalize_optionsscCs|j}tjj|rGtjj| rGtj|d|jnptjj|r||j tj |jfd|n;tjj|j s|j tj |j fd|j nt jd||jst|d}|jjj||jndS(Ntdry_runs Removing s Creating s Writing %stw(RRRtisdirtislinkRt remove_treeRtexiststexecutetunlinkRtmakedirsRtinfotopenR tmetadatatwrite_pkg_filetclose(RRtf((s:/usr/lib64/python2.7/distutils/command/install_egg_info.pytrun s %# cCs|jS(N(R(R((s:/usr/lib64/python2.7/distutils/command/install_egg_info.pyt get_outputs/s(s install-dir=Rsdirectory to install to( t__name__t __module__t__doc__t descriptiont user_optionsRRR)R*(((s:/usr/lib64/python2.7/distutils/command/install_egg_info.pyR s   cCstjdd|S(sConvert an arbitrary string to a standard distribution name Any runs of non-alphanumeric/. characters are replaced with a single '-'. s[^A-Za-z0-9.]+t-(tretsub(tname((s:/usr/lib64/python2.7/distutils/command/install_egg_info.pyR 7scCs%|jdd}tjdd|S(sConvert an arbitrary string to a standard version string Spaces become dots, and all other non-alphanumeric characters become dashes, with runs of multiple dashes condensed to a single dash. t t.s[^A-Za-z0-9.]+R0(treplaceR1R2(R((s:/usr/lib64/python2.7/distutils/command/install_egg_info.pyR?scCs|jddS(s|Convert a project or version name to its filename-escaped form Any '-' characters are currently replaced with '_'. R0t_(R6(R3((s:/usr/lib64/python2.7/distutils/command/install_egg_info.pyR Is( R-t distutils.cmdRt distutilsRRRRR1RR RR (((s:/usr/lib64/python2.7/distutils/command/install_egg_info.pyts$,