# esync - script to show updates of an 'emerge sync'

## haceye

*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

```
ACCEPT_KEYWORDS=~arch emerge esearch
```

You need a version >=esearch-0.5.3 From now on you can run

```
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:

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

```
emerge esearch
```

Create the esearch-index:

```
su

eupdatedb
```

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':

```
mkdir esync

cd esync
```

Download the current version of esync and make it executable:

```
wget http://david-peter.de/esync/esync

chmod +x esync
```

You're done. Just login as root and call esync:

```
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:

```
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

----------

## Master_Of_Disaster

Just my 2 cents:

An option like  *Quote:*   

> esync --logfile /path/to/logfile.log

  would be useful.

----------

## El_Presidente_Pufferfish

```
esync > logfile
```

----------

## grudge

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 ... ?

----------

## haceye

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:

```
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

----------

## dr_strange

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?

----------

## haceye

 *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 ?
> ...

 

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):

```

cd /path/to/esync-folder

./esync

```

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

David

----------

## dr_strange

thank you!

----------

## OneOfOne

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 

```
    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

```
    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.

```
#!/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

----------

## haceye

 *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

----------

## OneOfOne

the script no longer show any output with the latest esearch  :Sad: 

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

----------

## sebest

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

```

#!/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:

```

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

----------

## haceye

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  :Wink: 

David

----------

## ikaro

works nice here :>

thanks for another nice script  :Wink: 

----------

## Narada

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.

----------

## haceye

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

----------

## amne

very nice script, just a minor cosmetical problem:

im using esync via a shell script:

```
#!/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
> ...

 

seems the text got mixed up somehow.

----------

## spooch

Very nice script!

What about bringing in the official portage tree?

Grats,

spooch

----------

## fkurth

please make the [U] displayed in blue like emerge does.

would improve readability a lot.

----------

## albazeus

Hi,

esync doesn't work in my box:

```
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:

```

[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:

```

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".

----------

## OneOfOne

 *albazeus wrote:*   

> Hi,
> 
> esync doesn't work in my box:
> 
> ```
> ...

 

same, i just noticed it today!

peace

----------

## haceye

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:

```

#!/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:

```

$ 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

----------

## albazeus

thx! it worked for me!  :Very Happy: 

----------

## OneOfOne

changing  *Quote:*   

> #!/usr/bin/env python2.2
> 
> to 
> 
> #!/usr/bin/env python2.3

 

fixed it!

peace

----------

## moltonel

Nice script indeed :)

I was doing something quite similar with a command line :

```
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" ?

----------

## haceye

Hi,

I really love such one-liners, and it's pretty useful, but it does sth. else than esync.

esync only shows the packages that are updated during an `emerge sync. If you run a second esync directly after the first one, you probably won't see any packages updated.

David

----------

## Khan

I'm getting 2 different errors:

avenger esync # eupdatedb

Traceback (most recent call last):

  File "/usr/sbin/eupdatedb", line 7, in ?

    from output import red, darkgreen, green, bold, nocolor

ImportError: No module named output

then

avenger esync # ./esync

Traceback (most recent call last):

  File "./esync", line 9, in ?

    import portage

ImportError: No module named portage

Any idea what's going on here?

-ac

----------

## haceye

hi,

Please try to re-emerge python. This sould work. I don't know exactly yet, but I think this is a problem of portage. Will probably be fixed in next esearch.

David

----------

## beandog

Um, am I doing something wrong?  Running eupdatedb the first time took 20 minutes!  Is that normal?

----------

## haceye

Hi,

I'm currently working on the next esearch version. I did some research and I think I found an error/strange behaviour in portage. Maybe the next version of eupdatedb will be faster (with changes in portage.py?)

20 minutes are really long, but I think if you run eupdatedb again, it will run a little bit faster.

David

----------

## beandog

Yah, the second time it ran under 2 minutes.  But when I did emerge sync, and ran eupdatedb, it was going slowly again. :T

----------

## haceye

Sorry, but I'm just bumping this thread, because there is an update:

esync is now in portage (shipped with app-portage/esearch-0.5.3). See my first post for details

Thanks,

David

----------

## psyqil

I just updated and got 

```
 * Getting old portage tree

 * Doing 'emerge sync' now

 * Doing 'eupdatedb' now

 * indexing: 699 ebuilds to go 

!!! Problem with determining the name/location of an ebuild.

!!! Please report this on IRC and bugs if you are not causing it.

!!! mycpv:   sys-devel/hardened-gcc-4.0-3.3.2-r1

!!! mysplit: ['sys-devel', 'hardened-gcc-4.0-3.3.2-r1']

!!! psplit:  None

!!! error:   unsubscriptable object

 * Getting new portage tree

 * Preparing databases

 * Searching for changes

```

  :Sad: 

----------

## shanghai

I've got this error launching esync for the first time.

I did eupdatedb and esearch seems working

```

Getting old portage tree

Traceback (most recent call last):

  File "/usr/sbin/esync", line 33, in ?

    tree_old = gettree("old")

  File "/usr/sbin/esync", line 25, in gettree

    os.symlink("/var/cache/edb/esearchdb.pyc", tmp_prefix + tree + "tree.pyc")

OSError: [Errno 17] File exists
```

What's wrong?

----------

## haceye

Hi,

