Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
esync - script to show updates of an 'emerge sync'
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
haceye
Apprentice
Apprentice


Joined: 22 May 2003
Posts: 187
Location: Stuttgart, Germany

PostPosted: Mon Oct 06, 2003 12:09 pm    Post subject: esync - script to show updates of an 'emerge sync' Reply with quote

*UPDATE*
For everyone who likes this script, there is now an updated version of `esync` in the esearch package. All you have to do is
Code:
ACCEPT_KEYWORDS=~arch emerge esearch


You need a version >=esearch-0.5.3 From now on you can run
Code:
esync
. You don't have to create an extra directory etc., output of `emerge sync` will be logged to /var/log/emerge-sync.log.

Thanks to everyone who helped me to improve this script.

Description:
Ever wanted to know what is being updated during an emerge sync?
Here's a little script to show new packages and updates on existing packages.

Steps to install and use esync:

  1. You need esearch to run this script, so emerge it:
    Code:
    emerge esearch

  2. Create the esearch-index:
    Code:
    su
    eupdatedb

  3. Create a new folder somewhere (e.g. esync). esync will store a sync.log in it, so you may view the original output from 'emerge sync':
    Code:
    mkdir esync
    cd esync

  4. Download the current version of esync and make it executable:
    Code:
    wget http://david-peter.de/esync/esync
    chmod +x esync

  5. You're done. Just login as root and call esync:
    Code:
    su
    ./esync



How it works
First esync imports the old portage tree (esearch-index), then it executes 'emerge sync' (it stores the output in sync.log). Now it calls eupdatedb to regenerate the esearch-index and imports the new portage tree.
Now it loops through the new tree and compares it with the old one.

Result
For example, my ouput from today's esync is:
Code:
root (~) # esync
 * Getting old portage tree
 * Doing 'emerge sync' now
 * Doing 'eupdatedb' now

 * indexing: 0 ebuilds to go
 * esearch-index generated in 1 minutes and 7 seconds
 * indexed 5515 ebuilds
 * size of esearch-index: 843 kB

 * Getting new portage tree
 * Preparing databases
 * Searching for changes
[ U] libwnck (2.4.0.1):  A window navigation construction kit
[ U] gconf (2.4.0.1):  Gnome Configuration System and Daemon
[ N] anaglyph-stereo-quake (130100-r1):  play Quake in 3D with red - blue glasses
[ U] gstreamer (0.6.3):  Streaming media framework
[ U] gnome-games (2.4.0):  Collection of games for the GNOME desktop
[ U] libbonoboui (2.4.0):  User Interface part of Lib bonobo
[MN] libdvb (0.2.3):  mpegtools package for manipulation of various MPEG file formats
[ U] gedit (2.4.0):  A text editor for the Gnome2 desktop
[ U] control-center (2.4.0):  the gnome2 Desktop configuration tool
[ N] kth-krb (1.2.2-r1):  Kerberos 4 implementation from KTH
[ U] libxslt (1.0.33):  XSLT libraries and tools
[MN] folding (2.97):  A folding-editor-like Emacs minor mode
[ N] mm-sources (2.6.0_beta6-r4):  Full sources for the development linux kernel with Andrew Morton's patchset
[ U] glib (2.2.3):  The GLib library of C routines
[ U] libbonobo (2.4.0):  GNOME CORBA framework
[ U] eel (2.4.0):  EEL is the Eazel Extentions Library
[ U] libgtop (2.0.5):  A library that proivdes top functionality to applications
[ U] gnome-mime-data (2.4.0):  MIME data for Gnome
[ U] gnome-utils (2.4.0):  Utilities for the Gnome2 desktop
[ U] gnome-desktop (2.4.0):  Libraries for the gnome desktop that is not part of the UI
[ U] gtk-doc (1.1):  GTK+ Documentation Generator
[ U] bug-buddy (2.4.0):  Bug Report helper for Gnome
[MN] lua-mode (1.26):  An Emacs major mode for editing Lua scripts
[ U] gst-plugins (0.6.3):  Basepack of plugins for gstreamer
[ U] gnome-applets (2.4.0):  Applets for the Gnome2 Desktop and Panel
[ U] gnome-panel (2.4.0-r1):  The Panel for Gnome2
[MN] cl-xlunit (0.6.1):  XLUnit is a Test Framework based on XPTest and JUnit. XLUnit strives to have a good balance between low programmer overhead and good support for fixture setup and teardown. XLUnit has greatly decreased programmer overhead compared to XPTest while adding more functionality from JUnit.
[ U] file-roller (2.4.0.1):  archive manager for GNOME
[ N] monkey-bubble (0.1.5):  A frozen-bubble clone
[MU] mod_python (3.0.3):  An Apache2 DSO providing an embedded Python interpreter

