Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 1841 - emerge --update world fails if a package in /var/cache/edb/world has been masked
Summary: emerge --update world fails if a package in /var/cache/edb/world has been masked
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Daniel Robbins (RETIRED)
URL:
Whiteboard:
Keywords:
: 1856 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-04-16 13:28 UTC by Grant Goodyear (RETIRED)
Modified: 2011-10-30 22:22 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
portage exception definitions and generic handler (portage_exceptions.py,1.34 KB, application/octet-stream)
2002-04-30 05:07 UTC, George Shapovalov (RETIRED)
Details
patch to solve this problem ;) (emerge.patch,2.01 KB, patch)
2002-04-30 05:08 UTC, George Shapovalov (RETIRED)
Details | Diff
updated patch (emerge.patch,1.87 KB, patch)
2002-05-01 23:32 UTC, George Shapovalov (RETIRED)
Details | Diff
just a cosmetic touch (\n at the beginning of error message, so that it looks better) (portage_exceptions.py,1.35 KB, application/octet-stream)
2002-05-01 23:33 UTC, George Shapovalov (RETIRED)
Details
updated patch to emerge to handle the problem (emerge.patch-1.9.9,1.87 KB, patch)
2002-05-07 01:34 UTC, George Shapovalov (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Grant Goodyear (RETIRED) gentoo-dev 2002-04-16 13:28:08 UTC
We probably need to a graceful way of handling an entire 
package being masked and in /var/cache/edb/world 
when doing an emerge --update world.

# emerge --pretend --update world

These are the packages that I would merge, in order.

Calculating world dependencies \
!!! Error: couldn't find match for net-im/licq in update (likely old /var/db/pkg
entry)
Comment 1 Seemant Kulleen (RETIRED) gentoo-dev 2002-04-16 21:24:10 UTC
*** Bug 1856 has been marked as a duplicate of this bug. ***
Comment 2 Arcady Genkin (RETIRED) gentoo-dev 2002-04-16 22:16:02 UTC
Are you sure that this is indeed a duplicate of bug 1856?  I looked at this one
before posting 1856, but it sounds like something different, since this one
seems to be about a whole package being masked out, and the bug that I
encountered is basically about not checking for existence of a directory before
trying to open a file in it.
Comment 3 Daniel Robbins (RETIRED) gentoo-dev 2002-04-22 00:01:19 UTC
I'm pretty sure this bug is fixed in 1.9.1 or earlier.  I can't replicate the
problem here with 1.9.1.
Comment 4 George Shapovalov (RETIRED) gentoo-dev 2002-04-30 05:07:52 UTC
Created attachment 731 [details]
portage exception definitions and generic handler
Comment 5 George Shapovalov (RETIRED) gentoo-dev 2002-04-30 05:08:51 UTC
Created attachment 732 [details, diff]
patch to solve this problem ;)
Comment 6 George Shapovalov (RETIRED) gentoo-dev 2002-04-30 05:09:37 UTC
Hi Daniel, hi guys.

I completed updated patch to address this problem:
\begin_quote
If the package was moved/renamed or masked completely (like openoffice* for
example) after it has been installed and included into world file, emerge
--update world reports error and exits.
\end_quote
(and I need this corrected before I will start moving apps into app-sci,
otherwise emerge --update world will be broken for users who installed relevant
packages.
And apparently it is not fixed up to portage-1.9.5, as this was why I started on
it).

So now (with new patch) emerge behaves correctly:
First it scans /var/cache/edb/world. If some package listed in it is
problemmatic (match cannot find it), then it reports the problem, comments out
relevant entry in world and continues.
Then with updated world file it proceeds as usual - so that it reports and halts
on incorrect dependencies.
Patch should apply cleanly to portage-1.9.5 (portage_exceptions.py should
probably reside in site-packages next to portage.py and output.py or any other
place as long as python finds it).

I reopen the bug until changes are incorporated or some other solution is found.


BTW along the way I introduced proper error handling mechanism - through
exceptions (it is necessary in this case as match should handle errors
differently based on where it was called from). 

There are two classes defined and generic exception handler hooked (so that user
gets error message instead of traceback for portage exceptions. All standard
exceptions will be passed and result in a traceback as at present). All this is
done in portage_exceptions.py. 

This has to be separate file as this functionality may be desirable elsewhere in
the portage. In fact it is really easy to convert error handling to exceptions:

just import portage_exceptions (this hooks handler automatically)
and then replace: print "doing harakiri now" \n sys.exit(1)
with: raise GenericPortageError(message)
This will default to reporting the problem and exiting (as done now), but it
will also be possible to easily override this behavior at the specific spot.
(Sorry for these basics, but I feel it is important to handle errors in a proper
way).

George
Comment 7 George Shapovalov (RETIRED) gentoo-dev 2002-05-01 23:30:56 UTC
Few Cosmetic updates to the patch.
Should apply cleanly against emerge - 1.90 (cvs).
Comment 8 George Shapovalov (RETIRED) gentoo-dev 2002-05-01 23:32:32 UTC
Created attachment 754 [details, diff]
updated patch
Comment 9 George Shapovalov (RETIRED) gentoo-dev 2002-05-01 23:33:58 UTC
Created attachment 755 [details]
just a cosmetic touch (\n at the beginning of error message, so that it looks better)
Comment 10 George Shapovalov (RETIRED) gentoo-dev 2002-05-07 01:34:12 UTC
Created attachment 866 [details, diff]
updated patch to emerge to handle the problem

Updated the patch to make it apply cleanly against 1.9.9 (emerge-1.93).