[51850] trunk/base/src/port1.0/portdestroot.tcl
jmr at macports.org
jmr at macports.org
Fri Jun 5 07:04:29 PDT 2009
Revision: 51850
http://trac.macports.org/changeset/51850
Author: jmr at macports.org
Date: 2009-06-05 07:04:29 -0700 (Fri, 05 Jun 2009)
Log Message:
-----------
remove Jaguar-specific check
Modified Paths:
--------------
trunk/base/src/port1.0/portdestroot.tcl
Modified: trunk/base/src/port1.0/portdestroot.tcl
===================================================================
--- trunk/base/src/port1.0/portdestroot.tcl 2009-06-05 13:49:27 UTC (rev 51849)
+++ trunk/base/src/port1.0/portdestroot.tcl 2009-06-05 14:04:29 UTC (rev 51850)
@@ -178,97 +178,92 @@
}
# Compress all manpages with gzip (instead)
- # but NOT on Jaguar (Darwin 6.x)
- if {![regexp {darwin6} "${os.platform}${os.version}"]} {
- set manpath "${destroot}${prefix}/share/man"
- set gzip [findBinary gzip ${portutil::autoconf::gzip_path}]
- set gunzip "$gzip -d"
- set bunzip2 "[findBinary bzip2 ${portutil::autoconf::bzip2_path}] -d"
- if {[file isdirectory ${manpath}] && [file type ${manpath}] == "directory"} {
- ui_info "$UI_PREFIX [format [msgcat::mc "Compressing man pages for %s"] ${name}]"
- set found 0
- set manlinks [list]
- foreach mandir [readdir "${manpath}"] {
- if {![regexp {^(cat|man)(.)$} ${mandir} match ignore manindex]} { continue }
- set mandirpath [file join ${manpath} ${mandir}]
- if {[file isdirectory ${mandirpath}] && [file type ${mandirpath}] == "directory"} {
- ui_debug "Scanning ${mandir}"
- foreach manfile [readdir ${mandirpath}] {
- set manfilepath [file join ${mandirpath} ${manfile}]
- if {[file isfile ${manfilepath}] && [file type ${manfilepath}] == "file"} {
- if {[regexp "^(.*\[.\]${manindex}\[a-z\]*)\[.\]gz\$" ${manfile} gzfile manfile]} {
- set found 1
- system "cd ${manpath} && \
- $gunzip -f [file join ${mandir} ${gzfile}] && \
- $gzip -9vf [file join ${mandir} ${manfile}]"
- } elseif {[regexp "^(.*\[.\]${manindex}\[a-z\]*)\[.\]bz2\$" ${manfile} bz2file manfile]} {
- set found 1
- system "cd ${manpath} && \
- $bunzip2 -f [file join ${mandir} ${bz2file}] && \
- $gzip -9vf [file join ${mandir} ${manfile}]"
- } elseif {[regexp "\[.\]${manindex}\[a-z\]*\$" ${manfile}]} {
- set found 1
- system "cd ${manpath} && \
- $gzip -9vf [file join ${mandir} ${manfile}]"
+ set manpath "${destroot}${prefix}/share/man"
+ set gzip [findBinary gzip ${portutil::autoconf::gzip_path}]
+ set gunzip "$gzip -d"
+ set bunzip2 "[findBinary bzip2 ${portutil::autoconf::bzip2_path}] -d"
+ if {[file isdirectory ${manpath}] && [file type ${manpath}] == "directory"} {
+ ui_info "$UI_PREFIX [format [msgcat::mc "Compressing man pages for %s"] ${name}]"
+ set found 0
+ set manlinks [list]
+ foreach mandir [readdir "${manpath}"] {
+ if {![regexp {^(cat|man)(.)$} ${mandir} match ignore manindex]} { continue }
+ set mandirpath [file join ${manpath} ${mandir}]
+ if {[file isdirectory ${mandirpath}] && [file type ${mandirpath}] == "directory"} {
+ ui_debug "Scanning ${mandir}"
+ foreach manfile [readdir ${mandirpath}] {
+ set manfilepath [file join ${mandirpath} ${manfile}]
+ if {[file isfile ${manfilepath}] && [file type ${manfilepath}] == "file"} {
+ if {[regexp "^(.*\[.\]${manindex}\[a-z\]*)\[.\]gz\$" ${manfile} gzfile manfile]} {
+ set found 1
+ system "cd ${manpath} && \
+ $gunzip -f [file join ${mandir} ${gzfile}] && \
+ $gzip -9vf [file join ${mandir} ${manfile}]"
+ } elseif {[regexp "^(.*\[.\]${manindex}\[a-z\]*)\[.\]bz2\$" ${manfile} bz2file manfile]} {
+ set found 1
+ system "cd ${manpath} && \
+ $bunzip2 -f [file join ${mandir} ${bz2file}] && \
+ $gzip -9vf [file join ${mandir} ${manfile}]"
+ } elseif {[regexp "\[.\]${manindex}\[a-z\]*\$" ${manfile}]} {
+ set found 1
+ system "cd ${manpath} && \
+ $gzip -9vf [file join ${mandir} ${manfile}]"
+ }
+ set gzmanfile ${manfile}.gz
+ set gzmanfilepath [file join ${mandirpath} ${gzmanfile}]
+ if {[file exists ${gzmanfilepath}]} {
+ set desired 00444
+ set current [file attributes ${gzmanfilepath} -permissions]
+ if {$current != $desired} {
+ ui_info "[file join ${mandir} ${gzmanfile}]: changing permissions from $current to $desired"
+ file attributes ${gzmanfilepath} -permissions $desired
}
- set gzmanfile ${manfile}.gz
- set gzmanfilepath [file join ${mandirpath} ${gzmanfile}]
- if {[file exists ${gzmanfilepath}]} {
- set desired 00444
- set current [file attributes ${gzmanfilepath} -permissions]
- if {$current != $desired} {
- ui_info "[file join ${mandir} ${gzmanfile}]: changing permissions from $current to $desired"
- file attributes ${gzmanfilepath} -permissions $desired
- }
- }
- } elseif {[file type ${manfilepath}] == "link"} {
- lappend manlinks [file join ${mandir} ${manfile}]
}
+ } elseif {[file type ${manfilepath}] == "link"} {
+ lappend manlinks [file join ${mandir} ${manfile}]
}
}
}
- if {$found == 1} {
- # check man page links and rename/repoint them if necessary
- foreach manlink $manlinks {
- set manlinkpath [file join $manpath $manlink]
- # if link destination is not gzipped, check it
- set manlinksrc [file readlink $manlinkpath]
- # if link destination is an absolute path, convert it to a
- # relative path
- if {[file pathtype $manlinksrc] eq "absolute"} {
- set manlinksrc [file tail $manlinksrc]
+ }
+ if {$found == 1} {
+ # check man page links and rename/repoint them if necessary
+ foreach manlink $manlinks {
+ set manlinkpath [file join $manpath $manlink]
+ # if link destination is not gzipped, check it
+ set manlinksrc [file readlink $manlinkpath]
+ # if link destination is an absolute path, convert it to a
+ # relative path
+ if {[file pathtype $manlinksrc] eq "absolute"} {
+ set manlinksrc [file tail $manlinksrc]
+ }
+ if {![regexp "\[.\]gz\$" ${manlinksrc}]} {
+ set mandir [file dirname $manlink]
+ set mandirpath [file join $manpath $mandir]
+ set pwd [pwd]
+ if {[catch {_cd $mandirpath} err]} {
+ puts $err
+ return
}
- if {![regexp "\[.\]gz\$" ${manlinksrc}]} {
- set mandir [file dirname $manlink]
- set mandirpath [file join $manpath $mandir]
- set pwd [pwd]
- if {[catch {_cd $mandirpath} err]} {
- puts $err
- return
+ # if gzipped destination exists, fix link
+ if {[file isfile ${manlinksrc}.gz]} {
+ # if actual link name does not end with gz, rename it
+ if {![regexp "\[.\]gz\$" ${manlink}]} {
+ ui_debug "renaming link: $manlink to ${manlink}.gz"
+ file rename $manlinkpath ${manlinkpath}.gz
+ set manlink ${manlink}.gz
+ set manlinkpath [file join $manpath $manlink]
}
- # if gzipped destination exists, fix link
- if {[file isfile ${manlinksrc}.gz]} {
- # if actual link name does not end with gz, rename it
- if {![regexp "\[.\]gz\$" ${manlink}]} {
- ui_debug "renaming link: $manlink to ${manlink}.gz"
- file rename $manlinkpath ${manlinkpath}.gz
- set manlink ${manlink}.gz
- set manlinkpath [file join $manpath $manlink]
- }
- # repoint the link
- ui_debug "repointing link: $manlink from $manlinksrc to ${manlinksrc}.gz"
- file delete $manlinkpath
- ln -s "${manlinksrc}.gz" "${manlinkpath}"
- }
- _cd $pwd
+ # repoint the link
+ ui_debug "repointing link: $manlink from $manlinksrc to ${manlinksrc}.gz"
+ file delete $manlinkpath
+ ln -s "${manlinksrc}.gz" "${manlinkpath}"
}
+ _cd $pwd
}
- } else {
- ui_debug "No man pages found to compress."
}
+ } else {
+ ui_debug "No man pages found to compress."
}
- } else {
- ui_debug "No man page compression on ${os.platform}${os.version}."
}
# test for violations of mtree
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090605/29214d08/attachment.html>
More information about the macports-changes
mailing list