Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
deleted /var/db/pkg [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
ank
Apprentice
Apprentice


Joined: 06 Aug 2003
Posts: 185
Location: Maribor, Slovenia

PostPosted: Fri Nov 03, 2006 3:11 pm    Post subject: deleted /var/db/pkg [solved] Reply with quote

I delete /var/db/pkg and now portage have problems with circular dependencies and i can't emerge anything. Is it possible to get somehow contains of /var/db/pkg back?

!!! Error: circular dependencies:

ebuild / x11-libs/libXau-1.0.2 merge depends on
ebuild / x11-misc/util-macros-1.1.1 merge (hard)
ebuild / sys-devel/autoconf-2.60 merge (hard)
ebuild / x11-proto/xproto-7.0.9 merge (hard)
ebuild / sys-devel/automake-1.10 merge (hard)
ebuild / sys-devel/libtool-1.5.22 merge (hard)
ebuild / virtual/jdk-1.5.0 merge depends on
ebuild / dev-java/sun-jdk-1.5.0.08 merge (medium)
ebuild / net-misc/openssh-4.4_p1-r6 merge depends on
ebuild / sys-apps/tcp-wrappers-7.6-r8 merge (hard)
ebuild / dev-libs/openssl-0.9.8d merge (hard)
ebuild / x11-apps/xauth-1.0.1 merge (hard)
ebuild / sys-devel/autoconf-2.60 merge (hard)
ebuild / sys-devel/automake-1.10 merge (hard)
ebuild / sys-libs/pam-0.78-r5 merge (hard)
ebuild / sys-devel/libtool-1.5.22 merge (hard)
ebuild / sys-apps/shadow-4.0.18.1 merge (hard)
ebuild / x11-proto/inputproto-1.4 merge depends on
ebuild / x11-misc/util-macros-1.1.1 merge (hard)
ebuild / sys-devel/autoconf-2.60 merge (hard)
ebuild / sys-devel/automake-1.10 merge (hard)
ebuild / sys-devel/libtool-1.5.22 merge (hard)
ebuild / x11-proto/xextproto-7.0.2 merge depends on
ebuild / x11-misc/util-macros-1.1.1 merge (hard)
ebuild / sys-devel/autoconf-2.60 merge (hard)
ebuild / sys-devel/automake-1.10 merge (hard)
ebuild / sys-devel/libtool-1.5.22 merge (hard)
ebuild / sys-devel/libperl-5.8.8-r1 merge depends on
ebuild / sys-libs/db-4.3.29-r2 merge (hard)
ebuild / sys-libs/gdbm-1.8.3-r2 merge (hard)
ebuild / dev-python/pycrypto-2.0.1-r5 merge depends on
ebuild / dev-lang/python-2.4.3-r4 merge (hard)
ebuild / app-misc/ca-certificates-20050804 merge depends on
ebuild / dev-libs/openssl-0.9.8d merge (medium)
ebuild / x11-proto/printproto-1.0.3 merge depends on
ebuild / x11-misc/util-macros-1.1.1 merge (hard)
ebuild / sys-devel/autoconf-2.60 merge (hard)
ebuild / sys-devel/automake-1.10 merge (hard)
ebuild / sys-devel/libtool-1.5.22 merge (hard)
ebuild / dev-python/python-fchksum-1.7.1 merge depends on
ebuild / dev-lang/python-2.4.3-r4 merge (hard)
ebuild / virtual/libstdc++-3.3 merge depends on
ebuild / sys-devel/gcc-4.1.1-r1 merge (soft)
ebuild / sys-libs/libstdc++-v3-3.3.6 merge (medium)
ebuild / dev-lang/python-2.4.3-r4 merge depends on
ebuild / sys-libs/db-4.3.29-r2 merge (hard)
ebuild / dev-libs/openssl-0.9.8d merge (hard)
ebuild / sys-libs/gdbm-1.8.3-r2 merge (hard)
ebuild / sys-process/psmisc-22.3 merge depends on
ebuild / sys-devel/libtool-1.5.22 merge (hard)
ebuild / sys-kernel/gentoo-sources-2.6.18-r1 merge depends on
ebuild / sys-fs/udev-103 merge (medium)
ebuild / sys-apps/tcp-wrappers-7.6-r8 merge depends on
ebuild / sys-libs/glibc-2.4-r4 merge (hard)
ebuild / x11-libs/libX11-1.0.3 merge depends on
ebuild / x11-libs/libXau-1.0.2 merge (hard)
ebuild / x11-misc/util-macros-1.1.1 merge (hard)
ebuild / x11-proto/bigreqsproto-1.0.2 merge (hard)
ebuild / x11-proto/xcmiscproto-1.1.2 merge (hard)
ebuild / x11-proto/inputproto-1.4 merge (hard)
ebuild / x11-libs/xtrans-1.0.2 merge (hard)
ebuild / x11-proto/xf86bigfontproto-1.1.2 merge (hard)
ebuild / sys-devel/autoconf-2.60 merge (hard)
ebuild / x11-proto/xproto-7.0.9 merge (hard)
ebuild / x11-proto/xextproto-7.0.2 merge (hard)
ebuild / sys-devel/automake-1.10 merge (hard)
ebuild / x11-libs/libXdmcp-1.0.2 merge (hard)
ebuild / x11-proto/kbproto-1.0.3 merge (hard)
ebuild / sys-devel/libtool-1.5.22 merge (hard)
ebuild / sys-apps/coreutils-6.4 merge depends on
ebuild / sys-apps/help2man-1.36.4 merge (hard)
ebuild / sys-devel/autoconf-2.60 merge (hard)
ebuild / sys-devel/automake-1.9.6-r2 merge (hard)
ebuild / sys-devel/automake-1.10 merge (hard)
ebuild / sys-devel/libtool-1.5.22 merge (hard)
ebuild / x11-libs/libXmu-1.0.2 merge depends on
ebuild / x11-misc/util-macros-1.1.1 merge (hard)
ebuild / x11-libs/libXext-1.0.2 merge (hard)
ebuild / sys-devel/autoconf-2.60 merge (hard)
ebuild / x11-proto/xproto-7.0.9 merge (hard)
ebuild / sys-devel/automake-1.10 merge (hard)
ebuild / sys-devel/libtool-1.5.22 merge (hard)
ebuild / x11-libs/libXt-1.0.3 merge (hard)
ebuild / x11-libs/libX11-1.0.3 merge (hard)
ebuild / dev-libs/mpfr-2.2.0_p16 merge depends on
ebuild / sys-devel/libtool-1.5.22 merge (hard)
ebuild / sys-devel/autoconf-2.60 merge (hard)
ebuild / sys-devel/automake-1.10 merge (hard)
ebuild / net-misc/wget-1.10.2 merge depends on
ebuild / dev-libs/openssl-0.9.8d merge (hard)
ebuild / sys-devel/autoconf-2.60 merge (hard)
ebuild / x11-libs/libXp-1.0.0 merge depends on
ebuild / x11-libs/libXau-1.0.2 merge (hard)
ebuild / x11-misc/util-macros-1.1.1 merge (hard)
ebuild / x11-libs/libXext-1.0.2 merge (hard)
ebuild / sys-devel/autoconf-2.60 merge (hard)
ebuild / sys-devel/automake-1.10 merge (hard)
ebuild / x11-libs/libX11-1.0.3 merge (hard)
ebuild / x11-proto/printproto-1.0.3 merge (hard)
ebuild / sys-devel/libtool-1.5.22 merge (hard)
ebuild / dev-libs/openssl-0.9.8d merge depends on
ebuild / dev-lang/perl-5.8.8-r2 merge (hard)
ebuild / dev-lang/python-2.4.3-r4 merge (soft)
ebuild / x11-libs/libXi-1.1.0 merge depends on
ebuild / x11-libs/libXext-1.0.2 merge (hard)
ebuild / x11-misc/util-macros-1.1.1 merge (hard)
ebuild / x11-proto/inputproto-1.4 merge (hard)
ebuild / sys-devel/autoconf-2.60 merge (hard)
ebuild / x11-proto/xproto-7.0.9 merge (hard)
ebuild / sys-devel/automake-1.10 merge (hard)
ebuild / x11-libs/libX11-1.0.3 merge (hard)
ebuild / sys-devel/libtool-1.5.22 merge (hard)
ebuild / sys-fs/udev-103 merge depends on
ebuild / sys-apps/baselayout-1.12.6 merge (medium)
ebuild / x11-proto/recordproto-1.13.2 merge depends on
ebuild / x11-misc/util-macros-1.1.1 merge (hard)
ebuild / sys-devel/autoconf-2.60 merge (hard)
ebuild / sys-devel/automake-1.10 merge (hard)
ebuild / sys-devel/libtool-1.5.22 merge (hard)
ebuild / x11-libs/libICE-1.0.2 merge depends on
ebuild / x11-misc/util-macros-1.1.1 merge (hard)
ebuild / x11-libs/xtrans-1.0.2 merge (hard)
ebuild / sys-devel/autoconf-2.60 merge (hard)
ebuild / x11-proto/xproto-7.0.9 merge (hard)
ebuild / sys-devel/automake-1.10 merge (hard)
ebuild / sys-devel/libtool-1.5.22 merge (hard)
ebuild / perl-core/Test-Simple-0.64 merge depends on
ebuild / dev-lang/perl-5.8.8-r2 merge (hard)
ebuild / sys-libs/glibc-2.4-r4 merge depends on
ebuild / sys-devel/gcc-4.1.1-r1 merge (hard)
ebuild / x11-proto/xf86bigfontproto-1.1.2 merge depends on
ebuild / x11-misc/util-macros-1.1.1 merge (hard)
ebuild / sys-devel/autoconf-2.60 merge (hard)
ebuild / sys-devel/automake-1.10 merge (hard)
ebuild / sys-devel/libtool-1.5.22 merge (hard)
ebuild / sys-apps/portage-2.1.2_rc1-r3 merge depends on
ebuild / dev-python/pycrypto-2.0.1-r5 merge (medium)
ebuild / dev-python/python-fchksum-1.7.1 merge (medium)
ebuild / dev-lang/python-2.4.3-r4 merge (hard)
ebuild / sys-libs/libstdc++-v3-3.3.6 merge depends on
ebuild / sys-libs/glibc-2.4-r4 merge (hard)
ebuild / sys-devel/gcc-4.1.1-r1 merge (hard)
ebuild / x11-proto/xcmiscproto-1.1.2 merge depends on
ebuild / x11-misc/util-macros-1.1.1 merge (hard)
ebuild / sys-devel/autoconf-2.60 merge (hard)
ebuild / sys-devel/automake-1.10 merge (hard)
ebuild / sys-devel/libtool-1.5.22 merge (hard)
ebuild / sys-libs/pam-0.78-r5 merge depends on
ebuild / sys-libs/db-4.3.29-r2 merge (hard)
ebuild / dev-lang/perl-5.8.8-r2 merge (hard)
ebuild / sys-devel/autoconf-2.60 merge (hard)
ebuild / sys-devel/automake-1.10 merge (hard)
ebuild / virtual/perl-Test-Simple-0.64 merge depends on
ebuild / perl-core/Test-Simple-0.64 merge (medium)
ebuild / sys-apps/module-init-tools-3.2.2-r1 merge depends on
ebuild / sys-apps/baselayout-1.12.6 merge (hard)
ebuild / sys-apps/shadow-4.0.18.1 merge depends on
ebuild / sys-apps/portage-2.1.2_rc1-r3 merge (hard)
ebuild / sys-devel/autoconf-2.60 merge (hard)
ebuild / sys-devel/automake-1.10 merge (hard)
ebuild / sys-libs/pam-0.78-r5 merge (hard)
ebuild / sys-devel/libtool-1.5.22 merge (hard)
ebuild / x11-libs/xtrans-1.0.2 merge depends on
ebuild / x11-misc/util-macros-1.1.1 merge (hard)
ebuild / sys-devel/autoconf-2.60 merge (hard)
ebuild / sys-devel/automake-1.10 merge (hard)
ebuild / sys-devel/libtool-1.5.22 merge (hard)
ebuild / dev-libs/popt-1.10.4-r2 merge depends on
ebuild / sys-devel/libtool-1.5.22 merge (hard)
ebuild / sys-devel/autoconf-2.60 merge (hard)
ebuild / sys-devel/automake-1.9.6-r2 merge (hard)
ebuild / x11-libs/libXdmcp-1.0.2 merge depends on
ebuild / x11-misc/util-macros-1.1.1 merge (hard)
ebuild / sys-devel/autoconf-2.60 merge (hard)
ebuild / x11-proto/xproto-7.0.9 merge (hard)
ebuild / sys-devel/automake-1.10 merge (hard)
ebuild / sys-devel/libtool-1.5.22 merge (hard)
ebuild / x11-libs/libXt-1.0.3 merge depends on
ebuild / x11-misc/util-macros-1.1.1 merge (hard)
ebuild / sys-devel/libtool-1.5.22 merge (hard)
ebuild / sys-devel/autoconf-2.60 merge (hard)
ebuild / x11-proto/xproto-7.0.9 merge (hard)
ebuild / sys-devel/automake-1.10 merge (hard)
ebuild / x11-libs/libSM-1.0.2 merge (hard)
ebuild / x11-proto/kbproto-1.0.3 merge (hard)
ebuild / x11-libs/libX11-1.0.3 merge (hard)
ebuild / x11-libs/libXtst-1.0.1 merge depends on
ebuild / x11-proto/recordproto-1.13.2 merge (hard)
ebuild / x11-misc/util-macros-1.1.1 merge (hard)
ebuild / x11-libs/libXext-1.0.2 merge (hard)
ebuild / sys-devel/autoconf-2.60 merge (hard)
ebuild / sys-devel/automake-1.10 merge (hard)
ebuild / x11-libs/libX11-1.0.3 merge (hard)
ebuild / sys-devel/libtool-1.5.22 merge (hard)
ebuild / x11-proto/bigreqsproto-1.0.2 merge depends on
ebuild / x11-misc/util-macros-1.1.1 merge (hard)
ebuild / sys-devel/autoconf-2.60 merge (hard)
ebuild / sys-devel/automake-1.10 merge (hard)
ebuild / sys-devel/libtool-1.5.22 merge (hard)
ebuild / sys-apps/help2man-1.36.4 merge depends on
ebuild / dev-lang/perl-5.8.8-r2 merge (hard)
ebuild / dev-perl/Locale-gettext-1.05 merge (hard)
ebuild / virtual/jre-1.5.0 merge depends on
ebuild / virtual/jdk-1.5.0 merge (medium)
ebuild / sys-devel/libtool-1.5.22 merge depends on
ebuild / sys-devel/autoconf-2.60 merge (hard)
ebuild / sys-apps/help2man-1.36.4 merge (hard)
ebuild / sys-devel/automake-1.10 merge (hard)
ebuild / app-admin/perl-cleaner-1.04.3 merge depends on
ebuild / dev-lang/perl-5.8.8-r2 merge (medium)
ebuild / dev-java/java-config-2.0.30 merge depends on
ebuild / dev-lang/python-2.4.3-r4 merge (hard)
ebuild / x11-proto/xproto-7.0.9 merge depends on
ebuild / x11-misc/util-macros-1.1.1 merge (hard)
ebuild / sys-devel/autoconf-2.60 merge (hard)
ebuild / sys-devel/automake-1.10 merge (hard)
ebuild / sys-devel/libtool-1.5.22 merge (hard)
ebuild / dev-perl/Locale-gettext-1.05 merge depends on
ebuild / virtual/perl-Test-Simple-0.64 merge (hard)
ebuild / dev-lang/perl-5.8.8-r2 merge (hard)
ebuild / x11-misc/util-macros-1.1.1 merge depends on
ebuild / sys-devel/libtool-1.5.22 merge (hard)
ebuild / sys-devel/autoconf-2.60 merge (hard)
ebuild / sys-devel/automake-1.10 merge (hard)
ebuild / x11-libs/libSM-1.0.2 merge depends on
ebuild / x11-misc/util-macros-1.1.1 merge (hard)
ebuild / x11-libs/xtrans-1.0.2 merge (hard)
ebuild / x11-libs/libICE-1.0.2 merge (hard)
ebuild / sys-devel/autoconf-2.60 merge (hard)
ebuild / x11-proto/xproto-7.0.9 merge (hard)
ebuild / sys-devel/automake-1.10 merge (hard)
ebuild / sys-devel/libtool-1.5.22 merge (hard)
ebuild / perl-core/Test-Harness-2.62 merge depends on
ebuild / dev-lang/perl-5.8.8-r2 merge (hard)
ebuild / x11-libs/libXext-1.0.2 merge depends on
ebuild / x11-misc/util-macros-1.1.1 merge (hard)
ebuild / sys-devel/autoconf-2.60 merge (hard)
ebuild / x11-proto/xproto-7.0.9 merge (hard)
ebuild / x11-proto/xextproto-7.0.2 merge (hard)
ebuild / sys-devel/automake-1.10 merge (hard)
ebuild / x11-libs/libX11-1.0.3 merge (hard)
ebuild / sys-devel/libtool-1.5.22 merge (hard)
ebuild / sys-devel/automake-1.9.6-r2 merge depends on
ebuild / sys-devel/autoconf-2.60 merge (hard)
ebuild / dev-lang/perl-5.8.8-r2 merge (hard)
ebuild / sys-apps/help2man-1.36.4 merge (hard)
ebuild / sys-devel/automake-1.10 merge depends on
ebuild / sys-devel/autoconf-2.60 merge (hard)
ebuild / dev-lang/perl-5.8.8-r2 merge (hard)
ebuild / sys-apps/help2man-1.36.4 merge (hard)
ebuild / x11-proto/kbproto-1.0.3 merge depends on
ebuild / x11-misc/util-macros-1.1.1 merge (hard)
ebuild / sys-devel/autoconf-2.60 merge (hard)
ebuild / sys-devel/automake-1.10 merge (hard)
ebuild / sys-devel/libtool-1.5.22 merge (hard)
ebuild / sys-libs/db-4.3.29-r2 merge depends on
ebuild / dev-java/java-config-2.0.30 merge (hard)
ebuild / virtual/jre-1.5.0 merge (medium)
ebuild / virtual/jdk-1.5.0 merge (hard)
ebuild / sys-apps/portage-2.1.2_rc1-r3 merge (hard)
ebuild / dev-lang/python-2.4.3-r4 merge (soft)
ebuild / dev-java/sun-jdk-1.5.0.08 merge depends on
ebuild / dev-java/java-config-2.0.30 merge (hard)
ebuild / x11-libs/libXtst-1.0.1 merge (medium)
ebuild / x11-libs/libXau-1.0.2 merge (medium)
ebuild / sys-apps/portage-2.1.2_rc1-r3 merge (hard)
ebuild / dev-java/java-config-1.3.7 merge (medium)
ebuild / x11-libs/libXext-1.0.2 merge (medium)
ebuild / x11-libs/libXi-1.1.0 merge (medium)
ebuild / x11-libs/libICE-1.0.2 merge (medium)
ebuild / x11-libs/libSM-1.0.2 merge (medium)
ebuild / x11-libs/libXp-1.0.0 merge (medium)
ebuild / x11-libs/libXdmcp-1.0.2 merge (medium)
ebuild / media-libs/alsa-lib-1.0.13 merge (medium)
ebuild / x11-libs/libX11-1.0.3 merge (medium)
ebuild / x11-libs/libXt-1.0.3 merge (medium)
ebuild / sys-apps/util-linux-2.12r-r5 merge depends on
ebuild / dev-lang/perl-5.8.8-r2 merge (hard)
ebuild / dev-lang/perl-5.8.8-r2 merge depends on
ebuild / sys-libs/gdbm-1.8.3-r2 merge (hard)
ebuild / sys-libs/db-4.3.29-r2 merge (hard)
ebuild / sys-devel/libperl-5.8.8-r1 merge (hard)
ebuild / x11-apps/xauth-1.0.1 merge depends on
ebuild / x11-libs/libXau-1.0.2 merge (hard)
ebuild / x11-misc/util-macros-1.1.1 merge (hard)
ebuild / x11-libs/libXext-1.0.2 merge (hard)
ebuild / sys-devel/autoconf-2.60 merge (hard)
ebuild / sys-devel/automake-1.10 merge (hard)
ebuild / x11-libs/libX11-1.0.3 merge (hard)
ebuild / sys-devel/libtool-1.5.22 merge (hard)
ebuild / x11-libs/libXmu-1.0.2 merge (hard)
ebuild / media-libs/alsa-lib-1.0.13 merge depends on
ebuild / sys-kernel/gentoo-sources-2.6.18-r1 merge (hard)
ebuild / sys-devel/libtool-1.5.22 merge (hard)
ebuild / sys-devel/autoconf-2.60 merge (hard)
ebuild / sys-devel/automake-1.9.6-r2 merge (hard)
ebuild / net-misc/rsync-2.6.8-r2 merge depends on
ebuild / dev-libs/popt-1.10.4-r2 merge (hard)
ebuild / sys-apps/portage-2.1.2_rc1-r3 merge (hard)
ebuild / sys-devel/autoconf-2.60 merge depends on
ebuild / dev-lang/perl-5.8.8-r2 merge (hard)
ebuild / sys-devel/gcc-4.1.1-r1 merge depends on
ebuild / sys-libs/glibc-2.4-r4 merge (hard)
ebuild / dev-libs/mpfr-2.2.0_p16 merge (hard)
ebuild / sys-apps/baselayout-1.12.6 merge depends on
ebuild / sys-apps/portage-2.1.2_rc1-r3 merge (hard)
ebuild / sys-apps/coreutils-6.4 merge (medium)
ebuild / sys-apps/file-4.18 merge depends on
ebuild / dev-lang/python-2.4.3-r4 merge (hard)
ebuild / perl-core/PodParser-1.34 merge depends on
ebuild / dev-lang/perl-5.8.8-r2 merge (hard)
ebuild / dev-java/java-config-1.3.7 merge depends on
ebuild / dev-lang/python-2.4.3-r4 merge (hard)
ebuild / sys-libs/gdbm-1.8.3-r2 merge depends on
ebuild / sys-libs/db-4.3.29-r2 merge (hard)
ebuild / dev-lang/python-2.4.3-r4 merge (soft)


Last edited by ank on Sat Nov 04, 2006 11:37 am; edited 1 time in total
Back to top
View user's profile Send private message
Aurisor
Guru
Guru


Joined: 20 Sep 2003
Posts: 361
Location: Boston MA

PostPosted: Fri Nov 03, 2006 3:13 pm    Post subject: Reply with quote

Try an emerge sync?
Back to top
View user's profile Send private message
ank
Apprentice
Apprentice


Joined: 06 Aug 2003
Posts: 185
Location: Maribor, Slovenia

PostPosted: Fri Nov 03, 2006 3:17 pm    Post subject: Reply with quote

I have try emerge sync already. Didnt help. Only thing i can emerge is binutils.
Back to top
View user's profile Send private message
Lloeki
Guru
Guru


Joined: 14 Jun 2006
Posts: 437
Location: France

PostPosted: Fri Nov 03, 2006 3:18 pm    Post subject: Reply with quote

emerge -e system ? emerge -e world ?
_________________
Moved to using Arch Linux
Life is meant to be lived, not given up...
HOLY COW I'M TOTALLY GOING SO FAST OH F*** ;)
Back to top
View user's profile Send private message
ank
Apprentice
Apprentice


Joined: 06 Aug 2003
Posts: 185
Location: Maribor, Slovenia

PostPosted: Fri Nov 03, 2006 3:20 pm    Post subject: Reply with quote

emerge -e system or emerge -e world dont work either.
Back to top
View user's profile Send private message
ank
Apprentice
Apprentice


Joined: 06 Aug 2003
Posts: 185
Location: Maribor, Slovenia

PostPosted: Fri Nov 03, 2006 5:14 pm    Post subject: deleted /var/db/pkg [somehow solved] Reply with quote

This is how i somehow solve the problem:

From Sabayon Live-DVD i copy Installation/db/pkg/* to /var/db/pkg/

Now i can emerge what i want again. I just need to clean world. emaint -c world show some packages are not installed but they are and some packages want to upgrade which are not installed.

Propaby this is not the best thing i have done but will be much less work to do to get system to normal than if i emerge all again.


If anybody have some suggestion let post it.
Back to top
View user's profile Send private message
Lloeki
Guru
Guru


Joined: 14 Jun 2006
Posts: 437
Location: France

PostPosted: Fri Nov 03, 2006 6:14 pm    Post subject: Reply with quote

well, you should certainly emerge -e world then emerge --depclean to be consistent
_________________
Moved to using Arch Linux
Life is meant to be lived, not given up...
HOLY COW I'M TOTALLY GOING SO FAST OH F*** ;)
Back to top
View user's profile Send private message
hielvc
Advocate
Advocate


Joined: 19 Apr 2002
Posts: 2801
Location: Oceanside, Ca

PostPosted: Fri Nov 03, 2006 9:00 pm    Post subject: Reply with quote

Well its to late for you to test this, but I just finished writing a script to regenerate /var/dp/pkg/cat/pkg-version using your /var/log/emerge.log . I went to test it on a stage3 I have, removed /var/db/pkg/* ( move to /root/org ). I then ran "emerge system -uDp " and it didnt complain at all. :twisted: So I ran my script which repopulated /var/db/pkg reran emerge. Ok here are some numbers
Quote:
NO /var/db/pkg
emerge system -uDp|wc
120 748 7647 ==> 120 new pkgs
After running the script UPDATED 1-12-06
emerge system -uDpq
[ebuild NS ] sys-devel/autoconf-wrapper-3.2-r2
[ebuild NS ] sys-devel/autoconf-2.60
[ebuild NS ] sys-devel/automake-1.9.6-r2
[ebuild NS ] sys-apps/coreutils-6.4
[ebuild N ] sys-apps/man-1.6d
[ebuild NS ] net-misc/openssh-4.4_p1-r5
[ebuild NS ] sys-apps/kbd-1.12-r8

After putting the org /var/db/pkg listing back
emerge system -uDqp
[ebuild U ] sys-devel/autoconf-wrapper-3.2-r2 [3.2]
[ebuild U ] sys-devel/autoconf-2.60 [2.59-r7]
[ebuild U ] sys-apps/coreutils-6.4 [5.94-r1]
[ebuild U ] net-misc/openssh-4.4_p1-r5 [4.3_p2-r5]
[ebuild U ] sys-apps/kbd-1.12-r8 [1.12-r7]
[ebuild NS ] sys-devel/automake-1.5

If your running portage-2.1.2-r1 or maybe r1-rc3 and above, as I said above, portage didnt even blink. It ran emerge system -uDp an gave the above list with NO /var/db/pkg. I leave it to you to test. The one thing you can do with script is give a date such as " nov 5 2006" or "Nov 06 2006" or epoch date from emerge.log " 1162971562 " and it will list everything built since then. It accepts -p , pretend and -d to make /var/db/pkg , then the date string if you want to. No flags an it prints usage. EX: rcvr_var_db_pkg.sh -p nov 2 2006 . It will list everything on and from Nov 2. Oh if you dont know you can name it whatever you want and then chmod a+x <name>.

Heres the script. 10-1-07 Cleaned and added minor changes. I had a chance to test this on a stage1 to stage3. It works with Portage 2.1.3.9.
Code:

#!/bin/bash
# hielvc 11-11-06 as usual use at ye own risk. It works for me but not
# always for the right reason, right heavyjoost ;^)
# An attempt at a /var/db/pkg recovwery tool useing /var/log/emerge.log
# with the portage-2.1.2 appears not to be needed but you can use to see
# pkg's built since date.
# 11-15 set date_regx to default date april 1 2002
# 1-12-07 Added an unmerge filter, it helps to pick unmerged packages out
# and keep sloted versions
# 9-29-07 added the date exclusion to unmerge list
# 10-1-07 changed unmerge and fix script to actually out put to /var/db/pkg .

# empty pkg_atom.lst & tmp
    :>pkg_atom.lst ; :>cat_pkg.lst ; :>tmp
date_regx="" ; day="" ; pkg=""

usage(){
   cat<<-END
   
   USAGE: rcv_pkg_db.sh [options] (optonal date=> Jul 7 2006)
      Run with "-p" for pretend. Output goes to screen.
      Use "-d" to do the deed, write to /var/db/pkg/ . If
      you did a world --emptytree recently then look through
      your emerge.log and find the date. Enter the date as
      Aug 13 2006. The script will then only use files from
      that date on.
   Opitons
      -p for pretend. Outputs to screen
      -d to populate /var/db/pkg/
END
   echo
   exit
}

# Added a usage, pretend and "really do the deed"
if [ "$1" == "" ];then
   usage
elif [ "$1" == "-p" ]; then
   test="p"
elif [ "$1" == "-d" ]; then
   test="d"
else
   usage
fi

# Added date fetching
# Check # of agrcs if 2 then epoch time ?
if [ $# -eq 1 ];then
   date_regx="1017648000"  # april 1 2002
elif [ $# -eq 2 ];then
   date_regx="$1"
else
   shift
   day="$@"
   date_regx="$(date -d "$day" +%s)"  #convert to epoch time
fi

# the below gets a list of all pkgs merged and the time stamp >= date_regx
# sample  "1162267626 x11-misc/xscreensaver-5.01-r1"
awk '/completed/ && !/Sync/ {print $1, $8}' /var/log/emerge.log|sed 's/://'| \
awk '$1 >= '"$date_regx"' {print $1, $2}'>emerge.lst

# To get list of unmerged pkgs.9-29 added date regex
awk '/unmerge/ && !/Nothing/ {print $5}' /var/log/emerge.log|sed 's/://'| \
awk '$1 >= '"$date_regx"' {print $1}'>unmerge.lst

# now remove the unmerged
for i in $(< unmerge.lst);do
   grep -v "$i" emerge.lst>tmp ; mv tmp emerge.lst
done

# Now get cat/pkg from list,and remove timestamp
# Chaned to keep version as it makes a more precise match.
#awk -F / '{print $2}' emerge.lst |sed 's/-[0-9].*//'|sort -u >pkg_atom.lst
awk -F / '{print $2}' emerge.lst | sort -u >pkg_atom.lst

# Now get "timestamp cat/pkg-version" and compare timestamps
# use cat/pkg to get all the timestamp's and get the latest version,
# useing the timestamp. It should be the one currently in use.
for pkg in $(< pkg_atom.lst); do
   TS_empty="yes" ; T_newest="0" ; ALL_TS=""
    # timestamp for matching pkg's
   ALL_TS=$(awk '/'"$pkg"'/ {print $1}' emerge.lst)
    # Now sort by newest,largest,timestamp
   for T in $(echo $ALL_TS);do
    # Checking timestamp age
      if [ "$T_empty" == "yes" ]; then
         T_newest=$T ; T_empty="no"
      elif [ "$T" -gt "$T_newest" ]; then
         T_newest=$T
      fi
   done

# Now find the newest merged cat/pkg useing the timestamp and
# put the matching cat/pkg-ver in cat_pkg.lst
   awk '$1 ~ /'"$T_newest"'/ {print $2}' emerge.lst>>cat_pkg.lst
done

# Added -u to cut out double entries
cat_pkg=$(sort -u cat_pkg.lst)
if [ "$test" == "p" ]; then
   echo "$cat_pkg"
elif [ "$test" == "d" ]; then
   # Now make /var/db/pkg/$cat/pkg. Expanded $cat_pkg in a loop 10-1.
   for cp in ${cat_pkg} ; do
      mkdir -p /var/db/pkg/$cp
   done
else echo "$pkg"
   echo " And ow de ell id gya get ere"
fi

#clean up
rm cat_pkg.lst pkg_atom.lst emerge.lst unmerge.lst


If this happens to you, you should "emerge world -e" after running the script to fully fill out /var/db/pkg/cat/pkg-version/files. The files can only be gotten by running emerge. Why well for one reason -N wont work until you do.
_________________
An A-Z Index of the Linux BASH command line


Last edited by hielvc on Tue Oct 02, 2007 5:16 am; edited 12 times in total
Back to top
View user's profile Send private message
ank
Apprentice
Apprentice


Joined: 06 Aug 2003
Posts: 185
Location: Maribor, Slovenia

PostPosted: Sat Nov 04, 2006 11:34 am    Post subject: Reply with quote

Now it is everything alright again. Gentoo never dies :D
Back to top
View user's profile Send private message
Lok
n00b
n00b


Joined: 23 Mar 2006
Posts: 23

PostPosted: Thu Jan 18, 2007 3:11 pm    Post subject: Reply with quote

hielvc wrote:
Code:

#!/bin/bash
# hielvc 11-11-06 as usual use at ye own risk. It works for me but not
# always for the right reason, right heavyjoost ;^)
# An attempt at a /var/db/pkg recovwery tool useing /var/log/emerge.log
# with the portage-2.1.2 appears not to be needed but you can use to see
# pkg's built since date.
# 11-15 set date_regx to default date april 1 2002
# 1-12-06 Added an unmerge filter, it helps to pick unmerged packages out
# and keep sloted versions

# empty pkg_atom.lst & tmp
:>pkg_atom.lst ; :>cat_pkg.lst ; :>tmp
date_regx="" ; day="" ; pkg=""

usage(){
   cat<<-END
   
   USAGE: rcv_pkg_db.sh [options] (optonal date=> Jul 7 2006)
      Run with "-p" for pretend. Output goes to screen.
      Use "-d" to do the deed, write to /var/db/pkg/ . If
      you did a world --emptytree recently then look through
      your emerge.log and find the date. Enter the date as
      Aug 13 2006. The script will then only use files from
      that date on.
   Opitons
      -p for pretend. Outputs to screen
      -d to populate /var/db/pkg/
END
   echo
   exit
}

# Added a usage, pretend and "really do the deed"
if [ "$1" == "" ];then
   usage
elif [ "$1" == "-p" ]; then
   test="p"
elif [ "$1" == "-d" ]; then
   test="d"
else
   usage
fi
# Added date fetching
# Check # of agrcs if 2 then epoch time ?
if [ $# -eq 1 ];then
   date_regx="1017648000"  # april 1 2002
elif [ $# -eq 2 ];then
   date_regx="$1"
else
   shift
   day="$@"
   date_regx="$(date -d "$day" +%s)"  #convert to epoch time
fi

# the below gets a list of all pkgs merged and the time stamp >= date_regx
# sample  "1162267626 x11-misc/xscreensaver-5.01-r1"
awk '/completed/ && !/Sync/ {print $1, $8}' /var/log/emerge.log|sed 's/://'| \
awk '$1 >= '"$date_regx"' {print $1, $2}'>emerge.lst

# To get list of unmerged pkgs
awk '/unmerge/ && !/Nothing/ {print $5}' /var/log/emerge.log >unmerge.lst

# now remove the umerged
for i in $(awk -F "/" '{print $2}' unmerge.lst);do
   grep -v "$i" emerge.lst>tmp;mv tmp emerge.lst
done
# Now get cat/pkg from list,and remove version and timestamp
# Had get just pkg as cat/pkg was considered division 8-(
awk '{print $2 }' emerge.lst |sed 's/-[0-9].*//'| \
awk -F / '{print $2}'|sort -u >pkg_atom.lst

# Now get "timestamp cat/pkg-version" and compare timestamps
# use cat/pkg to get all the timestamp's and get the latest version,
# useing the timestamp. It should be the one currently in use.
for pkg in $(< pkg_atom.lst); do
   TS_empty="yes" ; T_newest="0" ; ALL_TS=""
   # timestamp for matching pkg's
   ALL_TS=$(awk '/'"$pkg"'/ {print $1}' emerge.lst)
   # Now sort by newest,largest,timestamp
   for T in $(echo $ALL_TS);do
      # Checking timestamp age
      if [ "$T_empty" == "yes" ]; then
         T_newest=$T ; T_empty="no"
      elif [ "$T" -gt "$T_newest" ]; then
         T_newest=$T
      fi
   done
   # Now find the newest merged cat/pkg useing the timestamp and
   # put the matching cat/pkg-ver in cat_pkg.lst
   awk '$1 ~ /'"$T_newest"'/ {print $2}' emerge.lst>>cat_pkg.lst
done

# Added -u to cut out double entries
cat_pkg=$(sort -u cat_pkg.lst)
if [ "$test" == "p" ]; then
      echo "$cat_pkg"
   elif [ "$test" == "d" ]; then
      # Now make /var/db/pkg/$cat/pkg
      mkdir -p /var/db/pkg/$cat_pkg
   else echo "$pkg"
      echo " And ow de ell id yaa get ere"
fi

rm cat_pkg.lst pkg_atom.lst emerge.lst unmerge.lst


localhost master # cd /var/db/pkg/
localhost pkg # /home/master/rcv_pkg_db.sh -d
Code:

localhost pkg # emerge -e system
Calculating system dependencies /Traceback (most recent call last):
  File "/usr/bin/emerge", line 5254, in ?
    retval = emerge_main()
  File "/usr/bin/emerge", line 5249, in emerge_main
    myopts, myaction, myfiles, spinner)
  File "/usr/bin/emerge", line 4564, in action_build
    if not mydepgraph.xcreate(myaction):
  File "/usr/bin/emerge", line 2150, in xcreate
    if not self.validate_blockers():
  File "/usr/bin/emerge", line 1830, in validate_blockers
    counter = long(vardb.aux_get(pkg, ["COUNTER"])[0])
ValueError: invalid literal for long():
localhost pkg #

Code:

localhost pkg # emerge world -e
Calculating world dependencies |Traceback (most recent call last):
  File "/usr/bin/emerge", line 5254, in ?
    retval = emerge_main()
  File "/usr/bin/emerge", line 5249, in emerge_main
    myopts, myaction, myfiles, spinner)
  File "/usr/bin/emerge", line 4564, in action_build
    if not mydepgraph.xcreate(myaction):
  File "/usr/bin/emerge", line 2150, in xcreate
    if not self.validate_blockers():
  File "/usr/bin/emerge", line 1830, in validate_blockers
    counter = long(vardb.aux_get(pkg, ["COUNTER"])[0])
ValueError: invalid literal for long():
localhost pkg #

Code:

localhost pkg # ls /var/db/pkg
app-admin    app-mobilephone  dev-java    games-fps    media-plugins  net-ftp    net-proxy     sys-fs       x11-drivers
app-arch     app-office       dev-lang    gnome-base   media-sound    net-im     net-wireless  sys-kernel   x11-libs
app-cdr      app-portage      dev-libs    gnome-extra  media-tv       net-irc    net-www       sys-libs     x11-misc
app-crypt    app-shells       dev-ml      kde-base     media-video    net-libs   perl-core     sys-process  x11-plugins
app-dicts    app-text         dev-perl    kde-misc     net-analyzer   net-mail   pkg_atom.lst  tmp          x11-proto
app-doc      app-vim          dev-php5    mail-filter  net-dialup     net-misc   sci-libs      virtual      x11-terms
app-editors  app-xemacs       dev-python  media-fonts  net-dns        net-nds    sys-apps      www-client   x11-themes
app-i18n     cat_pkg.lst      dev-ruby    media-gfx    net-firewall   net-p2p    sys-boot      x11-apps     x11-wm
app-misc     dev-db           dev-util    media-libs   net-fs         net-print  sys-devel     x11-base
localhost pkg #

but
localhost pkg # ls /var/db/pkg/media-sound/amarok-1.4.4
localhost pkg #

pls help, how rebuild system and world ?
Back to top
View user's profile Send private message
hielvc
Advocate
Advocate


Joined: 19 Apr 2002
Posts: 2801
Location: Oceanside, Ca

PostPosted: Thu Jan 18, 2007 4:52 pm    Post subject: Reply with quote

I dony think your prob has to do with /var/db/pkg .Try Doing a search of the Search useing " invalid literal for long(): " and select the "Portage & Pergramming forum " There were alot of hits. I usually start reading the post with the fewest replies in first 20 to 30 returned.

Luck
_________________
An A-Z Index of the Linux BASH command line
Back to top
View user's profile Send private message
Lok
n00b
n00b


Joined: 23 Mar 2006
Posts: 23

PostPosted: Thu Jan 18, 2007 7:26 pm    Post subject: Reply with quote

Code:

localhost pkg # emerge -e system
Calculating system dependencies /Traceback (most recent call last):
  File "/usr/bin/emerge", line 5254, in ?
    retval = emerge_main()
  File "/usr/bin/emerge", line 5249, in emerge_main
    myopts, myaction, myfiles, spinner)
  File "/usr/bin/emerge", line 4564, in action_build
    if not mydepgraph.xcreate(myaction):
  File "/usr/bin/emerge", line 2150, in xcreate
    if not self.validate_blockers():
  File "/usr/bin/emerge", line 1830, in validate_blockers
    counter = long(vardb.aux_get(pkg, ["COUNTER"])[0])
