Skip Menu |
Report information
Id: 925
Status: resolved
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: angela.huang [at] Corp.Sun.COM
Cc:
AdminCc:

Operating System: generic
PatchStatus: (no value)
Severity: medium
Type: core
Perl Version: 5.005
Fixed In: (no value)



Date: Mon, 28 Jun 1999 10:07:03 -0700
From: ANGELA HUANG <angela.huang [...] Corp.Sun.COM>
To: perlbug [...] perl.com
Cc: angela.huang [...] EBay.Sun.COM
Subject: Timelocal library bug using perl compiler of Perl 5.005
Download p2.pl
text/x-perl 2.4k
#!/bin/sh -- # Really perl eval 'exec perl $0 ${1+"$@"}' if 0; use Time::Local; # location of the cross reference file $XREF="/cms/src/patchdiag/ahtest/patchdiag.xref2"; sub calculateage{ # # calculate the age of the patch according to current date # $DAY = 24 * 60 * 60; %MONTHS = ( "Jan", 0, "Feb", 1, "Mar", 2, "Apr", 3, "May", 4, "Jun", 5, "Jul", 6, "Aug", 7, "Sep", 8, "Oct", 9, "Nov", 10, "Dec", 11 ); ( $lmonth, $day, $year ) = split(/\//, $_[0]); $month = $MONTHS{$lmonth}; $start = timelocal( 1, 1, 1, $day, $month, $year ); $end = time; print "testing:start=$start,end=$end,day=$day,month=$month,yr=$year\n"; $age = int( ( $end - $start ) / $DAY ); } ##============================================== ## BEGIN ##============================================== # ## process the commandline arguments $mode = "AUDIT"; # default mode open( UNAME, "/usr/bin/uname -nrp |" ); $uname = <UNAME>; close( UNAME ); ($name, $os, $arch) = split( / /, $uname); $arch =~ s/[\n\t ]*//g; # standard processing if ( $mode eq "AUDIT" || $mode eq "LONG" || $mode eq "PKGINFO" || $mode eq "SHOWREV" ) { # Read cross-reference file into memeory open(XREF, "<$XREF"); $/=""; $xref = <XREF>; $/="\n"; close XREF; @xref = split( /\n/, $xref ); # find all the recommended patches for OS that's NOT installed print "UNINSTALLED RECOMMENDED PATCHES\n\n"; print "$datestamp\n"; print $sec_header_w_age; $foundone = $FALSE; ($solaris_vers = $os) =~ s/^5/2/; # # Check for Solaris 7 and above # $os7 = substr($os,2,1); # get the number after the 1st (.) of the SunOS if ( $os7 ge 7 ) { $solaris_vers = $os7 }; @recmd=grep( /$arch[\.;]|all/, grep( /\|R\|/, grep( /\|$solaris_vers\|/, @xref ) ) ); for $i (0 .. $#xref) { print "xref= $xref[$i]\n"; } print "recmd=$#recmd\n"; for $i (0 .. $#recmd) { print "recmd= $recmd[$i]\n"; } foreach $recommend ( @recmd ) { ( $id, $crev, $reldate, $rFlag, $sFlag, $oFlag, $byFlag, $junk2, $archs, $pkgs, $synopsis ) = split( /\|/, $recommend); # &calculateage( $reldate ); &calculateage("May/04/99"); } } #============================================== # END #==============================================
Download p3.pl
text/x-perl 2.4k
#!/bin/sh -- # Really perl eval 'exec perl $0 ${1+"$@"}' if 0; use Time::Local; # location of the cross reference file $XREF="/cms/src/patchdiag/ahtest/patchdiag.xref2"; sub calculateage{ # # calculate the age of the patch according to current date # $DAY = 24 * 60 * 60; %MONTHS = ( "Jan", 0, "Feb", 1, "Mar", 2, "Apr", 3, "May", 4, "Jun", 5, "Jul", 6, "Aug", 7, "Sep", 8, "Oct", 9, "Nov", 10, "Dec", 11 ); ( $lmonth, $day, $year ) = split(/\//, $_[0]); $month = $MONTHS{$lmonth}; $start = timelocal( 1, 1, 1, $day, $month, $year ); $end = time; print "testing:start=$start,end=$end,day=$day,month=$month,yr=$year\n"; $age = int( ( $end - $start ) / $DAY ); } ##============================================== ## BEGIN ##============================================== # ## process the commandline arguments $mode = "AUDIT"; # default mode open( UNAME, "/usr/bin/uname -nrp |" ); $uname = <UNAME>; close( UNAME ); ($name, $os, $arch) = split( / /, $uname); $arch =~ s/[\n\t ]*//g; # standard processing if ( $mode eq "AUDIT" || $mode eq "LONG" || $mode eq "PKGINFO" || $mode eq "SHOWREV" ) { # Read cross-reference file into memeory open(XREF, "<$XREF"); $/=""; $xref = <XREF>; $/="\n"; close XREF; @xref = split( /\n/, $xref ); # find all the recommended patches for OS that's NOT installed print "UNINSTALLED RECOMMENDED PATCHES\n\n"; print "$datestamp\n"; print $sec_header_w_age; $foundone = $FALSE; ($solaris_vers = $os) =~ s/^5/2/; # # Check for Solaris 7 and above # $os7 = substr($os,2,1); # get the number after the 1st (.) of the SunOS if ( $os7 ge 7 ) { $solaris_vers = $os7 }; @recmd=grep( /$arch[\.;]|all/, grep( /\|R\|/, grep( /\|$solaris_vers\|/, @xref ) ) ); for $i (0 .. $#xref) { print "xref= $xref[$i]\n"; } print "recmd=$#recmd\n"; for $i (0 .. $#recmd) { print "recmd= $recmd[$i]\n"; } # foreach $recommend ( @recmd ) { ( $id, $crev, $reldate, $rFlag, $sFlag, $oFlag, $byFlag, $junk2, $archs, $pkgs, $synopsis ) = split( /\|/, $recommend); # &calculateage( $reldate ); &calculateage("May/04/99"); # } } #============================================== # END #==============================================
Download patchdiag.xref2
text/plain 209b
## PATCHDIAG TOOL CROSS-REFERENCE FILE AS OF 25/Jun/99 ## 106793|01|Nov/23/98|R|S| | |7|sparc;|SUNWcsu:11.7.0,REV=1998.10.06.00.59;SUNWhea:11.7.0,REV=1998.09.01.04.16;|SunOS 5.7: ufsdump and ufsrestore patch


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org