2

After I ran sudo port upgrade outdated I’d like to know what was upgraded. The output was longer than my scrollback buffer.

I checked /opt/local/var/macports/logs/ but it seems to only contain logs for some of the compilations, not installation. For example, a copy of the output of sudo port upgrade outdated would be nice. Right now I simply tee the output to a file, but this kills the nice progress bar since port doesn’t see a TTY at the stdout.

1 Answer 1

2

I will be semi helpful here. I can show you where the data is and an SQL query but you might need more for a clean solution.

Macports keeps a registry in an SQLite database in /opt/local/var/macports/registry/registry.db This includes a date which looks like to me the time the package was last installed on your machine

An SQL query returns the data

SELECT
  ports.name, 
  datetime(ports.date, 'unixepoch')
FROM
  ports
ORDER BY
  ports.date

You will need to modify the query for your exact use case to only show a subset (e.g. add a where clause) and something to run it in

A crude way to do this is use sqlite3.

sqlite3 /opt/local/var/macports/registry/registry.db

Then you get a prompt - at that paste in the SQL above - then type in ; and hit return

At the bottom I get

iTerm2|2021-05-10 09:48:10
openjdk16-zulu|2021-05-10 09:49:00
rust|2021-05-16 09:47:44

I have only upgraded rust today

1
  • Thank you! This looks very promising. Is there any field to show whether I install a port from package, or compiling from distfiles? This is shown in the console output during port upgrade, but I don’t see it shown in the database. The installtype seems to always be “image”. May 17, 2021 at 3:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .