<pre style='margin:0'>
Marcus Calhoun-Lopez (MarcusCalhoun-Lopez) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/7f48b1b92f59b1e1642359771c09858621f332a7">https://github.com/macports/macports-ports/commit/7f48b1b92f59b1e1642359771c09858621f332a7</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new 7f48b1b92f5 muniversal PG: add ability to merge files w/o macros
</span>7f48b1b92f5 is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 7f48b1b92f59b1e1642359771c09858621f332a7
</span>Author: Marcus Calhoun-Lopez <mcalhoun@macports.org>
AuthorDate: Sun Jan 1 14:38:07 2023 -0700
<span style='display:block; white-space:pre;color:#404040;'> muniversal PG: add ability to merge files w/o macros
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Add option called`muniversal.combine that contains the list of files.
</span>---
_resources/port1.0/group/muniversal-1.1.tcl | 25 ++++++++++++++++++-------
1 file changed, 18 insertions(+), 7 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/_resources/port1.0/group/muniversal-1.1.tcl b/_resources/port1.0/group/muniversal-1.1.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 806d2af25f8..3e9f0ca6cfe 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/_resources/port1.0/group/muniversal-1.1.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/_resources/port1.0/group/muniversal-1.1.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -37,6 +37,10 @@ default muniversal.no_3_archs {no}
</span> options muniversal.dont_diff
default muniversal.dont_diff {}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+# list of file name whose contents just need to be interlaced
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+options muniversal.combine
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+default muniversal.combine {}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> ##########################################################################################
# utilites
##########################################################################################
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -362,8 +366,9 @@ proc muniversal::strip_dir_arch {arch1 arch2 dir1 dir2 dir fl} {
</span> # merge ${base1}/${prefixDir} and ${base2}/${prefixDir} into dir ${base}/${prefixDir}
# arch1, arch2: names to prepend to files if a diff merge of two files is forbidden by merger_dont_diff
# merger_dont_diff: list of files for which diff ${diffFormat} will not merge correctly
<span style='display:block; white-space:pre;background:#e0ffe0;'>+# merger_combine: list of files whose different contents just need to be interlaced
</span> # diffFormat: format used by diff to merge two text files
<span style='display:block; white-space:pre;background:#ffe0e0;'>-proc muniversal::merge {base1 base2 base prefixDir arch1 arch2 merger_dont_diff diffFormat} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+proc muniversal::merge {base1 base2 base prefixDir arch1 arch2 merger_dont_diff merger_combine diffFormat} {
</span> set dir1 ${base1}/${prefixDir}
set dir2 ${base2}/${prefixDir}
set dir ${base}/${prefixDir}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -407,7 +412,7 @@ proc muniversal::merge {base1 base2 base prefixDir arch1 arch2 merger_dont_diff
</span> }
} elseif { [file isdirectory ${dir1}/${fl}] } {
# files are directories (but not links), so recursively call function
<span style='display:block; white-space:pre;background:#ffe0e0;'>- muniversal::merge ${base1} ${base2} ${base} ${prefixDir}/${fl} ${arch1} ${arch2} ${merger_dont_diff} ${diffFormat}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ muniversal::merge ${base1} ${base2} ${base} ${prefixDir}/${fl} ${arch1} ${arch2} ${merger_dont_diff} ${merger_combine} ${diffFormat}
</span> } else {
# files are neither directories nor links
if { ! [catch {system "/usr/bin/cmp -s \"${dir1}/${fl}\" \"${dir2}/${fl}\" && /bin/cp -v \"${dir1}/${fl}\" \"${dir}\""}] } {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -442,6 +447,11 @@ proc muniversal::merge {base1 base2 base prefixDir arch1 arch2 merger_dont_diff
</span>
copy -force ${dir1}/${fl} ${dir}/${arch1}-${fl}
copy -force ${dir2}/${fl} ${dir}/${arch2}-${fl}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ } elseif {"${prefixDir}/${fl}" in ${merger_combine}} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # user has specified that contents just need to be interlaced
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set diffFormatCombine {--old-group-format='%<' --new-group-format='%>' --unchanged-group-format='%=' --changed-group-format='%<%>'}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_debug "universal: merge: created ${prefixDir}/${fl} by combining ${prefixDir}/${arch1}-${fl} ${prefixDir}/${arch1}-${fl}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ system "[muniversal::muniversal_get_diff_to_use] -dw ${diffFormatCombine} \"${dir1}/${fl}\" \"${dir2}/${fl}\" > \"${dir}/${fl}\"; test \$? -le 1"
</span> } else {
# files could not be merged into a fat binary
# handle known file types
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -969,7 +979,8 @@ proc portdestroot::destroot_start {args} {
</span> rename portdestroot::destroot_finish portdestroot::destroot_finish_real
proc portdestroot::destroot_finish {args} {
global workpath \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- muniversal.dont_diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ muniversal.dont_diff \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ muniversal.combine
</span>
# GNU diff can merge two C/C++ files
# See https://www.gnu.org/software/diffutils/manual/html_mono/diff.html#If-then-else
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1010,10 +1021,10 @@ proc portdestroot::destroot_finish {args} {
</span> %>#endif
'}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- muniversal::merge ${workpath}/destroot-ppc ${workpath}/destroot-ppc64 ${workpath}/destroot-powerpc "" ppc ppc64 ${muniversal.dont_diff} ${diffFormatM}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- muniversal::merge ${workpath}/destroot-i386 ${workpath}/destroot-x86_64 ${workpath}/destroot-intel "" i386 x86_64 ${muniversal.dont_diff} ${diffFormatM}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- muniversal::merge ${workpath}/destroot-powerpc ${workpath}/destroot-intel ${workpath}/destroot-ppc-intel "" powerpc x86 ${muniversal.dont_diff} ${diffFormatProc}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- muniversal::merge ${workpath}/destroot-arm64 ${workpath}/destroot-ppc-intel ${workpath}/destroot "" arm64 ppcintel ${muniversal.dont_diff} ${diffFormatArmElse}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ muniversal::merge ${workpath}/destroot-ppc ${workpath}/destroot-ppc64 ${workpath}/destroot-powerpc "" ppc ppc64 ${muniversal.dont_diff} ${muniversal.combine} ${diffFormatM}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ muniversal::merge ${workpath}/destroot-i386 ${workpath}/destroot-x86_64 ${workpath}/destroot-intel "" i386 x86_64 ${muniversal.dont_diff} ${muniversal.combine} ${diffFormatM}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ muniversal::merge ${workpath}/destroot-powerpc ${workpath}/destroot-intel ${workpath}/destroot-ppc-intel "" powerpc x86 ${muniversal.dont_diff} ${muniversal.combine} ${diffFormatProc}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ muniversal::merge ${workpath}/destroot-arm64 ${workpath}/destroot-ppc-intel ${workpath}/destroot "" arm64 ppcintel ${muniversal.dont_diff} ${muniversal.combine} ${diffFormatArmElse}
</span>
portdestroot::destroot_finish_real ${args}
}
</pre><pre style='margin:0'>
</pre>