ValueError: invalid literal for long():
localhost pkg #

This mistake appears after performance of a script.
If to copy /var/db/pkg from stage1 that it is not present, but there is no also a correct base of ports:)
Why after performance of a script of a folder/var/db/pkg/*/* empty? In the same place there should be data. How it to fix?
Before performance of a script (/var/db/pkg it is copied from stage)
Code:

localhost master # ls /var/db/pkg/app-admin/perl-cleaner-1.01
ASFLAGS   CDEPEND   COUNTER   DEPEND           EXTRA_EMAKE  LDFLAGS      PDEPEND                   PROVIDE   USE
CATEGORY  CFLAGS    CTARGET   environment.bz2  FEATURES     LIBCFLAGS    perl-cleaner-1.01.ebuild  RDEPEND
CBUILD    CHOST     CXX       EXTRA_ECONF      INHERITED    LIBCXXFLAGS  PF                        RESTRICT
CC        CONTENTS  CXXFLAGS  EXTRA_EINSTALL   IUSE         LICENSE      PKGUSE                    SLOT
localhost master #

After performance of a script
Code:

localhost master # ls /var/db/pkg/app-admin/perl-cleaner-1.04.3
localhost master #
Back to top
View user's profile Send private message
hielvc
Advocate
Advocate


Joined: 19 Apr 2002
Posts: 2801
Location: Oceanside, Ca

PostPosted: Fri Jan 19, 2007 6:20 pm    Post subject: Reply with quote

Im not sure what your doing.
1 A stage1 does have /var/db/pkg/<blah>

2 A stage1 doesnt have a /var/log/emerge.log so the script wouldnt generate anything.

3 If you screw up a stage1 just mkfs /dev/partition or if its a chroot directory, rm -r chroot_Dir/* and redo it.

4 As I stated in my post where I posted the script with portage-2.1.2 it no longer seems to be needed.
Prior to 2.1.2 if you removed /var/db/pkg you were dead as far portage was concerned.

5 As stated in the above post the script just gives you the directory tree, To fill in the files you have to emerge each package as the files are a record of your emerge enviroment at the time the package is built. When you remove /var/db/pkg all that info is lost. Unless you have a backup there is no reasonable way to get it back. To regenerate it for your current enviroment you have to re-emerge the all the packages, which is done most easily by "emerge world -e". This is true even if you have no probs after removing /var/db/pkg and your useing >=portage-2.1.2. This is one of the places where emerge gets the info it needs when you use -N, --newuse flag.
_________________
An A-Z Index of the Linux BASH command line


Last edited by hielvc on Sat Sep 29, 2007 1:43 am; edited 1 time in total
Back to top
View user's profile Send private message
Lok
n00b
n00b


Joined: 23 Mar 2006
Posts: 23

PostPosted: Tue Jan 23, 2007 7:40 pm    Post subject: Reply with quote

I modified this script a little, have added check on time, for packages which left in system, for example in your script if the package has been removed and then is again established, does not get in the general leaf cat_pkg.lst, also automated a few calculation of the version in file SLOT, the truth works not so well, but more less... It is necessary for emerge that true decisions U UD NS R made... Excuse, but the script is not optimized
Code:

#!/bin/bash
mkdir -p /var/db/pkg
cd /var/db/pkg
# empty pkg_atom.lst & tmp
:>pkg_atom.lst ; :>cat_pkg.lst ; :>tmp
date_regx="" ; day="" ; pkg=""

usage(){
   cat<<-END

   USAGE: rcv_pkg_db_mod.sh [options] (optonal date=> Jul 7 2006)
      Run with "-p" for pretend. Output goes to screen
      Use "-d" to do the deed, write to /var/db/pkg/ . If
      you did a world --emptytree recently then look through
      your emerge.log and find the date. Enter the date as
      Aug 13 2006. The script will then only use files from
      that date on.
   Opitons
      -p for pretend. Outputs to screen
      -d to populate /var/db/pkg/
END
   echo
   exit
}

# Added a usage, pretend and "really do the deed"
if [ "$1" == "" ];then
   usage
elif [ "$1" == "-p" ]; then
   test="p"
elif [ "$1" == "-d" ]; then
   test="d"
else
   usage
fi

# Added date fetching
# Check # of agrcs if 2 then epoch time ?
if [ $# -eq 1 ];then
   date_regx="1017648000"  # april 1 2002
elif [ $# -eq 2 ];then
   date_regx="$1"
else
   shift
   day="$@"
   date_regx="$(date -d "$day" +%s)"  #convert to epoch time
fi
echo " Recovery pkg dbase begin..."
awk '/completed/ && !/Sync/ {print $1, $8}' /var/log/emerge.log|sed 's/://'| awk '$1 >= '"$date_regx"' {print $1, $2}'>emerge.lst
echo "step1..."
awk '/unmerge/ && !/Nothing/ {print $1, $5}' /var/log/emerge.log |sed 's/://'>unmerge.lst
cat unmerge.lst |grep / > tmpu
mv tmpu unmerge.lst

awk '{print $2}' emerge.lst > emerge.opt
awk '{print $2}' unmerge.lst > unmerge.opt

sort -u emerge.opt > emerge.optim
sort -u unmerge.opt > unmerge.optim

cp emerge.optim emerge.backup
cp unmerge.optim unmerge.backup
cp emerge.lst emergelst.backup
cp unmerge.lst unmergelst.backup

for i in $(awk '{print}' unmerge.optim);do
   grep -vx "$i" emerge.optim>tmp;mv tmp emerge.optim #optim1 �� �������� � optim
done

cp emerge.optim emerge.optim1
cp emerge.backup emerge.optim

for i in $(awk '{print}' emerge.optim1);do
   grep -vx "$i" emerge.optim>tmp;mv tmp emerge.optim #optim2 == unmerge
done

cp emerge.optim emerge.optim2
cp emerge.backup emerge.optim
echo "step2..."
for i in $(awk '{print}' emerge.optim2);do
   grep -vx "$i" unmerge.optim>tmp;mv tmp unmerge.optim #unmerge.optim1
done

cp unmerge.optim unmerge.optim1
cp unmerge.backup unmerge.optim

for i in $(awk '{print}' unmerge.optim1);do
   grep -vx "$i" unmerge.optim>tmp;mv tmp unmerge.optim #unmerge.optim2 ��� emerge
done

cp unmerge.optim unmerge.optim2
cp unmerge.backup unmerge.optim
cp emerge.optim2 emerge.backup2
echo "step3..."
for i in $(awk '{print}' unmerge.optim2);do
   grep -vx "$i" emerge.optim2 >tmp;mv tmp emerge.optim2 #unmerge.optim2 ��� emerge
done

cp emerge.optim2 unmerge.optim2
cp emerge.backup2 emerge.optim2


for i in $(awk '{print}' emerge.optim2);do
   grep -v "$i$" unmerge.lst>tmp;mv tmp unmerge.lst #unmerge.lst1 ��� ����� ���� ���������� (��� �� ��������������� �������)!!!!!!!!
done

cp unmerge.lst unmerge.lst1
cp unmergelst.backup unmerge.lst
echo "step4..."
for i in $(awk '{print}' unmerge.lst1);do
   grep -v "$i$" unmerge.lst>tmp;mv tmp unmerge.lst #unmerge.lst2 ��� emerge
done

cp unmerge.lst unmerge.lst2
cp unmergelst.backup unmerge.lst

for i in $(awk '{print}' emerge.optim2);do
   grep -v "$i$" emerge.lst>tmp;mv tmp emerge.lst #emerge.lst1
done

cp emerge.lst emerge.lst1
cp emergelst.backup emerge.lst

for i in $(awk '{print}' emerge.lst1);do
   grep -v "$i$" emerge.lst>tmp;mv tmp emerge.lst #emerge.lst2
done

cp emerge.lst emerge.lst2
cp emergelst.backup emerge.lst
kol=$(cat emerge.lst2 -n |awk '{print $1}'|tail --lines=1)
echo "step5..."
 for ix in `seq $kol -1 1`;
   do
for i in $(awk 'NR=='$ix' {print}' emerge.optim2);do
   grep "$i$" emerge.lst2 >>tmp
   grep "$i$" unmerge.lst2 >>tmp1
done
done

kol1=$(cat tmp -n |awk '{print $1}'|tail --lines=1)
 for ix in `seq $kol1 -1 1`;do
i=$(awk 'NR=='$ix' {print}' tmp)   #��������� � ����������
echo "$i" >>tmp0
done

kol2=$(cat tmp1 -n |awk '{print $1}'|tail --lines=1)

 for ix in `seq $kol2 -1 1`;do
i=$(awk 'NR=='$ix' {print}' tmp1)   #��������� � ����������
echo "$i" >>tmp01
done
echo "step6..."
kol3=$(cat tmp0 -n |awk '{print $1}'|tail --lines=1)
 for ix in `seq 1 1 $kol3`;
   do
for i in $(awk 'NR=='$ix' {print}' emerge.optim2);do
   grep "$i$" tmp0 -m 1 >>tmp3             #emerge
   grep "$i$" tmp01 -m 1 >>tmp4
done
done

kol4=$(cat tmp3 -n |awk '{print $1}'|tail --lines=1)
 for ix in `seq 1 $kol4`;
   do
a=$(awk 'NR=='$ix' {print $1}' tmp3)
b=$(awk 'NR=='$ix' {print $1}' tmp4)
  if [ $a -gt $b ]
then
for i in $(awk 'NR=='$ix' {print}' tmp3);do
     grep "$i$" tmp3 >>tmp7    #������ ������� ���� � �������, �.� ������� ����� ��������
done
            fi
done

awk '{print $2}' tmp7 >em

cat emerge.optim1 > cat_pkg.lst
cat em >> cat_pkg.lst

awk '{print $0"/COUNTER"}' cat_pkg.lst > cat_pkg1.lst

`sed 's/COUNTER/SLOT/' cat_pkg1.lst > cat_pkg2.lst`

cat_pkg=$(sort -u cat_pkg.lst)
cat_pkg1=$(sort -u cat_pkg1.lst)
cat_pkg2=$(sort -u cat_pkg2.lst)
if [ "$test" == "p" ]; then
echo "Printing packets..."
      echo "$cat_pkg"
cd /var/db/pkg
dir -p1 /var/db/pkg |grep -v / >ex
sed 's/^/rm \/var\/db\/pkg\//' ex >ex1
echo "rm /var/db/pkg/ex1" >>ex1
echo "rm /var/db/pkg/ex" >>ex1
chmod +x ex1
./ex1

elif  [ "$test" == "d" ]; then
      mkdir -p /var/db/pkg/$cat_pkg
      touch /var/db/pkg/$cat_pkg1
      touch /var/db/pkg/$cat_pkg2
      echo " Write dbase folders OK"
   else echo "$pkg"
      echo " Write dbase folders OK"
fi

if [ "$test" == "p" ]; then
      echo "end"
elif  [ "$test" == "d" ]; then

`find ./ -name COUNTER > 5`
`sed 's/^/echo "1" >  /' 5 > 55`
`chmod +x 55 && ./55`

`find ./ -name SLOT > 51`
`sed 's/^/echo "0" >  /' 51 > 551`
`chmod +x 551 && ./551`

echo " Analize /usr/portage... This may take some times"
for i in /usr/portage/*/*/*;
do
grep -L 'SLOT' $i >>12345
done
cat 12345|grep -v 'dev-db/mysql' >123456
cat 123456|grep -v 'x11-base/xorg-server' >12345
#new
for i in /usr/portage/*/*/*;
do
grep -l 'SLOT="${' $i >>12345
done
#new
cat 12345| grep ebuild >1234

cat 1234|awk -F "/" '{print $4"/"$5}'|sort -u >1

echo "step7..."
kol5=$(cat 1 -n |awk '{print $1}'|tail --lines=1)
 for ix in `seq 1 1 $kol5`;
   do
for i in $(awk 'NR=='$ix' {print}' 1);do
   grep "$i" cat_pkg.lst >>90 #�������� ������ ������, �� ������ � ������� ��� ��� SLOT
done
done


#cat default | awk -F "-0" '{print $1}'|awk -F "-1" '{print $1}'| awk -F "-2" '{print $1}'|awk -F "-3" '{print $1}'  | awk -F "-4" '{print $1}'|awk -F "-5" '{print $1}'  | awk -F "-6" '{print $1}'|awk -F "-7" '{print $1}' | awk -F "-8" '{print $1}'|awk -F "-9" '{print $1}'   > 901 #��� ����� ��� ������


cat 90|grep -v 'media-fonts/font-adobe-[0-9]' > 90a
cat 90a | awk -F "-0" '{print $1}'|awk -F "-1" '{print $1}'| awk -F "-2" '{print $1}'|awk -F "-3" '{print $1}'  | awk -F "-4" '{print $1}'|awk -F "-5" '{print $1}'  | awk -F "-6" '{print $1}'|awk -F "-7" '{print $1}' | awk -F "-8" '{print $1}'|awk -F "-9" '{print $1}' >901a
cat 90|grep 'media-fonts/font-adobe-[0-9]'| awk -F "i-" '{print $1"i"}'   >>901a
#echo "sys-devel/automake" >>901a

cat 90|grep -v 'media-fonts/font-adobe-[0-9]' > 90a
cat 90|grep 'media-fonts/font-adobe-[0-9]' >>90a


kol6=$(cat 901a -n |awk '{print $1}'|tail --lines=1)
 for ix in `seq 1 1 $kol6`;
   do
cat 901a|awk 'NR=='$ix' {print}'|sed 's/[/]/[\/]/' >>902 #������� x11-proto[/]printproto

done


for ix1 in `seq 1 1 211`;
   do
w=$(cat 902|awk 'NR=='$ix1' {print}')

sed 's/'$w'-//' 90a|awk 'NR=='$ix1' {print}' >> a4 #������ ������
done

echo "step8..."
kol7=$(cat a4 -n |awk '{print $1}'|tail --lines=1)
 for ix in `seq 1 1 $kol7`;
   do
awk -F "." 'NR=='$ix' {print $1"."$2}' a4|awk -F "-" '{print $1}'|awk -F "_" '{print $1}'|sed 's/\.$//' >>vers
done


kol8=$(cat 90a -n |awk '{print $1}'|tail --lines=1)
 for ix in `seq 1 1 $kol8`;
   do
w=$(cat vers |awk 'NR=='$ix' {print}')
w1=$(cat 90a |awk 'NR=='$ix' {print $0"/SLOT"}')
w2=$(cat 90a |awk 'NR=='$ix' {print $0"/SLOT1"}')
echo $w >$w1
sed '/^$/d' $w1 > $w2
rm $w1
mv $w2 $w1
done
echo " Analize /usr/portage... This may take some times"
echo -e "SLOT=\"1\"\nSLOT=\"2\"\nSLOT=\"3\"\nSLOT=\"4\"\nSLOT=\"5\"\nSLOT=\"6\"\nSLOT=\"7\"\nSLOT=\"8\"\nSLOT=\"9\"" > search
for i in /usr/portage/*/*/*;
do
grep -lf search $i >>opa
done

cat opa| grep ebuild >opa1

cat opa1|awk -F "/" '{print $4"/"$5}'|sort -u >h1
echo "step9..."
kol9=$(cat h1 -n |awk '{print $1}'|tail --lines=1)
 for ix in `seq 1 1 $kol9`;
   do
for i in $(awk 'NR=='$ix' {print}' h1);do
   grep "$i" cat_pkg.lst >>sup1 #�������� ������ ������, �� ������ � ������� ��� est' SLOT="2"
done
done

cat sup1|grep -v 'media-fonts/font-adobe-[0-9]' > sup1a
cat sup1a | awk -F "-0" '{print $1}'|awk -F "-1" '{print $1}'| awk -F "-2" '{print $1}'|awk -F "-3" '{print $1}'  | awk -F "-4" '{print $1}'|awk -F "-5" '{print $1}'  | awk -F "-6" '{print $1}'|awk -F "-7" '{print $1}' | awk -F "-8" '{print $1}'|awk -F "-9" '{print $1}' >sup11a
cat sup1|grep 'media-fonts/font-adobe-[0-9]'| awk -F "i-" '{print $1"i"}'   >>sup11a
#echo "sys-devel/automake" >>901a

cat sup1|grep -v 'media-fonts/font-adobe-[0-9]' > sup1a
cat sup1|grep 'media-fonts/font-adobe-[0-9]' >>sup1a


kol10=$(cat sup11a -n |awk '{print $1}'|tail --lines=1)
 for ix in `seq 1 1 $kol10`;
   do
cat sup11a|awk 'NR=='$ix' {print}'|sed 's/[/]/[\/]/' >>sup22 #������� x11-proto[/]printproto

done


for ix1 in `seq 1 1 211`;
   do
w=$(cat sup22|awk 'NR=='$ix1' {print}')

sed 's/'$w'-//' sup1a|awk 'NR=='$ix1' {print}' >> hok #������ ������
done



#cat h1 | awk -F "." '{print $1}'| awk -F "-" '{print $2}' > hok #versii files

echo "step10..."
kol11=$(cat hok -n |awk '{print $1}'|tail --lines=1)
 for ix in `seq 1 1 $kol11`;
   do
awk -F "." 'NR=='$ix' {print $1}' hok|awk -F "-" '{print $1}'|awk -F "_" '{print $1}'|sed 's/\.$//' >>hokvers
done

kol12=$(cat sup1a -n |awk '{print $1}'|tail --lines=1)
 for ix in `seq 1 1 $kol12`;
   do
w=$(cat hokvers |awk 'NR=='$ix' {print}')
w1=$(cat sup1a |awk 'NR=='$ix' {print $0"/SLOT"}')
w2=$(cat sup1a |awk 'NR=='$ix' {print $0"/SLOT1"}')
echo $w >$w1
sed '/^$/d' $w1 > $w2
rm $w1
mv $w2 $w1
done
cd /var/db/pkg
dir -p1 /var/db/pkg |grep -v / >ex
sed 's/^/rm \/var\/db\/pkg\//' ex >ex1
echo "rm /var/db/pkg/ex1" >>ex1
chmod +x ex1
./ex1
echo " Recovery pkg dbase end OK!"
echo " * Please run \"emaint --check world\" and make by hand /var/db/pkg/* lack packets"
echo " * run \"emerge -pve world|grep NS\" and check this packets, if you think that it is not true, fix it by analize /usr/portage and write true info in /var/db/pkg/<*>/<doubt packet>/SLOT, theses packets not many :)"
echo " * run \"equery list --duplicates\" this show info packets in slot, not spare rebuild this packets"
echo " * if you get message about block packets, check /var/db/pkg/<*>/<*>/SLOT and fix it"
echo " * run \"emerge -e system\""
echo " * run \"emerge -e world\""
fi


And still, emerge why that cannot finish installation of a package without file CONTENTS, at a stage merging there is a stop.
Quote:

# emerge --info
Portage 2.1.2 (default-linux/x86/2006.1/desktop, gcc-4.1.1, glibc-2.4-r4, 2.6.18-gentoo-r6 i686)
=================================================================

Therefore it will be logical to create this file, having executed a script:
Code:

#!/bin/sh
find /var/db/pkg/*/*/SLOT > 1
sed 's/SLOT/CONTENTS/' 1 >2
w=$(cat 2)
touch $w
Back to top
View user's profile Send private message
Dan
Veteran
Veteran