[ N] scilab (2.7-r2):  Scientific software package for numerical computations, Matlab lookalike
[ U] gail (1.4.0):  Part of Gnome Accessibility
[MN] cl-xmls (0.5):  Xmls is a small, simple, non-validating xml parser for Common Lisp. It's designed to be a self-contained, easily embedded parser that recognizes a useful subset of the XML spec. It provides a simple mapping from xml to lisp s-expressions and back.
[ U] xfree (4.3.0-r3):  Xfree86: famous and free X server
[ U] yelp (2.4.0):  Help browser for Gnome
[MN] gauche-gtk (0.3):  GTK2 binding for Gauche
[ U] gnome-terminal (2.4.0.1):  The Gnome Terminal
[ N] bitlbee (0.80-r2):  Bitlbee is an irc to IM gateway that support mutliple IM protocols
[ U] atk (1.4.0):  Gnome Accessibility Toolkit
[ U] metacity (2.6.1):  Gnome default windowmanager
[ U] gnome-vfs (2.4.0):  Gnome Virtual Filesystem
[MN] flawfinder (1.23):  Examines C/C++ source code for security flaws
[ U] gnome2-user-docs (2.4.0):  end user documentation for Gnome2
[ U] libgnome (2.4.0):  Essential Gnome Libraries
[ U] libart_lgpl (2.3.16):  a LGPL version of libart
[ N] gnat (3.15p-r3):  The GNU Ada Toolkit
[ U] gnome-themes (2.4.0):  A set of gnome2 themes, with sets for users with limited or low vision
[ N] crack-attack (1.1.9):  Addictive OpenGL-based block game
[ U] libxml2 (2.5.11):  Version 2 of the library to manipulate XML files
[ U] vte (0.11.10):  Xft powered terminal widget
[MN] vyqchat (0.1.1):  QT based Vypress Chat clone for X.
[ U] gnome-system-monitor (2.4.0):  Procman - The Gnome System Monitor
[ U] libgnomeprint (2.4.0):  Printer handling for Gnome
[ U] acme (2.4.0):  GNOME tool to make use of the multimedia buttons on laptops and internet keyboards
[ U] intltool (0.27.2):  Scripts for extracting translatable strings from various sourcefiles
[ U] libgnomeui (2.4.0.1):  User Interface routines for Gnome
[ U] scrollkeeper (0.3.12):  Scrollkeeper
[ N] f-prot (4.2.1):  Frisk Software's f-prot virus scanner
[ U] nautilus-media (0.3.3.1):  Media plugins for Nautilus (audio view and info tab)
[ U] libgnomeprintui (2.4.0):  user interface libraries for gnome print
[ N] ltris (1.0.5):  very polished Tetris clone
[ U] gconf-editor (2.4.0):  An editor to the GNOME 2 config system
[MN] echat (0.02-r1):  Console vypress chat clone for *nix like systems.
[ N] memcached-api-perl (1.0.8):  Perl API for memcached
[ U] librsvg (2.4.0):  rendering svg library
[ U] gnome-session (2.4.0):  Gnome session manager
[ U] pango (1.2.5):  Text rendering and layout library
[ U] gnome-media (2.4.0):  Multimedia related programs for the Gnome2 desktop
[ U] gnome-icon-theme (1.0.9):  Gnome2 default icon themes
[ N] gtkam (0.1.10-r1):  A frontend for gPhoto 2
[MN] frontier-rpc (0.07_beta4):  A Perl 5 module for performing remote procedure calls using extensible markup language
[MN] libgeotiff (1.2.1):  libgeotiff
[MN] cl-ppcre (0.5.9):  CL-PPCRE is a portable regular expression library for Common Lisp.
[ U] nautilus (2.4.0):  A filemanager for the Gnome2 desktop
[MN] fxpy (1.0.5):  Fox Toolkit GUI bindings for Python.
[MN] eclipse-sdk (2.1.1):  Eclipse Tools Platform
[ U] gnome (2.4):  Meta package for the GNOME desktop.
[ U] ggv (2.4.0.1):  The GNOME PostScript document viewer
[MN] rbot (0.9.6):  rbot is a ruby IRC bot
[ U] libgnomecanvas (2.4.0):  the Gnome 2 Canvas library
[ U] epiphany (1.0):  GNOME webbrowser based on the mozilla rendering engine
[ U] eog (2.4.0):  the Eye Of Gnome - Image Viewer and Cataloger for Gnome2
[ U] ORBit2 (2.8.1):  ORBit2 is a high-performance CORBA ORB


