Wed, 10 Jun 2009
Upgrading Python with Portmaster
If you are upgrading python on FreeBSD to 2.6 the steps as they stand now require portupgrade to be installed. This is based purely on the usage of pkg_which when walking /usr/local/lib/python$ver to determine what ports to rebuild.
Last night I came up with a patch that allows one to use portmaster instead of portupgrade. It's slower because it uses pkg_info. My guess is that pkg_which is using the pkgdb used by the portupgrade suite, which makes it significantly faster then how pkg_info works. We try to parallelize the processing but it's still slow - IMO we could greatly increase the amount of parallelism going on but I'm not going to push it too far.
The patch is available at my FreeBSD space and will apply cleanly to the latest lang/python port. I intend to commit it tomorrow morning while I'm eating breakfast but if you want to test it out now just do the following:
cd /usr/ports/lang/python fetch - http://people.freebsd.org/~wxs/python26-portmaster.diff | patch portmaster -o lang/python26 lang/python25 make upgrade-site-packages -DUSE_PORTMASTER
posted at: 12:45 | tags: freebsd, portmaster, python | path: /entries/freebsd | permanent link to this entry
Fri, 14 Dec 2007
Portmaster and Deleted Ports. :(
I use Ion as my window manager of choice. I've used it for many years now and have grown to love it over everything else I've tried. However, that doesn't stop me from not liking the attitude of it's developer. For instance, see this thread on ports@ that resulted in the port being removed from the tree. Personally, I agree with it's removal but I'm still going to maintain my own local copy of the port because I couldn't find anything I liked as nice as Ion (dwm has promise but it's just not right for me).
Anyways, it has been a while since I updated rst so I decided to do so. I really like portmaster for updating my ports. I still use portupgrade also, mostly because it's still there on some of my machines but also because it has never really failed me in a long time. Below are two particular things I ran into with portmaster...
wxs@rst ~ % sudo portmaster -L [...] ===>>> imake-1.0.2_4,1 ===>>> intltool-0.36.2 ===>>> New version available: intltool-0.36.3 ===>>> ion-3rc-20070927 ===>>> The x11-wm/ion-3 port has been deleted: ===>>> Aborting update wxs@rst ~ %Listing all installed ports and searching for updates causes portmaster to abort since Ion's removal.
wxs@rst ~ % sudo portmaster -aD [...] ===>>> The x11-wm/ion-3 port has been deleted: ===>>> Aborting update ===>>> Child process 39419: wxs@rst ~ %Trying to update all ports that need updating causes portmaster to abort also. The other odd part is that it's not displaying the message explaining why it was deleted.
I've decided that adding an option to ignore deleted ports is what I want. I had thought putting a +IGNORE me file in /var/db/pkg/foo would cause it to skip the port, but that's not the case. Below is a patch that adds the option to ignore deleted ports. You can get it here if you want. The patch is relative to ${PORTSDIR}/ports-mgmt/portmaster and has been sent to the author for consideration. If he would rather it be done using +IGNOREME I'll look into that.
Index: files/portmaster.sh.in
===================================================================
RCS file: /home/ncvs/ports/ports-mgmt/portmaster/files/portmaster.sh.in,v
retrieving revision 1.26
diff -u -r1.26 portmaster.sh.in
--- files/portmaster.sh.in 12 Dec 2007 21:50:59 -0000 1.26
+++ files/portmaster.sh.in 14 Dec 2007 17:34:10 -0000
@@ -518,7 +518,13 @@
'
for l in `grep "^$sf" $pd/MOVED`; do
case "$l" in
- ${sf}\|\|*) fail "The $sf port has been deleted: ${l##*|}"
+ ${sf}\|\|*)
+ if [ -z "$IGNORE_DELETED" ]; then
+ fail "The $sf port has been deleted: ${l##*|}"
+ else
+ echo "===> The $sf port has been deleted: ${l##*|}"
+ echo "===> Ignoring deleted port."
+ fi
;;
${sf}\|*) newportdir=${l#*\|}
newportdir=${newportdir%%\|*}
@@ -997,7 +1003,7 @@
fi
# Save switches for potential child processes
-while getopts 'BCDGLRabde:fghilm:nop:r:stuvwx:' COMMAND_LINE_ARGUMENT ; do
+while getopts 'BCDGLRabde:fghiIlm:nop:r:stuvwx:' COMMAND_LINE_ARGUMENT ; do
case "${COMMAND_LINE_ARGUMENT}" in
B) NO_BACKUP=yes; ARGS="-B $ARGS" ;;
C) DONT_PRE_CLEAN=yes; ARGS="-C $ARGS" ;;
@@ -1016,6 +1022,7 @@
g) MAKE_PACKAGE=yes; ARGS="-g $ARGS" ;;
h) usage 0 ;;
i) INTERACTIVE_UPDATE=yes; ARGS="-i $ARGS" ;;
+ I) IGNORE_DELETED=yes ;;
l) LIST=yes ;;
m) PM_MAKE_ARGS=$OPTARG
export PM_MAKE_ARGS # For 'make checksum'
While I was at it I found that the last 7 entires (at the time of this writing) in MOVED were wrong. They incorrectly ended in | which caused portmaster to not be able to properly display the messages. Portmaster uses ${l##*|} expansion where $l is the line from MOVED which matches the port in question. These are now fixed.
posted at: 20:10 | tags: portmaster, freebsd, ports | path: /entries/freebsd | permanent link to this entry








