Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (3) </ [1] 2 3 >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: MyDSL problem, prevent duplicate menu items bug?< Next Oldest | Next Newest >
cbagger01 Offline





Group: Members
Posts: 4264
Joined: Oct. 2003
Posted: July 08 2005,04:40 QUOTE

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.
Back to top
Profile PM 
roberts Offline





Group: Members
Posts: 4983
Joined: Oct. 2003
Posted: July 08 2005,05:12 QUOTE

It is that extension, usbview, it has a nameing convention violation and should be fixed.. Try scite, ted, zile. Not a problem.
Back to top
Profile PM WEB 
ke4nt1 Offline





Group: Members
Posts: 2329
Joined: Oct. 2003
Posted: July 08 2005,05:58 QUOTE

Rebuilt and renamed to USBview.tar.gz

test and feedback..  

It works for me..
ke4nt
Back to top
Profile PM 
friedgold Offline





Group: Members
Posts: 122
Joined: Mar. 2005
Posted: July 14 2005,00:46 QUOTE

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
Back to top
Profile PM 
roberts Offline





Group: Members
Posts: 4983
Joined: Oct. 2003
Posted: July 14 2005,01:07 QUOTE

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.
Back to top
Profile PM WEB 
11 replies since July 08 2005,04:40 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (3) </ [1] 2 3 >/
reply to topic new topic new poll
Quick Reply: MyDSL problem

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code