I hope someone finds this useful.

David
_________________
faster 'emerge -s'? emerge esearch


Last edited by haceye on Mon Jan 12, 2004 3:38 pm; edited 2 times in total
Back to top
View user's profile Send private message
Master_Of_Disaster
l33t
l33t


Joined: 28 Feb 2003
Posts: 610
Location: 15.05072° East, 48.13747° North (aka Mauer), Austria

PostPosted: Mon Oct 06, 2003 12:40 pm    Post subject: Reply with quote

Just my 2 cents:
An option like
Quote:
esync --logfile /path/to/logfile.log
would be useful.
_________________
post tenebras lux, post fenestras tux
Registered Linux User Nr. 312509
Adopt an unanswered post today!
Back to top
View user's profile Send private message
El_Presidente_Pufferfish
Veteran
Veteran


Joined: 11 Jul 2002
Posts: 1179
Location: Seattle

PostPosted: Mon Oct 06, 2003 1:06 pm    Post subject: Reply with quote

Code:
esync > logfile
Back to top
View user's profile Send private message
grudge
Tux's lil' helper
Tux's lil' helper


Joined: 26 Oct 2002
Posts: 77
Location: South Africa

PostPosted: Mon Oct 06, 2003 2:38 pm    Post subject: Reply with quote

Will it still work if I can only do a emerge-webrsync from my workstation ?

[edit] sounds like something I could use at home as well. Can I have it regularly run ? How would I insert something like this in vcron ? what about having it email the results to me daily ? is this too much that I am asking or is this all very easy ... ?
Back to top
View user's profile Send private message
haceye
Apprentice
Apprentice


Joined: 22 May 2003
Posts: 187
Location: Stuttgart, Germany

PostPosted: Mon Oct 06, 2003 3:35 pm    Post subject: Reply with quote

Hi,

Master_Of_Disaster wrote:
Just my 2 cents:
An option like
Quote:
esync --logfile /path/to/logfile.log
would be useful.

I'll possibly add this in an upcoming version

@El_Presidente_Pufferfish:
Code:
esync > logfile
will only put the output of esync into logfile, but I think Master_Of_Disaster want's to put the output of 'emerge sync' into that logfile

grudge wrote:
Will it still work if I can only do a emerge-webrsync from my workstation ?

It will (I hope so, at least)

grudge wrote:
[edit] sounds like something I could use at home as well. Can I have it regularly run ? How would I insert something like this in vcron ?

Of course you can. Just put a symlink to /path/to/esync into your cron.daily-folder?!

grudge wrote:
what about having it email the results to me daily ?

Should be no problem to write a small script...


David
_________________
faster 'emerge -s'? emerge esearch
Back to top
View user's profile Send private message
dr_strange
Guru
Guru


Joined: 16 Apr 2002
Posts: 480
Location: Cambridge, UK

PostPosted: Tue Oct 07, 2003 7:12 am    Post subject: Reply with quote

I got the following error when I tried to run it from cron (this was the second time I run the script, first time it went okay):

Traceback (most recent call last):
File "/drstrange/bin/esync", line 21, in ?
tree_old = gettree("old")
File "/drstrange/bin/esync", line 15, in gettree
from oldtree import db
ImportError: No module named oldtree

