odd port list installed output
In my previous email I wrote: If I decide to reinstall, is there some way I can record what ports I currently have installed then, after the basic install, reinstall those ports with one command? So port list installed seems to spit out something almost like what I need, but I noticed that I seem to have two copies of several ports installed. It looks like fftw-3, oss-uuid, python24 and python25 are all installed twice: % port list installed bison @2.3 devel/bison bzip2 @1.0.4 archivers/bzip2 db44 @4.4.20 databases/db44 expat @2.0.1 textproc/expat fftw-3 @3.1.2 math/fftw-3 fftw-3 @3.1.2 math/fftw-3 freetype @2.3.5 print/freetype g95 @0.90 lang/g95 gdbm @1.8.3 databases/gdbm gettext @0.17 devel/gettext jasper @1.701.0 graphics/jasper jpeg @6b graphics/jpeg libiconv @1.12 textproc/libiconv libpng @1.2.25 graphics/libpng libxml2 @2.6.31 textproc/libxml2 libxslt @1.1.22 textproc/libxslt m4 @1.4.10 devel/m4 mercurial @0.9.5 devel/mercurial ncurses @5.6 devel/ncurses ncursesw @5.6 devel/ncursesw netpbm @10.26.50 graphics/netpbm openssl @0.9.8g devel/openssl ossp-uuid @1.6.0 devel/ossp-uuid ossp-uuid @1.6.0 devel/ossp-uuid postgresql83 @8.3.0 databases/postgresql83 py25-dateutil @1.4 python/py25-dateutil py25-tz @2007k python/py25-tz python24 @2.4.4 lang/python24 python24 @2.4.4 lang/python24 python25 @2.5.2 lang/python25 python25 @2.5.2 lang/python25 readline @5.2.007 devel/readline tiff @3.8.2 graphics/tiff unzip @5.52 archivers/unzip wget @1.11 net/wget zlib @1.2.3 archivers/zlib What's up with that? I suppose I should be able to do something like this: port list installed | awk '{print $1}' > currentports sudo rm -rf /opt/local sudo port install $(cat currentports) but isn't there some other directory I need to remove? Some sort of MacPorts frameworks directory? -- Skip Montanaro - skip@pobox.com - http://www.webfast.com/~skip/
On Mar 6, 2008, at 5:02 AM, skip@pobox.com wrote:
In my previous email I wrote:
If I decide to reinstall, is there some way I can record what ports I currently have installed then, after the basic install, reinstall those ports with one command?
So port list installed seems to spit out something almost like what I need, but I noticed that I seem to have two copies of several ports installed. It looks like fftw-3, oss-uuid, python24 and python25 are all installed twice:
You'll get more joy, I believe, from: port installed Note that "port list installed" will "list" each port that is installed. The list command simply tells you the latest version of the particular port. So that combination is not particularly useful. A more useful combination might be "port echo installed", which will provide much the same information as "port installed". In either case, you're seeing multiple entries for some ports because you have installed, but inactive, versions of those ports. To find only the active versions, you might try: port echo active Combine that with a pipe through cut and you'd have a list of all ports that are currently active. You could save that list away and then later pass the list to "port install" when you want to reinstall. Note that this would lose any particular variants you have installed. port echo active | cut -d ' ' -f 1 Hmm. I think the output of "port echo active" without the cut, would conveniently give you exactly what you need to replicate your setup _with_ variants. Almost as if I designed it that way! The only issue might be if the specified versions were no longer available. James
% port list installed bison @2.3 devel/bison bzip2 @1.0.4 archivers/bzip2 db44 @4.4.20 databases/db44 expat @2.0.1 textproc/expat fftw-3 @3.1.2 math/fftw-3 fftw-3 @3.1.2 math/fftw-3 freetype @2.3.5 print/freetype g95 @0.90 lang/g95 gdbm @1.8.3 databases/gdbm gettext @0.17 devel/gettext jasper @1.701.0 graphics/jasper jpeg @6b graphics/jpeg libiconv @1.12 textproc/libiconv libpng @1.2.25 graphics/libpng libxml2 @2.6.31 textproc/libxml2 libxslt @1.1.22 textproc/libxslt m4 @1.4.10 devel/m4 mercurial @0.9.5 devel/mercurial ncurses @5.6 devel/ncurses ncursesw @5.6 devel/ncursesw netpbm @10.26.50 graphics/netpbm openssl @0.9.8g devel/openssl ossp-uuid @1.6.0 devel/ossp-uuid ossp-uuid @1.6.0 devel/ossp-uuid postgresql83 @8.3.0 databases/ postgresql83 py25-dateutil @1.4 python/py25-dateutil py25-tz @2007k python/py25-tz python24 @2.4.4 lang/python24 python24 @2.4.4 lang/python24 python25 @2.5.2 lang/python25 python25 @2.5.2 lang/python25 readline @5.2.007 devel/readline tiff @3.8.2 graphics/tiff unzip @5.52 archivers/unzip wget @1.11 net/wget zlib @1.2.3 archivers/zlib
What's up with that? I suppose I should be able to do something like this:
port list installed | awk '{print $1}' > currentports sudo rm -rf /opt/local sudo port install $(cat currentports)
but isn't there some other directory I need to remove? Some sort of MacPorts frameworks directory?
-- Skip Montanaro - skip@pobox.com - http://www.webfast.com/~skip/ _______________________________________________ macports-users mailing list macports-users@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macports-users
>> ... I noticed that I seem to have two copies of several ports >> installed. It looks like fftw-3, oss-uuid, python24 and python25 are >> all installed twice: James> You'll get more joy, I believe, from: James> port installed Thanks for that. There seem to be way too many similar commands for my feeble brain to keep straight. James> In either case, you're seeing multiple entries for some ports James> because you have installed, but inactive, versions of those James> ports. Ah, I see. I missed that the version numbers were slightly different. Consider this: % port installed | egrep python python24 @2.4.4_2+darwin_9 python24 @2.4.4_4+darwin_9 (active) python25 @2.5.2_0+darwin_9 python25 @2.5.2_1+darwin_9 (active) One would think I should be able to uninstall the inactive ports, but I can't: % sudo port uninstall python25@2.5.2_0+darwin_9 ---> Unable to uninstall python25 2.5.2_0+darwin_9, the following ports depend on it: ---> py25-tz ---> py25-dateutil ---> py25-hashlib ---> py25-tkinter Error: port uninstall failed: Please uninstall the ports that depend on python25 first. It doesn't appear that the port command is smart enough to realize that the active version of the python25 port should be able to satisfy the stated dependencies. Skip
On Mar 6, 2008, at 08:56, skip@pobox.com wrote:
Consider this:
% port installed | egrep python python24 @2.4.4_2+darwin_9 python24 @2.4.4_4+darwin_9 (active) python25 @2.5.2_0+darwin_9 python25 @2.5.2_1+darwin_9 (active)
One would think I should be able to uninstall the inactive ports, but I can't:
% sudo port uninstall python25@2.5.2_0+darwin_9 ---> Unable to uninstall python25 2.5.2_0+darwin_9, the following ports depend on it: ---> py25-tz ---> py25-dateutil ---> py25-hashlib ---> py25-tkinter Error: port uninstall failed: Please uninstall the ports that depend on python25 first.
It doesn't appear that the port command is smart enough to realize that the active version of the python25 port should be able to satisfy the stated dependencies.
That is correct. The port command is non-smart in this regard. You have to force it. sudo port -f uninstall python25@2.5.2_0+darwin_9
participants (3)
-
James Berry
-
Ryan Schmidt
-
skip@pobox.com