Step though fetch and others
Ryan Schmidt
ryandesign at macports.org
Thu Feb 5 18:25:44 PST 2009
On Feb 5, 2009, at 20:10, Bradley Giesbrecht wrote:
> I want to contribute a port and I picked dbmail.
We appreciate it! :)
> I installed macports via svn.
> /opt/local/etc/macports/sources.conf:
> file:///Users/brad/misc/MacPorts/ports [nosync]
> file:///opt/mports/trunk/dports [default]
>
> This seemed like the way to go to add my own ports.
> Am I wrong?
That seems ok.
I've never bothered with the "local repository" setup myself, though
it's what the Guide recommends. I just have a single working copy of
trunk/dports which I use for everything. It can get a bit messy but
it works for me.
> With this configuration, if I do "port selfupdate" will macports
> check out or update from svn trunk?
If /opt/mports/trunk/dports is a Subversion working copy, then "port
sync" and "port selfupdate" will update that working copy with new
portfiles.
Nothing will change about how "port selfupdate" access the MacPorts
base code, which will still come via rsync and will still be the
released 1.7.0 version. If you want to build MacPorts base from
trunk, read this how-to:
http://trac.macports.org/wiki/howto/RunningTrunk
> I was mostly worried about having my own ports wiped out by updates
> but now I don't think that's an issue because, I just added them to
> my local repository, right?
If you use a local dports repository, as you have, then port sync
won't wipe out your changes.
Also, if you use a Subversion working copy, as I do, then port sync
uses svn update instead of rsync and it won't wipe out your changes
either.
> So I have local_repo/mail/dbmail/Portfile:
> name dbmail
> version 2.2.11
> homepage http://www.dbmail.org
> master_sites http://www.dbmail.org/download/2.2/
A construct we like to use in these situations is:
set branch [join [lrange [split ${version} .] 0 1] .]
master_sites http://www.dbmail.org/download/${branch}
That way you don't have to update master_sites when the version changes.
> checksums md5 d535587973d73b85469d92a35f52133b \
> sha1 7b9c19de7ca14d849e8388377b8aa941f3f3538b \
> rmd160 e8a506b850d1610b66059b685b7a2318ce5e37a9
>
> According to what I've read it should be fetching from:
> ${master_sites}${name}-${version}.tar.gz
In the end, yes.
More specifically, it fetches from ${master_sites}${distfiles}
(assuming master_sites and distfiles are both only a single item,
which they are in your case)
${distfiles} defaults to ${distname}${extract.suffix}.
${distname} defaults to ${name}-${version}
${extract.suffix} defaults to .tar.gz
> Well, there is definitely a file at that address. But I'm getting a
> html page download that's failing checksum besides not being what I
> want.
>
> How do I step through the fetch process?
>
> Or print to console the vars fetch is using?
You can enable debug mode with the -d switch:
cd path/to/dbmail
sudo port clean
sudo port -d fetch
You can also get the full URLs MacPorts wants to download from by using
port distfiles
More information about the macports-dev
mailing list