Re: portmaster -x not working?

2009-08-08 Thread Lawrence Stewart

Lawrence Stewart wrote:

Frederique Rijsdijk wrote:

Lawrence Stewart wrote:

Hijacking the thread slightly, but is there a way to exclude multiple
ports using the -x switch (or multiple -x switches)? Logically, I want
to be able to do something like this:

portmaster -a -x '*foo*' -x '*bar*'



portmaster -x '[.*php5.*|.*apache.*]' -n drupal6-6.12

That seems to work for me..



Nifty, although regex goo is unfriendly even at the best of times.

Thanks for the tip (and sorry for the hijack).


Today, I again had need of the ability to exclude multiple ports from an 
update run. It turns out your tip doesn't work with portmaster, though I 
suspect it would with portupgrade.


I finally bit the bullet and created a patch that allows a user to 
specify -x multiple times, or specify it once with a space-separated 
list of port globs.


Example usage with the patch applied:

Update everything, ignoring ports that match *postgres*:
portmaster -adx 'postgres'


Update everything, ignoring ports that match *postgres* or *imap-uw*:
portmaster -adx 'postgres imap-uw'
portmaster -adx 'postgres' -x 'imap-uw'


Doug, what do you think of the attached patch?

Cheers,
Lawrence
--- portmaster.orig 2009-08-08 22:13:01.0 +1000
+++ portmaster  2009-08-09 04:24:34.0 +1000
@@ -618,17 +618,21 @@
 }
 
 globstrip () {
+   local glob
+   local globs
local in
 
-   in=$1
+   globs=$1
 
-   case $in in
-   *\*) in=`echo $in | sed s/.$//`
-   esac
-
-   in=${in%\\}
+   for glob in $globs
+   do
+   case $glob in
+   *\*) glob=`echo $glob | sed s/.$//`
+   esac
+   in=${glob%\\} $in
+   done
 
-   echo $in
+   echo ${in%% }
 }
 
 #=== End functions relevant to --features and main ===
@@ -801,7 +805,7 @@
u)  echo === The -u option has been deprecated ; echo '' ;;
v)  PM_VERBOSE=vopt; ARGS=-v $ARGS ;;
w)  SAVE_SHARED=wopt; ARGS=-w $ARGS ;;
-   x)  EXCL=`globstrip $OPTARG` ;;
+   x)  EXCL=`globstrip $OPTARG` ${EXCL} ; EXCL=${EXCL%% } ;;
*)  echo '' ; echo === Try ${0##*/} --help; exit 1 ;;
esac
 done
@@ -818,7 +822,7 @@
 if [ -n $EXCL ]; then
case $EXCL in
-*) fail 'The -x option requires an argument' ;;
-   *)  ARGS=-x $EXCL $ARGS ;;
+   *)  ARGS=-x '$EXCL' $ARGS ;;
esac
 fi
 
@@ -1461,16 +1465,21 @@
 }
 
 check_exclude () {
+   local glob
+
[ -n $EXCL ] || return 0
 
-   case $1 in
-   *${EXCL}*)
-   if [ -n $PM_VERBOSE ]; then
-   echo === Skipping $1
-   echobecause it matches the pattern: *${EXCL}*
-   fi
-   return 1 ;;
-   esac
+   for glob in $EXCL
+   do
+   case $1 in
+   *$glob*)
+   if [ -n $PM_VERBOSE ]; then
+   echo === Skipping $1
+   echobecause it matches the pattern: 
*$glob*
+   fi
+   return 1 ;;
+   esac
+   done
return 0
 }
 
