Screen-out wrong kernels in PPM

01micko suggested this recently. In the Puppy Package Manager, do not display packages with the wrong kernel version in their name. I have implemented this.

It requires a package name to have the kernel version in a certain format, for example "-k2.6.32.28-", where the full package could be "".

That is, the kernel version to be prefixed with "-k" and postfixed with "-".

I modified '' and '' in /usr/local/petget. Here they are:

Posted on 30 May 2011, 10:47


Posted on 2 Jun 2011, 21:51 by K Godt
Is the syntax strict ?
The kernel translates the commandline [a-zA-Z] .
Would " _K$Kernel.$VERS.$MAJ.$MIN_ " work also ?

sed ing 's#-#\\\-#' for grep to work properly is a horror ...
and sometimes sed 's# does not work but 's! or 's% , seems to depend on ash or bash .
I avoid using 's/ because many times I have slashes inside the string .
Examples :
PPPE=`cat $HOME/Choices/ROX-Filer/PuppyPin | grep pup_event | sed -e 's#\.#\\\\\\\.#g ; s#\/#\\\\\\\/#g'`
GREPBIN=`echo "$ONEBIN" | sed 's#\[#\\\\[#g'`
ls -l /dev/mouse | grep -o "\\$P.*"

So the advice in MODULESCONFIG
#Please use underscore '_' in all module names, not '-'.
is apparently related to that .

BTW is there a good tutorial about the special characters for grep or sed on the net ?

Posted on 3 Jun 2011, 8:10 by BarryK
Re underscores
Yes, the backslashing requirement is pretty horrible.

That comment in MODULESCONFIG is probably because certain apps such as 'lsmod' always show module names with an underscore, even if the actual module has a dash, for example usb-storage.ko.