Joined: 25 Oct 2005
Posts: 1301

PostPosted: Sat Jan 27, 2007 10:03 pm    Post subject: Reply with quote

Traceback (most recent call last):
File "/usr/bin/emerge", line 5270, in ?
retval = emerge_main()
File "/usr/bin/emerge", line 5265, in emerge_main
myopts, myaction, myfiles, spinner)
File "/usr/bin/emerge", line 4732, in action_build
retval = mergetask.merge(pkglist, favorites, mtimedb)
File "/usr/bin/emerge", line 3068, in merge
"clean", [xsplit[0]], ldpath_mtimes)
File "/usr/bin/emerge", line 3325, in unmerge
slotmap[myslot][localtree.dbapi.cpv_counter(mypkg)]=mypkg
File "/usr/lib/portage/pym/portage.py", line 4920, in cpv_counter
return long(self.aux_get(mycpv, ["COUNTER"])[0])
ValueError: invalid literal for long():


I get that too. after using that script.
_________________
- Failure is not an option. It's bundled with your software.
Back to top
View user's profile Send private message
Lok
n00b
n00b


Joined: 23 Mar 2006
Posts: 23

PostPosted: Sun Jan 28, 2007 1:42 pm    Post subject: Reply with quote

return long (self.aux_get (mycpv, ["COUNTER"]) [0])

