Suppose I want to reset a port to its initial state, including its configuration files. This can be achieved by:
sudo port uninstall portname
sudo port install portname
(Deactivating and then reactivating the port does not reset the configuration files.)
Is there any way to do this without uninstalling and reinstalling the port, avoiding the overhead of having to rebuild the package?
Edit: Thanks for the replies, Alexander and Nerdling. Archive mode worked for me.
MacPorts uses autoconf and makefiles for installation. These commands will build and install MacPorts to /opt/local . You can add --prefix to ./configure to relocate MacPorts to another directory if needed. Now MacPorts will look for portfiles in the working copy and use Git instead of rsync to update your ports tree.
A port, or subcutaneous implantable catheter, is placed entirely under the skin. There is a small reservoir, a plastic or metal cylinder usually placed just below the collar bone, connected to a catheter that enters the jugular vein in the neck. These may stay in for months to years, or permanently.
What you want to do is activate archive mode.
vi ${prefix}/etc/macports/macports.conf
Typically, your prefix is /opt/local
.
Inside that file, look for portarchivemode
and enable it. Now, whenever you install a package, the files will be archived as whatever portarchivetype
is set to.
Supported types: tgz (default), tar, tbz, tbz2, tlz, xar, zip, cpgz, cpio
If you uninstall a port, it will open the archive rather than rebuilding everything.
I had the exact same question a few weeks ago. I searched through the Macports documentation without any luck. As far as I know, it doesn't have a command to do that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With