New Ticket     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #777: info.diff

File info.diff, 4.8 KB (added by fenner@…, 9 years ago)

Patch to add install-info handling to port1.0

  • portdestroot.tcl

    ? info.diff
    ? old-info.diff
    RCS file: /Volumes/src/cvs/od/proj/darwinports/base/src/port1.0/portdestroot.tcl,v
    retrieving revision 1.7
    diff -u -r1.7 portdestroot.tcl
     
    7676} 
    7777 
    7878proc destroot_finish {args} { 
    79     global destroot 
     79    global destroot prefix 
    8080 
    8181    # Prune empty directories in ${destroot} 
    8282    catch {system "find \"${destroot}\" -depth -type d -print | xargs rmdir 2>/dev/null"} 
     83    # Delete any info/dir file since we're going to run install-info 
     84    set dirfile "${destroot}/${prefix}/info/dir" 
     85    if {[file exists $dirfile]} { 
     86        ui_debug "removing $dirfile" 
     87        file delete -force $dirfile 
     88    } 
    8389    return 0 
    8490} 
  • portinstall.tcl

    RCS file: /Volumes/src/cvs/od/proj/darwinports/base/src/port1.0/portinstall.tcl,v
    retrieving revision 1.64
    diff -u -r1.64 portinstall.tcl
     
    6868            exec touch -r $src_element $dst_element 
    6969        } 
    7070    } 
     71 
     72    # if it's an info file in an info directory, run install-info 
     73    if [regexp {(.*/info)/([^/]*\.info)$} $dst_element match path filename] { 
     74        system "install-info ${path}/${filename} ${path}/dir" 
     75    } 
    7176} 
    7277 
    7378proc directory_dig {rootdir workdir {cwd ""}} { 
  • portpackage.tcl

    RCS file: /Volumes/src/cvs/od/proj/darwinports/base/src/port1.0/portpackage.tcl,v
    retrieving revision 1.43
    diff -u -r1.43 portpackage.tcl
     
    7575    file copy -force -- ${portresourcepath}/package/background.tiff ${pkgpath}/Contents/Resources/background.tiff 
    7676    system "mkbom ${destpath} ${pkgpath}/Contents/Archive.bom" 
    7777    system "cd ${destpath} && pax -x cpio -w -z . > ${pkgpath}/Contents/Archive.pax.gz" 
     78    write_postinstall_script ${pkgpath}/Contents/Resources/postinstall ${destpath} 
    7879 
    7980    write_sizes_file ${pkgpath}/Contents/Resources/Archive.sizes ${portname} ${portversion} ${pkgpath} ${destpath} 
    8081 
     
    243244InstalledSize $installedSize 
    244245CompressedSize $compressedSize" 
    245246    close $fd 
     247} 
     248 
     249proc write_postinstall_script {script destpath} { 
     250    set find [open "|find ${destpath} -name *.info" r] 
     251    # this never returns anything. 
     252    # why?  I dunno.  tcl is not my friend. 
     253    while {[gets $find fname] >= 0} { 
     254        if {![info exists scriptfile]} { 
     255            set scriptfile [open $script w] 
     256            puts $scriptfile "#!/bin/sh" 
     257        } 
     258        regexp "^${destpath}(/.*/info)/(\[^/]*\.info)$" $fname match path filename 
     259        puts $scriptfile "install-info ${path}/${filename} ${path}/dir" 
     260    } 
     261    if [info exists scriptfile] { 
     262        close $scriptfile 
     263        file attributes $script -permission +x 
     264    } 
     265    close $find 
    246266} 
  • portrpmpackage.tcl

    RCS file: /Volumes/src/cvs/od/proj/darwinports/base/src/port1.0/portrpmpackage.tcl,v
    retrieving revision 1.3
    diff -u -r1.3 portrpmpackage.tcl
     
    159159%build 
    160160echo \"Go DarwinPorts\" 
    161161%install 
    162 %clean 
    163 %files -f ${destroot}/../${portname}.filelist 
    164 " 
     162%clean" 
     163    set filelist [open "${destroot}/../${portname}.filelist" r] 
     164    set post {} 
     165    set preun {} 
     166    while {[gets $filelist fname] >= 0} { 
     167        # if it's an info file in an info directory, run install-info 
     168        if [regexp {"(.*/info)/(.*\.info)"$} $fname match path filename] { 
     169            append post "install-info ${path}/${filename} ${path}/dir\n" 
     170            append preun "install-info --delete ${path}/${filename} ${path}/dir\n" 
     171        } 
     172    } 
     173    close $filelist 
     174    if {$post != {}} { 
     175        puts $specfd "%post 
     176${post}" 
     177    } 
     178    if {$preun != {}} { 
     179        puts $specfd "%preun 
     180${preun}" 
     181    } 
     182    puts $specfd "%files -f ${destroot}/../${portname}.filelist" 
    165183    close $specfd 
    166184} 
  • portuninstall.tcl

    RCS file: /Volumes/src/cvs/od/proj/darwinports/base/src/port1.0/portuninstall.tcl,v
    retrieving revision 1.28
    diff -u -r1.28 portuninstall.tcl
     
    119119                        } 
    120120                    } 
    121121                } else { 
     122                    # if it's an info file in an info directory, run install-info 
     123                    if [regexp {(.*/info)/([^/]*\.info)$} $fname match path filename] { 
     124                        system "install-info --delete ${path}/${filename} ${path}/dir" 
     125                    } 
    122126                    if [catch {file delete -- $fname}] { 
    123127                        ui_info "$UI_PREFIX  [format [msgcat::mc "Uninstall unable to remove file %s"] $fname]" 
    124128                        set uninst_err 1