Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 41062 - emerge --inject returns '!!! BAD COUNTER'
Summary: emerge --inject returns '!!! BAD COUNTER'
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2004-02-09 19:17 UTC by Robert Morris
Modified: 2004-07-03 17:18 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Morris 2004-02-09 19:17:21 UTC
When attempting to inject any package into portage using Portage 2.0.50
it returns with the error '!!! BAD COUNTER in <package-name>'. it seems to inject the package ok otherwise.

Reproducible: Always
Steps to Reproduce:
1. emerge --inject net-www/epiphany-1.0.7

Actual Results:  
emerge returns with:
!!! BAD COUNTER in net-www/epiphany-1.0.7
>>> Injected net-www/epiphany-1.0.7.

Expected Results:  
Should return with
>>> Injected net-www/epiphany-1.0.7

I've checked the sources of ver. 2.0.50 against ver. 2.0.49-r21 and I think I've
tracked down the problem.

In file /usr/lib/portage/pym/portage.py :
The function dbapi.counter_tick_core has this line (line 3808 in ver 2.0.50)
old_counter = long(self.aux_get(x, ["COUNTER"])[0])

but aux_get() just returns None since there is no code in the function which
raises an excepion and causes the error message.

In version 2.0.49-rc2 the variable mycpv is None so this code is never called.
By changing line 4000 from:
counter=db[self.root]["vartree"].dbapi.counter_tick(self.root,mycpv)
to:
counter=db[self.root]["vartree"].dbapi.counter_tick(self.root)
as it is in version 2.0.490-rc2, the error is eliminated.

I'm not sure if somebody forgot to add the aux_get() code, if the mycpv variable
was added by accident, or if this really is the correct result (I hope not
because to users it seems like there is something very bad happening).
Comment 1 PL Hayes 2004-03-04 18:03:29 UTC
I noticed this too but I also discovered that although the injected pkg shows up in 'emerge search' etc, emerge will still try to install the old pkgs I was trying to skip. I've tried to use inject to stop 'emerge system/world' from trying to install devfsd and for other stuff but it doesn't work.   
Comment 2 PL Hayes 2004-03-08 10:48:23 UTC
Okay, my mistake - I've found that it works but only if I inject the exact version of devfsd that emerge thinks should be installed.       
Comment 3 Masatomo Nakano (RETIRED) gentoo-dev 2004-03-17 12:31:43 UTC
Fixed in cvs
Comment 4 Jordi Vilalta 2004-07-03 09:51:25 UTC
Can you change this bug's status to closed?
Comment 5 Jason Stubbs (RETIRED) gentoo-dev 2004-07-03 17:18:44 UTC
Done.