From: Andrew M. <fit...@us...> - 2006-03-14 16:42:53
|
Update of /cvsroot/radmind/radmind-assistant In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27351 Modified Files: RAVersionCompare.m RCMStepController.h RCMStepController.m Log Message: Fix: Radmind Assistant - About Shows Previous Version [bug #1448087] Index: RCMStepController.m =================================================================== RCS file: /cvsroot/radmind/radmind-assistant/RCMStepController.m,v retrieving revision 1.104 retrieving revision 1.105 diff -C2 -d -r1.104 -r1.105 *** RCMStepController.m 10 Mar 2006 13:35:31 -0000 1.104 --- RCMStepController.m 14 Mar 2006 16:42:46 -0000 1.105 *************** *** 34,41 **** static BOOL firstTimeWalkThrough = NO; ! static char *tools[] = { "/usr/local/bin/fsdiff", "/usr/local/bin/ktcheck", ! "/usr/local/bin/lapply", "/usr/local/bin/lcksum", ! "/usr/local/bin/lcreate", "/usr/local/bin/lfdiff", ! "/usr/local/bin/lmerge", "/usr/local/bin/twhich", "/usr/local/sbin/radmind", NULL }; --- 34,46 ---- static BOOL firstTimeWalkThrough = NO; ! static char *tools[] = { "/usr/local/bin/fsdiff", ! "/usr/local/bin/ktcheck", ! "/usr/local/bin/lapply", ! "/usr/local/bin/lcksum", ! "/usr/local/bin/lcreate", ! "/usr/local/bin/lfdiff", ! "/usr/local/bin/lmerge", ! "/usr/local/bin/lsort", ! "/usr/local/bin/twhich", "/usr/local/sbin/radmind", NULL }; *************** *** 197,203 **** - ( void )versionCheck { FILE *fp; char buf[ MAXPATHLEN ], cmd[ MAXPATHLEN ], **p; ! int cmpdone = 0; for ( p = tools; *p != NULL; p++ ) { --- 202,219 ---- - ( void )versionCheck { + if ( [[ RAVersionCompare sharedComparison ] + compareInstalledVersion ] > 0 ) { + [ self setNeedsToolUpdate: YES ]; + } + } + + /* get version info for all installed tools */ + - ( IBAction )showAboutPanel: ( id )sender + { FILE *fp; char buf[ MAXPATHLEN ], cmd[ MAXPATHLEN ], **p; ! ! [ aboutToolsVersionView setEditable: YES ]; ! [ aboutToolsVersionView setString: @"" ]; for ( p = tools; *p != NULL; p++ ) { *************** *** 206,215 **** if ( access( toolpath, F_OK | X_OK ) < 0 ) { if ( errno == ENOENT ) { - if ( strcmp( toolpath, "/usr/local/bin/fsdiff" ) == 0 ) { - [ self setNeedsToolUpdate: YES ]; - } [ aboutToolsVersionView insertText: ! [ NSString stringWithFormat: @"%s not installed.\n\n", toolpath ]]; ! continue; } else { NSLog( @"Couldn't access %s: %s\n", *p, strerror( errno )); --- 222,228 ---- if ( access( toolpath, F_OK | X_OK ) < 0 ) { if ( errno == ENOENT ) { [ aboutToolsVersionView insertText: ! [ NSString stringWithFormat: ! @"%s not installed.\n\n", toolpath ]]; } else { NSLog( @"Couldn't access %s: %s\n", *p, strerror( errno )); *************** *** 219,223 **** } ! if ( snprintf( cmd, MAXPATHLEN, "%s -V", toolpath ) > ( MAXPATHLEN -1 )) { NSLog( @"%s -V: too long", toolpath ); [ aboutToolsVersionView setEditable: NO ]; --- 232,236 ---- } ! if ( snprintf( cmd, MAXPATHLEN, "%s -V", toolpath ) >= MAXPATHLEN ) { NSLog( @"%s -V: too long", toolpath ); [ aboutToolsVersionView setEditable: NO ]; *************** *** 229,233 **** [ aboutToolsVersionView insertText: [ NSString stringWithFormat: ! @"Couldn't get version for %s.\n\n", toolpath ]]; continue; } --- 242,247 ---- [ aboutToolsVersionView insertText: [ NSString stringWithFormat: ! @"Couldn't get version for %s: %s.\n\n", ! toolpath, strerror( errno ) ]]; continue; } *************** *** 236,248 **** [ NSString stringWithFormat: @"%s:\n\t", toolpath ]]; while ( fgets( buf, MAXPATHLEN, fp ) != NULL ) { ! if ( strcmp( toolpath, "/usr/local/bin/fsdiff" ) == 0 && cmpdone == 0 ) { ! if ( [[ RAVersionCompare sharedComparison ] ! compareInstalledVersion ] > 0 ) { ! [ self setNeedsToolUpdate: YES ]; ! } ! cmpdone++; ! } ! ! [ aboutToolsVersionView insertText: [ NSString stringWithUTF8String: buf ]]; [ aboutToolsVersionView insertText: @"\t" ]; } --- 250,255 ---- [ NSString stringWithFormat: @"%s:\n\t", toolpath ]]; while ( fgets( buf, MAXPATHLEN, fp ) != NULL ) { ! [ aboutToolsVersionView insertText: ! [ NSString stringWithUTF8String: buf ]]; [ aboutToolsVersionView insertText: @"\t" ]; } *************** *** 255,258 **** --- 262,267 ---- [ aboutToolsVersionView setEditable: NO ]; [ aboutToolsVersionView scrollRangeToVisible: NSMakeRange( 0, 0 ) ]; + + [ aboutPanel makeKeyAndOrderFront: nil ]; } Index: RCMStepController.h =================================================================== RCS file: /cvsroot/radmind/radmind-assistant/RCMStepController.h,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** RCMStepController.h 12 Aug 2005 20:20:43 -0000 1.42 --- RCMStepController.h 14 Mar 2006 16:42:46 -0000 1.43 *************** *** 146,149 **** --- 146,150 ---- /* about panel methods */ + - ( IBAction )showAboutPanel: ( id )sender; - ( IBAction )emailAuthors: ( id )sender; - ( IBAction )visitWebsite: ( id )sender; Index: RAVersionCompare.m =================================================================== RCS file: /cvsroot/radmind/radmind-assistant/RAVersionCompare.m,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** RAVersionCompare.m 12 Aug 2005 19:29:10 -0000 1.5 --- RAVersionCompare.m 14 Mar 2006 16:42:46 -0000 1.6 *************** *** 51,54 **** --- 51,59 ---- path = [ fsdiffPath fileSystemRepresentation ]; + /* an install is required if we don't find fsdiff */ + if ( ![[ NSFileManager defaultManager ] fileExistsAtPath: fsdiffPath ] ) { + return( 1 ); + } + if ( snprintf( cmd, MAXPATHLEN, "%s -V", path ) >= MAXPATHLEN ) { NSLog( @"%s -V: too long", path ); |