You are here:

Mon, 21 May 2007

Playing with the package file

For Meikes thesis, we needed a csv-File from the Debian-Package file, so I wrote a small script to do that. You can get it from my repository (or via websvn). (Not yet perfect, but worked well enough for us; patches welcome.)

If you just need the csv to copy the data in a database (like she did), don't try to guess, how long a textfield (e.g. for depends or the long description) should be; we tried and failed several times (Sure... 2000 characters should be enough for a long description.). We finally used the following database (We used PostgreSQL, should work similar on other database systems): CREATE TABLE packages ( package character varying (75) NOT NULL, source character varying (75), priority character varying(10) NOT NULL, section character varying(20) NOT NULL, installedsize integer NOT NULL, maintainer character varying(150) NOT NULL, architecture character varying(4) NOT NULL, version character varying(40) NOT NULL, depends character varying(5000), conflicts character varying(5000), recommends character varying(5000), suggests character varying(5000), enhances character varying(500), predepends character varying(500), provides character varying(500), replaces character varying(500), buildessential character varying(3), essential character varying(3), filename character varying(200) NOT NULL, md5sum character(33) NOT NULL, origin character varying(100), sha1 character(41) NOT NULL, sha256 character(65) NOT NULL, size integer NOT NULL, tag character varying(1000), task character varying(400), description text NOT NULL, longdescription character varying(30000), CONSTRAINT pk PRIMARY KEY (package) );.

Now that you've created a table, you need to fill it. Easiest method is to use the COPY statement, as follows: copy packages (package, source, priority, section, installedsize, maintainer, version, depends, conflicts, recommends, suggests, enhances, predepends, replaces, buildessential, essential, filename, md5sum, origin, sha1, sha256, size, tag, task, description, longdescription) FROM '/path/to/your/csv-file' DELIMETER ';' CSV;.

You should now have a nice database to play with :)

Some examples... Which are the packages with the longest longdescription?

debian_packages=> select package, length(longdescription) as length from packages order by length desc limit 5;
        package         | length
------------------------+--------
 texlive-latex-extra    |  25337
 texlive-fonts-extra    |   5719
 emacs-goodies-el       |   4502
 xbase-clients          |   4403
 postgresql-contrib-7.4 |   4223
(5 rows)

Or... Which maintainer have the most packages?

debian_packages=> select maintainer, count(*) as anzahl  from packages group by maintainer order by anzahl desc limit 5;
                            maintainer                            | anzahl
------------------------------------------------------------------+--------
 Debian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>       |    465
 Debian QA Group <packages@qa.debian.org>                         |    458
 Debian X Strike Force <debian-x@lists.debian.org>                |    274
 Debian Perl Group <pkg-perl-maintainers@lists.alioth.debian.org> |    261
 Daniel Baumann <daniel@debian.org>                               |    255
(5 rows)

Or... Is there a package, whose sha256-sum contains Meikes birthday?

debian_packages=> select package, sha256 from packages where sha256 like '%261081%';
           package            |                              sha256
------------------------------+-------------------------------------------------------------------
 libobject-realize-later-perl | 5188126108146fc0b1328473125687fb388bd8d87f460e335952dbb1b66aa3d1
(1 row)

And another goodie (We needed to alter the database several times, to make this package fit into it): Which is the package with the longest name?

debian_packages=> select package, length(package) from packages order by length(package) desc limit 1;
                         package                         | length
---------------------------------------------------------+--------
 libmaypole-plugin-authentication-usersessioncookie-perl |     55
(1 row)

A lot of fun... and a lot of interesting facts to be discovered...

postet at 13:09 into [Debian] permanent link


Sat, 05 May 2007

Bug #422411

Do you remeber that scene from Star Wars: A new Hope, where Obi Wan Kenobi and Darth Vader finally meeth for their light saber duell? And Vader says: I've been waiting for you, Obi-Wan. We meet again, at last. The circle is now complete.?

Felt a bit like that, when I today filled a rc bug against one of my old application managers packges...

*evil grin*

postet at 21:40 into [Debian] permanent link


Thu, 03 May 2007

That's sooo childish!

Hiding a number? Why such an effort? If you post the number 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0, you can always claim you did it, because you thought it was one of those stupid memes...

postet at 13:05 into [Debian/memes] permanent link


Thu, 26 Apr 2007

How stupid can one be?

Do you know MSDNAA? That's a program from Microsoft offering their products to students at many universities. So not even this bullheaded users of this "free software" thingy have an excuse of not using their products when participating in different courses. In our case they even offer most of their stuff as ISO-Images. Shouldn't be a problem to install that in a virtual machine, get a good grade and be satisfied when finally deleting it again.

Theoretically. Let's not talk about licenses here, or about the website, you need to log into, or wonder why it talks about customers and shopping... Let's just wonder, why you can't download an ISO-Image there. No, you can only download a download-program there... A windows executable!

Ha! That's funny!

It doesn't even run in wine :(

postet at 21:11 into [Debian] permanent link


Sun, 22 Apr 2007

URLs

But you can link to releases by name, Wichert.

Can't say anything about the other points you mentioned.

postet at 15:20 into [Debian] permanent link


<<  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 [36] 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87  >>

About

Alexander Tolimar Reichle-Schmehl lives in Tuttlingen / Germany. Hw works as IT manager (specialized on Unix and SAN/Storage) for an international automotive supplier.

Links