<pre style='margin:0'>
Rainer Müller (raimue) pushed a commit to branch master
in repository macports-contrib.
</pre>
<p><a href="https://github.com/macports/macports-contrib/commit/421043b1e3f12de0643795f60d37819140e6ec14">https://github.com/macports/macports-contrib/commit/421043b1e3f12de0643795f60d37819140e6ec14</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 421043b1e3f12de0643795f60d37819140e6ec14
</span>Author: Rainer Müller <raimue@macports.org>
AuthorDate: Tue Nov 8 17:42:35 2016 +0100
<span style='display:block; white-space:pre;color:#404040;'> portfile-gen: add help text for each portgroup
</span>---
portfile-gen/portfile-gen | 42 +++++++++++++++++++++++++++++++++++-------
1 file changed, 35 insertions(+), 7 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/portfile-gen/portfile-gen b/portfile-gen/portfile-gen
</span><span style='display:block; white-space:pre;color:#808080;'>index 065eedc..dd44ad9 100755
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/portfile-gen/portfile-gen
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/portfile-gen/portfile-gen
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -12,19 +12,43 @@ set MY_VERSION 0.2
</span>
set supportedGroups [list perl5 php python ruby github]
<span style='display:block; white-space:pre;background:#ffe0e0;'>-proc printUsage {{channel stderr}} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+proc printUsage {{portgroup ""} {channel stderr}} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ global supportedGroups
</span> puts $channel "Usage: $::argv0 \[-h\] \[-g portgroup\] <portname> <portversion>"
<span style='display:block; white-space:pre;background:#ffe0e0;'>- puts $channel " -g Specify a port group to use (perl5, python, github, etc)"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts $channel " -g Specify a port group to use"
</span> puts $channel " -h This help"
puts $channel ""
<span style='display:block; white-space:pre;background:#ffe0e0;'>- puts $channel "portname name to use for the port; for group-based ports, don't"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- puts $channel " use the prefix (py-, p5-, etc) as this will add that"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- puts $channel " for you when needed. For github, use githubuser/reponame."
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts $channel "portname name to use for the port; see also port groups usage"
</span> puts $channel "portversion version to use for the port"
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts $channel ""
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$portgroup eq ""} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts $channel "To see usage for a specific port group: $::argv0 -h -g portgroup"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts $channel "Supported port groups: ${supportedGroups}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts $channel "Usage for port group $portgroup:"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$portgroup eq "perl5"} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts $channel "Do not use the prefix 'p5-' in the portname as it will be added when needed."
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } elseif {$portgroup eq "php"} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts $channel "Do not use the prefix 'php-' in the portname as it will be added when needed."
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } elseif {$portgroup eq "python"} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts $channel "Do not use the prefix 'py-' in the portname as it will be added when needed."
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } elseif {$portgroup eq "ruby"} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts $channel "Do not use the prefix 'rb-' in the portname as it will be added when needed."
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } elseif {$portgroup eq "github"} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts $channel "Usage: $::argv0 -g github username/repository tag"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts $channel ""
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts $channel "GitHub username and repository have to be specifed as one argument,"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts $channel "but will be split automatically. The tag is the version number,"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts $channel "often in the format of 'vX.Y.Z'."
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts $channel "No special parameters for '$portgroup'."
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span> }
set groupCode ""
<span style='display:block; white-space:pre;background:#e0ffe0;'>+set usage false
</span> while {[string index [lindex $::argv 0] 0] eq "-"} {
switch [string range [lindex $::argv 0] 1 end] {
g {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -42,8 +66,7 @@ while {[string index [lindex $::argv 0] 0] eq "-"} {
</span> set ::argv [lrange $::argv 1 end]
}
h {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- printUsage stdout
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- exit 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set usage true
</span> }
default {
puts stderr "Unknown option [lindex $::argv 0]"
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -54,6 +77,11 @@ while {[string index [lindex $::argv 0] 0] eq "-"} {
</span> set ::argv [lrange $::argv 1 end]
}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+if {$usage} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ printUsage $groupCode stdout
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ exit 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> if {[llength $::argv] != 2} {
puts stderr "Error: missing portname or portversion"
printUsage
</pre><pre style='margin:0'>
</pre>