Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 23311 Details for
Bug 37484
app-dicts/freedict-* - Add Freedict packages using a Python script that generates all possible ebuild packages.
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
A python script to generate freedict ebuilds
genfreedictebuilds.py (text/plain), 2.58 KB, created by
guaka
on 2004-01-07 08:40:07 UTC
(
hide
)
Description:
A python script to generate freedict ebuilds
Filename:
MIME Type:
Creator:
guaka
Created:
2004-01-07 08:40:07 UTC
Size:
2.58 KB
patch
obsolete
># Copyright 2004 Gentoo Technologies, Inc. ># Distributed under the terms of the GNU General Public License v2 > >from twisted.internet import reactor >from twisted.web.client import downloadPage >from twisted.python.util import println >import sys > >import os > >distfiles = "/usr/portage/distfiles" >tmpdir = "/tmp/freedict/" >ebuilds_dir = "/usr/local/portage/app-dicts/" >sf_url = "http://freedict.sourceforge.net/download/linux/" > >languages = ["afr", "cze", "dan", "deu", > "eng", "fra", "hun", "iri", > "ita", "jpn", "lat", "nld", > "por", "rus", "sco", "scr", > "slo", "spa", "swa", "swe", > "tur", "wel"] > > >############################################## >ebuild_code = """ ># Copyright 1999-2004 Gentoo Technologies, Inc. ># Distributed under the terms of the GNU General Public License v2 >##### $Header: /home/cvsroot/gentoo-x86/app-dicts/freedict-eng-fra/freedict-eng-fra-1.0.ebuild,v 1.1 2003/03/18 03:51:36 seemant Exp $ > >FORLANG="language1" >TOLANG="language2" >inherit freedict >""" > >dictd_freedicts_code = """ ># Copyright 1999-2003 Gentoo Technologies, Inc. ># Distributed under the terms of the GNU General Public License v2 >##### $Header: /home/cvsroot/gentoo-x86/app-dicts/dictd-dicts/dictd-dicts-1.0.ebuild,v 1.6 2003/07/16 15:05:47 pvdabeel Exp $ > >DESCRIPTION="A package to simplify installation of all dictd freedict dictionaries" > >SLOT="0" >LICENSE="GPL-2" >KEYWORDS="x86 ppc sparc" > >DEPEND="" > >RDEPEND= >""" >################################################## > >def getFile(url, file): > downloadPage(url, file).addCallbacks( > lambda value:reactor.stop(), > lambda error:(println("an error occurred",error),reactor.stop())) > reactor.run() > > >def getDictFiles(): > for l1 in languages: > for l2 in languages: > if l1 != l2: > f = l1 + "-" + l2 + ".tar.gz" > getFile(sf_url + f, tmpdir + f) > >def makeDigests(): > print "Little bash line:" > print "for ebuild in $(find " + ebuilds_dir + "|grep ebuild$); do ebuild $ebuild digest; done" > >def makeEbuild(NP, NV, code): > path = os.path.join(ebuilds_dir, NP) > if not os.path.exists(path): > os.mkdir(path) > ebuild = os.path.join(path, NP + "-" + NV + ".ebuild") > f = open(ebuild, 'w') > f.write(code) > f.close > > >def makeEbuilds(): > freedicts = [f[:-7] for f in os.listdir(tmpdir)] > deps = 'RDEPEND="' > for freedict in freedicts: > NP = "freedict-" + freedict > NV = "1.0" > makeEbuild(NP, NV, ebuild_code) > deps += "app-dicts/" + NP + "\n" > > print deps > makeEbuild("dictd-freedicts", "1.0", dictd_freedicts_code + deps + '"') > > >################################################## >#getDictFiles() >if not os.path.exists(tmpdir): > os.mkdir(tmpdir) >makeEbuilds() >makeDigests()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 37484
: 23311