What's going wrong?
Back to top
View user's profile Send private message
haceye
Apprentice
Apprentice


Joined: 22 May 2003
Posts: 187
Location: Stuttgart, Germany

PostPosted: Tue Oct 07, 2003 10:23 am    Post subject: Reply with quote

dr_strange wrote:
I got the following error when I tried to run it from cron (this was the second time I run the script, first time it went okay):

Traceback (most recent call last):
File "/drstrange/bin/esync", line 21, in ?
tree_old = gettree("old")
File "/drstrange/bin/esync", line 15, in gettree
from oldtree import db
ImportError: No module named oldtree

What's going wrong?


Hi,

The script nees write-access to the folder it is stored in. That's why I proposed to create an extra folder (It creates and deletes two symlinks during execution). I'm sure it will work, if you do the following with a small script (that you can run with your cronjob):
Code:

cd /path/to/esync-folder
./esync


I will try to do this on a better way in the next version

David
_________________
faster 'emerge -s'? emerge esearch
Back to top
View user's profile Send private message
dr_strange
Guru
Guru


Joined: 16 Apr 2002
Posts: 480
Location: Cambridge, UK

PostPosted: Tue Oct 07, 2003 11:09 am    Post subject: Reply with quote

thank you!
Back to top
View user's profile Send private message
OneOfOne
Guru
Guru


Joined: 28 May 2003
Posts: 368

PostPosted: Tue Oct 07, 2003 11:13 am    Post subject: Reply with quote

real nice script, but i had a tiny problem with "head" not liking "-1" and wanted to use "-n1" instead.
you have 2 options to fix it (for the rest of us using ~x86) :
1. add export _POSIX2_VERSION=199209 somewhere in the script (too much trouble, really..)
2. replace
Code:
    if pkg not in old_keys:
        os.system("esearch -c ^" + pkg.split("/")[1] + "$ | head -1")
    elif old[pkg] != new[pkg]:
        os.system("esearch -c ^" + pkg.split("/")[1] + "$ | head -1")

with
Code:
    if pkg not in old_keys:
        os.system("esearch -c ^" + pkg.split("/")[1] + "$ | head -n1")
    elif old[pkg] != new[pkg]:
        os.system("esearch -c ^" + pkg.split("/")[1] + "$ | head -n1")

here's the fully updated version, i made the error output of emerge sync to be saved to the log.
Code:
#!/usr/bin/env python2.2

import os
import sys
import portage
from output import red, green, bold

def emsg(msg):
    print green(" *"), msg

def gettree(tree):
    emsg("Getting " + tree + " portage tree")
    os.symlink("/var/cache/edb/esearchdb.pyc", tree + "tree.pyc")
    if tree == "old":
        from oldtree import db
    else:
        from newtree import db
    os.unlink(tree + "tree.pyc")
    return db

tree_old = gettree("old")

emsg("Doing 'emerge sync' now")

if os.system("emerge sync > sync.log 2>&1") != 0:
    print red(" * Error:"), "emerge sync failed"
    print ""
    sys.exit(1)

print ""
print ""
emsg("Doing 'eupdatedb' now")
print ""
os.system("eupdatedb")
print ""

tree_new = gettree("new")

emsg("Preparing databases")
new = {}
for pkg in tree_new:
    new[pkg[1]] = pkg[3]

old = {}
for pkg in tree_old:
    old[pkg[1]] = pkg[3]

emsg("Searching for changes")
old_keys = old.keys()
for (pkg, version) in new.items():
    if pkg not in old_keys:
        os.system("esearch -c ^" + pkg.split("/")[1] + "$ | head -n1")
    elif old[pkg] != new[pkg]:
        os.system("esearch -c ^" + pkg.split("/")[1] + "$ | head -n1")

peace
Back to top
View user's profile Send private message
haceye
Apprentice
Apprentice


Joined: 22 May 2003
Posts: 187
Location: Stuttgart, Germany

PostPosted: Tue Oct 07, 2003 1:39 pm    Post subject: Reply with quote

OneOfOne wrote:
real nice script, but i had a tiny problem with "head" not liking "-1" and wanted to use "-n1" instead.