Means that the file/var/db/*/*/COUNTER or is absent, or empty.
In this script http://forums.gentoo.org/viewtopic-p-3861893.html#3861893 are lines:

awk '{print $0 "/COUNTER"}' cat_pkg.lst> cat_pkg1.lst
......
touch /var/db/pkg/$cat_pkg1
....
`find ./ -name COUNTER > 5`
`sed 's/^/echo "1" > /' 5 > 55`
`chmod +x 55 && ./55`

create this file containing "1" , means this mistake:
Code:

Traceback (most recent call last):
File "/usr/bin/emerge", line 5270, in ?
retval = emerge_main()
File "/usr/bin/emerge", line 5265, in emerge_main
myopts, myaction, myfiles, spinner)
File "/usr/bin/emerge", line 4732, in action_build
retval = mergetask.merge(pkglist, favorites, mtimedb)
File "/usr/bin/emerge", line 3068, in merge
"clean", [xsplit[0]], ldpath_mtimes)
File "/usr/bin/emerge", line 3325, in unmerge
slotmap[myslot][localtree.dbapi.cpv_counter(mypkg)]=mypkg
File "/usr/lib/portage/pym/portage.py", line 4920, in cpv_counter
return long(self.aux_get(mycpv, ["COUNTER"])[0])
ValueError: invalid literal for long():

