[137871] branches/gsoc15-portfile
chunyang at macports.org
chunyang at macports.org
Mon Jun 22 06:16:23 PDT 2015
Revision: 137871
https://trac.macports.org/changeset/137871
Author: chunyang at macports.org
Date: 2015-06-22 06:16:22 -0700 (Mon, 22 Jun 2015)
Log Message:
-----------
github2port: Support peoject URL
Modified Paths:
--------------
branches/gsoc15-portfile/README.md
branches/gsoc15-portfile/github2port/github2port
Modified: branches/gsoc15-portfile/README.md
===================================================================
--- branches/gsoc15-portfile/README.md 2015-06-22 13:02:33 UTC (rev 137870)
+++ branches/gsoc15-portfile/README.md 2015-06-22 13:16:22 UTC (rev 137871)
@@ -14,7 +14,8 @@
Create Portfile template using PortGroup:
- # Github tarball URL
+ # Github project or tarball URL
+ $ ./port-create -group github https://github.com/tmux/tmux
$ ./port-create -group github https://github.com/tmux/tmux/releases/download/2.0/tmux-2.0.tar.gz
# Bitbucket project URL
$ ./port-create -group bitbucket https://bitbucket.org/sshguard/sshguard
Modified: branches/gsoc15-portfile/github2port/github2port
===================================================================
--- branches/gsoc15-portfile/github2port/github2port 2015-06-22 13:02:33 UTC (rev 137870)
+++ branches/gsoc15-portfile/github2port/github2port 2015-06-22 13:16:22 UTC (rev 137871)
@@ -1,16 +1,17 @@
#!/usr/bin/env 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 github group template Portfile given tarball URL
+# Generate a github group template Portfile given tarball or project URL
#
proc usage {{channel stderr}} {
global argv0
puts $channel "Usage: $argv0 URL"
puts $channel ""
- puts $channel "URL is the github tarball URL"
+ puts $channel "URL is the github tarball or project URL"
puts $channel ""
puts $channel "Example:"
+ puts $channel " $argv0 https://github.com/tmux/tmux"
puts $channel " $argv0 https://github.com/tmux/tmux/releases/download/2.0/tmux-2.0.tar.gz"
puts $channel " $argv0 https://github.com/jonas/tig/archive/tig-2.1.1.tar.gz"
}
@@ -62,6 +63,10 @@
# v0.8.5.tar.gz
set tarball [lindex $tmp 6]
parse_fancy_version $tarball
+} elseif {[string match *github* $url]} {
+ set tmp [split $url /]
+ set author [lindex $tmp 3]
+ set project [lindex $tmp 4]
} else {
usage
exit 1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150622/e48febc4/attachment.html>
More information about the macports-changes
mailing list