[...]

here's the fully updated version, i made the error output of emerge sync to be saved to the log.

[...]


Hi,

Thanks a lot, I've updated it online.


David
_________________
faster 'emerge -s'? emerge esearch
Back to top
View user's profile Send private message
OneOfOne
Guru
Guru


Joined: 28 May 2003
Posts: 368

PostPosted: Wed Oct 22, 2003 12:44 pm    Post subject: Reply with quote

the script no longer show any output with the latest esearch :(
i tried to check the code but i'm no good in python (well i actually hate it).
could u please check the script? i really like it.

peace
Back to top
View user's profile Send private message
sebest
Apprentice
Apprentice


Joined: 03 Jul 2002
Posts: 163
Location: Paris - France

PostPosted: Tue Oct 28, 2003 1:29 pm    Post subject: Reply with quote

Here is another script to do almost the same thing:
- emerge sync
- mail the files that need to be updated
- show differences between last run

Code:

#!/bin/bash

EMAIL="admin@yourdomain.com"

DIR="/var/cache/gentoo-updates"
VERSION="5"

if [ ! -d ${DIR} ]
then
    mkdir ${DIR}
fi

if [ -f ${DIR}/updates.new ]
then
    mv ${DIR}/updates.new ${DIR}/updates.old
else
    touch ${DIR}/updates.old
fi

emerge sync > ${DIR}/rsync.log
emerge -Up world | grep ebuild | sort >& ${DIR}/updates.new
diff -u0 ${DIR}/updates.old ${DIR}/updates.new | grep ebuild > ${DIR}/updates.diff


#
# creating mail
#
echo "Packages that need to be updaded:" > ${DIR}/updates.mail
cat ${DIR}/updates.new >> ${DIR}/updates.mail
echo >>  ${DIR}/updates.mail
echo "Differences between last run:" >> ${DIR}/updates.mail
cat ${DIR}/updates.diff >> ${DIR}/updates.mail
echo >> ${DIR}/updates.mail
echo "--" >> ${DIR}/updates.mail
echo $0 version ${VERSION} >> ${DIR}/updates.mail

if [ -s ${DIR}/updates.new ] && [ -s ${DIR}/updates.diff ]
then
#    NB_UPDATES=`wc -l ${DIR}/updates.new | cut -f 1 -d " "`
    mail -s "Gentoo Updates At `hostname`" ${EMAIL} < ${DIR}/updates.mail
fi


example of the output:
Code:

Subject: Gentoo Updates At me-srv01
Content-Type:
X-UID: 104


Packages that need to be updaded:
[ebuild     U ] sys-apps/findutils-4.1.7-r5 [4.1.7-r4]
[ebuild     U ] sys-devel/binutils-2.14.90.0.6-r6 [2.14.90.0.6-r2]
[ebuild     U ] sys-libs/zlib-1.1.4-r2 [1.1.4-r1]

Differences between last run:
+[ebuild     U ] sys-libs/zlib-1.1.4-r2 [1.1.4-r1]

--
/etc/cron.daily/gentoo-updates.cron version 5


you can save the script in a file "gentoo-updates"
make it executable "chmod +x"
and put it in your /etc/cron.daily or /etc/cron.weekly
_________________
--
Seb aka "Mr Est"
Back to top
View user's profile Send private message
haceye
Apprentice
Apprentice


Joined: 22 May 2003
Posts: 187
Location: Stuttgart, Germany

PostPosted: Sat Nov 08, 2003 11:55 am    Post subject: Reply with quote

Hi,
Sorry, but I didn't see your answer because I did not recieve any email about it... strange.

OneOfOne wrote:
the script no longer show any output with the latest esearch :(

Not even any error-messages?

Which version of esearch are you using? I have 0.5.1 and it works perfectly for me. In fact it should work with any version of esearch

OneOfOne wrote:
i tried to check the code but i'm no good in python (well i actually hate it).


I love it ;-)

David
_________________
faster 'emerge -s'? emerge esearch
Back to top
View user's profile Send private message
ikaro
Advocate
Advocate


Joined: 14 Jul 2003
Posts: 2527
Location: Denmark

PostPosted: Sat Nov 08, 2003 4:49 pm    Post subject: Reply with quote

works nice here :>
thanks for another nice script ;)
_________________
linux: #232767
Back to top
View user's profile Send private message
Narada
Guru
Guru


