Do let me know if you find any bugs. This script is pretty much going into a maintenance stage since I can't think of any more features to add. Adding --jobs was the most difficult for me, but now that is done, and the script is stable. I would like to keep it stable which implies I should leave it as it is.
Note (15 Mar 2015): Google Code is dead. But this script has been on GitHub for quite a few years already. So, no worries
- 20 Dec 2014: Version 20141220.Fix breakage due to changed emerge output.
- 05 Feb 2014: Version 20140205.Small update to change the color of time taken.
- 27 Apr 2013: Version 20130427.Small update for new make.conf location.
- 13 Apr 2012: Version 20120413.Small update to catch new emerge message.
- 06 Apr 2012: Version 20120406.Bugfix: Squash two rusty old bugs.
- 29 Jan 2012: Update zsh-completion instructions.
- 15 Jan 2012: Version 20120115.Bugfix: Reintroduce -q
- 30 Dec 2011: Version 20111230.Bugfix: Fix an infinite recursion.
- 24 Dec 2011: Version 20111224. Execute emerge directly on unsupported args. Fixed some bugs.
- 27 Nov 2011: Version 20111127. Show additional total ETA without binary emerge.
- 13 Nov 2011: Version 20111113. Remove -q from emerge command.
- 27 Aug 2011: Version 20110827. Small bugfixes.
- 26 Jun 2011: Version 20110617. Bugfix for --autounmask-write. Remove references to genlop on this post.
- 11 Jun 2011: Version 20110611. Support for --autounmask-write.
- 21 May 2011: Version 20110521. Mainly one bug fix when SHOW_MERGE_TIME=1
- 20 May 2011: Version 20110520. with --jobs support and some bug fixes. Updated screenshot and usage below
- 30 Apr 2011: Update to version 20110430.Should detect --color=n in command line now. Also bug fix for --resume. Updated screenshot.
- 22 Apr 2011: Version 20110422. Use own genlop function and remove genlop dependency.
- 07 Apr 2010: Version 20100407. Support for a pre-command and a post-command.
- 19 Jan 2010: Version 20100119. Support for multiple quietemerge instances.
- 22 Dec 2009: Update to version 20091222

- 02 Dec 2009: Allow environment variable to override config file setting.
- 21 Nov 2009: Some bug fixes and some security fixes.
- 20 Nov 2009: Respect --ask in EMERGE_DEFAULT_OPTS.
- 12 Nov 2009: Updated to version 20091112. Some bug fixes and some features

- 05 Nov 2009: Workaround the bug in genlop. Again.

- 02 Nov 2009: New config option. SHOW_MERGE_TIME. Set it to 1 to see the merge time for the package instead of "Done!"
Updated this version to workaround genlop bug. - 30 Oct 2009: One (not so obvious) bug fix.
- 29 Oct 2009: Version 20091029; support for --keep-going; numerous other changes.
- 26 Oct 2009: Include infon from a different script.
- 23 Oct 2009: New version with compatibility with --ask option of emerge; updated screenshot
- 17 Oct 2009: Added bash completion instruction. Updated zsh completion instruction.
I am providing this script on a request at the monthly screenshot thread. What this script does is provide a nice timer, while emerging packages. An example screenshot is present in http://oi51.tinypic.com/1ze820g.jpg
How it works:
The script first checks if the emerge process will proceed properly, by doing a emerge --pretend. If the emerge process was successful, then the script launches emerge via
Code: Select all
emerge <rest of the command line options> 2>&1 > output_file &The program then repeatedly checks the output of emerge in output_file for updates and accordingly provides an updated terminal output.
Usage:
The script should be run simply as if you were running emerge. To facilitate a nice output as shown in the screenshot, it is recommended to not use emerge options such as -c, -C, --sync. The script itself takes no arguments other than -h or --help and passes all the rest of the arguments to emerge.
If the script detects any unsupported arguments, then it simply executes emerge directly, bypassing all the other setup in the script.
This is a bash script and its compatibility with other shells is unknown. It will definitely produce tons of errors if called as some other shell. So you can either make the script executable (chmod 755 quietemerge) and then just run it as quietemerge, or run it as bash quietemerge.
In order to temporarily override the settings present in the config file, prepend the variable with an underscore _ and provide it as an environment variable.
An example where I want to override the config file setting temporarily, and/or provide a temporary setting:
Code: Select all
_DELAY=2 _MOUNT_TMPFS=1 quietemerge -a eselectDownload:
You can download the script from: https://github.com/ppurka/quietemerge/r ... 220.tar.gz
You can copy the file quietemerge after extracting it from the tarball.
The files have also been added retroactively to a git repository: http://code.google.com/p/quietemerge/source/list
Installation:
Copy the script to some directory which is in $PATH of root. Personally, I have it installed in /usr/local/sbin.
Dependencies:
Till version 20100407: The script depends on app-portage/genlop.
From version 20110422: No dependency on genlop.
Configuration:
The script creates a configuration file $HOME/.config/quietemerge.config. It is not mandatory to modify that file,- I have tried to keep the defaults sane. However, if you want to mount tmpfs on to /var/tmp/portage or run your favourite config update utility after emerge is over, I would suggest looking at the configuration file.
zsh completion configuration:
If you use zsh, then you can perform the following steps to enable command line autocompletion of quietemerge in zsh.
New instructions for zsh completion:
- Install zsh-completion:Add the following line to the beginning of your $HOME/.zshrc
Code: Select all
emerge zsh-completionCode: Select all
[[ -f /etc/zsh/zprofile ]] && . /etc/zsh/zprofile - Enable completion by running these commands
Code: Select all
echo "compdef quietemerge=emerge" >> $HOME/.zshrc exec zsh
- Install zsh-completion:Add the following line to the beginning of your $HOME/.zshrc
Code: Select all
emerge zsh-completionCode: Select all
[[ -f /etc/zsh/zprofile ]] && . /etc/zsh/zprofile - Create a directory /etc/zsh/zsh-functions
- Enable this new zsh completion path:
Code: Select all
echo "fpath=( /etc/zsh/zsh-functions \$fpath )" >> /etc/zsh/zprofile - Download _quietemerge and copy it to /etc/zsh/zsh-functions
- Run the commands
Code: Select all
env-update exec zsh
Bash completion configuration:
Command line completion of quietemerge in bash can be achieved by executing the following steps.
- Install and configure gentoo-bashcomp
Code: Select all
emerge gentoo-bashcomp eselect bashcomp enable --global base eselect bashcomp enable --global gentoo - Add the following two lines to the end of your $HOME/.bashrc
Code: Select all
[[ -f /etc/profile.d/bash-completion.sh ]] && source /etc/profile.d/bash-completion.sh complete -o filenames -F _emerge quietemerge - Run the command
Code: Select all
exec bash
Git: 1. On Google Code. 2. On Github
README: 1. On Google Code. 2. On Github.
Version: 20141220




