how to correct corrupted ports tree?

3 views
Skip to first unread message

Gary Aitken

unread,
Nov 16, 2012, 11:56:21 PM11/16/12
to FreeBSD Mailing List
so, after updating bios, repartitioning, etc,
things seem to be stable, modulo the following:

decided to rebuild ports for peace of mind,
but my basic ports tree is hosed:

# portmaster -t --clean-distfiles
...
"/usr/ports/Mk/bsd.php.mk", line 335: Malformed conditional (${_USE_PHP_VER${PHP_VER}:Myes} != "")
...
make: fatal errors encountered -- cannot continue

===>>> No DISTINFO_FILE in /usr/ports/lang/php4-extensions

"Makefile", line 20: Could not find /usr/ports/mail/enigmail-thunderbird3/../enigmail/Makefile
make: fatal errors encountered -- cannot continue

Sure enough:

# ls /usr/ports/lang/php4-extensions
CVS Makefile pkg-descr

I didn't see anything in the handbook about how to get the ports tree itself
back to a sane condition. Do I have to blow the whole thing away and do a
fresh extract? I don't see a way to force refetch of the actual ports files
like "distinfo" when portsnap thinks the port is up to date.

Gary
_______________________________________________
freebsd-...@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questi...@freebsd.org"

Shane Ambler

unread,
Nov 17, 2012, 12:48:13 AM11/17/12
to fre...@dreamchaser.org, FreeBSD Mailing List
On 17/11/2012 15:26, Gary Aitken wrote:

> decided to rebuild ports for peace of mind,
> but my basic ports tree is hosed:

> I didn't see anything in the handbook about how to get the ports tree itself
> back to a sane condition. Do I have to blow the whole thing away and do a
> fresh extract? I don't see a way to force refetch of the actual ports files
> like "distinfo" when portsnap thinks the port is up to date.

portsnap extract will always install the entire tree, if you have made
any modifications they will be overwritten, but new ports folders you
have added should remain, sometimes this can also cause old folders to
be left behind.

Worst case is to delete the existing /usr/ports and extract a clean set.

Another option is partial extraction -
portsnap extract lang/php5-extensions will extract just the one port
portsnap extract lang/php5 will match all lang ports starting with php5
portsnap extract lang will extract all the lang ports

I think that you will find your issue comes from the fact that all the
php4 ports have been deleted - you seem to have some old folders left
behind. Could be from extracting over an existing cvs checkout. Maybe
you want a clean start.

If you still have php4 installed then you should be able to use
portmaster -o lang/php5-extensions lang/php4-extensions
to get it to update with the new version

find /usr/ports -type d -and -name "php4*" | xargs rm -R
will delete any remaining php4 folders
find /usr/ports -name "CVS" | xargs rm -R
will remove all the cvs garbage left behind.

Polytropon

unread,
Nov 17, 2012, 5:02:03 AM11/17/12
to fre...@dreamchaser.org, FreeBSD Mailing List
On Fri, 16 Nov 2012 21:56:21 -0700, Gary Aitken wrote:
> I don't see a way to force refetch of the actual ports files
> like "distinfo" when portsnap thinks the port is up to date.

You cansolve the problem of "few per-file mismatches" by
using the traditional CVS approach of updating the ports
tree. Only files not matching the current (on-server) content
will be updated.

For example, if you can "predict" in which categories errors
appear, only update those. Let's assume the problem you experience
is only in the ports base directory.

Create a file /etc/sup/ports.sup with the following content:

*default host=cvsup.freebsd.org
*default base=/var/db
*default prefix=/usr
*default release=cvs tag=.
*default delete use-rel-suffix
*default compress
ports-base

You can use "ports-lang" to update the lang category only, or
"ports-all" for the whole tree. Note that incorporating all
those small deltas may take some time!

An example file with all categories can be found here:
/usr/share/examples/cvsup/ports-supfile

Then add this to /etc/make.conf:

SUP_UPDATE= yes
SUP= /usr/bin/csup
SUPFLAGS= -L 2
SUPHOST= cvsup.freebsd.org
PORTSSUPFILE= /etc/sup/ports.sup

Maybe choose a near mirror for better performance.

Now do this:

# cd /usr/ports
# make update

Now according to this example, the base files for /usr/ports will
be checked for changes and (being different) will be updated.

Also note that this approach sometimes is more current than
using portsnap. There might be deltas in the CVS ports tree
already that might not be yet in the most current ports snapshot.
However, this is an "old-fashioned" approach; I'm not sure for
how long it will work. :-)

See "man 5 make.conf" for details, as well as "man 7 ports".


--
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

C. P. Ghost

unread,
Nov 17, 2012, 10:51:11 AM11/17/12
to Polytropon, FreeBSD Mailing List
On Sat, Nov 17, 2012 at 11:02 AM, Polytropon <fre...@edvax.de> wrote:
> On Fri, 16 Nov 2012 21:56:21 -0700, Gary Aitken wrote:
>> I don't see a way to force refetch of the actual ports files
>> like "distinfo" when portsnap thinks the port is up to date.
>
> You cansolve the problem of "few per-file mismatches" by
> using the traditional CVS approach of updating the ports
> tree. Only files not matching the current (on-server) content
> will be updated.

