From bounce-debian-bugs-dist==chris-lamb.co.uk@lists.debian.org Sun Apr 20 08:47:26 2008
Received: from liszt.debian.org ([82.195.75.100])
	by chris-lamb.co.uk with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.63)
	(envelope-from <bounce-debian-bugs-dist==chris-lamb.co.uk@lists.debian.org>)
	id 1JnUGd-0005jw-N6
	for bot.address@chris-lamb.co.uk; Sun, 20 Apr 2008 08:47:26 +0100
Received: from localhost (localhost [127.0.0.1])
	by liszt.debian.org (Postfix) with QMQP
	id 27A5613A4E5B; Sun, 20 Apr 2008 07:47:17 +0000 (UTC)
Old-Return-Path: <debbugs@rietz.debian.org>
X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on liszt.debian.org
X-Spam-Level: 
X-Spam-Status: No, score=-3.8 required=4.0 tests=BAYES_00,FOURLA,LDO_WHITELIST,
	MONEY,RCVD_IN_DNSWL_LOW,SARE_HTML_INV_CHARSET,STOCKLIKE,WWWRU autolearn=no
	version=3.2.3
X-Original-To: debian-bugs-dist@lists.debian.org
Delivered-To: lists-debian-bugs-dist@liszt.debian.org
Received: from rietz.debian.org (rietz.debian.org [140.211.166.43])
	by liszt.debian.org (Postfix) with ESMTP id EAF9F13A4DF6;
	Sun, 20 Apr 2008 07:46:58 +0000 (UTC)
Received: from debbugs by rietz.debian.org with local (Exim 4.63)
	(envelope-from <debbugs@rietz.debian.org>)
	id 1JnUES-0003eF-TW; Sun, 20 Apr 2008 07:45:05 +0000
X-Loop: owner@bugs.debian.org
Subject: Bug#476909: suggestions on reorganisation of the stardict package.
Reply-To: "Dmitry E. Oboukhov" <dimka@avanto.org>, 476909@bugs.debian.org
Resent-From: "Dmitry E. Oboukhov" <dimka@avanto.org>
Resent-To: debian-bugs-dist@lists.debian.org
Resent-CC: debian-devel@lists.debian.org, Andrew Lee <andrew@linux.org.tw>
Resent-Date: Sun, 20 Apr 2008 07:45:01 +0000
Resent-Message-ID: <handler.476909.B.120867642915600@bugs.debian.org>
X-Debian-PR-Message: report 476909
X-Debian-PR-Package: stardict
X-Debian-PR-Keywords: 
X-Debian-PR-Source: stardict
Received: via spool by submit@bugs.debian.org id=B.120867642915600
          (code B ref -1); Sun, 20 Apr 2008 07:45:01 +0000
Received: (at submit) by bugs.debian.org; 20 Apr 2008 07:27:09 +0000
X-Amavis-Spam-Status: No, score=-9.3 required=4.0 tests=BAYES_00,FORGED_RCVD_HELO,
	FOURLA,HAS_PACKAGE,MONEY,STOCKLIKE,WWWRU,X_DEBBUGS_CC autolearn=no 
	version=3.1.4-bugs.debian.org_2005_01_02
Received: from vds.uvw.ru ([85.249.230.209])
	by rietz.debian.org with esmtp (Exim 4.63)
	(envelope-from <dimka@uvw.ru>)
	id 1JnTx6-00040N-EU
	for submit@bugs.debian.org; Sun, 20 Apr 2008 07:27:09 +0000
Received: from [81.9.63.169] (helo=home.uvw.ru)
	by vds.uvw.ru with esmtp (Exim 4.63)
	(envelope-from <dimka@uvw.ru>)
	id 1JnTwt-0004c3-Ct
	for submit@bugs.debian.org; Sun, 20 Apr 2008 11:27:04 +0400
Received: from [10.255.1.50] (helo=apache.rbscorp.ru)
	by home.uvw.ru with esmtp (Exim 4.68)
	(envelope-from <dimka@uvw.ru>)
	id 1JnTwl-0002Jq-7G
	for submit@bugs.debian.org; Sun, 20 Apr 2008 11:26:50 +0400
