Ticket #2366: portdestroot.tcl.diff

File portdestroot.tcl.diff, 1.4 KB (added by jberry@…, 19 years ago)

Patch to base/src/port1.0/portdestroot.tcl

  • portdestroot.tcl

    RCS file: /Volumes/src/cvs/od/proj/darwinports/base/src/port1.0/portdestroot.tcl,v
    retrieving revision 1.14
    diff -u -r1.14 portdestroot.tcl
     
    3939target_postrun ${com.apple.destroot} destroot_finish
    4040
    4141# define options
    42 options destroot.target destroot.destdir destroot.clean
     42options destroot.target destroot.destdir destroot.clean destroot.keepdirs
    4343commands destroot
    4444
    4545# Set defaults
     
    5050default destroot.post_args {${destroot.destdir}}
    5151default destroot.destdir {DESTDIR=${destroot}}
    5252default destroot.clean no
     53default destroot.keepdirs ""
    5354
    5455set_ui_prefix
    5556
     
    7980    global UI_PREFIX destroot prefix portname
    8081
    8182    # Prune empty directories in ${destroot}
    82     catch {system "find \"${destroot}\" -depth -type d -exec rmdir -- \{\} \\; 2>/dev/null"}
     83    set exclude_dirs [list]
     84    set exclude_phrase ""
     85    foreach path [option destroot.keepdirs] {
     86        lappend exclude_dirs "-path \"${path}\""
     87    }
     88    if { [llength ${exclude_dirs}] > 0 } {
     89        set exclude_phrase "! \\( [join ${exclude_dirs} " -or "] \\)"
     90    }
     91    catch {system "find \"${destroot}\" -depth -type d ${exclude_phrase} -exec rmdir -- \{\} \\; 2>/dev/null"}
    8392
    8493        # Compress all manpages with gzip (instead)
    8594        set manpath "${destroot}${prefix}/share/man"