Please update to esearch-0.6 (~x86)

David

----------

## kKDu

What's about this nice feature?

At the end of /usr/sbin/esync:

```
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")

        # begin kKDu

        os.system("esearch ^" + pkg.split("/")[1] + "$ | awk 'NR==8 { print $0 }'")

        # end kKDu

    elif old[pkg] != new[pkg]:

        os.system("esearch -c ^" + pkg.split("/")[1] + "$ | head -n1")

        # begin kKDu

        os.system("esearch ^" + pkg.split("/")[1] + "$ | awk 'NR==8 { print $0 }'")

        #end kKDu

```

This shows the URL of every new package, so if you run esync in a gnome-terminal you can very quick launching the link and get more information about the package.

----------

## haceye

Hi,

I already thougt about showing the homepage, too. This code is quite ugly, you sould take a look at the -o/--own option of esearch  :Wink: 

Anyway, thanks for the tip.

David

----------

## kKDu

I'm very confused.

I have portage-2.0.50-r1, python-2.3.3, esearch-0.6. 

If I run esync, eupdatedb needs about 50(!) minutes to finish.

With portage-2.0.49 it needs only 4 minutes!

----------

## Hackeron

http://david-peter.de/esync/esync  ----- link is dead, file no longer exists.

----------

## swimmer

 *Hackeron wrote:*   

> http://david-peter.de/esync/esync  ----- link is dead, file no longer exists.

 

It is now part of apps-portage/esearch - just emerge that and you'll have esync as well  :Wink: 

greetz

Stefan

----------

## Zaister

Great script! I have one small feature request, though. Would you be able to add an option for esync to use "emerge-webrsync" instead of "emerge sync" for those of us behind firewalls?

Regards,

Stefan.

----------

## haceye

Hi,

I have already implemented this option, you just have to wait for the next version of esearch.

David

----------

## shanghai

Hi everyone,

i've a feature request... I added a line

```
%daily * * mailsync | mailx -s "Ultimo mailsync"

```

to my crontab. I also changed two lines in esync to disable esearch from adding colours to the output, and renamed the change as mailsync (i just added -n in the options  :Smile:  ). But i can't really write python still, so could you please write a tweak of esync that:

a) prepares the output for an email (colours formatted in html or whatever)

b) orders the output in the way that the updates come up listed before than the new packages

c) it's possible to add the changelogs to the output

I'd write it on my own but as i said i can't write python scripts still.

Thank you.

Nice work!!!

Shanghai.

----------

## haceye

 *shanghai wrote:*   

> Hi everyone,
> 
> i've a feature request... I added a line
> 
> ```
> ...

 

Hi,

This feature is already implemented  :Wink:  (as webrsync, see above) Wait for the next version, than you can do

```
esync -n
```

 *shanghai wrote:*   

> But i can't really write python still, so could you please write a tweak of esync that:
> 
> a) prepares the output for an email (colours formatted in html or whatever)

 

Hm, maybe ... I will think about it.

 *shanghai wrote:*   

> b) orders the output in the way that the updates come up listed before than the new packages

 

I have already implemented a alphabetic sort for the next version, but your idea isn't bad, either.

 *shanghai wrote:*   

> c) it's possible to add the changelogs to the output

 

To see "version bump" 100 times?  :Smile: 

 *shanghai wrote:*   

> I'd write it on my own but as i said i can't write python scripts still.
> 
> Thank you.
> 
> Nice work!!!

 

Thanks,

David

----------

## shanghai

 *haceye wrote:*   

> 
> 
>  *shanghai wrote:*   c) it's possible to add the changelogs to the output 
> 
> To see "version bump" 100 times? 
> ...

 

I use to read the changelogs because if i don't see any change useful for me (example "~ppc stable" ... ) i add that package version to package.mask and i avoid an useless time consuming update...   :Cool: 

----------

## vificunero

Hi nice script. Thank's.

I wonder if it could be nice to insert a 

```
gensync bmg-main
```

option too.

I don't know python so I'd like to know how could I add it to esync.

Thank's again.

----------

## deepthink

I run esync from /etc/cron.daily/esync.cron and so I added a few options to make the email recieved from cron more readable.

```
esync (0.1) - Run 'emerge sync' and show updated ebuilds

 

Usage: esync [ options ]

Options:

  --help, -h

    Print this help message

 

  --bmg, -b

    Enable break my gentoo main tree

 

  --nocolor, -n

    Don't use ANSI codes for colored output

 

  --quiet, -q

    Print only summary

```

The complete script is here

Hope you like it.

----------

## juppe22

 *deepthink wrote:*   

> I run esync from /etc/cron.daily/esync.cron and so I added a few options to make the email recieved from cron more readable.
> 
> ```
> esync (0.1) - Run 'emerge sync' and show updated ebuilds
> 
> ...

 

This is really nice, but could you add bmg-gnome-current also...

```

gensync bmg-gnome-current

```

TIA

----------

## deepthink

Script updated at the same location.

Added the following flags.

```
  --gnome, -g

    Enable break my gentoo current gnome tree (gensync bmg-gnome-current)
```

----------

## juppe22

 *deepthink wrote:*   

> Script updated at the same location.
> 
> Added the following flags.
> 
> ```
> ...

 

Thank you!!  :Very Happy: 

----------