cannot be.
Code:

# cat /var/db/pkg/*/*/COUNTER
1
1
1
1
1
1
1
........

After rebuild this file recovery.
Back to top
View user's profile Send private message
discostu
Guru
Guru


Joined: 01 Nov 2002
Posts: 333

PostPosted: Mon Feb 19, 2007 5:39 pm    Post subject: Reply with quote

I had a separate partition for "/var" It got corrupted and I lost everything in var. All I have are the portage tree and the ccache. I was able to restore some files via the script using the emerge system technique with the regenpkgdb script (though I added --nodeps to the script because otherwise it spit out circular dependency errors).

Is there anyway to restore more of portage? Or am I just gonna have to rebuild everything?
_________________
"Disco Stu doesn't advertise."
Back to top
View user's profile Send private message
Dan
Veteran
Veteran


Joined: 25 Oct 2005
Posts: 1301

PostPosted: Wed Feb 21, 2007 2:33 pm    Post subject: Reply with quote

emerge -e system && emerge -e world
_________________
- Failure is not an option. It's bundled with your software.
Back to top
View user's profile Send private message
jsosic
Guru
Guru


Joined: 02 Aug 2004
Posts: 510
Location: Split (Croatia)

PostPosted: Mon Mar 17, 2008 4:16 pm    Post subject: Lost my /var/db/pkg Reply with quote