@@ -1509,7 +1518,7 @@
[ -n $DEPTH ]  echo$DEPTH  ${1#$pd/}
 
if [ -z $NO_ACTION -o -n $CONFIG_ONLY ]; then
-   ($0 $ARGS $1) || fail Update for $1 failed
+   (eval $0 $ARGS $1) || fail Update for $1 failed
. $IPC_SAVE
else
[ -n $PM_VERBOSE ] 
@@ -1701,7 +1710,7 @@
if [ -n $CONFIG_ONLY ]; then
for port in $worklist; do
check_interactive $port || continue
-   ($0 $ARGS $port) || fail Update for $port failed
+   (eval $0 $ARGS $port) || fail Update for $port failed
. $IPC_SAVE
done
check_fetch_only
@@ -1721,7 +1730,7 @@
;;
esac
check_interactive $port || continue
-   ($0 $ARGS $port) || fail Update for $port failed
+   (eval $0 $ARGS $port) || fail Update for $port failed
. $IPC_SAVE
done
safe_exit
@@ -1968,7 +1977,7 @@
[ -d $pd/$moved_npd ] || no_valid_port
 
if [ $$ -eq $PARENT_PID ]; then
-   $0 $ARGS -o $moved_npd $upg_port
+   eval $0 $ARGS -o $moved_npd $upg_port
safe_exit
else
exec $0 $ARGS -o $moved_npd $upg_port
--- portmaster.8.orig   2009-08-09 04:28:51.0 +1000
+++ portmaster.82009-08-09 04:36:49.0 +1000
@@ -24,7 +24,7 @@
 .\
 .\ $FreeBSD: ports/ports-mgmt/portmaster/files/portmaster.8,v 2.8 2009/07/29 
23:26:14 dougb Exp $
 .\
-.Dd July 29, 2009
+.Dd August 8, 2009
 .Dt PORTMASTER 8
 .Os
 .Sh NAME
@@ -296,7 +296,9 @@
 any arguments to supply to
 .Xr make 1
 .It Fl x
-avoid building or updating ports that match this 

Re: portmaster -x not working?

2009-08-08 Thread Doug Barton
Lawrence Stewart wrote:

 Today, I again had need of the ability to exclude multiple ports from an
 update run. It turns out your tip doesn't work with portmaster, though I
 suspect it would with portupgrade.

For now, if you need to exclude more than one port you can check the
man page about +IGNOREME files.

 Doug, what do you think of the attached patch?

I think it's interesting, but not quite how I would do it. I have
plans to rewrite the command line parser in order to accommodate this,
and make things easier to work with generally, so stay tuned.

Doug

-- 

This .signature sanitized for your protection

___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: portmaster -x not working?

2009-08-08 Thread Lawrence Stewart

Doug Barton wrote:

Lawrence Stewart wrote:


Today, I again had need of the ability to exclude multiple ports from an
update run. It turns out your tip doesn't work with portmaster, though I
suspect it would with portupgrade.


For now, if you need to exclude more than one port you can check the
man page about +IGNOREME files.



Ok cool. I would definitely like to be able to specify things 
dynamically on a per-run basis as well though without adding +IGNOREME 
files. I often want to special case the exclusion of ports one time only.



Doug, what do you think of the attached patch?


I think it's interesting, but not quite how I would do it. I have
plans to rewrite the command line parser in order to accommodate this,
and make things easier to work with generally, so stay tuned.


No problemo, will stay tuned.

Cheers,
Lawrence
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: portmaster -x not working?

2009-07-15 Thread Frederique Rijsdijk
Lawrence Stewart wrote:
 Hijacking the thread slightly, but is there a way to exclude multiple
 ports using the -x switch (or multiple -x switches)? Logically, I want
 to be able to do something like this:
 
 portmaster -a -x '*foo*' -x '*bar*'
 

portmaster -x '[.*php5.*|.*apache.*]' -n drupal6-6.12

That seems to work for me..


-- Frederique

___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: portmaster -x not working?

2009-07-15 Thread Miroslav Lachman

Doug Barton wrote:


Try using just this:

portmaster -x mysql-client- phpMyAdmin-3.1.5

That should work. If it does not, please let me know.


The same result:

r...@track ~/# portmaster -x mysql-client- phpMyAdmin-3.1.4

=== Currently installed version: phpMyAdmin-3.1.4
=== Port directory: /usr/ports/databases/phpmyadmin
=== Launching 'make checksum' for databases/phpmyadmin in background
=== Gathering dependency list for databases/phpmyadmin from ports
=== Starting recursive 'make config' check
=== Launching child to update mysql-client-5.0.77_1 to 
mysql-client-5.0.83

phpMyAdmin-3.1.4  mysql-client-5.0.77_1

=== Port directory: /usr/ports/databases/mysql50-client
=== Gathering dependency list for databases/mysql50-client from ports
=== Starting recursive 'make config' check
=== Recursive 'make config' check complete for databases/mysql50-client
phpMyAdmin-3.1.4  mysql-client-5.0.77_1

=== Continuing 'make config' dependency check for databases/phpmyadmin
=== Recursive 'make config' check complete for databases/phpmyadmin

=== Starting build for databases/phpmyadmin ===

=== Starting check for build dependencies
=== Gathering dependency list for databases/phpmyadmin from ports
=== Starting dependency check
=== Launching child to update mysql-client-5.0.77_1 to 
mysql-client-5.0.83

phpMyAdmin-3.1.4  mysql-client-5.0.77_1

=== Port directory: /usr/ports/databases/mysql50-client
=== Starting check for build dependencies
=== Gathering dependency list for databases/mysql50-client from ports
=== Starting dependency check
=== Dependency check complete for databases/mysql50-client
phpMyAdmin-3.1.4  mysql-client-5.0.77_1

===  Cleaning for mysql-client-5.0.83

= mysql-5.0.83.tar.gz doesn't seem to exist in /usr/ports/distfiles/.
= Attempting to fetch from 
ftp://ftp.fi.muni.cz/pub/mysql/Downloads/MySQL-5.0/.

^C


uname: FreeBSD 7.2-RELEASE #0: Fri May  1 08:49:13 UTC 2009 
r...@walker.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386


portmaster: portmaster-2.7


r...@track ~/# cat ~/.portmasterrc
# portmaster rc file
DONT_SCRUB_DISTFILES=yes
BACKUP=yes
MAKE_PACKAGE=yes
SAVE_SHARED=yes


r...@track ~/# pkg_info -r phpMyAdmin-3.1.4
Information for phpMyAdmin-3.1.4:

Depends on:
Dependency: mysql-client-5.0.77_1


r...@track ~/# pkg_info -R mysql-client-5.0.77_1
Information for mysql-client-5.0.77_1:

Required by:
amavisd-new-2.5.4,1
mysql-server-5.0.67_1
mytop-1.6_4
p5-DBD-mysql-4.010
php5-extensions-1.3
php5-mysql-5.2.9
php5-mysqli-5.2.9
phpMyAdmin-3.1.4
postfix-2.5.6,1
proftpd-mysql-1.3.2
courier-authlib-mysql-0.62.2


Miroslav Lachman
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: portmaster -x not working?

2009-07-15 Thread Miroslav Lachman

Doug Barton wrote:


Try using just this:

portmaster -x mysql-client- phpMyAdmin-3.1.5

That should work. If it does not, please let me know.


part 2:

It is working with -x mysql, but not with -x mysql- or -x mysql-client 
or -x mysql-client-


r...@track ~/# ~/portmaster -x mysql phpMyAdmin-3.1.4

=== Currently installed version: phpMyAdmin-3.1.4
=== Port directory: /usr/ports/databases/phpmyadmin
=== Launching 'make checksum' for databases/phpmyadmin in background
=== Gathering dependency list for databases/phpmyadmin from ports
=== Starting recursive 'make config' check
=== Recursive 'make config' check complete for databases/phpmyadmin

=== Starting build for databases/phpmyadmin ===

=== The 'make config' check found no dependencies to update

===  Cleaning for phpMyAdmin-3.2.0.1

=== Waiting on fetch  checksum for databases/phpmyadmin ===
You may use the following additional build option:

WITH_SUPHP=yes   Install appropriately for use with
 the www/suphp port [default: no]

This version of phpmyadmin requires PHP 5.2+ and MySQL
5.0+.  If you need to use an older version of PHP or
manage older MYSQL databases, please use the
databases/phpmyadmin211 port instead.

===  Found saved configuration for phpMyAdmin-3.1.4
===  Extracting for phpMyAdmin-3.2.0.1
= MD5 Checksum OK for phpMyAdmin-3.2.0.1-all-languages.tar.bz2.
= SHA256 Checksum OK for phpMyAdmin-3.2.0.1-all-languages.tar.bz2.
^C


So, something is broken, but I don't know what.

Miroslav Lachman
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: portmaster -x not working?

2009-07-15 Thread Miroslav Lachman

Miroslav Lachman wrote:

Doug Barton wrote:


Try using just this:

portmaster -x mysql-client- phpMyAdmin-3.1.5

That should work. If it does not, please let me know.



part 2:

It is working with -x mysql, but not with -x mysql- or -x mysql-client 
or -x mysql-client-


[...]


So, something is broken, but I don't know what.


I got some progress. I hack a function check_exclude, to be more verbose 
and it help a little:


check_exclude () {
echo Exclude: $EXCL
echo Dependency: $1
[ -n $EXCL ] || return 0

case $1 in
*${EXCL}*)
if [ -n $PM_VERBOSE ]; then
echo === Skipping $1
echobecause it matches the pattern: *${EXCL}*
fi
return 1 ;;
esac
return 0
}