Joined: 12 Dec 2002
Posts: 300
Location: London, UK

PostPosted: Tue Nov 11, 2003 1:48 pm    Post subject: Reply with quote

Hey. Excellent idea and great script. Just one thought that occured to me when using it. When I ran it for the first time it froze on emerge sync and because it should no output I couldn't tell whether there had been a timeout or whether it was doing its job. The same goes for eupdatedb. Some indication of progress is reassuring to indicate that progress is ongoing. You could allow syncing and eupdatedb to produce their normal output on screen if you like and then esync can append its output later. Just a thought.
_________________
http://dhruba.name/
Back to top
View user's profile Send private message
haceye
Apprentice
Apprentice


Joined: 22 May 2003
Posts: 187
Location: Stuttgart, Germany

PostPosted: Tue Nov 11, 2003 9:34 pm    Post subject: Reply with quote

Hi,

esync writes it's output into the logfile sync.log. If you want to see the output you could change the script to not pipe the output to this file. The complete ouput of eupdatedb should be shown...?!

David
_________________
faster 'emerge -s'? emerge esearch
Back to top
View user's profile Send private message
amne
Bodhisattva
Bodhisattva


Joined: 17 Nov 2002
Posts: 6378
Location: Graz / EU

PostPosted: Thu Nov 13, 2003 11:31 am    Post subject: Reply with quote

very nice script, just a minor cosmetical problem:
im using esync via a shell script:
Code:
#!/bin/sh
cd ~root/esync && ./esync > esynclog
less esynclog


esynclog:
Quote:
* indexing: 0 ebuilds to go
* esearch-index generated in 2 minute(s) and 2 second(s)
* indexed 6091 ebuilds
* size of esearch-index: 893 kB
[ N] hardened-gcc (2.4.5): This package provides transparent PaX/etdyn ASLR and
propolice/SSP in the gcc specs file.

[..]

[ N] sip (3.8): SIP is a tool for generating bindings for C++ classes so that t
hey can be used by Python.
* Getting old portage tree
* Doing 'emerge sync' now


* Doing 'eupdatedb' now


* Getting new portage tree
* Preparing databases
* Searching for changes

seems the text got mixed up somehow.
Back to top
View user's profile Send private message
spooch
n00b
n00b


Joined: 25 Nov 2003
Posts: 5
Location: München

PostPosted: Sun Dec 07, 2003 1:00 pm    Post subject: Re: esync - script to show updates of an 'emerge sync' Reply with quote

Very nice script!

What about bringing in the official portage tree?

Grats,
spooch
Back to top
View user's profile Send private message
fkurth
n00b
n00b


Joined: 15 Apr 2002
Posts: 27
Location: Dresden/Germany

PostPosted: Sun Dec 07, 2003 3:15 pm    Post subject: colors Reply with quote

please make the [U] displayed in blue like emerge does.
would improve readability a lot.
_________________
--
Felix Kurth
Back to top
View user's profile Send private message
albazeus
Tux's lil' helper
Tux's lil' helper


Joined: 03 Sep 2003
Posts: 81

PostPosted: Tue Dec 09, 2003 2:05 pm    Post subject: Reply with quote

Hi,
esync doesn't work in my box:
Code:
esync # ./esync
 * Getting old portage tree
Traceback (most recent call last):
  File "./esync", line 21, in ?
    tree_old = gettree("old")
  File "./esync", line 13, in gettree
    os.symlink("/var/cache/edb/esearchdb.pyc", tree + "tree.pyc")
OSError: [Errno 17] File exists


If i remove oldtree.pyc:
Code:

[root@Gentoo] -14:04- esync # ./esync
 * Getting old portage tree
Traceback (most recent call last):
  File "./esync", line 21, in ?
    tree_old = gettree("old")
  File "./esync", line 15, in gettree
    from oldtree import db
ImportError: Bad magic number in ./oldtree.pyc


Is it possible that it's related with the new version of python? I have:
Code:


esync # emerge -pv python wxPython

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