How to recover portage pkg db? Is it possible? Thank you :)
_________________
I avenge with darkness, the blood is the life
The Order of the Dragon, I feed on human life
Back to top
View user's profile Send private message
nixnut
Bodhisattva
Bodhisattva


Joined: 09 Apr 2004
Posts: 10974
Location: the dutch mountains

PostPosted: Mon Mar 17, 2008 5:04 pm    Post subject: Reply with quote

merged above post here.
_________________
Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered

talk is cheap. supply exceeds demand
Back to top
View user's profile Send private message
bob doe
Apprentice
Apprentice


Joined: 11 Jun 2007
Posts: 207

PostPosted: Sun May 25, 2008 2:13 pm    Post subject: Help! /var/db/pkg/ is gone! Reply with quote

So....

Im building my own Gentoo LiveCD on my system, and during the process, I mount --bind /usr/portage into the usr/portage directory of the liveCD, to avoid having two trees and distfiles on my system. I know its not the safest thing to do... but. I've been doing this for about two months now and have recompiled the LiveCD dozens of times. Never had any problems. The worst problem I'd encounter is when I'd forget to umount the liveCD's usr/portage directory before deleting the sources. This would delete my host system's tree and distfiles. But nothing a eix-sync -v (or emerge --sync) cant fix.

