From e7fb349dd75afd715b425408d1088ef15e948b95 Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Tue, 10 Jul 2012 12:30:17 -0400 Subject: [PATCH] removed some more importenv.pl and remove hostname.pl. --- scripts/archival/shared_snarfer.pl | 13 ++++--------- scripts/archival/snarf_feisty_meow.pl | 3 ++- scripts/archival/snarf_fred_data.pl | 3 ++- scripts/archival/snarf_linux_config.pl | 3 ++- scripts/archival/snarf_notes.pl | 3 ++- scripts/archival/snarf_opensim.pl | 3 ++- scripts/archival/snarf_quartz.pl | 3 ++- scripts/archival/snarf_user.pl | 3 ++- scripts/core/generate_aliases.pl | 4 +--- scripts/rev_control/cvs_fix.pl | 1 - scripts/schedule/generate_reminders.pl | 2 +- scripts/text/add_cr.pl | 3 ++- scripts/text/diff_lib.pl | 6 +++--- scripts/text/new_sig.pl | 3 ++- scripts/text/strip_cr.pl | 3 ++- scripts/text/text_to_url.pl | 1 - 16 files changed, 29 insertions(+), 28 deletions(-) diff --git a/scripts/archival/shared_snarfer.pl b/scripts/archival/shared_snarfer.pl index 9edc4142..2d778b4a 100644 --- a/scripts/archival/shared_snarfer.pl +++ b/scripts/archival/shared_snarfer.pl @@ -21,12 +21,12 @@ ############################################################################### require "filename_helper.pl"; -require "hostname.pl"; -require "importenv.pl"; require "inc_num.pl"; use Cwd; +use Sys::Hostname; use File::Which; +use Env qw(FEISTY_MEOW_SCRIPTS TMP); $null_log = "/dev/null"; @@ -74,7 +74,8 @@ sub initialize_snarfer { # returns the current hostname, but without any domain included. sub short_hostname { - local($temphost) = &hostname(); + local($temphost) = hostname(); +#&hostname(); $temphost =~ s/([^.]*)\..*/\1/; return &lower($temphost); } @@ -84,12 +85,6 @@ sub short_hostname { sub snarf_prefix { local($base) = @_; $date_tool = "date"; - -# if ($OS =~ /win/i) { -# # just hope that this is running under msys in our build bin. -# $date_tool = "$PRODUCTION_DIR/msys/bin/date"; -# } - local($date_part) = `$date_tool +%Y-%m-%d-%H%M`; while ($date_part =~ /[\r\n]$/) { chop $date_part; } local($host) = &short_hostname(); diff --git a/scripts/archival/snarf_feisty_meow.pl b/scripts/archival/snarf_feisty_meow.pl index f58032b2..e468e126 100644 --- a/scripts/archival/snarf_feisty_meow.pl +++ b/scripts/archival/snarf_feisty_meow.pl @@ -15,9 +15,10 @@ # version of the License. Please send any updates to "fred@gruntose.com". # ############## -require "importenv.pl"; require "shared_snarfer.pl"; +use Env qw(HOME); + &initialize_snarfer; # let the snarfer hook us in. # get the number attachment and increment it for the next use. diff --git a/scripts/archival/snarf_fred_data.pl b/scripts/archival/snarf_fred_data.pl index 54402b2e..1aff83c6 100644 --- a/scripts/archival/snarf_fred_data.pl +++ b/scripts/archival/snarf_fred_data.pl @@ -18,9 +18,10 @@ # version of the License. Please send any updates to "fred@gruntose.com". # ############################################################################### -require "importenv.pl"; require "shared_snarfer.pl"; +use Env qw(HOME); + &initialize_snarfer; # get the number we use and increment it for the next use. diff --git a/scripts/archival/snarf_linux_config.pl b/scripts/archival/snarf_linux_config.pl index b59e1f3f..436ab523 100644 --- a/scripts/archival/snarf_linux_config.pl +++ b/scripts/archival/snarf_linux_config.pl @@ -15,9 +15,10 @@ # version of the License. Please send any updates to "fred@gruntose.com". ############## -require "importenv.pl"; require "shared_snarfer.pl"; +use Env qw(HOME); + &initialize_snarfer; # get the number we use and increment it for the next use. diff --git a/scripts/archival/snarf_notes.pl b/scripts/archival/snarf_notes.pl index f2e39d2e..40b535eb 100644 --- a/scripts/archival/snarf_notes.pl +++ b/scripts/archival/snarf_notes.pl @@ -18,9 +18,10 @@ # version of the License. Please send any updates to "fred@gruntose.com". # ############################################################################### -require "importenv.pl"; require "shared_snarfer.pl"; +use Env qw(HOME); + &initialize_snarfer; # get the number we use and increment it for the next use. diff --git a/scripts/archival/snarf_opensim.pl b/scripts/archival/snarf_opensim.pl index ddf43b0f..6840498d 100644 --- a/scripts/archival/snarf_opensim.pl +++ b/scripts/archival/snarf_opensim.pl @@ -18,9 +18,10 @@ # version of the License. Please send any updates to "fred@gruntose.com". # ############################################################################### -require "importenv.pl"; require "shared_snarfer.pl"; +use Env qw(HOME); + &initialize_snarfer; # let the snarfer hook us in. # get the number attachment and increment it for the next use. diff --git a/scripts/archival/snarf_quartz.pl b/scripts/archival/snarf_quartz.pl index 2e25e09a..b9d54a30 100644 --- a/scripts/archival/snarf_quartz.pl +++ b/scripts/archival/snarf_quartz.pl @@ -18,9 +18,10 @@ # version of the License. Please send any updates to "fred@gruntose.com". # ############################################################################### -require "importenv.pl"; require "shared_snarfer.pl"; +use Env qw(HOME); + &initialize_snarfer; # get the number we use and increment it for the next use. diff --git a/scripts/archival/snarf_user.pl b/scripts/archival/snarf_user.pl index 7abd79d3..27991eca 100644 --- a/scripts/archival/snarf_user.pl +++ b/scripts/archival/snarf_user.pl @@ -18,9 +18,10 @@ # version of the License. Please send any updates to "fred@gruntose.com". # ############################################################################### -require "importenv.pl"; require "shared_snarfer.pl"; +use Env qw(HOME USER); + &initialize_snarfer; # get the number we use and increment it for the next use. diff --git a/scripts/core/generate_aliases.pl b/scripts/core/generate_aliases.pl index ead37dac..80f52b77 100644 --- a/scripts/core/generate_aliases.pl +++ b/scripts/core/generate_aliases.pl @@ -23,7 +23,7 @@ require "filename_helper.pl"; -require "importenv.pl"; +use Env qw(BINDIR BUILD_TOP FEISTY_MEOW_DIR FEISTY_MEOW_GENERATED FEISTY_MEOW_SCRIPTS SHELL_DEBUG ); # given a possible aliasable filename, this will decide whether to create a perl # or bash alias for it. it needs the filename of the possible alias and the @@ -190,8 +190,6 @@ if (length($SHELL_DEBUG)) { # open the alias files to be created. open(she, ">> $FEISTY_MEOW_GENERATED/fmc_aliases_for_scripts.sh"); -#print "os is $OS\n"; - # find the list of files in the scripts directory. #opendir(scripts, "$FEISTY_MEOW_SCRIPTS"); #@shell_files = sort(readdir(scripts)); diff --git a/scripts/rev_control/cvs_fix.pl b/scripts/rev_control/cvs_fix.pl index 51a9c25c..4cee4be6 100644 --- a/scripts/rev_control/cvs_fix.pl +++ b/scripts/rev_control/cvs_fix.pl @@ -20,7 +20,6 @@ ############################################################################### #require "filename_helper.pl"; -#require "importenv.pl"; $new_cmd="cvs"; diff --git a/scripts/schedule/generate_reminders.pl b/scripts/schedule/generate_reminders.pl index 5b348675..e5177c6b 100644 --- a/scripts/schedule/generate_reminders.pl +++ b/scripts/schedule/generate_reminders.pl @@ -26,7 +26,7 @@ # The day must be a number, followed by a space. Anything after that # space is considered the description of the event. -require "importenv.pl"; +use Env qw(CLOUD_DIR TMP); ############## diff --git a/scripts/text/add_cr.pl b/scripts/text/add_cr.pl index 5d64771d..b98fdc88 100644 --- a/scripts/text/add_cr.pl +++ b/scripts/text/add_cr.pl @@ -19,7 +19,8 @@ ############################################################################### require "filename_helper.pl"; -require "importenv.pl"; + +use Env qw(TMP); $new_version = `mktemp "$TMP/zz_add_cr_tmp.XXXXXX"`; chop($new_version); diff --git a/scripts/text/diff_lib.pl b/scripts/text/diff_lib.pl index c0ffaf7a..6b194c2f 100644 --- a/scripts/text/diff_lib.pl +++ b/scripts/text/diff_lib.pl @@ -23,9 +23,9 @@ # support from CPAN. this can be installed by using cpan and telling it # install Text::Diff -require "ctime.pl"; require "filename_helper.pl"; -require "importenv.pl"; + +use Env qw(FEISTY_MEOW_DIR); use Text::Diff; @@ -146,7 +146,7 @@ sub print_header { # this function prints out the header prior to printing out any real # data. if there are no diffs, the header should never get printed. print "$break_line\n"; - local($printable_date) = &ctime(time); + local($printable_date) = scalar(localtime()); $printable_date =~ s/\n//g; print "[$printable_date]\n"; print "Left (<) is \"$temp_src\".\n"; diff --git a/scripts/text/new_sig.pl b/scripts/text/new_sig.pl index 82b2e98a..50c55fcc 100644 --- a/scripts/text/new_sig.pl +++ b/scripts/text/new_sig.pl @@ -19,7 +19,8 @@ ############################################################################### require "filename_helper.pl"; -require "importenv.pl"; + +use Env qw(HOME TMP); # creates a new signature file for outgoing email. local($temp_filename) = "$TMP/zz_signate"; diff --git a/scripts/text/strip_cr.pl b/scripts/text/strip_cr.pl index c9e0dab9..2f32a698 100644 --- a/scripts/text/strip_cr.pl +++ b/scripts/text/strip_cr.pl @@ -19,7 +19,8 @@ ############################################################################### require "filename_helper.pl"; -require "importenv.pl"; + +use Env qw(TMP); $new_version = `mktemp "$TMP/zz_strip_cr_tmp.XXXXXX"`; chop($new_version); diff --git a/scripts/text/text_to_url.pl b/scripts/text/text_to_url.pl index d1feeb16..3c3faf85 100644 --- a/scripts/text/text_to_url.pl +++ b/scripts/text/text_to_url.pl @@ -20,7 +20,6 @@ ############################################################################### #require "filename_helper.pl"; -#require "importenv.pl"; #require "inc_num.pl"; &generate_web_page(@ARGV); -- 2.34.1