Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Nov 2015 20:45:04 -0600
From:      "Matthew D. Fuller" <fullermd@over-yonder.net>
To:        Miroslav Lachman <000.fbsd@quip.cz>
Cc:        Carmel NY <carmel_ny@outlook.com>, FreeBSD Ports <freebsd-ports@freebsd.org>
Subject:   Re: update PHP
Message-ID:  <20151129024504.GW30248@over-yonder.net>
In-Reply-To: <5659F096.7030200@quip.cz>
References:  <BLU436-SMTP9F607C82FA606074F3D4980030@phx.gbl> <5659F096.7030200@quip.cz>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Nov 28, 2015 at 07:21:10PM +0100 I heard the voice of
Miroslav Lachman, and lo! it spake thus:
> Carmel NY wrote on 11/27/2015 12:39:
> > Would I l then need to rebuild everything that depends on PHP or could I just
> > add the "-r" flag to portupgrade?
> 
> You can get list of all origins of ports depending on main php port by 
> this command
> 
> pkg query %o `pkg info -r php5 | tail -n +2`

I've had good luck with PHP upgrades by just changing the origins,
then rebuilding the php ports themselves.  PECL stuff will also need a
rebuild.

Of course, you could just do a little sed'ery, but I tossed together a
quickie .pl to do it with a little more seatbelts.  e.g., with a
little editing to pretend I'm going from 5.6 to 5.5:

% pkg query '%o' | grep php56 | /tmp/phpup.pl
pkg set -yo lang/php56:lang/php55
pkg set -yo archivers/php56-bz2:archivers/php55-bz2
pkg set -yo textproc/php56-ctype:textproc/php55-ctype
pkg set -yo ftp/php56-curl:ftp/php55-curl
[...]

I intentionally just made it print out the 'pkg set's so I could
eyeball them for sanity.  Then just a quick C&P of 'em into a root
terminal, and I'm off to the rebuilding races.  A little obvious
editing should let you do 5->56 with it.

(of course there's always the chance of extensions moving around, so
you may have to manually find and deal with one or two, but it makes
it a lot easier)


--------------8K------------------
#!/usr/bin/env perl
use strict;
use warnings;

# pkg query '%o' | grep php56 | $SELF

while(<STDIN>)
{
	chomp;
	my $old = $_;
	(my $new = $_) =~ s/56/55/;

	die "Couldn't find dir $new" unless -d "/usr/ports/$new";

	print "pkg set -yo $old:$new\n";
}
--------------8K------------------


-- 
Matthew Fuller     (MF4839)   |  fullermd@over-yonder.net
Systems/Network Administrator |  http://www.over-yonder.net/~fullermd/
           On the Internet, nobody can hear you scream.



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