Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 109243 Details for
Bug 164655
quickpkg wrongly excludes symlinks to directories
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
A reimplementation of quickpkg
quickpkg.py (text/plain), 3.45 KB, created by
Martin Parm
on 2007-02-05 17:05:23 UTC
(
hide
)
Description:
A reimplementation of quickpkg
Filename:
MIME Type:
Creator:
Martin Parm
Created:
2007-02-05 17:05:23 UTC
Size:
3.45 KB
patch
obsolete
>#!/usr/bin/python ># ># Copyright 2006 Martin Parm ># Distributed under the terms of the GNU General Public License v2 ># ># $Header$ ># Author: Martin Parm <parmus@diku.dk> > >__author__ = "Martin Parm" >__email__ = "parmus@diku.dk" >__version__ = "0.5" >__productname__ = "quickpkg-ng" >__description__ = "" > > >class Quickpkg: > def __init__(self): > import output > import pwd > import grp > self.eout = output.EOutput() > self.unames = dict([(entry[2],entry[0]) for entry in pwd.getpwall()]) > self.gnames = dict([(entry[2],entry[0]) for entry in grp.getgrall()]) > > def __call__(self, pkg): > import sys > import portage > import xpak > import tarfile > import os > > self.eout.ebegin("Building package for %s" % pkg) > sys.stdout.flush() > > s=pkg.split('/') > db=portage.dblink(s[0], s[1], portage.root, mysettings=portage.settings) > if not db.exists(): > self.eout.eerror("Not found!") > return > binpkg=portage.db[portage.root]['bintree'].getname(pkg) > if not os.path.exists(os.path.dirname(binpkg)): > os.makedirs(os.path.dirname(binpkg)) > symlink=os.path.join(portage.db[portage.root]['bintree'].pkgdir, s[0], os.path.basename(binpkg)) > if not os.path.exists(os.path.dirname(symlink)): > os.makedirs(os.path.dirname(symlink)) > > contents=db.getcontents() > tarball=tarfile.open(binpkg+'.$$', "w:bz2") > for item in sorted(contents.keys()): > if not os.path.exists(item): > # Ignore ALL missing packages for now (due to bug #16162) > # FIXME: Remove this when #16162 has been solved > continue > > tarinfo=tarball.gettarinfo(item, './'+item) > try: > tarinfo.uname=self.unames[tarinfo.uid] > except KeyError: > tarinfo.uname=str(tarinfo.uid) > self.unames[tarinfo.uid]=str(tarinfo.uid) > > try: > tarinfo.gname=self.gnames[tarinfo.gid] > except KeyError: > tarinfo.gname=str(tarinfo.gid) > self.gnames[tarinfo.gid]=str(tarinfo.gid) > > if contents[item][0]=='dir': > tarinfo.linkname='' > tarinfo.type=tarfile.DIRTYPE > tarball.addfile(tarinfo) > elif contents[item][0]=='obj': > tarinfo.linkname='' > tarinfo.type=tarfile.REGTYPE > tarball.addfile(tarinfo, file(item)) > else: > tarball.addfile(tarinfo) > tarball.close() > xpak.tbz2(binpkg+'.$$').recompose(db.getpath()) > os.rename(binpkg+'.$$', binpkg) > if os.path.exists(symlink): > # FIXME: This might not be a symlink at all > os.remove(symlink) > os.symlink(os.path.join('../All', os.path.basename(binpkg)), symlink) > self.eout.eend(0) > return > >if __name__ == '__main__': > import sys > > def usage(): > print "QUICKPKG ver %s" % __version__ > print "USAGE: quickpkg <list of pkgs>" > print " a pkg can be of the form:" > print " - single depend-type atom ..." > print " if portage can emerge it, quickpkg can make a package" > print " for exact definitions of depend atoms, see ebuild(5)" > print > print "EXAMPLE:" > print " quickpkg apache" > print " package up apache, all versions of apache installed" > print " quickpkg =apache-1.3.27-r1" > print " package up apache, just version 1.3.27-r1" > sys.exit(1) > > if len(sys.argv)<2: > usage() > > quickpkg=Quickpkg() > > # Try to match up all packages > import portage > pkgs=[] > for arg in sys.argv[1:]: > try: > matches=portage.db[portage.root]["vartree"].dbapi.match(arg) > if not matches: > print "Error: Could not find anything to match '%s'" % arg > sys.exit(2) > pkgs+=matches > except KeyError, e: > print e > sys.exit(1) > > # Pack everything > for pkg in pkgs: > quickpkg(pkg)
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 164655
:
108933
|
109243
|
110639
|
119261
|
119283
|
119332
|
119926