Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

A simple MacPorts and Fink update script UNIX
If you use the MacPorts and Fink package managers, you might find it useful to be able to update both package managers with one simple command. I wrote the following simple script which does just that:
#!/bin/bash
#the script updates MacPorts and Fink packages;

if [ "$(whoami)" != 'root' ]; then
  echo "You have no permission to run $0 as non-root user."
  exit 1
fi

port selfupdate
port -d sync
portindex
port upgrade installed
apt-get update
apt-get upgrade
fink -q -y selfupdate
fink -q -y update-all
Just create a file containing that code and save it, say, to your home folder. Assuming that the file's been saved as ~you/updf (where you is your short username), just cd to that directory and make the code executable:
chmod u+x upfg
If it's not already set, you might also add the line PATH=$PATH:~you to your profile. Then simply type sudo upfd, wait a little bit, and you're done. Hopefully, that is, if there are no compilation errors, but that's another story!
    •    
  • Currently 3.75 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (4 votes cast)
 
[25,598 views]  

A simple MacPorts and Fink update script | 5 comments | Create New Account
Click here to return to the 'A simple MacPorts and Fink update script' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A simple MacPorts and Fink update script
Authored by: jctull on Dec 29, '06 09:13:55AM

Maybe this is covered elsewhere, but have you been able to get both fink and macports to coexist without both installing common library and package dependencies? My impression (from attempts at using both in the past and reading information online) is that you will have multiple installations of dependencies so that you may have ImageMagick installed by both fink and macports in order to get separate image packages built under each system. This always bothered me, so I tend to stick to one system or the other. Lately I have moved to macports.



[ Reply to This | # ]
A simple MacPorts and Fink update script
Authored by: LukeR on Dec 29, '06 02:42:21PM

Unfortunately not. When I want to install a package, I always check the MacPorts and Fink websites to see which has a newer version and then use that manager to install it. But that means that I have multiple libraries and so on (duplicated in /sw and in /opt directories) - I have no clue how to avoid that redundancy. Maybe something to do with PKGCONFIG. I hope it may be solved somehow.



[ Reply to This | # ]
A simple MacPorts and Fink update script
Authored by: jctull on Dec 29, '06 07:54:54PM

That is what I thought. I guess I decided macports was going to work better for me, but it keeps breaking on TeTex install, a dependency for Octave. What I have started doing is installing a mix of precompiled binaries (e.g., TeTex from i-installer), but this is no better than Fink and macports mixed.

I guess it is a good thing to have these alternatives, even if there is no panacea.



[ Reply to This | # ]
A simple MacPorts and Fink update script
Authored by: Ranger Rick on Dec 31, '06 02:12:13PM

It's really best to move one out of the way when updating the other as well. Both systems have expectations in many cases that they will be using their own versions of software. Fink (or MacPorts) versions of shared things might be patched with bugfixes, changes related to interoperability with other packages, and other similar things.

Having fink in the PATH while building MacPorts software and vice-versa often means not being able to unentangle them from each other when issues arise.

I would not recommend using this script without adding code to move /sw out of the way when updating macports and moving /opt/dports out of the way when updating fink.



[ Reply to This | # ]
A simple MacPorts and Fink update script
Authored by: Ranger Rick on Jan 02, '07 08:36:47AM

excuse me, /opt/local -- not /opt/dports ;)



[ Reply to This | # ]