replaced_by and final port review ( pureftpd pure-ftpd )

Ryan Schmidt ryandesign at macports.org
Mon Nov 16 15:48:29 PST 2009


On Nov 16, 2009, at 17:31, Scott Haneda wrote:

> I made an effort to use replaced_by, but I am not seeing it in the docs.

It is new for 1.8.0 and has yet to be documented.


> I have a new port, pure-ftpd, the old port is pureftpd (off by one dash)
> 
> My local repo is ~/macports
> cd ~/macports/net
> cp -R pure-ftpd pureftpd
> cd pureftpd
> port edit
> 
> Added into the Portfile, at the top, after the name:
> replaced_by	pure-ftpd
> Changed the name of the portfile to the old name, pureftpd
> 
> Saved the file
> 
> cd ~/macports; portindex
> 
> Creating software index in /Users/me/macports
> Adding port net/pure-ftpd
> Adding port net/pureftpd
> 
> cd ~/macports/pureftpd
> sudo port -d install
> 
> And it happily went about installing itself.

I recall somebody else reporting this too. As I recall, "replaced_by" makes it so that if a user already has pureftpd installed, "port outdated" will show they need to upgrade to pure-ftpd, and "sudo port upgrade pureftpd" will uninstall pureftpd and will install pure-ftpd. However, "replaced_by" does nothing to prevent a user from trying to "sudo port install pureftpd". If I'm remembering that correctly, then it would be nice if this were fixed in MacPorts base.


> Where did I slip up, and what is the bare min I need in the replaced_by Portfile? I was thinking just:
> PortSystem          1.0
> 
> name                pureftpd
> replaced_by	    pure-ftpd
> categories          net
> platforms           darwin

I think you'll at least need to add a version. To fix the above issue, I would also add a pre-fetch block to prevent installation. Run port lint, see what else it says. Though port lint may still need to be adjusted for the new realities of the replaced_by keyword.


> I then submit that diff to the original port?




More information about the macports-dev mailing list