[KDE/Mac] How can I change one piece of code in a MacPorts installation?

Bradley Giesbrecht pixilla at macports.org
Mon Jul 21 22:10:21 UTC 2014


On Jul 21, 2014, at 1:17 PM, Marko Käning <mk-lists at email.de> wrote:

> Hi Ian,
> 
> On 21 Jul 2014, at 15:41 , Nicolas Pavillon <nicos at macports.org> wrote:
>> it can be pretty cumbersome, as you have to rebuild everything from scratch each time, with your new patches. 
>> Another way to avoid rebuilding everything is to use lower-level Macports commands, to avoid the fact that a new clean copy of your gets extracted each time, with a clean at the end of the install. You can run “port extract” to get a copy, change the code with patches or manually, and then run “port activate” to install the port, but normally without the cleaning stage, so that you keep the copy of the code.
> 
> well, it is also helpful to check out port’s options ‘-k’ and ‘-o’! :-)
> 
> ‘-k’ keeps the sources even after the port got installed, so omitting the cleaning phase somehow, which enables the debugger to find the program’s sources later on.

You can also save time extracting or building large packages with -ko by editing the macports state file:

# install a port
cd $(port dir bash-completion)
sudo port -kof install bash-completion

# uninstall the port keeping work dir
sudo port -kof uninstall bash-completion

# to redo the destroot phase and the phases that follow
sudo sed -i '' '/destroot/,$d' ./work/.macports.bash-completion.state
sudo rm -R ./work/destroot

# now edit Portfile or source files and run "port install" again
sudo port -kof install bash-completion


# Optionally, if you need to go back and redo earlier phases such as build or configure try:
# to redo the configure phase and the phases that follow
sudo sed -i '' '/configure/,$d' ./work/.macports.bash-completion.state
# or to redo the build phase and the phases that follow
sudo sed -i '' '/build/,$d' ./work/.macports.bash-completion.state


Regards,
Bradley Giesbrecht (pixilla)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mail.kde.org/pipermail/kde-mac/attachments/20140721/f5f67cc0/attachment.sig>


More information about the kde-mac mailing list