Changeset 227 for trunk/dasscm


Ignore:
Timestamp:
Nov 27, 2007, 3:12:12 PM (16 years ago)
Author:
joergs
Message:

prevent aborting if a file exists in the repository but not on the system

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dasscm/dasscm

    r226 r227  
    195195    my @permlist = ();
    196196    foreach my $file (@files) {
    197         my $info       = stat( "/" . $file ) || die "$file: stat error";
    198         my $mode       = get_type( $info->mode ) & 07777;
    199         my $modestring = sprintf( "%04o", $mode );
    200         my $uid        = $info->uid;
    201         my $uidname    = getpwuid($uid);
    202         my $gid        = $info->gid;
    203         my $gidname    = getgrgid($gid);
    204         push(
    205             @permlist,
    206             sprintf( "%-55s %-17s %4d",
    207                 $file, "${uidname}:${gidname}", $modestring )
    208         );
     197        $file = "/" . $file;
     198        if( -e $file ) {
     199            my $info       = stat( $file ) || die "failed to stat $file: aborting";
     200            my $mode       = get_type( $info->mode ) & 07777;
     201            my $modestring = sprintf( "%04o", $mode );
     202            my $uid        = $info->uid;
     203            my $uidname    = getpwuid($uid);
     204            my $gid        = $info->gid;
     205            my $gidname    = getgrgid($gid);
     206            push(
     207                @permlist,
     208                sprintf( "%-55s %-17s %4d",
     209                    $file, "${uidname}:${gidname}", $modestring )
     210            );
     211        } else {
     212            print "failed to get status of $file. It exists in the repository, but not on the system\n";
     213        }
    209214    }
    210215    return @permlist;
     
    746751    # revert
    747752    # activate
    748 }
     753    # rm
     754}
Note: See TracChangeset for help on using the changeset viewer.