First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 164655
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Portage team <dev-portage@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: SpanKY <vapier@gentoo.org>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
quickpkg.py Reimplementation of quickpkg.py text/plain Martin Parm 2007-02-02 13:58 0000 3.18 KB Details
quickpkg.py A reimplementation of quickpkg text/plain Martin Parm 2007-02-05 17:05 0000 3.45 KB Details
quickpkg.py A reimplementation of quickpkg text/plain Martin Parm 2007-02-19 14:30 0000 5.13 KB Details
quickpkg.py A reimplementation of quickpkg text/plain Martin Parm 2007-05-14 21:03 0000 5.46 KB Details
quickpkg A reimplementation of quickpkg text/plain Alexander Graf 2007-05-14 23:55 0000 6.12 KB Details
quickpkg.py A reimplementation of quickpkg (v0.7.1) text/plain Martin Parm 2007-05-15 07:50 0000 5.90 KB Details
quickpkg.py A reimplementation of quickpkg (v0.7.2) text/plain Alexander Graf 2007-05-21 20:27 0000 6.25 KB Details
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 164655 depends on: Show dependency tree
Bug 164655 blocks: 181949
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2007-01-31 05:36 0000
build a package of say xorg-server, and it produces a bum package

# grep /usr/lib/X11/xserver/ /var/db/pkg/x11-base/xorg-server-1.2.0/CONTENTS |
wc
    912    4337   65457
# quickpkg x11-base/xorg-server
 * Building package for xorg-server-1.2.0 ...

 * Packages now in /usr/portage/packages:
 * xorg-server-1.2.0: 8.8M
# cd /usr/portage/packages/x11-base
# tar tf xorg-server-1.2.0.tbz2 | grep /usr/lib/X11/xserver/ | wc
    247     247   16627


there are a ton of symlinks in /usr/lib/X11/xserver/ that point to
/usr/lib/X11/xserver/C and running quickpkg destroys them all

------- Comment #1 From SpanKY 2007-01-31 05:37:27 0000 -------
if we cant pull the files off correctly from /, then we should probably copy
them to a temp directory and create a tarball of that

should be pretty easy to translate CONTENTS into a file list for rsync and then
have rsync copy the files over

------- Comment #2 From SpanKY 2007-02-01 04:39:33 0000 -------
*** Bug 164271 has been marked as a duplicate of this bug. ***

