# Portmaster -e globs not working?



## hopla (Oct 29, 2010)

I'm new to portmaster and I'm trying the remove all php5 packages using:


```
portmaster -e 'php5-*'
```

But it's not working, portmaster replies:


```
===>>> No such directory/port: /var/db/pkg/php5-*
===>>> Aborting update
```

But when I do:


```
echo /var/db/pkg/php5-* | xargs -n 1
```

there are tons of them!

Am I just-not-getting-it or is this a bug?


----------



## SirDice (Oct 29, 2010)

Try 
`# portmaster -e php5-\*`


----------



## hopla (Oct 29, 2010)

Hmm, thanks, but no-go:


```
# portmaster -e php5-\*

===>>> No such directory/port: /var/db/pkg/php5-*
===>>> Aborting update
```

:S


----------



## DutchDaemon (Oct 29, 2010)

You can try [cmd=]pkg_delete -f php5-\*[/cmd] followed by [cmd=]portmaster -s[/cmd]

Does the same thing, by and large. Looks like a bug, yes. Not going to try and replicate it, as I'm quite attached to my current PHP installation


----------



## fronclynne (Oct 29, 2010)

It's definitely some kind of weird bug: 
	
	



```
# portmaster -n -e p\*

===>>> No such directory/port: /var/db/pkg/pics
===>>> Aborting update

# portmaster -n -e "p\*"

===>>> No such directory/port: /var/db/pkg/p\*
===>>> Aborting update

# portmaster -n -e "p*"

===>>> No such directory/port: /var/db/pkg/pics
===>>> Aborting update
```
It appears to be grabbing the first entry matching "p*" in my CWD, even when escaped from the shell.

Also: 
	
	



```
# portmaster -n -e /var/db/pkg/p*

===>>> No such directory/port: /var/db/pkg//var/db/pkg/p5-CDDB_get-2.27,1
===>>> Aborting update

# portmaster -n -e /var/db/pkg/p\*

===>>> No such directory/port: /var/db/pkg//var/db/pkg/p5-CDDB_get-2.27,1
===>>> Aborting update
```


It does appear to work correctly if your CWD is /var/db/pkg/


----------



## dougb@ (Oct 31, 2010)

Couple of problems here.   First, -e does not take multiple ports. I've just updated the svn version to clarify this, and the update will be in 3.2 which will be coming out ASAP. Second, the term "glob" in the portmaster documents refers to a glob pattern, which does not need a * appended on the command line. In fact, portmaster will strip those off internally. 

If you really want to remove all ports that start with php the easiest way to do that using sh/bash/etc. would be something like:


```
cd /var/db/pkg
for port in php*; do
portmaster -e $port
done
```


hope this helps,

Doug


----------

