Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 111865 - Patch to make eix-sync (eix-0.5.0_beta) write to a /var/log/ file when --quiet is set
Summary: Patch to make eix-sync (eix-0.5.0_beta) write to a /var/log/ file when --quie...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Benedikt Böhm (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-08 05:35 UTC by Jeroen Roovers (RETIRED)
Modified: 2005-11-17 16:02 UTC (History)
1 user (show)

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


Attachments
eix-0.5.0_beta-sync-log.patch (eix-0.5.0_beta-sync-log.patch,330 bytes, patch)
2005-11-08 05:36 UTC, Jeroen Roovers (RETIRED)
Details | Diff
eix-0.5.0_beta-sync-log.patch (eix-0.5.0_beta-sync-log.patch,798 bytes, patch)
2005-11-08 06:17 UTC, Jeroen Roovers (RETIRED)
Details | Diff
eix-0.5.0_pre1-eix-sync-log-man.patch (eix-0.5.0_pre1-eix-sync-log-man.patch,838 bytes, patch)
2005-11-16 19:37 UTC, Jeroen Roovers (RETIRED)
Details | Diff
eix-0.5.0_pre1-eix-sync-log-man.patch (eix-0.5.0_pre1-eix-sync-log-man.patch,818 bytes, patch)
2005-11-16 20:18 UTC, Jeroen Roovers (RETIRED)
Details | Diff
eix-0.5.0_pre1-eix-sync-log-man.patch (eix-0.5.0_pre1-eix-sync-log-man.patch,844 bytes, patch)
2005-11-16 20:27 UTC, Jeroen Roovers (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jeroen Roovers (RETIRED) gentoo-dev 2005-11-08 05:35:17 UTC
In the current eix-sync script, with the --quiet option set, the output of '
emerge --{metadata,sync}' is written to /dev/null, which is a rather bad idea 
for any situation where you want to automate running eix-sync. This patch 
writes the output of 'emerge --{metadata,sync}' to /var/log/emerge-sync.log as '
eupdatedb --sync' does, so that admins can check where it all went wrong when 
it has all gone wrong.


Reproducible: Always
Steps to Reproduce:


Actual Results:  



Expected Results:
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2005-11-08 05:36:10 UTC
Created attachment 72449 [details, diff]
eix-0.5.0_beta-sync-log.patch
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2005-11-08 05:50:03 UTC
Improved patch coming soon. 8-)
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2005-11-08 06:17:06 UTC
Created attachment 72454 [details, diff]
eix-0.5.0_beta-sync-log.patch
Comment 4 Emil Beinroth 2005-11-13 07:56:03 UTC
The logfile should be cleaned at startup, so it's guaranteed that the file is
clean and the error-messages should tell the admin about the logfile ("A logfile
was created in blabla" or similar).
just my 2 cents :)
Comment 5 Jeroen Roovers (RETIRED) gentoo-dev 2005-11-13 18:14:02 UTC
(In reply to comment #4)
> The logfile should be cleaned at startup, so it's guaranteed that the file is
> clean and the error-messages should tell the admin about the logfile ("A 
logfile
> was created in blabla" or similar).
> just my 2 cents :)

The second patch does that...
Comment 6 Jeroen Roovers (RETIRED) gentoo-dev 2005-11-13 18:17:04 UTC
Er....

(In reply to comment #5)
> (In reply to comment #4)
> > The logfile should be cleaned at startup, so it's guaranteed that the file 
is
> > clean >8

> 
> The second patch does that...
> 


>8 and the error-messages should tell the admin about the logfile ("A 
> logfile
> > was created in blabla" or similar).

What does "tell the admin" mean? Write something to the syslog?
Comment 7 Jeroen Roovers (RETIRED) gentoo-dev 2005-11-16 19:37:05 UTC
(In reply to comment #4)
> The logfile should be cleaned at startup, so it's guaranteed that the file is
> clean and the error-messages should tell the admin about the logfile ("A 
logfile
> was created in blabla" or similar).
> just my 2 cents :)

Let me get this straight. First of all, the patch *already* makes sure the 
logfile is cleaned using:

   echo > /var/log/eix-sync.log

If you wish, you might of course replace echo with something like

   echo "
>>> $(date)
>>> $(uname -n)" >> /var/log/eix-sync.log

for good measure, so that none of the old messages are lost.

Other than that, I wouldn't know what you'd want to specifically tell every 
admin in the output that they couldn't learn elsewhere.

'emerge --sync|--metadata' both have their share of output, all of which is 
logged in /var/log/eix-sync.log. IMHO explaining this on at most two extra 
lines in eix(1) is a lot cleaner than adding fluff to the output that's sent to 
a console or through a mail system (when used in a cron job) to the admin.

With the current script as patched, the output to the console/mail/
whateveryoufancy might look like this, when used with at(1):

-------------------------------------
From: "root" <xyz@xyz.example.com>
To: root
Subject: Output from your job        3
Date: Thu, 17 Nov 2005 00:55:23 +0100

 * Running emerge --metadata ...                                          [ ok ]
 * Running update-eix ...                                                 [ ok ]
Diffing databases (10291 - 10284 packages)
    << app-mobilephone/ussp-push (none): OBEX object push client for Linux
    << dev-php/onphp (none): onPHP is the GPL'ed multi-purpose object-oriented 
PHP framework.
    << media-video/ati-drivers (none): Ati precompiled drivers for r350, r300, r
250 and r200 chipsets
    << media-video/ati-drivers-extra (none): Ati precompiled drivers extra 
application
    << media-video/drip (none): A DVD to DIVX convertor frontend
    << sci-libs/charm (none): Charm++ is a message-passing parallel language 
and runtime system.
    << sys-libs/libkudzu-knoppix (none): Knoppix version of the Red Hat 
hardware detection tools
-------------------------------------

That's all the information you need, I think. If something goes wrong with 
update-eix or emerge --sync|--metadata, it's logged to /var/log/eix-sync.log 
and the script returns this to stdout anyway: "Problems running [command]". I 
have a patch for the man page, if you like...
Comment 8 Jeroen Roovers (RETIRED) gentoo-dev 2005-11-16 19:37:33 UTC
Created attachment 73050 [details, diff]
eix-0.5.0_pre1-eix-sync-log-man.patch
Comment 9 Jeroen Roovers (RETIRED) gentoo-dev 2005-11-16 20:18:41 UTC
Created attachment 73054 [details, diff]
eix-0.5.0_pre1-eix-sync-log-man.patch

This one applies to the eix.1.in in the source instead of to the installed one.
8-)
Comment 10 Jeroen Roovers (RETIRED) gentoo-dev 2005-11-16 20:27:07 UTC
Created attachment 73056 [details, diff]
eix-0.5.0_pre1-eix-sync-log-man.patch

This time, the patch even corrects the assumption that eix-sync only runs
'emerge --sync' (and not 'emerge --metadata' as well if asked nicely).
Comment 11 Emil Beinroth 2005-11-17 04:13:55 UTC
Wops, you're right and I'am wrong .. sorry!
I applied the patches upstream, thanks.
Comment 12 Benedikt Böhm (RETIRED) gentoo-dev 2005-11-17 16:02:54 UTC
fixed in 0.5.0_pre2