myDSL Extensions (deprecated) :: MyDSL problem



I observed the following behavior for DSL version 1.21 USB frugal install:

1) Add an /optional directory to the root directory of /cdrom
2) Add a bunch of optional extensions including alsadebs.dsl and usbview.dsl from the latest myDSL online repository
3) Boot up DSL and choose alsadebs or usbview from the optional menu.
4) The usbview or alsadebs myDSL menu item refuses to appear.

I have not done a lot of testing, but I believe that the "bug" is related to the "eliminate duplicate menu items" code as part of the mydsl-load process.  I think that the script decided that there is already a "usbview" menu item (even though this is not true) and therefore deleted the new menu entry to prevent duplicates.

usbview.dsl is an ideal testing candidate because it is small and doesn't require dependencies like alsadebs.dsl

Hopefully, this behavior can be reproduced and if so, fixed.

It is that extension, usbview, it has a nameing convention violation and should be fixed.. Try scite, ted, zile. Not a problem.
Rebuilt and renamed to USBview.tar.gz

test and feedback..  

It works for me..
ke4nt

I also had similar problems. The relvent part of the mydsl-load script is as follows

Code Sample
checkmenu_item(){
  FILE="$MYMENU"/"$APPNAME"
  if [ -f "$FILE" ]; then
     MENUITEM=`awk '{print $2}' $FILE`
     if stringinfile "$MENUITEM" "$DSLMENU"; then
        rm -f "$FILE"
     fi
  fi
}


Suppose the extension includes a menu file which looks like this (I'm using firefox as an example):

Code Sample

[exec] (Firefox) {/opt/firefox/firefox}


Then this is my understanding of what goes on:

awk '{print $2}' $FILE will return "(Firefox)" so MENUITEM="(Firefox)". Therefore stringinfile "$MENUITEM" "$DSLMENU" will be return true since the entry (Firefox) exists in the standard DSL Menu. This means a new menu item won't be created.

A couple of thoughts
1) Why is the fluxbox description being used to check for duplicates? Surely it is more accurate to check the command that is used for running the extension. There are situations where an extension might share a description with something already in the DSL menu. However two different programs cannot use the exact same command. So why not check the command instead? Or why not check for the presence of the entire line (i.e. description and command) - this would guarantee the least false positives.
2) Currently this check has issues with spaces. Suppose I realised the reason my firefox extension didn't have a menu item was because the description matched something already in the menu. I then decide to change the menufile to

Code Sample

[exec] (Firefox 1.0.4) {/opt/firefox/firefox}


And it still doesn't work. This is because awk '{print $2}' $FILE just matches the 2nd field in the menu file and so will return the truncated description "(Firefox" , instead of the full description. Since this string is already in the menu again a menu item will still not be created.

Some possible fixes?

To check the full description (whether it includes spaces or not) change MENUITEM=`awk '{print $2}' $FILE` to MENUITEM="(`echo $FILE|cut -d '(' -f 2|cut -d ')' -f 1`)"

Or to check the command instead of the description use MENUITEM="{`echo $FILE|cut -d '{' -f 2|cut -d '}' -f 1`}"

Or to check the entire line just use MENUITEM="`cat $FILE`"

From the sounds of it 1.3 has some pretty big changes so hopefully this is solved and I've just wasted time writing this all out. But if not maybe the developers might consider this issue

Simplier fix make the first part of the name unique!  
I know about this and I may rewrite parts to avoid bash overhead of stacking so many commands to process.
I am looking to optimize.  And quite frankly I didn't feel it was that high a priority.
There were things changed/fixed in 1.3 that are of a much larger scale.

Next Page...
original here.