[137726] branches/gsoc15-portfile/portfile-gen/portfile-gen
chunyang at macports.org
chunyang at macports.org
Wed Jun 17 21:29:07 PDT 2015
Revision: 137726
https://trac.macports.org/changeset/137726
Author: chunyang at macports.org
Date: 2015-06-17 21:29:07 -0700 (Wed, 17 Jun 2015)
Log Message:
-----------
portfile-gen: reindent & add modeline
Modified Paths:
--------------
branches/gsoc15-portfile/portfile-gen/portfile-gen
Modified: branches/gsoc15-portfile/portfile-gen/portfile-gen
===================================================================
--- branches/gsoc15-portfile/portfile-gen/portfile-gen 2015-06-18 04:27:43 UTC (rev 137725)
+++ branches/gsoc15-portfile/portfile-gen/portfile-gen 2015-06-18 04:29:07 UTC (rev 137726)
@@ -1,4 +1,5 @@
#!/usr/bin/tclsh
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
#
# Generate a basic template Portfile given a few bits of information
#
@@ -14,51 +15,51 @@
proc printUsage {{channel stderr}} {
- puts $channel "Usage: $::argv0 \[-h\] \[-g portgroup\] <portname> <portversion>"
- puts $channel " -g Specify a port group to use (perl5, python, etc)"
- puts $channel " -h This help"
- puts $channel ""
- puts $channel "portname name to use for the port; for group-based ports, don't"
- puts $channel " use the prefix (py-, p5-, etc) as this will add that"
- puts $channel " for you when needed"
- puts $channel "portversion version to use for the port"
+ puts $channel "Usage: $::argv0 \[-h\] \[-g portgroup\] <portname> <portversion>"
+ puts $channel " -g Specify a port group to use (perl5, python, etc)"
+ puts $channel " -h This help"
+ puts $channel ""
+ puts $channel "portname name to use for the port; for group-based ports, don't"
+ puts $channel " use the prefix (py-, p5-, etc) as this will add that"
+ puts $channel " for you when needed"
+ puts $channel "portversion version to use for the port"
}
set groupCode ""
while {[string index [lindex $::argv 0] 0] eq "-"} {
- switch [string range [lindex $::argv 0] 1 end] {
- g {
- if {[llength $::argv] < 2} {
- puts stderr "-g needs a port group"
+ switch [string range [lindex $::argv 0] 1 end] {
+ g {
+ if {[llength $::argv] < 2} {
+ puts stderr "-g needs a port group"
+ printUsage
+ exit 1
+ }
+ set groupCode [lindex $::argv 1]
+ if {[lsearch ${supportedGroups} ${groupCode}] == -1} {
+ puts "Sorry, port group ${groupCode} is currently not supported"
+ puts "Supported: [join ${supportedGroups}]"
+ exit 1
+ }
+ set ::argv [lrange $::argv 1 end]
+ }
+ h {
+ printUsage stdout
+ exit 0
+ }
+ default {
+ puts stderr "Unknown option [lindex $::argv 0]"
printUsage
exit 1
- }
- set groupCode [lindex $::argv 1]
- if {[lsearch ${supportedGroups} ${groupCode}] == -1} {
- puts "Sorry, port group ${groupCode} is currently not supported"
- puts "Supported: [join ${supportedGroups}]"
- exit 1
- }
- set ::argv [lrange $::argv 1 end]
- }
- h {
- printUsage stdout
- exit 0
- }
- default {
- puts stderr "Unknown option [lindex $::argv 0]"
- printUsage
- exit 1
- }
- }
- set ::argv [lrange $::argv 1 end]
+ }
+ }
+ set ::argv [lrange $::argv 1 end]
}
if {[llength $::argv] != 2} {
- puts stderr "Error: missing portname or portversion"
- printUsage
- exit 1
+ puts stderr "Error: missing portname or portversion"
+ printUsage
+ exit 1
}
set portname [lindex $::argv 0]
@@ -69,39 +70,39 @@
puts ""
puts "PortSystem 1.0"
switch ${groupCode} {
- perl5 {
- puts "PortGroup perl5 1.0"
- puts ""
- puts "perl5.branches 5.8 5.10 5.12 5.14 5.16"
- puts "perl5.setup ${portname} ${portversion}"
- puts "categories-append replaceme"
- }
- php {
- puts "PortGroup php 1.1"
- puts ""
- puts "name php-${portname}"
- puts "version ${portversion}"
- puts "categories-append replaceme"
- }
- python {
- puts "PortGroup python 1.0"
- puts ""
- puts "name py-${portname}"
- puts "version ${portversion}"
- puts "categories-append replaceme"
- }
- ruby {
- puts "PortGroup ruby 1.0"
- puts ""
- puts "ruby.setup ${portname} ${portversion}"
- puts "categories-append replaceme"
- }
- default {
- puts ""
- puts "name ${portname}"
- puts "version ${portversion}"
- puts "categories replaceme"
- }
+ perl5 {
+ puts "PortGroup perl5 1.0"
+ puts ""
+ puts "perl5.branches 5.8 5.10 5.12 5.14 5.16"
+ puts "perl5.setup ${portname} ${portversion}"
+ puts "categories-append replaceme"
+ }
+ php {
+ puts "PortGroup php 1.1"
+ puts ""
+ puts "name php-${portname}"
+ puts "version ${portversion}"
+ puts "categories-append replaceme"
+ }
+ python {
+ puts "PortGroup python 1.0"
+ puts ""
+ puts "name py-${portname}"
+ puts "version ${portversion}"
+ puts "categories-append replaceme"
+ }
+ ruby {
+ puts "PortGroup ruby 1.0"
+ puts ""
+ puts "ruby.setup ${portname} ${portversion}"
+ puts "categories-append replaceme"
+ }
+ default {
+ puts ""
+ puts "name ${portname}"
+ puts "version ${portversion}"
+ puts "categories replaceme"
+ }
}
puts "platforms darwin"
puts "maintainers replaceme"
@@ -118,47 +119,47 @@
puts ""
puts "long_description replaceme"
switch ${groupCode} {
- perl5 {
- }
- php {
- }
- python {
- puts ""
- puts "homepage replaceme"
- puts "master_sites replaceme"
- puts {distname ${portname}-${version}}
- }
- ruby {
- }
- default {
- puts ""
- puts "homepage replaceme"
- puts "master_sites replaceme"
- }
+ perl5 {
+ }
+ php {
+ }
+ python {
+ puts ""
+ puts "homepage replaceme"
+ puts "master_sites replaceme"
+ puts {distname ${portname}-${version}}
+ }
+ ruby {
+ }
+ default {
+ puts ""
+ puts "homepage replaceme"
+ puts "master_sites replaceme"
+ }
}
puts ""
puts "checksums rmd160 12345 \\"
puts " sha256 6789a"
switch ${groupCode} {
- php {
- puts ""
- puts "if {\${name} ne \${subport}} {"
- puts " depends_lib-append replaceme"
- puts ""
- puts " configure.args-append replaceme"
- puts "}"
- }
- python {
- puts ""
- puts "python.versions 25 26 27"
- puts ""
- puts "if {\${name} ne \${subport}} {"
- puts " post-destroot {"
- puts { set docdir ${prefix}/share/doc/${subport}}
- puts { xinstall -m 755 -d ${destroot}${docdir}}
- puts " xinstall -m 644 -W $\{worksrcpath\} replaceme \\"
- puts { ${destroot}${docdir}}
- puts " }"
- puts "}"
- }
+ php {
+ puts ""
+ puts "if {\${name} ne \${subport}} {"
+ puts " depends_lib-append replaceme"
+ puts ""
+ puts " configure.args-append replaceme"
+ puts "}"
+ }
+ python {
+ puts ""
+ puts "python.versions 25 26 27"
+ puts ""
+ puts "if {\${name} ne \${subport}} {"
+ puts " post-destroot {"
+ puts { set docdir ${prefix}/share/doc/${subport}}
+ puts { xinstall -m 755 -d ${destroot}${docdir}}
+ puts " xinstall -m 644 -W $\{worksrcpath\} replaceme \\"
+ puts { ${destroot}${docdir}}
+ puts " }"
+ puts "}"
+ }
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150617/b626d354/attachment-0001.html>
More information about the macports-changes
mailing list