App-SeismicUnixGui
view release on metacpan or search on metacpan
lib/App/SeismicUnixGui/big_streams/RestoreProject.pl view on Meta::CPAN
4. Replace folder names of original user name (e.g., "gllore") with
the current user's login name
Another named Project
1. Apply tar -xzvf to the compressed and tarred Project file in the user's
directory.
2. Confirm that the Project.config directory is present. Otherwise output a warning.
3. Replace original user name (e.g., "gllore") with the current user name in Project_config
4. Replace folder names of original user name (e.g., "gllore") with
the current user's login name
5. Message that process is complete
=head2 NOTES
We are using Moose.
Moose already declares that you need debuggers turned on
so you don't need a line like the following:
use warnings;
5. replace original user name (e.g., "gllore") with the current user name.
=cut
use Moose;
our $VERSION = '0.1.0';
use aliased 'App::SeismicUnixGui::misc::L_SU_local_user_constants';
use aliased 'App::SeismicUnixGui::configs::big_streams::RestoreProject_config';
use aliased 'App::SeismicUnixGui::misc::config_superflows';
use aliased 'App::SeismicUnixGui::misc::control';
use aliased 'App::SeismicUnixGui::misc::readfiles';
use File::Copy;
=head2 Instantiate classes:
Create a new versions of the packages
=cut
my $L_SU_local_user_constants = L_SU_local_user_constants->new();
my $RestoreProject_config = RestoreProject_config->new();
my $readfiles = readfiles->new();
my $config_superflows = config_superflows->new();
my $control = control->new();
=head2
Internal definitions
=cut
my $success_counter = 0;
my $current_username = getpwuid($<);
my $prog_name = 'Project';
my $home_directory;
my $untar_options = '-xzvf';
my $default_tutorial_name = 'Servilleta';
my $tutorial_name = '';
my $false = 0;
my $true = 1;
my $PROJECT_exists = $false;
my $HOME = $L_SU_local_user_constants->get_home();
my $CONFIGURATION = $L_SU_local_user_constants->get_CONFIGURATION();
my $ACTIVE_PROJECT = $L_SU_local_user_constants->get_ACTIVE_PROJECT();
=head2 Restoration of Servilleta Tutorial file
stdin is empty
=cut
if ( length( $ARGV[0] )
and $ARGV[0] eq $default_tutorial_name )
{
$tutorial_name = $default_tutorial_name;
}
else {
# NADA
# print("NADA RestoreProject.pl\n");
}
=head2 STEP 1.
Does configuration information exist?
TODO: get_PROJECT_exists seems always=false ??
=cut
$PROJECT_exists = $L_SU_local_user_constants->get_PROJECT_exists();
=head2 Create an ACTIVE_PROJECT
This is the first time user runs SUG
and no .LSU directory exists
=cut
if ( not $PROJECT_exists
and $tutorial_name eq $default_tutorial_name )
{
$L_SU_local_user_constants->makconfig();
my $tar_input = $HOME . '/' . $tutorial_name;
# print("Confirmation: PROJECT does not exist\n");
my $old_Project_config_file = $tar_input . '/Project.config';
( run in 2.609 seconds using v1.01-cache-2.11-cpan-483215c6ad5 )