------- Comment #3 From Martin Parm 2007-02-02 13:47:58 0000 -------
(In reply to comment #1)
> if we cant pull the files off correctly from /, then we should probably copy
> them to a temp directory and create a tarball of that
> 
> should be pretty easy to translate CONTENTS into a file list for rsync and then
> have rsync copy the files over

I disagree. This will create a huge overhead for big and/or many packages.

------- Comment #4 From Martin Parm 2007-02-02 13:58:14 0000 -------
Created an attachment (id=108933) [details]
Reimplementation of quickpkg.py

May I humbly suggest an alternative implementation of quickpkg? This is a
simple reimplementation I wrote when I noticed this problem the first time.
This implementation has the following features:
- It fixes bug #164655 by actually using the informations in CONTENTS
- It ignores bug #16162 silently (as do the official implementation)
- It's written in Python, so it can hook directly into Portage
- My initial benchmarkings indicates that it's a bit faster than the official
implementation (probably due to the overhead for calling portageq).

This implementation is missing:
- The ability to handle the '{PORTAGE_DB}/<CATEGORY>/<PKG-VERSION>/' -form
- Nice colors

However if anyone likes this implementation I might think about implementing
these features too.

------- Comment #5 From Zac Medico 2007-02-02 16:17:07 0000 -------
(In reply to comment #4)
> Created an attachment (id=108933) [edit] [details]
> Reimplementation of quickpkg.py

I was thinking about rewriting it in python too.  That's probably the best
solution considering that it allows us to use the existing portage libraries
and python's tarfile module (to work around the inadequacies of the plain tar
command).

Instead of hard coding package paths in /usr/portage/packages, the script
should use the methods of the binarytree class like emerge does.  In 2.1.2,
emerge uses the binarytree.prevent_collision() method to prevent collisions
between two packages that have the same $PF (bug 133908) and it uses
binarytree.getname() to get the location that the package should be stored at.

------- Comment #6 From Martin Parm 2007-02-02 19:15:33 0000 -------
(In reply to comment #5)
> (In reply to comment #4)
> > Created an attachment (id=108933) [edit] [details]
> > Reimplementation of quickpkg.py
> 
> I was thinking about rewriting it in python too.  That's probably the best
> solution considering that it allows us to use the existing portage libraries
> and python's tarfile module (to work around the inadequacies of the plain tar
> command).

Agreed.

> Instead of hard coding package paths in /usr/portage/packages, the script
> should use the methods of the binarytree class like emerge does.  In 2.1.2,
> emerge uses the binarytree.prevent_collision() method to prevent collisions
> between two packages that have the same $PF (bug 133908) and it uses
> binarytree.getname() to get the location that the package should be stored at.

Don't worry. This is not the final version. I just didn't want to spend too
much time on it until I knew that I had some support. I will tidy up the code
this weekend and post a new version.

------- Comment #7 From Martin Parm 2007-02-05 17:05:23 0000 -------
Created an attachment (id=109243) [details]
A reimplementation of quickpkg

Here's a new and improved version of quickpkg. Among the new things are:
- Making use of Portage's EOutput for showing output
- Uses informations from bintree instead of hardcoded directories
- Encapsulated in a class for easy reuse (import) in other applications

Comments, complaints and requests are most welcome.

------- Comment #8 From Jonathan Adamczewski 2007-02-15 02:05:29 0000 -------
Worked where 'official' quickpkg failed, thanks.  (xorg-server install from
pkg)

It is missing the file size output compared to the official version ;)

------- Comment #9 From Martin Parm 2007-02-19 14:26:32 0000 -------
(In reply to comment #8)
> It is missing the file size output compared to the official version ;)

Yeah, I know. Personally I think it a pretty useless feature, but I will
implement it later if someone asks for it. For now I have simply "prepared" the
code for it.

------- Comment #10 From Martin Parm 2007-02-19 14:30:01 0000 -------
Created an attachment (id=110639) [details]
A reimplementation of quickpkg

Updated version. The differences are:
- Documentation (inline in epytext format, like Portage will be)
- Can raise a portage_exception.PackageNotFound exception
- Returns the path to the binary package, which could be usefull e.g. for
printing the size of the package.

------- Comment #11 From Martin Parm 2007-05-14 21:03:38 0000 -------
Created an attachment (id=119261) [details]
A reimplementation of quickpkg

Minor update of my reimplementation of quickpkg. It now print the package size
like the official version does.

Comments, complaints, questions and suggestions are most welcome.

------- Comment #12 From Alexander Graf 2007-05-14 23:55:03 0000 -------
Created an attachment (id=119283) [details]
A reimplementation of quickpkg

Update of Martin Parm's quickpkg.

- now handles '{PORTAGE_DB}/<CATEGORY>/<PKG-VERSION>/' correctly.
- makes use of binarytree.prevent_collision()
- outputs unmatched packets like the original

------- Comment #13 From Martin Parm 2007-05-15 06:26:08 0000 -------
> Update of Martin Parm's quickpkg.
> 
> - now handles '{PORTAGE_DB}/<CATEGORY>/<PKG-VERSION>/' correctly.
> - makes use of binarytree.prevent_collision()
> - outputs unmatched packets like the original
> 

Thanks for the update. It's good to see a little activity ^_^.
One question though: is there any particular reason for you to change my
codestyle (renaming variable, etc.)? Is there some official Gentoo codestyle
that you're trying to match? If so, could you please provide me with a
description/link.

------- Comment #14 From Martin Parm 2007-05-15 07:50:13 0000 -------
Created an attachment (id=119332) [details]
A reimplementation of quickpkg (v0.7.1)

Some minor changes to Alexander Graf's update:
- The PID is read in __call__() instead of in __init__() thus allowing Quickpkg
to operate correctly from a child-process.
- Made use of os.path.realpath instead of doing the work manually with
os.readlink
- Check all package specification again the Portage API even when in the
/var/db/pkg/<CATEGORY>/<PKG-VERSION>/ form, thus preserving the original
intend: "Better integration with Portage by making direct use of the Portage
API, thus trying to avoid any kind of hardcoding or implicite knowledge."
- Check if binsize is empty before outputting it's content, thus making the
output more correct.

------- Comment #15 From Alexander Graf 2007-05-15 12:10:24 0000 -------
(In reply to comment #14)
> - The PID is read in __call__() instead of in __init__() thus allowing Quickpkg to operate correctly from a child-process.
> - Made use of os.path.realpath instead of doing the work manually with
> os.readlink

  I knew there was something easier ;)

  As for your/my codestyle: I don't know if there's an official gentoo
codestyle. It's just my style and I couldn't resist ;)
  But I think using variable names such as "cpv" is generally reasonable
because the same names are used in portage.

  One question: What is "the right thing" to do in line 110 if the "symlink" is
not removable (eg it's a folder or write protected or...)? Should we bail out
with an error or remove whatever there is using shutil.rmtree()?

------- Comment #16 From Alexander Graf 2007-05-21 20:27:59 0000 -------
Created an attachment (id=119926) [details]
A reimplementation of quickpkg (v0.7.2)

Some minor changes and bug fixes:

- added check for uid (root)
- added setting of umask
- fixed handling of name collisions (ie. quickpkg pecl-pdflib now works)
- fixed class import (os is now imported in __call__, not __init__ od Quickpkg)

------- Comment #17 From Zac Medico 2007-06-04 01:47:54 0000 -------
Thanks, this is now in trunk r6728.

------- Comment #18 From Zac Medico 2007-06-09 05:28:19 0000 -------
This has been released in 2.1.2.10.

------- Comment #19 From Jakub Moc (RETIRED) 2007-09-24 16:08:12 0000 -------
*** Bug 193653 has been marked as a duplicate of this bug. ***

First Last Prev Next    No search results available      Search page      Enter new bug