Package categories help wanted

Under development: PCMCIA, wireless, etc.
Message
Author
User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Package categories help wanted

#16 Post by L18L »

Let's start with Fun :lol:
s5.sed wrote:s/Game; /Fun_Sub /
s/Game;ActionGame; /Fun_adventure /
s/Game;Action; /Fun_adventure /
s/Game;BlocksGame; /Fun_Sub /
s/Game;Blocks; /Fun_Sub /
s/Game;AdventureGame; /Fun_adventure /
s/Game;Adventure; /Fun_adventure /
s/Game;ArcadeGame; /Fun_arcade /
s/Game;Arcade; /Fun_arcade /
s/Game;BoardGame; /Fun_boardgame /
s/Game;Board; /Fun_boardgame /
s/Game;CardGame; /Fun_cardgame /
s/Game;Card; /Fun_cardgame /
s/Game;KidsGame; /Fun_Sub /
s/Game;LogicGame; /Fun_puzzle /
s/Game;RolePlaying; /Fun_adventure /
s/Game;Simulation; /Fun_Sub /
s/Game;SportsGame; /Fun_Sub /
s/Game;StrategyGame; /Fun_puzzle /
s/Game;Strategy; /Fun_puzzle /

Code: Select all

sed -f s5.sed Categories_package.sorted | sort > xxx
mv xxx Categories_package.sorted
has given puppy category and subcategory to 330 Fun packages

The sad rest is:
Game;Emulator; bsnes
Game;Emulator; dosbox
Game;Emulator; kcemu
Game;Emulator; rlvm
Game;FileTools; snespurify
Game;GPE; gpe-julia
Game;Music;Education linthesia
dosbox a game is not a joke. Is it?
So what now? Silently forget that rest?

@technosaurus, I think that I have now found one way to continue.
Inserting package names into categories.dat will be be the very last step....

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#17 Post by BarryK »

L18L,
Ha ha, 'dosbox' a game :lol:

Well, yesterday I did a test Precise build, and the 'debdb2pupdb' utility created this package database entry for dosbox:

Code: Select all

dosbox_0.74-2|dosbox|0.74-2||Graphic|2468K|pool/universe/d/dosbox|dosbox_0.74-2_i386.deb|+libasound21.0.24.1,+libc6&ge2.7,+libgcc1&ge4.1.1,+libgl1-mesa-glx,+libpng12-0&ge1.2.13-4,+libsdl-net1.2,+libsdl-sound1.2&ge1.0.1,+libsdl1.2debian&ge1.2.10-1,+libstdc++6&ge4.6,+libx11-6,+zlib1g&ge1.1.4|x86 emulator with Tandy/Herc/CGA/EGA/VGA/SVGA graphics sound and DOS|ubuntu|precise||
...assigned it as "Graphic" category. It would have picked up on that keyword "graphics" in the description and assigned the category -- obviously it has done that before discovering "emulator".

That's one reason a more fleshed-out categories.dat will be very helpful. debdb2pupdb will check that first, failing that can then fall back to the somewhat-less-than-perfect method of checking description keywords.

Thanks for all the work you are doing on this, it is great!
[url]https://bkhome.org/news/[/url]

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#18 Post by BarryK »

L18L,
while putting pkgs into categories.dat, or preparing to do so, if you think that there is a bunch of packages that really should have another sub-category, we can easily add that.

For example, maybe many of the top-level categories should have a "utility" sub-category. For example:

Code: Select all

CONST PKG_CAT_Business_Sub$=" "
CONST PKG_CAT_Business_spreadsheet$=" gnumeric "
CONST PKG_CAT_Business_planner$=" planner "
CONST PKG_CAT_Business_finance$=" acct expensetracker grisbi homebank moneymanagerx "
CONST PKG_CAT_Business_calc$=" calcoo cgtkcalc galculator gmeasures ycalc xcalc "
There may be some utility-type business apps, for which we should have "PKG_CAT_Business_utility" variable.

Note, in the menu we don't have to have horizontal lines between all of the sub-categories. Some can be grouped. So, these variables are for organizational purposes, actual display in the menu is flexible.

In fact, in Precise there are no horizontal bars between "spreadsheet" and "finance".
[url]https://bkhome.org/news/[/url]

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

#19 Post by L18L »

BarryK wrote:... a more fleshed-out categories.dat will be very helpful. debdb2pupdb will check that first, failing that can then fall back to the somewhat-less-than-perfect method of checking description keywords...
This dosbox example has made it very clear what to do:

Assign exactly 1 (puppy) category/subcategory to each package.
Existing Categories (in .desktop file) may have more than 1 category, example:
dosbox.desktop wrote:[Desktop Entry]
Type=Application
Name=DOSBox Emulator
Comment=Run old DOS applications
Icon=dosbox
Exec=dosbox
Terminal=false
Categories=Game;Emulator;
What can be done automatically?
Everything that has just 1 (sub)category.

I have continued to use some sed snippets and came to about
750 which cannot be automatically processed.
But before I publish this I will repeat this process to make sure that it is reproducible.

Then we will see if
there is a bunch of packages that really should have another sub-category,

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#20 Post by sunburnt »

While you`re writing specialized scripts to parse the desktop files...

Why not generate an app. library dependency data base with ldd.?

I`ve said that statistics on library usage is a key item for O.S. design.
Puppy`s installed libraries are probably a good list of common ones.

But many apps. need more, so which libs. are only used 1 or 2 times?

Include the commonly used libs. in Puppy or make an add-on SFS file.
The rarely used odd libs. just include with the apps. It`s good design!