r...@track ~/# ~/portmaster -v -x mysql-client- phpMyAdmin-3.1.4

=== Currently installed version: phpMyAdmin-3.1.4
=== Port directory: /usr/ports/databases/phpmyadmin
=== Launching 'make checksum' for databases/phpmyadmin in background
=== Gathering dependency list for databases/phpmyadmin from ports
=== Starting recursive 'make config' check
=== Checking dependency: /usr/ports/databases/mysql50-client
Exclude: mysql-client-
Dependency: databases/mysql50-client


So the problem is, that portmaster is doing match to ports directory 
mysql50-client which is different from the package name mysql-client-5.x.x


Should it be better documented in manpage, or modified to match package 
name? (or check both?)


Miroslav Lachman
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: portmaster -x not working?

2009-07-15 Thread Lawrence Stewart

Frederique Rijsdijk wrote:

Lawrence Stewart wrote:

Hijacking the thread slightly, but is there a way to exclude multiple
ports using the -x switch (or multiple -x switches)? Logically, I want
to be able to do something like this:

portmaster -a -x '*foo*' -x '*bar*'



portmaster -x '[.*php5.*|.*apache.*]' -n drupal6-6.12

That seems to work for me..



Nifty, although regex goo is unfriendly even at the best of times.

Thanks for the tip (and sorry for the hijack).

