Ignore:
Timestamp:
Apr 24, 2007, 12:47:07 PM (11 years ago)
Author:
eridius@…
Message:

Implement new Pextlib command symlink which basically implements symlink(2).
Update ln in portutil to use this new symlink command.
Add full testing for ln, and for symlink.
Update ChangeLog appropriately

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/port1.0/portutil.tcl

    r24435 r24444  
    860860        }
    861861       
    862         if {[file isdirectory $target] && ![info exists options(h)]} {
     862        if {[file isdirectory $target] && ([file type $target] ne "link" || ![info exists options(h)])} {
    863863            set linktarget [file join $target [file tail $file]]
    864864        } else {
     
    866866        }
    867867       
    868         if {[file exists $linktarget] && ![info exists options(f)]} {
    869             return -code error "ln: $linktarget: File exists"
     868        if {![catch {file type $linktarget}]} {
     869            if {[info exists options(f)]} {
     870                file delete $linktarget
     871            } else {
     872                return -code error "ln: $linktarget: File exists"
     873            }
    870874        }
    871875       
     
    883887        }
    884888        if {[info exists options(s)]} {
    885             file link -symbolic $linktarget $file
     889            symlink $file $linktarget
    886890        } else {
    887891            file link -hard $linktarget $file
Note: See TracChangeset for help on using the changeset viewer.