<pre style='margin:0'>
Rainer Müller (raimue) pushed a commit to branch vcs-fetch
in repository macports-base.
</pre>
<p><a href="https://github.com/macports/macports-base/commit/0877d10d2d7f36f4b2cc8336ea11f4e38dd5a387">https://github.com/macports/macports-base/commit/0877d10d2d7f36f4b2cc8336ea11f4e38dd5a387</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 0877d10d2d7f36f4b2cc8336ea11f4e38dd5a387
</span>Author: Rainer Müller <raimue@macports.org>
AuthorDate: Mon Mar 19 01:19:54 2018 +0100
<span style='display:block; white-space:pre;color:#404040;'> fetch: Handle symlinks correctly in mktar
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> The Tcl command 'file attributes -permissions' always follows symlinks,
</span><span style='display:block; white-space:pre;color:#404040;'> making it impossible to read the permissions of the symlink itself. As
</span><span style='display:block; white-space:pre;color:#404040;'> many filesystems do not support mode bits on symlinks anyway, use a sane
</span><span style='display:block; white-space:pre;color:#404040;'> default value with all bits set.
</span>---
src/port1.0/portfetch.tcl | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/port1.0/portfetch.tcl b/src/port1.0/portfetch.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 7226f73..6441ee5 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/port1.0/portfetch.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/port1.0/portfetch.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -333,9 +333,6 @@ proc portfetch::mktar {tarfile dir mtime} {
</span> fs-traverse -tails f $dir {
set fpath [file join $dir $f]
if {$f ne "."} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- # use user permissions only, ignore the rest
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set mode [format "%o" [expr [file attributes $fpath -permissions] & 0700]]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span> # map type from Tcl to mtree
set type [file type $fpath]
array set typemap {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -352,6 +349,13 @@ proc portfetch::mktar {tarfile dir mtime} {
</span> }
set type $typemap($type)
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$type eq "link"} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set mode 0777
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # use user permissions only, ignore the rest
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set mode [format "%o" [expr [file attributes $fpath -permissions] & 0700]]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> # add entry to mtree output
puts $mtreefd "$f type=$type mode=$mode"
}
</pre><pre style='margin:0'>
</pre>