CVSup/csup is deprecated now and shouldn't be used anymore:

http://www.freebsd.org/news/2012-compromise.html

We should stop advertizing it as a way to update the ports tree.
svn or portsnap is the way to go now.

-cpghost.

--
Cordula's Web. http://www.cordula.ws/

Bernt Hansson

unread,
Nov 17, 2012, 11:14:50 PM11/17/12
to fre...@dreamchaser.org, FreeBSD Mailing List
2012-11-17 05:56, Gary Aitken skrev:
> so, after updating bios, repartitioning, etc,
> things seem to be stable, modulo the following:
>
> decided to rebuild ports for peace of mind,
> but my basic ports tree is hosed:
>
> # portmaster -t --clean-distfiles
> ...
> "/usr/ports/Mk/bsd.php.mk", line 335: Malformed conditional (${_USE_PHP_VER${PHP_VER}:Myes} != "")
> ...
> make: fatal errors encountered -- cannot continue
>
> ===>>> No DISTINFO_FILE in /usr/ports/lang/php4-extensions
>
> "Makefile", line 20: Could not find /usr/ports/mail/enigmail-thunderbird3/../enigmail/Makefile
> make: fatal errors encountered -- cannot continue
>
> Sure enough:
>
> # ls /usr/ports/lang/php4-extensions
> CVS Makefile pkg-descr
>
> I didn't see anything in the handbook about how to get the ports tree itself
> back to a sane condition. Do I have to blow the whole thing away and do a
> fresh extract? I don't see a way to force refetch of the actual ports files
> like "distinfo" when portsnap thinks the port is up to date.

I would do: portsnap fetch update extract or download the ports tarball.

ftp://ftp.sunet.se/pub/FreeBSD/ports/ports/ports.tar.gz

Bernt Hansson

unread,
Nov 17, 2012, 11:57:40 PM11/17/12
to fre...@dreamchaser.org, FreeBSD Mailing List
2012-11-18 05:14, Bernt Hansson skrev:

There is a readme file too.

ftp://ftp.sunet.se/pub/FreeBSD/ports/ports/README.TXT

Polytropon

unread,
Nov 18, 2012, 12:58:29 AM11/18/12
to C. P. Ghost, FreeBSD Mailing List
On Sat, 17 Nov 2012 16:51:11 +0100, C. P. Ghost wrote:
> On Sat, Nov 17, 2012 at 11:02 AM, Polytropon <fre...@edvax.de> wrote:
> > On Fri, 16 Nov 2012 21:56:21 -0700, Gary Aitken wrote:
> >> I don't see a way to force refetch of the actual ports files
> >> like "distinfo" when portsnap thinks the port is up to date.
> >
> > You cansolve the problem of "few per-file mismatches" by
> > using the traditional CVS approach of updating the ports
> > tree. Only files not matching the current (on-server) content
> > will be updated.
>
> CVSup/csup is deprecated now and shouldn't be used anymore:
>
> http://www.freebsd.org/news/2012-compromise.html
>
> We should stop advertizing it as a way to update the ports tree.
> svn or portsnap is the way to go now.

Thank you for changing my inner attitude toward the new
technology. I will try to avoid what "just works" (and
now "worked", past tense). :-)

I really hope a SVN equivalent like csup (a CVS implementation
that is part of the _base_ system) will appear so there is
no need to install something from ports (like cvsup-without-gui
in the past). It should be efficient, fast, and free of bloat.
It should also be easy to integrate it into basic operations
(as shown in my example with the sup/ config file and the
entry in /etc/make.conf, making "make update" a simple task,
both for OS sources and ports). When this is _granted_, one
could think about removing it from the base OS install.

Note that I did mention it because it worked all the years
fast and flawlessly, and I'm using CVS myself for "archiving"
configuration files of different systems locally. I never
thought about migrating this stuff over to SVN, because I
consider it "too voluminous". Maybe I'm wrong, and I should
be corrected.



--
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

Polytropon

unread,
Nov 18, 2012, 1:15:00 AM11/18/12
to Bernt Hansson, fre...@dreamchaser.org, FreeBSD Mailing List
On Sun, 18 Nov 2012 05:57:40 +0100, Bernt Hansson wrote:
> 2012-11-18 05:14, Bernt Hansson skrev:
>
> There is a readme file too.
>
> ftp://ftp.sunet.se/pub/FreeBSD/ports/ports/README.TXT

Which mentions the evil cvsup... :-)


--
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

Bernt Hansson

unread,
Nov 18, 2012, 6:42:41 AM11/18/12
to Polytropon, fre...@dreamchaser.org, FreeBSD Mailing List
2012-11-18 07:15, Polytropon skrev:
> On Sun, 18 Nov 2012 05:57:40 +0100, Bernt Hansson wrote:
>> 2012-11-18 05:14, Bernt Hansson skrev:
>>
>> There is a readme file too.
>>
>> ftp://ftp.sunet.se/pub/FreeBSD/ports/ports/README.TXT
>
> Which mentions the evil cvsup... :-)
>
Yes, yes it does. I'm so sorry for that, I'll try not to repeat my mistake.
Reply all
Reply to author
Forward
0 new messages