Sam Lawrance found a bug. If a port is deleted, then a file added back in, and then it’s removed, FreshPorts doesn’t know that the port is deleted.
He found this with x11/ruby-gnome. You can see that it is marked as an expired port. On 05 Nov 2005 08:07:45, kris removed it from the tree. FreshPorts would have marked it as DELETED. A short time later, he added a file Makefile.common
back into the tree. FreshPorts would have marked the port as ACTIVE. Then kris remove that file. FreshPorts did not mark the file as deleted. FreshPorts only marks a port as deleted when the Makefile
is removed.
I went to check if all the files under this port were marked as DELETED in the database. First I find the Element ID of the port:
freshports.org=# select pathname_id('ports/x11/ruby-gnome'); pathname_id ------------- 53098 (1 row)
Then I check all the files/directories under that point in the tree:
freshports.org=# select * from element where parent_id = 53098; id | name | parent_id | directory_file_flag | status -------+-----------------+-----------+---------------------+-------- 53103 | Makefile.common | 53098 | F | D 53106 | pkg-plist | 53098 | F | D 53105 | pkg-descr | 53098 | F | D 53099 | distinfo | 53098 | F | D 53102 | Makefile | 53098 | F | D 53104 | pkg-comment | 53098 | F | D 53100 | files | 53098 | D | A (7 rows)
Good. All the files deleted (status
= ‘D’, as in deleted). What about the files
directory? Let’s check there too:
freshports.org=# select * from element where parent_id = 53100; id | name | parent_id | directory_file_flag | status -------+------------------+-----------+---------------------+-------- 53101 | patch-extconf.rb | 53100 | F | D (1 row) freshports.org=#
Good. Everything is gone. Perhaps I should change FreshPorts to verify a port is deleted using the above strategy.
In the meantime, I’ll fix this port up soon and scan the tree for other such problems.
See also Are all files deleted?