Cheers,
Lawrence
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


portmaster -x not working?

2009-07-14 Thread Miroslav Lachman

Hi,

I tried -x to exclude some port from recursive upgrade, but it seems not 
working.


# portmaster -x mysql-client-* phpMyAdmin-3.1.5

is still trying to upgrade mysql-client before upgrade of phpMyAdmin.

I workaround this issue by interactive mode (-i) which is working fine.

Is -x not working or am I using it wrong way?
Is it / will it be possible to specify -x more then one time to exclude 
more ports from upgrade process?


Miroslav Lachman
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: portmaster -x not working?

2009-07-14 Thread Frederique Rijsdijk
Hi,

Miroslav Lachman wrote:
 Hi,
 
 I tried -x to exclude some port from recursive upgrade, but it seems not
 working.
 
 # portmaster -x mysql-client-* phpMyAdmin-3.1.5


Escape the asterix:

portmaster -x mysql-client-\* phpMyAdmin-3.1.5

That should work.


-- Frederique

___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: portmaster -x not working?

2009-07-14 Thread Lawrence Stewart

Frederique Rijsdijk wrote:

Hi,

Miroslav Lachman wrote:

Hi,

I tried -x to exclude some port from recursive upgrade, but it seems not
working.

# portmaster -x mysql-client-* phpMyAdmin-3.1.5