Received: from dimka by apache.rbscorp.ru with local (Exim 4.69)
	(envelope-from <dimka@work.uvw.ru>)
	id 1JnTwl-0003XX-5Y
	for submit@bugs.debian.org; Sun, 20 Apr 2008 11:26:47 +0400
Date: Sun, 20 Apr 2008 11:26:47 +0400
From: "Dmitry E. Oboukhov" <dimka@avanto.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Message-ID: <20080420072645.GA12816@avanto.org>
References: <20080419085947.GB9874@avanto.org> <480AEA7A.3050800@uvw.ru>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="4bRzO86E/ozDv8r1"
Content-Disposition: inline
In-Reply-To: <480AEA7A.3050800@uvw.ru>
User-Agent: Mutt/1.5.17+20080114 (2008-01-14)
X-SA-Exim-Connect-IP: 81.9.63.169
X-SA-Exim-Mail-From: dimka@uvw.ru
X-SA-Exim-Version: 4.2.1 (built Tue, 09 Jan 2007 17:23:22 +0000)
X-SA-Exim-Scanned: Yes (on vds.uvw.ru)
Delivered-To: submit@bugs.debian.org
Resent-Date: Sun, 20 Apr 2008 07:45:04 +0000
X-Debian-Message: from BTS
X-Rc-Virus: 2007-09-13_01
X-Rc-Spam: 2007-10-04_01
X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/343345
X-Loop: debian-bugs-dist@lists.debian.org
List-Id: <debian-bugs-dist.lists.debian.org>
List-Post: <mailto:debian-bugs-dist@lists.debian.org>
List-Help: <mailto:debian-bugs-dist-request@lists.debian.org?subject=help>
List-Subscribe: <mailto:debian-bugs-dist-request@lists.debian.org?subject=subscribe>
List-Unsubscribe: <mailto:debian-bugs-dist-request@lists.debian.org?subject=unsubscribe>
Precedence: list
Resent-Sender: debian-bugs-dist-request@lists.debian.org
Received-SPF: none
X-SPF-Guess: pass
X-Spam-Score: -30.8
X-Spam-Report: (-30.8 points, 5.0 required)
	pts rule name              description
	---- ---------------------- --------------------------------------------------
	-50 D_FOR_BOT              For debian-devel-changes bot
	0.1 FORGED_RCVD_HELO       Received: contains a forged HELO
	0.0 UNPARSEABLE_RELAY      Informational: message has unparseable relay lines
	-2.6 BAYES_00               BODY: Bayesian spam probability is 0 to 1%
	[score: 0.0000]
	0.6 SARE_HTML_INV_CHARSET  RAW: Illegal chracterset in message
	21 AWL                    AWL: From: address is in the auto white-list


--4bRzO86E/ozDv8r1
Content-Type: multipart/mixed; boundary="C7zPtVaVf+AK4Oqc"
Content-Disposition: inline


--C7zPtVaVf+AK4Oqc
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline

Package: stardict
Severity: normal

Hi, Andrew Lee and Anthony Fok!

I use stardict, I like this dictionary very much, but there is a great
discomfort: at every new installation it is necessary to download the
dictionaries from the site http://stardict.sourceforge.net by hand and
to install them.

It would be nice if the deb-package included the dictionaries from this
site, however it is most likely impossible because mostly they will not
correspond to DFSG.

I have a proposal to you:

to modify the package thus it has configure and template scripts for
debconf, which would allow users to choose and install the dictionaries
automatically (dpkg-reconfigure).

I've written a small script (it is attached) which creates a list of
what to download and where from: according to the results of the work of
this script one may generate the menu for choosing). Some time later I
would be able to complete the work on this system [1].

However now I have to choose whether to make a fake package only for
automatisation of downloading the dictionaries for stardict or to work
further on the stardict package.

Here I need your agreement or disagreement about working on the stardict
package: in the first case you'll include the results of my work into
package and add me to the  Uploaders group and in the second one I'll
make a retitle of this bug in ITP: staridct-dicts [1].

Please inform me what is your opinion on this subject.

Sincerely yours, Dmitry

PS: notes:

[1] _example_ of staridct-dicts.deb uploaded to:
		http://uvw.ru/debian/unstable/stardict/


--C7zPtVaVf+AK4Oqc
Content-Type: text/x-perl; charset=utf-8
Content-Disposition: attachment; filename="get_dict_list.pl"
Content-Transfer-Encoding: quoted-printable

