Re: [Leaf-user] uninstall option for lrpkg
David Douthitt wrote: # Remove package from packages list: PKGD=/var/lib/lrpkg mv $PKGD/packages $PKGD/pkg.old grep -v $PKGD/pkg.old $PKGD/packages This has an error; should be: # Remove package from packages list PKGD=/var/lib/lrpkg mv $PKGD/packages $PKGD/pkg.old grep -v '^'$PKGNAME'$' $PKGD/pkg.old $PKGD/packages ...note that this will remove ALL package entries with the same name. Since lrpkg will blithely allow you to install the package more than once, this may be useful :) ___ Leaf-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/leaf-user
Re: [Leaf-user] uninstall option for lrpkg
Great! Thanks Exactly what I was looking for. - Original Message - From: David Douthitt [EMAIL PROTECTED] To: LEAF Users List [EMAIL PROTECTED] Sent: Tuesday, December 11, 2001 9:54 AM Subject: Re: [Leaf-user] uninstall option for lrpkg David Douthitt wrote: # Remove package from packages list: PKGD=/var/lib/lrpkg mv $PKGD/packages $PKGD/pkg.old grep -v $PKGD/pkg.old $PKGD/packages This has an error; should be: # Remove package from packages list PKGD=/var/lib/lrpkg mv $PKGD/packages $PKGD/pkg.old grep -v '^'$PKGNAME'$' $PKGD/pkg.old $PKGD/packages ...note that this will remove ALL package entries with the same name. Since lrpkg will blithely allow you to install the package more than once, this may be useful :) ___ Leaf-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/leaf-user ___ Leaf-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/leaf-user
Re: [Leaf-user] uninstall option for lrpkg
On Tue, 11 Dec 2001, David Douthitt wrote: [...] grep -v '^'$PKGNAME'$' $PKGD/pkg.old $PKGD/packages why the rigamarole with the single quotes? grep -v ^$PKGNAME$ $PKGD/pkg.old $PKGD/packages --- Jeff NewmillerThe . . Go Live... DCN:[EMAIL PROTECTED]Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/BatteriesO.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...2k --- ___ Leaf-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/leaf-user
Re: [Leaf-user] uninstall option for lrpkg
Jeff Newmiller wrote: On Tue, 11 Dec 2001, David Douthitt wrote: [...] grep -v '^'$PKGNAME'$' $PKGD/pkg.old $PKGD/packages why the rigamarole with the single quotes? grep -v ^$PKGNAME$ $PKGD/pkg.old $PKGD/packages I was playing chicken :) The first breaks down this way: string (not scanned by shell): '^' variable: $PKGNAME string (not scanned by shell): '$' The second is a little more dicey - how does one know that the shell won't get confused or upset by the final '$'? With the double-quotes, the shell scans the string. Given your example, I think I'd prefer using: ^${PKGNAME}$ because it forces the name upon the shell - prevents even more confusion... ___ Leaf-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/leaf-user
[Leaf-user] uninstall option for lrpkg
Running dachstein RC2 floppy version: I'm try to add an uninstall option into lrpkg. I've added this code to /lib/POSIXness/POSIXness.linuxrouter in the lrpkg() function. # uninstall () { f="$1" FN_LIST="$(cat $lrpkgpath/$f.list)" for FN in $FN_LIST; do rm /$FN done }# this in the case function, # -u ) uninstall "$2" "$3" ;;# and this in the usage function: # eecho " -u: uninstall Uninstall package. (explude .lrp)"# Is this messy/incorrect/etc? I havevery littleexp. coding shell scripts, that's why i'm asking, although it seems to work ok. Also, what can I add to this to update the /var/lib/lrpkg/packages file to remove the named package from the list?