Escape the asterix:

portmaster -x mysql-client-\* phpMyAdmin-3.1.5

That should work.


Hijacking the thread slightly, but is there a way to exclude multiple 
ports using the -x switch (or multiple -x switches)? Logically, I want 
to be able to do something like this:


portmaster -a -x '*foo*' -x '*bar*'

I so far haven't been able to figure out with casual prodding how to 
achieve the desired behaviour on the command line.


Cheers,
Lawrence
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: portmaster -x not working?

2009-07-14 Thread Miroslav Lachman

Frederique Rijsdijk wrote:

Hi,

Miroslav Lachman wrote:


Hi,

I tried -x to exclude some port from recursive upgrade, but it seems not
working.

# portmaster -x mysql-client-* phpMyAdmin-3.1.5




Escape the asterix:

portmaster -x mysql-client-\* phpMyAdmin-3.1.5

That should work.


It is my bad, that I forgot to add backslash in command in original 
e-mail, but I use it in real command and here is the output (it starts 
cleaning and building for mysql-client)


r...@track ~/# portmaster -x mysql-client-\* phpMyAdmin-3.1.4

=== Currently installed version: phpMyAdmin-3.1.4
=== Port directory: /usr/ports/databases/phpmyadmin
=== Launching 'make checksum' for databases/phpmyadmin in background
=== Gathering dependency list for databases/phpmyadmin from ports
=== Starting recursive 'make config' check
=== Launching child to update mysql-client-5.0.77_1 to 
mysql-client-5.0.83

phpMyAdmin-3.1.4  mysql-client-5.0.77_1

=== Port directory: /usr/ports/databases/mysql50-client
=== Gathering dependency list for databases/mysql50-client from ports
=== Starting recursive 'make config' check
=== Recursive 'make config' check complete for databases/mysql50-client
phpMyAdmin-3.1.4  mysql-client-5.0.77_1

=== Continuing 'make config' dependency check for databases/phpmyadmin
=== Recursive 'make config' check complete for databases/phpmyadmin

=== Starting build for databases/phpmyadmin ===

=== Starting check for build dependencies
=== Gathering dependency list for databases/phpmyadmin from ports
=== Starting dependency check
=== Launching child to update mysql-client-5.0.77_1 to 
mysql-client-5.0.83

phpMyAdmin-3.1.4  mysql-client-5.0.77_1

=== Port directory: /usr/ports/databases/mysql50-client
=== Starting check for build dependencies
=== Gathering dependency list for databases/mysql50-client from ports
=== Starting dependency check
=== Dependency check complete for databases/mysql50-client
phpMyAdmin-3.1.4  mysql-client-5.0.77_1

===  Cleaning for mysql-client-5.0.83

= mysql-5.0.83.tar.gz doesn't seem to exist in /usr/ports/distfiles/.
= Attempting to fetch from 
ftp://ftp.fi.muni.cz/pub/mysql/Downloads/MySQL-5.0/.


^C


Same happens if I use:

portmaster -x 'mysql-client-*' phpMyAdmin-3.1.4
or
portmaster -x mysql-client-5.0.77_1 phpMyAdmin-3.1.4

This is why I wrote original post.

Are there somebody with working example of -x usage?

Miroslav Lachman
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Excluding multiple ports with -x (Was: Re: portmaster -x not working?)

2009-07-14 Thread Doug Barton
Lawrence Stewart wrote:
 Hijacking the thread slightly,

Generally better to start a new one, FYI.

 but is there a way to exclude multiple
 ports using the -x switch 

Not at this time, you'll want to use the -i option.


hth,

Doug
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: portmaster -x not working?

2009-07-14 Thread Doug Barton
Try using just this:

portmaster -x mysql-client- phpMyAdmin-3.1.5

That should work. If it does not, please let me know.


Doug
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org