Portinstall question

Bill Schmitt (SW) software at schmittnet.com
Sun Oct 24 12:57:48 PDT 2004


   Donald J. O'Neill wrote:

On Sunday 24 October 2004 09:27 am, Matthew Seaman wrote:

  

I was just wondering why you would want to use portinstall to
install new software, rather than (using your example port):
 cd /usr/ports/databases/mysql-server41
 make install
Is using portinstall magical in some way? If you use the make
install method, there isn't any guesswork as to what name to
use.
      

portinstall is just portupgrade by another name.  Infact, it's
pretty much identical to 'portungrade -f'.  As to why anyone
would want to use portupgrade?  That's a no-brainer.  Just try it
and you'll see.
    

Actually, I think you mean 'portupgrade -N', don't you?
'portupgrade -f' would be used if you want to force the upgrade of 
an already installed port (eg. you want to change some option). 
Remember, to someone unfamiliar with a process, how to use it it is 
not a no brainer, that's why Bill posted his question. The reasons 
to use a process, for someone familiar with it, probably is a no 
brainer. To someone who knows several ways to do something, it 
becomes more complicated.
  

To answer the original question, portupgrade or portinstall can
select a port to operate on in two ways.  You can either give it
the package name -- with or without the version number -- or you
can give it the port origin -- ie. the port directory relative to
/usr/ports.  Now, usually, the first part of package name is the
same as the last part of the port origin, but not always.  For
instance the www/apache2 port installs apache-2.0.52_1.  That
similarity of names is what was confusing the OP.  He could
either have issued the command:

    # portinstall mysql-server-4.1.6

or

    # portinstall databases/mysql41-server

and it all would have worked.  The command he did use:

    # portinstall mysql-server

worked for him, but that was partly a matter of luck, as it
happened to default to the 4.1.x branch of MySQL. (Maybe he had
WANT_MYSQL_VER=41 defined in /etc/make.conf or some such -- the
default is to install databases/mysql40-server)

To find out what package name a port will install, just:

    % cd /usr/ports/databases/mysql41-server
    % make -V PKGNAME
    

You're already there now, why not just use 'make install'?
You can even do 'make package' if you want to save a built package 
for later (you made an "oh, oh" and have to reinstall) emergency 
reinstalling a port.
  

portupgrade processes the /usr/ports/INDEX file into a database
of port origins and package names, which is why you always need
an up-to-date INDEX when using it.
    

So very true, you can read the many posts from people who have not 
done that. But, unless you do a 'portupgrade -a', you're going to 
have to run portversion (I use -vL=) in order to find the ports 
that need upgrading. I won't mention pkgdb -F (yes, I just did) 
sometimes needs to be run, I'm sure you circumstances for doing so.
  

 Cheers,

 Matthew
    

All that being said, I just don't use portinstall as I feel I don't 
have the control I have with 'make install'. Would I ever use 
portinstall? Probably not, I can do the same thing with portupgrade 
-n, if I ever felt inclined to do so. The reason for asking the OP 
the question about why he would want to use it, was to try to get 
him to see that there are other ways to do things and think about 
them. It evidently didn't work as I received from him, an exact 
copy of your email to me.

Good thinking Don. Some people don't realize that it's good to learn 
new ideas, and they can be learned by thinking about a few hints. 
By the way, I did relearn something from you email. Thank you.

Now I have a question for you, rather, I would like to know your 
opinion. I have been using '*default tag=RELENG_5' in my supfile. 
At some point I will be changing that tag to 'default 
tag=RELENG_5_3' to avoid getting something like 5.4 beta1 when it 
comes down the pike. How soon after the release of 5.3 do you think 
that should be done?

Thank you,

Don

  

Don,

Actually, I'm quite happy learning new ideas, or I would not have posted a ques
tion regarding something I didn't understand (or be installing FreeBSD on a hom
e machine previously running under Windows). If you look at the bottom of what 
you received from me, you'll note that I did not send an exact copy of Matthew 
Seaman's quote, but merely answered the comment from Matthew in the thread at t
he point where all discussion to that point had taken place rather than multipl
e times to multiple users and messing up any continuity that the "bottom postin
g" requests imply. Not knowing whether you were (or are) a subscriber, I includ
ed you as a cc.

I've used both means of installing, am aware (as per the man page) that portins
tall is the same as portupgrade -N, and simply thought that I was misunderstand
ing some of the information I found in the files I was reading. 

Bill


More information about the freebsd-questions mailing list