# Sorry for stepping on your thread Barry... The thought struck me. :wink:

User avatar
pemasu
Posts: 5474
Joined: Wed 08 Jul 2009, 12:26
Location: Finland

#21 Post by pemasu »

Is this finding relevant to the packages categories work:
http://www.murga-linux.com/puppy/viewto ... 179#665179

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

Inspecting desktop files

#22 Post by seaside »

While there are some perl and python programs to convert a deb file to a tar.gz file, I was surprised to find that just using linux tools was actually faster.

I found that the tar file starts at exactly 60 bytes offset from the header "data.tar.gz". (At least in the 6 deb files I tested). So here's an extractor for *.desktop files.

Code: Select all

#!/bin/sh
# extract *.desktop file from .deb file $1
# seaside November 18 2012

p=`grep --binary-files=text -m1 -b -o 'data.tar.gz' "$1"`
startp=$((${p%:*} + 60)) # add 60 to 'data.tar.gz'
dd if="$1" bs="$startp" skip=1 | tar -xz --strip 4 --wildcards --no-anchored '*.desktop' 
Some further processing, checking right from the download could also be possible.

Actually, I might as well make a right-click deb2tar program out of this.

EDIT: deb2tgz. pet here
http://murga-linux.com/puppy/viewtopic. ... 691#665691

Cheers,
s

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Package categories help wanted

#23 Post by L18L »

All data and scripts are in one directory.

fill_categories.tgz came a little later than the pictures

Code: Select all

./reset # (only if starting or restart)
./fill_categories_GUI
The inserted package names are merged with the existing package names and sorted.

---------------------------------
edit
Note please
fill_categories_GUI line 154 wrote: comm="`grep Comment= ../bk/a/$packagename.desktop | cut -d '=' -f2`"
this has to changed to link to the directory containing the .desktop files. These data have been uploaded here.
------
edit
above link here corrected (start=12, not 13)
Attachments
fill_categories.tar.gz
script and all necessary data in 1 directory
(30.21 KiB) Downloaded 866 times
fill_categories_ready.png
The easy way for 1208 packages:
automatic assignment from original category has happened
can be checked using comment

The more difficult work see downwards
(41.36 KiB) Downloaded 1583 times
fill_categories_1_2.png
1- select input data file
2- select Puppy Subcategory and OK button
or
select Packages button
(80.93 KiB) Downloaded 1179 times
fill_categories_3_4.png
Ex:
2 packages (gbirthday and globaltime)
assigned to Puppy Category Business_Sub

OK button continues to a confirm dialog
(79.54 KiB) Downloaded 1692 times
fill_categories_5.png
Ex:
2 packages (gbirthday and globaltime)
assigned to Puppy Category Business_Sub
(24.09 KiB) Downloaded 1178 times
Last edited by L18L on Wed 21 Nov 2012, 11:06, edited 2 times in total.

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

#24 Post by L18L »

pemasu wrote:Is this finding relevant to the packages categories work:
http://www.murga-linux.com/puppy/viewto ... 179#665179
Yes, I think so.

User avatar
pemasu
Posts: 5474
Joined: Wed 08 Jul 2009, 12:26
Location: Finland

#25 Post by pemasu »

It has been fixed with latest woof commits.

http://www.murga-linux.com/puppy/viewto ... 483#665483

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Re: Package categories help wanted

#26 Post by L18L »

L18L wrote:edit
Note please
fill_categories_GUI line 154 wrote: comm="`grep Comment= ../bk/a/$packagename.desktop | cut -d '=' -f2`"
this has to changed to link to the directory containing the .desktop files. These data have been uploaded here.
Sorry, my fault, wrong link to .desktop files.

All needed .desktop files are in applications.tar.gz down loadable from

http://murga-linux.com/puppy/viewtopic. ... 6&start=12 (not ....13)

Getting these .desktop files was the bandwidth consuming part.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#27 Post by technosaurus »

I went through the desktop files looking for any gotchas and to see if it would be feasible to just include the icons but noticed that:
(41) apps use svg icons (not supported by jwm) ... need a wrapper to convert to png and modify desktop file on install
(15) specify no icon
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#28 Post by sunburnt »

Oddly I can`t find any standard saying the icons are to have no extension.
But it`s obviously the case as none ( or few ) icons in desktop files do.
I`ve gotten an error once with a desktop file that had an icon extension.
# So it`s a good idea for Puppy to follow the no icon extension standard.

I think it was intended for the user app. to parse for the icon type it wants.
Example for JWM:

Code: Select all

icon=`cat (app).desktop |grep 'Icon='`
Icon=`ls $ThemeIconPath/${icon#*=} |egrep '(png|xpm)'`
Here are links to the FreeDesktop standards for Catagories, Icons, etc.

http://standards.freedesktop.org/menu-s ... c-1.0.html

Has code near bottom of page for parsing icons:
http://standards.freedesktop.org/icon-t ... atest.html

http://standards.freedesktop.org/icon-n ... atest.html

http://standards.freedesktop.org/deskto ... 01s06.html

http://standards.freedesktop.org/deskto ... 01s05.html

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#29 Post by amigo »

"standard saying the icons are to have no extension" It's in the specs for desktop files. For icons which are correctly installed under /usr/share/icons, no path nor file extension should be given. This is assuming that your WM knows how to correctly find the icon -respecting any theme you have chosen, etc.

However, if using some non-standard location for the icon, then you should give the full path and filename.

Post Reply