Screen-out wrong kernels in PPM
May 30, 2011 —
BarryK
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 "nvidia-260.19.12-k2.6.32.28-w5.pet".
That is, the kernel version to be prefixed with "-k" and postfixed with "-".
I modified 'filterpkgs.sh' and 'findnames.sh' in /usr/local/petget. Here they are:
http://distro.ibiblio.org/quirky/test/filterpkgs.sh.gz
http://distro.ibiblio.org/quirky/test/findnames.sh.gz
Comments
Is the syntax strict ?Username: K Godt
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 : [i]PPPE=`cat $HOME/Choices/ROX-Filer/PuppyPin | grep pup_event | sed -e 's#\.#\\\\\\\.#g ; s#\/#\\\\\\\/#g'`[/i] or [i]GREPBIN=`echo "$ONEBIN" | sed 's#\[#\\\\[#g'`[/i] or [i]P='-' ls -l /dev/mouse | grep -o "\\$P.*"[/i] So the advice in MODULESCONFIG [b]#Please use underscore '_' in all module names, not '-'.[/b] is apparently related to that . BTW is there a good tutorial about the special characters for grep or sed on the net ?
Re underscores
Username: BarryK
"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.
Tags: woof