Matt Schalit wrote:

> Here's what David does with Oxygen.  It has
> the -r option for removing a package that's
> been installed.

I see a bug - it's bit me recently in another area, and I see it here!

> remove () {
>         cd $PKGD
>         [ ! -f $1.list ] && err "no package! ($1)"
> 
>         grep -v "$1" packages > packages.new
>         mv packages.new packages
> 
>         cd - ; cd /
>         rm -f `cat $PKGD/$1.list`
>         cd -
>         }

grep -v "$1" will remove all packages that have the name in them from
the package list.

Probably the best (and most catastrophic!) example would be e.lrp (an
expression evaluator).  Using this code to remove "e" would ALSO remove
(only from the package list, that is)....

ettercap
etc
beep
e2fs
e3
ncurses5
ncurses4
mod-net1
mod-net2
zile

Need to change

grep -v "$1" [...]

...to...

grep -v '^'$1'$' [...]

...to match a package ONLY by itself on a line - so ^e$ matches but
^etc$ does not...

_______________________________________________
Leaf-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/leaf-devel

Reply via email to