This time though, I didnt forget the do the umount, but now the contents of /var/db/pkg have been deleted and I have no idea why! I automate the LiveCD process with two scripts, and none of them even touch that directory..

So now I cant do anything with emerge. Is there a way to re-generate the contents of this directory?

Thanks,
Back to top
View user's profile Send private message
nixnut
Bodhisattva
Bodhisattva


Joined: 09 Apr 2004
Posts: 10974
Location: the dutch mountains

PostPosted: Sun May 25, 2008 2:26 pm    Post subject: Reply with quote

merged above post here. please search before posting.
_________________
Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered

talk is cheap. supply exceeds demand
Back to top
View user's profile Send private message
bob doe
Apprentice
Apprentice


Joined: 11 Jun 2007
Posts: 207

PostPosted: Sun May 25, 2008 2:32 pm    Post subject: Reply with quote

Cheers. I did do a search for '/var/db/pkg' but nothing came up. Maybe the search function doesnt like symbols?
Back to top
View user's profile Send private message
nixnut
Bodhisattva
Bodhisattva


Joined: 09 Apr 2004
Posts: 10974
Location: the dutch mountains

PostPosted: Sun May 25, 2008 3:18 pm    Post subject: Reply with quote

yeah, the search feature kinda sucks. Here's a tip for firefox users.
_________________
Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered

talk is cheap. supply exceeds demand
Back to top
View user's profile Send private message
bob doe
Apprentice
Apprentice


Joined: 11 Jun 2007
Posts: 207

PostPosted: Mon May 26, 2008 1:35 am    Post subject: Reply with quote

Disregard, I was just being dumb (its been a long day in my defense)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum