prurigro / gnome-catgen

A Gnome 3 application-overview folder configuration tool
MIT License
25 stars 3 forks source link

Garry's Mod.desktop not escaped properly #2

Closed artizirk closed 10 years ago

artizirk commented 10 years ago

That little ' in the desktop file isn't escaped when reading .category file

‣ ./gnome-catgen set 
Setting configured folder categories in dconf...

Clearing old category data before populating

Adding category: Audio

Adding category: Games
expected ',' or ']' to follow array element:
  ['cube.desktop', 'darkplaces.desktop', 'dosbox.desktop', 'EDGE.desktop', 'eduke32.desktop', 'ezquake.desktop', 'five-or-more.desktop', 'four-in-a-row.desktop', 'Garry's Mod.desktop', 'gnome-chess.desktop', 'gnome-mahjongg.desktop', 'gnome-mines.desktop', 'gnome-nibbles.desktop', 'gnome-robots.desktop', 'gnome-sudoku.desktop', 'gnome-tetravex.desktop', 'gzdoom.desktop', 'gtetrinet.desktop', 'iagno.desktop', 'lightsoff.desktop', 'ltris.desktop', 'neverball.desktop', 'neverputt.desktop', 'openarena.desktop', 'openarena-server.desktop', 'openttd.desktop', 'paintown.desktop', 'quadrapassel.desktop', 'quake4.desktop', 'redeclipse.desktop', 'RUSH.desktop', 'sol.desktop', 'steam.desktop', 'stuntrally.desktop', 'supertuxkart.desktop', 'swell-foop.desktop', 'teeworlds.desktop', 'tesseract.desktop', 'yamagi-quake2.desktop']
                                                                                                                                                                         ^                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Adding category: Internet

Done!
‣
prurigro commented 10 years ago

Hey @arti95, thanks for letting me know about the bug!

I pushed a fix which I tested it by adding a desktop file with the ' character in its filename to a folder category with a ' in its name, and all seemed to work well.

I'll leave this bug report up until you confirm that things are working well on your end too.

PS: I posted the fix along with a bunch of other updates I made recently, among them being changes to the command line option strings (I was getting annoyed with the 7 character "short form" chooser for choose-remaining, not to mention the general lack of standardization.)

In any case, the README, manpage and gnome-catgen -h should all point to the new values. Let me know if you don't like the direction I went for those btw; if you have a better idea, I'm open to discuss.

Cheers!

artizirk commented 10 years ago

Still broken on my end

I created a Test.category file under ~/.local/share/applications-categories/ with only "Garry's Mod.desktop" as content then ran ./gnome-catgen --set and now it throws unary operator expected error

‣ cat ~/.local/share/applications-categories/Test.category 
Garry's Mod.desktop
‣ ./gnome-catgen --set
Applying current folder configuration...

Clearing old category data before populating folders

Evaluating: Test
./gnome-catgen: line 89: [: Garry's: unary operator expected

Done!
‣

Command-line interface itself is nicer now than it was before.

prurigro commented 10 years ago

@arti95: Hey, I think your issue may be fixed thanks to some help from @meridius- I applied similar logic to a few other spots and caught some similar problems too, then made some additional tweaks so double and single quotes could be used simultaneously.

My test case was:

It seemed to work well for all the options-- let me know how it goes for you!

artizirk commented 10 years ago

works now, thanks :)

prurigro commented 10 years ago

@arti95: Sweet deal! Thanks for reporting and following up :)

Your issue actually got me considering what other scenarios might break things, and I discovered gnome-catgen wasn't very friendly towards the backslash character either, so I patched in support for that too. My latest working test case is:

Let me know if you find anything else, Cheers!

prurigro commented 10 years ago

I discovered a few more strings that wouldn't work and fixed those too; the new test case is: