Update notification for macports

3

Is there any way or tool that I can use to receive notifications when any of my macports-packages are out-of-date?

Björn Pollex

Posted 2010-04-26T09:55:38.233

Reputation: 1 083

Answers

1

How about a cron job which runs port outdated and sends email when something is outdated. It could be as simple as this crontab:

MAILTO=Space_C0wb0y@domain.com

0 6 * * * /opt/local/bin/port outdated | /usr/bin/grep -v "No installed ports are outdated."

This will run at 6:00 am everyday. The grep -v removes the "no updates" line if everything is up to date. The MAILTO sets the address that cron will send output to if anything was written to stdout.

Doug Harris

Posted 2010-04-26T09:55:38.233

Reputation: 23 578

4

My rep is too low to comment on Doug's answer, but don't forget a step to update your repository in the first place! If you don't do that, port outdated can't tell you that anything needs updating, because your installed ports will match your portfiles exactly. However, updating is typically done with sudo port selfupdate. Whether you want to automate scripts with sudo access has pros and cons.

The "proper" way to sync and report on what needs upgrading is:

sudo port selfupdate && port outdated

selfupdate produces a fair amount of output, so I use something like

sudo port sync && port outdated

David M

Posted 2010-04-26T09:55:38.233

Reputation: 203

Note that selfupdate would also update your base installation, which is something you probably don't want to happen automatically with a cronjob. – raimue – 2010-06-07T18:50:14.463