#!/usr/bin/perl

use warnings;
use strict;

package MechUTF8;
use base qw(WWW::Mechanize);
use Encode qw(encode decode);

sub content
{
  my $self=3Dshift;
  my $content=3D$self->SUPER::content(@_);
 =20
  $self->response->header('Content-Type')=3D~/charset=3D([\w\d\-]+)/
    and $content=3Dencode(utf8=3D>decode($1=3D>$content));
  return $content;
}


package main;
use URI;
use File::Basename qw(basename);
use Getopt::Std qw(getopts);

my $server=3D"http://stardict.sourceforge.net";
my $durl=3D"$server/Dictionaries.php";

sub die_if_error($$)
{
  my ($browser, $errtxt)=3D@_;
  $browser->success and return;
  die sprintf "$errtxt, server status: %s\n",
    $browser->status;
}

sub usage()
{
  print <<endusage;
  usage: $0 [OPTIONS]

  OPTIONS:
    -h            - this helpscreen
    -v            - print verbose messages
    -o file       - save list to file
endusage
  exit -1;
}

getopts('o:hv', \my %opts) or usage;
$opts{h} and usage;
if ($opts{o})
{
  open STDOUT, '>', $opts{o}
    or die "Can not create file $opts{o}: $!\n";
  $|=3D1;
}

$|=3D1; select STDERR; $|=3D1; select STDOUT;
my $browser=3Dnew MechUTF8;
$opts{v} and print STDERR "Getting $durl ...\n";
$browser->get($durl);
die_if_error $browser, "Can not get categories list from $server";

my %ans=3D
    map { m{href=3D"(.*?)".*?>\s*(.*?)\s*<}s; ($2, "$server/$1") }
      $browser->content=3D~m{(<a.*?/a>)}sgi;
for (sort keys %ans)
{
  unless ($ans{$_}=3D~m{$server/Dictionaries_})
  {
    delete $ans{$_};
    next;
  }

  $opts{v} and print STDERR "\tGetting $ans{$_} ...\n";
  $browser->get($ans{$_});
  die_if_error $browser, "Can not get category `$_'";
  my $content=3D$browser->content;

  for ($content)
  {
    s[<t([rd]).*?>][<t$1>]sig;
    s[<\s*(?:/)?\s*(?:font|span|strong|b|b|br).*?>][ ]sig;
  }

  my %dlist=3D
    map { $$_[0]=3D~s[<td.*?>\s*(.*?)\s*<.*][$1]; ($$_[0], $$_[1]) }
    grep { $$_[1] !~ /rpm$/i }
    map { $$_[1]=3D~s/\?.*//s; $_ }
    map { ($$_[1]=3D~m[.*<a\s*href=3D"(.*?)"\s*>\s*tarbal]si)?[$$_[0], $1]:=
() }
    map { [ $$_[0], "$$_[1] $$_[2]" ] }
    grep { @$_ =3D=3D 4  or @$_ =3D=3D 3 }
    map { [ m[(<td.*?/td>)]sig ] }
      $content=3D~m{(<tr.*?/tr>)}sig;
  for my $url (values %dlist)
  {
    my $basename=3Dbasename(URI->new($url)->path);
    $url=3D{file=3D>$basename, url=3D>$url, section=3D>$_};
  }
 =20
  $opts{v} and
    printf STDERR "\t\tfound %d tarbal-links for download\n",
      scalar keys %dlist;
  unless (%dlist)
  {
    delete $ans{$_};
    next;
  }
 =20
  printf "%s\n",
    join "\t",=20
      $dlist{$_}{section},=20
      $_,
      $dlist{$_}{file},
      $dlist{$_}{url} for sort keys %dlist;
}

keys %ans or
  die "Can not find categories list in $durl\n";

exit 0;

--C7zPtVaVf+AK4Oqc--

--4bRzO86E/ozDv8r1
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFICvA1q4wAz/jiZTcRAqqKAKDtwBk8/wVQiEafpdP4AsfNR224eQCgy2lt
OE8jkbfNZnrS9ScOMPE4epM=
=Tf99
-----END PGP SIGNATURE-----

--4bRzO86E/ozDv8r1--



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


