Created
June 19, 2023 14:03
-
-
Save earnhardt3rd/e3ddefc9390cc28951e3fca10b5373f9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'getopts.pl'; | |
| Getopts('m:d:t'); | |
| my $MODE = uc($opt_m) || ""; | |
| my $DEBUG = $opt_d || 0; | |
| if (defined $opt_t) { my %TEST = &_SHOW_HISTORY();} | |
| 1; | |
| sub _SHOW_HISTORY { | |
| my @HISTORY; | |
| print " SEARCHING FOR HISTORY FILES!\n"; | |
| if (scalar(keys %ROOTS) > 0) { | |
| foreach my $rKey(sort keys %ROOTS) { | |
| next if ($rKey =~ /^${HAG}/); | |
| my $rPath = $ROOTS{$rKey}; | |
| print " ROOT_KEY :$rKey\n" if $DEBUG > 0; | |
| print " ROOT_PATH:$rPath\n" if $DEBUG > 0; | |
| if (-d $rPath) { | |
| opendir(HISFLD,$rPath); | |
| my @HISFILES = grep { /\.his$|\.HIS$/ } readdir(HISFLD); | |
| closedir(HISFLD); | |
| chdir "$rPath"; | |
| if (scalar(@HISFILES) > 0) { | |
| print " FOUND HISTORY FILE IN FOLDER: $rPath\n"; | |
| for my $hisFile(@HISFILES) { | |
| if (-f $hisFile) { | |
| print " READING *** $hisFile ***\n"; | |
| open (HIS,"< $hisFile"); | |
| while (<HIS>) { | |
| my $line = $_; | |
| chomp($line); | |
| if ($line =~ /PTF Wizard/) { | |
| print " ::$line\n"; | |
| my $hLine = $rPath . $SLASH . $hisFile . ",${line}"; | |
| push(@HISTORY,"$hLine"); | |
| } | |
| } | |
| my $fxHis = $rPath . $SLASH . $hisFile; | |
| my $nxHis = $PDM . $SLASH . "his" . $SLASH . &_PATH_STRING($fxHis); | |
| if (-f $nxHis) { | |
| my $hisDifCmd = $OS_TOOLS{"diff"} . " \"$fxHis\" \"$nxHis\""; | |
| my $xhDIF = `$hisDifCmd 2>&1`; | |
| if ($xhDIF =~ /Usage:/) { | |
| print " ***********************************\n"; | |
| print " ERROR!Unable to complete diff\n"; | |
| print " $hisDifCmd\n"; | |
| print " $xhDIF\n"; | |
| print "SKIP...\n"; | |
| next; | |
| } | |
| if ($xhDIF eq "") { | |
| print " ** NO DIFFERENCES **\n"; | |
| next; | |
| } else { | |
| my $hCmd = $OS_TOOLS{"cp"} . " \"$fxHis\" \"$nxHis\""; | |
| my $hEx = `$hCmd`; | |
| if (! -f $nxHis ) { | |
| print " ** COPY FAILED **\n"; | |
| print " $hCmd\n"; | |
| } | |
| } | |
| } else { | |
| my $hCmd = $OS_TOOLS{"cp"} . " \"$fxHis\" \"$nxHis\""; | |
| my $hEx = `$hCmd`; | |
| if (! -f $nxHis ) { | |
| print " ** COPY FAILED **\n"; | |
| print " $hCmd\n"; | |
| } | |
| } | |
| } else { | |
| print " NOT A VALID FILE: $hisFile\n"; | |
| } | |
| } | |
| } else { | |
| print " NO HISTORY FILES IN FOLDER: $rPath\n"; | |
| } | |
| } else { | |
| print " INVALID PATH! Could not locate Folder ( $rKey==$ROOTS{$rKey} )\n"; | |
| } | |
| } | |
| } else { | |
| &displayMessageInBox(" NO ROOT TAGS FOUND!\n"); | |
| #print " NO ROOT ENVIRONMENT TAGS FOUND!\n"; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment