Gentoo Archives: gentoo-dev

From: Chris White <chriswhite@g.o>
To: gentoo-dev@l.g.o
Subject: kde-theme.py (formerly [gentoo-dev] intention for kde-themes eclass)
Date: Tue, 14 Jun 2005 16:33:14
Message-Id: 20050615100630.79c3a4cd@localhost
In Reply to: [gentoo-dev] intention for kde-themes eclass by Chris White
1 Ok, so plans have changed. Now I've made a nice little script called kde-theme.py, which I haven't released yet because the code needs more effecient "what on earth are you trying to make me do.. I can't do that!" error handling. Here's the just of it:
2
3 http://dev.gentoo.org/~chriswhite/kde-theme.log
4
5 so here's how it works:
6
7 1) Check out kde-look.org and select any kde 3.2+ style/theme or window decorations (it may handle more, but that's about what I've tested so far)
8 2) the program assumes
9 a) it's a 3.2+ style/theme
10 b) you're using kde 3.4
11 c) the file is GPL
12 (all that will change btw.. I plan on working on some html parsing that will parse information straight off the page on license and kde version)
13 3) so you give it a download url for the source from the theme/style or w indow decorations page (like from here for example):
14
15 http://www.kde-look.org/content/show.php?content=21107
16
17 4) It downloads the file into a directory called .temp_directory, which must be empty (it will yell if it's not)
18 5) it does a directory listing to get the name of the source archive (yes, it must be empty because it has to be the only file there, since currently wget is handling the download and kde-theme.py has no true way of handling that saving doing a directory listing where the download is the only file there). I plan on adding some kind of download library later on to take care of this.
19 6) it checks the filename against a list of regex's. This tells it what type of file it's dealing with. By doing so, I can add support for rpm/deb/other strange files by simply updating the regex list. Right now it handles the following:
20
21 #-packagename-version.extension (kde-look.org hosted source archive)
22 packagename-version.extension (standard source archive)
23
24 7) it pulls packagename and ${P} by packagename+version
25 8) it creates /usr/portage/x11-themes/[packagename]/files
26 (I plan to work with PORTDIR_OVERLAY later on so files don't get removed on sync)
27 9) then it writes the ebuild, also if you use the '-a' option, you can set the arch it uses for KEYWORDS, otherwise it assume x86 (yes.. I know other archs exist ;p). Keywording is done on an ~arch basis since it uses kde 3.4 anyways. Also, if '-d' option is set (don't merge), the newly created ebuild will not be merged.
28 10) ebuild [file] digest is run to create the manifest
29 11) the file is emerged with --oneshot to prevent world udpates from going screwy
30
31 viola, that's all there is too it.
32 Chris White

Replies