How to fetch files from GitHub?

Bryan Drewery bryan at shatow.net
Thu Jul 26 23:41:40 UTC 2012


On Jul 26, 2012, at 16:42, "Mikhail T." <mi+thun at aldan.algebra.com> wrote:

> Hello!
> 
> I've created a port of bittorrent-libutp -- a piece of software, that has not been officially "released" yet. It is in use by a number of other projects (like net-p2p/transmission/). The not-yet-committed port can be found at:
> 
>   http://aldan.algebra.com/~mi/port-stuff/libutp.shar
> 
> The vendor's code is hosted on GitHub, which allows downloading the entire directory as a single tarball. However, to download sources as of particular date/time, one has to use a hash of the version one cares for.
> 
> For example, the current version's tag is d4685a3. If you attempt to download the tar.gz from the https://github.com/bittorrent/libutp/downloads, you will get a file named: bittorrent-libutp-d4685a3.tar.gz.
> 
> Setting MASTER_SITES to https://github.com/bittorrent/libutp/tarball/d4685a3/ works, but the download is a redirect...
> 
> The port builds fine, but has two nasty problems:
> 
> 1. The DISTVERSION being simply the first 7 characters of some hash will not be
>   sequential -- the next release of the sources may have a hash, that will
>   sort below the current one, necessitating an ugly PORT_EPOCH bump. The
>   PORTVERSION ends up being "d4685.a3", which is not at all useful, but
>   forcing one's own PORTVERSION (something like 0.20120726) is not allowed...
> 2. Fetching the code requires forceful removal of the -A option from fetch(1)'s
>   arguments.
> 
> Would anyone care to play with the port as posted and offer suggestions on how to best resolve the two problems (other than hosting the tarball on my own)?

Check out ports-mgmt/portupgrade-devel for an example.

It uses a known hash, but you can use tags as well. You'll need to override FETCH_ARGS as seen there too.

> 
> Thanks! Yours,
> 
>   -mi

Regards,
Bryan Drewery 

> 
> _______________________________________________
> freebsd-ports at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-ports
> To unsubscribe, send any mail to "freebsd-ports-unsubscribe at freebsd.org"


More information about the freebsd-ports mailing list