Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Feb 2002 10:31:58 -0600 (CST)
From:      Lars Eighner <eighner@io.com>
To:        Bsd Neophyte <bsdneophyte@yahoo.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: i still don't understand what cvsup does... entirely
Message-ID:  <20020205080822.G12364-100000@dumpster.io.com>
In-Reply-To: <20020205103641.25042.qmail@web20109.mail.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 5 Feb 2002, Bsd Neophyte wrote:

>
>I've read the section on cvsup in both the handbook and in Greg Lehey's
>book... but it still confuses me.
>
>Lemme explain it the way I understand it and then you guys can correct me
>and/or add information (actually i'd really appreciate details).
>
>First, can someone distingusih between ports and between sources?

First, forget about ports for a moment.  We will go first for what is
source and what is cvsup.

Source means an uncompiled computer program.  The operating system
(the kernel and various drivers), the basic utilities (such as cp,
mv, rm), and applications programs (like browsers, spreadsheets, and
word processors) all have source code.

You may or may not compile upgrades on your own system.  If you do,
you need the source (for the system and basic utilities) in /usr/src
(altogether the system source is called the source tree and /usr/src
is the root of the source tree).  Most of the system source remains
the same from one version to another.  When you want to upgrade you
could download all of the source from scratch. But if you have the
disk space to keep a copy of the source tree, it is much more
efficient to compare what you have in your source tree with what is
in the up-to-date source tree at a FreeBSD site and just make the
minor changes necessary to get your source tree to agree with the one
at the FreeBSD site.  This may entail deleting some obsolete files,
downloading some new files, or - in many cases - just changing a few
lines in a number of files.  But even for major upgrades, checking
for changes and just downloading the changes is much, much faster
than downloading the whole source tree.

This is what cvsup does: it gets one set of files at your site to
agree with another set of files at some other site.  It is useful
when most of the time there will be relatively few differences
between the two sets of files.  Cvsup is useful in lots of cases in
which you just want to keep a local site up-to-date with a master
site, and is used for many things besides the system source tree.

In particular, cvsup is used in FreeBSD to update local versions of
the system source tree, the ports tree (we are coming to that), and
parts of the system documentation (most notably the handbook).  (It
is used for other things too, and by systems other than FreeBSD.)

Okay we have talked about the system source tree (usually just
called "the source tree") which has its root at /usr/src .
As you may know, there are several kinds of "up-to-date"
for a FreeBSD system, but if you are not a developer you probably
should stick to "stable" for up-to-datedness.  /usr/src contains
(when you have it) bunches of C programs (and some assembly language
programs), some configuration files, and other information which
will allow you to compile and install a FreeBSD system along with a few
utilities that are essential for doing anything useful.  If
the /usr/src tree is up-to-date, it is all there, and you have
everything you need to make world and make a kernel.

Now the ports tree is something completely different.

A port is a recipe for making a particular application program work
with FreeBSD.  An application program is a program like a word
processor, a game, a spreadsheet, a browser, a mail reader, a news
reader, and so forth.  Some of these programs are very useless, such
as a pair of eyes for your X desktop that follow the motion of the
cursor.  Some are things that most people will want but you may not
want every one of them.  You will want a mail reader, but you may not
every single mail reader that is available.  Hardly anyone will want
every application available - unless you have Korean users, you
probably won't want Korean versions of a bunch of programs.

The port is the recipe for making a program work with FreeBSD, but it
is not the program itself.  Recipes are necessary because the various
unix-like systems are all somewhat different.  Ports do not contain
the programs themselves for several reasons, the most important of which
is the programs would take up a huge amount of space and hardly anyone
will want all of them.  You probably do want all of the recipes because
they take up relatively little space - and who knows, you might have
a reason to build Korean Netscape some day.

When you cvsup the ports tree, what you are doing is keeping the
recipes up-to-date.  The recipes include, among other things,
references for where to get the *source* - or uncompiled version of
the application program.   When you cvsup the ports tree (which is
at /usr/ports) you do not get the program sources for the reason
just mentioned: all of the programs would be huge and there is no
telling how many of them you will ever want to install.

In general, ports are not tied to a particular version of FreeBSD,
which is why cvsup'ing the source tree and cvsup'ing the ports tree
are two different operations.  However, if your ports tree gets very
old, some ports will not build because the old versions of the
programs will not still be available.  If your ports tree is very new in
comparison to your system, ports will not work because the recipes
will be adapted to new versions of the system (of course, programs
you installed with ports will continue to run with your old system).
So it is a good idea to upgrade your system from time to time and
to cvsup the ports tree at about the time you upgrade the system.

So,

Cvsup - a program for keeping a local set files in sync with a master
set of files.

Source - any uncompiled (or unassembled) program, but often used to
mean the system source in particular

Port - a recipe for building a particular application program, but
does not include the program itself (only a pointer to where to get it).


>As far as I can gather it does something with sources... and I think
>ports.
>
>If one has a ports and sources list... cvsup updates this list, removing
>items that are obsolete with more current information about the latest
>port or source.  CVSUP doesn't actually download the port or source to
>your system, it merely gives a pointer where you can download the source
>or port.

If you run cvsup to update the system source, it will indeed update
all of the code necessary to build the system and kernel.

If you run cvsup to update the ports, it will update the ports tree,
which are just recipes and do not contain the source code for the
particular applications.


>One has the ability to install a port or source by going to the specific
>directory and typing "make clean && make && make install" (I think I've
>left something out in that command string).
>
>That's what I see cvsup doing...

A port is a recipe.  You can, indeed, go to the directory for the
port, which will be /usr/port/<general category/<application name>,
typing as above, and the port will fetch the source for that
particular application (assuming it can get access to the internet),
and it will build and install that application.  (There are a few
ports for proprietary software for which you will have to get the
source manually and put it in /usr/ports/distributions/.) If you have
a current port, it will do that whether you have cvsup or not.  (The
truth is, the program "make" is what does the heavy lifting - looking
at the recipes and compiling and installing the programs
accordingly.)

All cvsup will do for ports is to update the local ports (recipes).
It won't fetch the source for the programs.  It won't build the programs.
It won't install the programs.  It just makes sure that ports (which do
all those things - with the help of make) are up-to-date.


>Now, I have a little more confusion when it comes to upgrading FreeBSD
>using this method...
>
>When you run cvsup does it automatically download the latest release
>sources?  Or is there a special method you need to download the these
>sources?

First, you need understand that "latest" is relative to which branch
of FreeBSD you want to run.  If you are not a developer, you probably
should be running and tracking "stable."

If you just want all of the (system) source for a particular release,
it is probably much more efficient to FTP it.  The virtue of cvsup is
to synchronize your local source tree with the master source tree for
the branch of FreeBSD (probably "stable") that you are tracking.  If
you already have a previous version, cvsup is much more efficient
because you only download the *changes*.

Second, perhaps it isn't entirely clear, cvsup is a very general program.
You call with particular files that tell it what to update.  You
can run it with one particular file that tells it just to update the
system source, or with another file to tell it to update the ports,
and so forth.  Usually you run at different times to do those different
things.

-- 
Lars Eighner
eighner@io.com -finger for geek code-
http://www.io.com/~eighner/index.html
700 Hearn #101 Austin TX 78703 (512)474-1920


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020205080822.G12364-100000>