Calculating dependencies ...done!
[ebuild   R   ] dev-lang/python-2.3.2-r2  +ncurses +gdbm -ssl +readline +tcltk +berkdb -bootstrap +ipv6 -build -ucs2
[ebuild   R   ] dev-python/wxPython-2.4.2.4  +opengl +tiff +jpeg +png +gtk2 -unicode

and when i upgraded it it said to run /dev-lang/python/files/python-updater to "rebuild all the python dependent modules to run with python-2.3".
Back to top
View user's profile Send private message
OneOfOne
Guru
Guru


Joined: 28 May 2003
Posts: 368

PostPosted: Tue Dec 09, 2003 2:27 pm    Post subject: Reply with quote

albazeus wrote:
Hi,
esync doesn't work in my box:
Code:
esync # ./esync
 * Getting old portage tree
Traceback (most recent call last):
  File "./esync", line 21, in ?
    tree_old = gettree("old")
  File "./esync", line 13, in gettree
    os.symlink("/var/cache/edb/esearchdb.pyc", tree + "tree.pyc")
OSError: [Errno 17] File exists


If i remove oldtree.pyc:
Code:

[root@Gentoo] -14:04- esync # ./esync
 * Getting old portage tree
Traceback (most recent call last):
  File "./esync", line 21, in ?
    tree_old = gettree("old")
  File "./esync", line 15, in gettree
    from oldtree import db
ImportError: Bad magic number in ./oldtree.pyc


Is it possible that it's related with the new version of python? I have:
Code:


esync # emerge -pv python wxPython

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

Calculating dependencies ...done!
[ebuild   R   ] dev-lang/python-2.3.2-r2  +ncurses +gdbm -ssl +readline +tcltk +berkdb -bootstrap +ipv6 -build -ucs2
[ebuild   R   ] dev-python/wxPython-2.4.2.4  +opengl +tiff +jpeg +png +gtk2 -unicode

and when i upgraded it it said to run /dev-lang/python/files/python-updater to "rebuild all the python dependent modules to run with python-2.3".

same, i just noticed it today!

peace
Back to top
View user's profile Send private message
haceye
Apprentice
Apprentice


Joined: 22 May 2003
Posts: 187
Location: Stuttgart, Germany

PostPosted: Tue Dec 09, 2003 2:58 pm    Post subject: Reply with quote

Hi,

This is really a problem of Python. Compiled python scripts (.pyc) from 2.2 are not compatible with the .pyc's from python 2.3.
Please edit the first line of the esync script and change it to:

Code:

#!/usr/bin/python -u

or download the new version from the old URL (see first post).

The -u switch is for unbuffered output. With this you're able to do:
Code:

$ esync | tee esync.log


@spooch: Maybe I'll release it with the next version of esearch

@fkurth: This is a "problem" of esearch, I will fix that in the next version, thanks.

David
_________________
faster 'emerge -s'? emerge esearch
Back to top
View user's profile Send private message
albazeus
Tux's lil' helper
Tux's lil' helper


Joined: 03 Sep 2003
Posts: 81

PostPosted: Tue Dec 09, 2003 3:31 pm    Post subject: Reply with quote

thx! it worked for me! :D
Back to top
View user's profile Send private message
OneOfOne
Guru
Guru


Joined: 28 May 2003
Posts: 368

PostPosted: Thu Dec 11, 2003 8:19 pm    Post subject: Reply with quote

changing
Quote:
#!/usr/bin/env python2.2
to
#!/usr/bin/env python2.3

fixed it!

peace
Back to top
View user's profile Send private message
moltonel
n00b
n00b


Joined: 31 Mar 2003
Posts: 31
Location: Ireland

PostPosted: Thu Jan 08, 2004 4:01 pm    Post subject: Reply with quote

Nice script indeed :)

I was doing something quite similar with a command line :
Code:
esearch -o '[ ! -z "%vi" -a "%vi" != "%va" ] && echo "%p\t\t%vi -> %va"\n' . | sh

It's not as beautifull (it is very straightforward), but it can run separately from "emerge sync;eupdatedb".

Hey, what about an option to esync that says "don't update the tree, just scan the old log" ?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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