# TODO Tue Feb 26 09:35:41 2013 GMT
# $Id: TODO 148 2013-05-29 09:29:34Z minus $

# GENERAL

    *     mpm !!

    *   src/skel     targz      
       __DATA__  MPMinus/Helepr/Skel.pm   Skel.pm    
               SKEL   
      share  .   ,  Skel.pm     
               ...   
        !

    * phpinfo -    mpminfo --   MPMinus.    
         .      CSS , ,  JS.   
        Kernel.mpm     /mpminfo    
         /mpminfo/?action=main.css  ..   
      Kernel.mpm   MPMinus!    (  ) 
         ::Handlers !!
   
# BUGS

    * none

# REFACTORING

    *   croak  die,    !!

    * dir_*        File::Spec (CTK::Util)

    *      :

         * share.mnshome.info --       jquery , ..    
         * mnshome.info --     
         * suffit.org --     

    *    !!

    *  ,     pays !

# DOCUMENTATION

    * none

# DIAGNOSTICS

    *   

# SUPPORT

    * none

FROM CPAN
=========

sub _gitify # 
	{
	my $args = shift;

	my $loaded = eval "require Archive::Extract; 1;";
	croak "You need Archive::Extract to use features that gitify distributions\n"
		unless $loaded;

	my $starting_dir = cwd();

	foreach my $module ( @$args )
		{
		$logger->info( "Checking $module" );
		my $path = CPAN::Shell->expand( "Module", $module )->cpan_file;

		my $store_paths = _download( [ $module ] );
		$logger->debug( "gitify Store path is $store_paths->{$module}" );
		my $dirname = dirname( $store_paths->{$module} );

		my $ae = Archive::Extract->new( archive => $store_paths->{$module} );
		$ae->extract( to => $dirname );

		chdir $ae->extract_path;

		my $git = $ENV{GIT_COMMAND} || '/usr/local/bin/git';
		croak "Could not find $git"    unless -e $git;
		croak "$git is not executable" unless -x $git;

		# can we do this in Pure Perl?
		system( $git, 'init'    );
		system( $git, qw( add . ) );
		system( $git, qw( commit -a -m ), 'initial import' );
		}

	chdir $starting_dir;

	return HEY_IT_WORKED;
	}
