Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Discussion & Documentation Documentation, Tips & Tricks
  • Search

little script for displaying the emerge status...

Unofficial documentation for various parts of Gentoo Linux. Note: This is not a support forum.
Post Reply
Advanced search
8 posts • Page 1 of 1
Author
Message
mortus
n00b
n00b
User avatar
Posts: 21
Joined: Fri Nov 28, 2003 8:19 am
Location: Austria

little script for displaying the emerge status...

  • Quote

Post by mortus » Tue Jul 27, 2004 3:02 pm

...just play'in around with genlop... :wink:

Code: Select all

#!/bin/bash
# tiny little script which shows you the status of emerge
#
clear
echo 'Show whats going on:'
echo '--------------------'
echo 'last 10 emerges...'
echo ''
genlop -l | tail -n 11
echo '--------------------'
echo 'emerging now...'
genlop --current
PKGNOW=`genlop --current | grep "*" | cut -d " " -f 3`
PKGREADY=`echo "[ebuild] $PKGNOW" | genlop --pretend | grep "Estimated"`
echo "    $PKGREADY"
echo '--------------------'
exit 0
Regular Matter, Dark Matter, Wassa Matter...
Top
GentooBox
Veteran
Veteran
User avatar
Posts: 1168
Joined: Sun Jun 22, 2003 10:52 am
Location: Denmark

  • Quote

Post by GentooBox » Tue Jul 27, 2004 7:22 pm

just a note:

genlop -c or genlop --current dont work on AMD64 for some reason.
Encrypt, lock up everything and duct tape the rest
Top
AgenT
Apprentice
Apprentice
User avatar
Posts: 280
Joined: Sun May 18, 2003 4:17 pm

  • Quote

Post by AgenT » Wed Jul 28, 2004 7:23 pm

Thanks, small but useful :)
Top
mil0t
n00b
n00b
User avatar
Posts: 62
Joined: Tue Jun 24, 2003 7:46 am

  • Quote

Post by mil0t » Tue Dec 20, 2005 8:12 pm

Here i wrote in python similar to mortus.

Code: Select all

#!/usr/bin/python
##############################################
# Gentoo emerge status			     #	
# This script requires genlop,		     #	
# you can install it using `emerge genlop`.  #
# Milot <milot@mymyah.com>	     #
##############################################

import sys
import os
import time

#colors
color={}
color["r"]="\x1b[31;01m"
color["g"]="\x1b[32;01m"
color["b"]="\x1b[34;01m"
color["0"]="\x1b[0m"


def r(txt):
	return color["r"]+txt+color["0"]
def g(txt):
	return color["g"]+txt+color["0"]
def b(txt):
	return color["b"]+txt+color["0"]

# View Options
def view_opt():	
			
	print
	print 
	print g("full-info - View full information for emerged package")
	print g("cur - View current emerge")
	print g("hist - View history of emerged packages by day")
	print g("hist-all - View full list of history of emerged packages")
	print g("rsync - View rsync history")
	print g("time - View time for compiling a package")
	print g("time-unmerged - View time of unmerged packages")
	print
	command = raw_input(r("Press Enter to return to main "))
	if command == '':
		c()
		program()
	else:
		c()
		program()

# system command 'clear'
def c():
	os.system('clear')


# Base program
def program():
	c()
	print g("Gentoo emerge status script")
	print ("---------------------------")
	print

	print ("1]") + g(" Enter options")
	print ("2]") + g(" View options")
	print ("3]") + g(" Exit")
	print
	command = input("[]> ")


	if command == 1:	
		print
		print r("""First of all  you must view options to know what to use, you can enter option name ( if you know any ) or type `view-opt` to view options.""")
		print
		time.sleep(2)
		command = raw_input(b("Option name: "))
		if (command == 'view-opt' or command == 'VIEW-OPT'):
			view_opt()


		elif command == 'full-info':
			c()
			print g("Full information for a single package")
			print ("-------------------------------------")
			print
			print b("Enter package name")
			command=raw_input("> ")
			c()
			print g("Full information for package"), b(command)
			print ("-----------------------------------")
			print
			pack=['genlop -i '+command]
			pack_=" ".join(pack)
			os.system(pack_)
			print
			print r("Press Enter to return to main.")
			command=raw_input()
			if command == '':
				c()
				program()

			else:
				c()
				program()


		elif command == 'cur':
			if command == 'cur':
				c()
				print g("Current emerge session(s)")
				print ("-------------------------")
				print
				print b("Listing current emerge session(s)")
				print
				time.sleep(1)
				os.system('genlop -c')
				print
				print r("Press Enter to return to main.")
				command = raw_input()
				if (command == ''):
					c()
					program()

				else:
					c()
					program()

				
		elif command == 'hist':
			if command == 'hist':
				c()
				print g("History of merged packages")
				print ("---------------------------")
				print
				time.sleep(1)
				print b("Enter number of how many days ago you want to see the packages")
				command = raw_input("> ")
				c()
				print g("Packages merged "+b(command)+ g(" day(s) before"))
				print ("------------------------------------")
				pkg=['genlop --list --date '+command+' days ago']
				pkg_=" ".join(pkg)
				os.system(pkg_)
				print
				print r("Press Enter to return to main.")
				command = raw_input()
				if command == '':
					c()
					program()

				else:
					c()
					program()


		elif command == 'hist-all':
				c()
				print g("Full history of merged individual packages")
				print ("--------------------------------------")
				print
				print b("Do you want to view individual package?")
				print r("YES/NO?")
				command = raw_input("> ")
				print
				if (command == 'yes' or command == 'YES'):
					print g("Enter package name")
					command = raw_input("> ")
					print
					pkg=['genlop -l | grep '+command+ ' | less']
					pkg_=" ".join(pkg)
					os.system(pkg_)
					print
					print r("Press Enter to return to main")
					command = raw_input()
					if command == '':
						c()
						program()
					else:
						c()
						program()
				
				elif (command == 'no' or command == 'NO'):
					pkg=['genlop -l | less']
					pkg_=" ".join(pkg)
					os.system(pkg_)
					print
					print r("Press Enter to return to main")
					command = raw_input()
					if command == '':
						c()
						program()
		
					else:
						c()
						program()

				else:
					c()
					program()
		

		elif command == 'rsync':
			print g("RSYNC updates")
			print
			print
			print
			print b("You can view rsynced time by year!")
			print r("Do you want this script to do it for you? (yes/no)")
			command = raw_input("> ")
			if (command == 'yes' or command == 'YES'):
				print
				print g("Enter year i.e"), b("2005")
				print
				command = raw_input("> ")
				rsync=['genlop -r | grep '+command+' | less']
				rsync_=" ".join(rsync)
				os.system(rsync_)
				print
				print r("Press Enter to return to main.")
				c()
				program()
			elif (command == 'no' or command == 'NO'):
				os.system('genlop -r | less')
				print
				print r("Press Enter to return to main.")
				command = raw_input()
				if command == '':
					c()
					program()
		
				else:
					c()
					program()
				
		elif command == 'time':
			c()
			print g("Time of package compilation")
			print ("---------------------------")
			print
			print

			print b("Enter package name")
			pkg_name = raw_input("> ")
			pkg=['emerge '+pkg_name+' -p | genlop -p | less']
			pkg_=" ".join(pkg)
			os.system(pkg_)
			print
			print r("Press Enter to return to main")
			time.sleep(2)
			command = raw_input()
			if command == '':
				c()
				program()
		
			else:
				c()
				program()


		elif command == 'time-unmerged':
			c()
			print g("Show when package(s) is/when is unmerged")
			print ("----------------------------------------")
			print
			
			print b("Enter package name: ")
			name = raw_input("> ")
			pkg=['genlop -u '+name]
			pkg_=" ".join(pkg)
			os.system(pkg_)
			print
			print r("Press Enter to return to main")
			time.sleep(2)
			command = raw_input()
			if command == '':
				c()
				program()
			
			else:
				c()
				program()

		else:
			print
			print r("Wrong Selection!")
			time.sleep(2)
			c()
			program()
			

	elif command == 2:
		view_opt()
		command = raw_input(r("Press Enter to return to main "))
		if command == '':
			c()
			program()
		else:
			c()
			program()


	elif command == 3:
		print
		print b("Thank you for using this script")
		print
		time.sleep(1)
		sys.exit()

	else:
		print
		print r("Wrong Selection!")
		time.sleep(2)
		c()
		program()
		command = ("")
	

program()


It's copyleft-ed :P
Last edited by mil0t on Fri Aug 16, 2024 4:26 pm, edited 1 time in total.
emerge --pretend love | genlop --pretend
Top
LoSeR_5150
Guru
Guru
User avatar
Posts: 455
Joined: Sun Mar 20, 2005 9:19 pm
Location: San Francisco, CA

  • Quote

Post by LoSeR_5150 » Tue Dec 20, 2005 9:01 pm

i use the amd64 acrh and it is true genlop-0-.30.3 doesnt execute genlop -c correctly, says no working merge found... however the unstable genlop-0.30.5 works perfectly...
Opteron 1356@2.4Ghz
6GB DDR2 800Mhz
128MB Quadro NVS 210S
640GB Western Digital HD
*Gentoo-x86_64-2.6.30-r1

Opteron175@2.2GHz
2GB DDR 400MHz
256MB Quadro 1400 Go
(2) 80GB Segate HDs: RAID0
*Gentoo-x86_64-2.6.30-r1
Top
thoffmeyer
Apprentice
Apprentice
User avatar
Posts: 208
Joined: Sun Apr 11, 2004 3:46 am
Location: GMT -5 Hours

  • Quote

Post by thoffmeyer » Fri Dec 23, 2005 3:06 am

Nice scripts :)
Conrad Guide, Current Maintainer

Join us on IRC
Server: irc.freenode.net
Channel: #conrad
Top
redhook
n00b
n00b
Posts: 18
Joined: Mon Jan 24, 2005 12:59 pm

  • Quote

Post by redhook » Fri Dec 23, 2005 12:04 pm

mil0t wrote:Here i wrote in python similar to mortus.
I get this error when I run the script

Code: Select all

hatori ~ # ./genstat.py
  File "./genstat.py", line 219
    elif (command Selection!")
                          ^
SyntaxError: invalid syntax
Top
mil0t
n00b
n00b
User avatar
Posts: 62
Joined: Tue Jun 24, 2003 7:46 am

  • Quote

Post by mil0t » Fri Dec 23, 2005 3:32 pm

redhook wrote:
mil0t wrote:Here i wrote in python similar to mortus.
I get this error when I run the script

Code: Select all

hatori ~ # ./genstat.py
  File "./genstat.py", line 219
    elif (command Selection!")
                          ^
SyntaxError: invalid syntax
It has some problems while i copied and paste it here, i uploaded the script and you can get it here:
http://milot.albanianit.org/genstat.py


the script works here on my computer (watch below):

Code: Select all

root@monsterpenguin milot # python -v genstat.py
# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
# /usr/lib/python2.4/site.pyc matches /usr/lib/python2.4/site.py
import site # precompiled from /usr/lib/python2.4/site.pyc
# /usr/lib/python2.4/os.pyc matches /usr/lib/python2.4/os.py
import os # precompiled from /usr/lib/python2.4/os.pyc
import posix # builtin
# /usr/lib/python2.4/posixpath.pyc matches /usr/lib/python2.4/posixpath.py
import posixpath # precompiled from /usr/lib/python2.4/posixpath.pyc
# /usr/lib/python2.4/stat.pyc matches /usr/lib/python2.4/stat.py
import stat # precompiled from /usr/lib/python2.4/stat.pyc
# /usr/lib/python2.4/UserDict.pyc matches /usr/lib/python2.4/UserDict.py
import UserDict # precompiled from /usr/lib/python2.4/UserDict.pyc
# /usr/lib/python2.4/copy_reg.pyc matches /usr/lib/python2.4/copy_reg.py
import copy_reg # precompiled from /usr/lib/python2.4/copy_reg.pyc
# /usr/lib/python2.4/types.pyc matches /usr/lib/python2.4/types.py
import types # precompiled from /usr/lib/python2.4/types.pyc
# /usr/lib/python2.4/warnings.pyc matches /usr/lib/python2.4/warnings.py
import warnings # precompiled from /usr/lib/python2.4/warnings.pyc
# /usr/lib/python2.4/linecache.pyc matches /usr/lib/python2.4/linecache.py
import linecache # precompiled from /usr/lib/python2.4/linecache.pyc
import encodings # directory /usr/lib/python2.4/encodings
# /usr/lib/python2.4/encodings/__init__.pyc matches /usr/lib/python2.4/encodings/__init__.py
import encodings # precompiled from /usr/lib/python2.4/encodings/__init__.pyc
# /usr/lib/python2.4/codecs.pyc matches /usr/lib/python2.4/codecs.py
import codecs # precompiled from /usr/lib/python2.4/codecs.pyc
import _codecs # builtin
# /usr/lib/python2.4/encodings/aliases.pyc matches /usr/lib/python2.4/encodings/aliases.py
import encodings.aliases # precompiled from /usr/lib/python2.4/encodings/aliases.pyc
# /usr/lib/python2.4/encodings/ascii.pyc matches /usr/lib/python2.4/encodings/ascii.py
import encodings.ascii # precompiled from /usr/lib/python2.4/encodings/ascii.pyc
Python 2.4.2 (#1, Nov 23 2005, 00:45:24)
[GCC 3.4.4 (Gentoo 3.4.4, ssp-3.4.4-1.0, pie-8.7.8)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
dlopen("/usr/lib/python2.4/lib-dynload/time.so", 2);
import time # dynamically loaded from /usr/lib/python2.4/lib-dynload/time.so




Gentoo emerge status script
---------------------------

1] Enter options
2] View options
3] Exit

[]> 3

Thank you for using this script

# clear __builtin__._
# clear sys.path
# clear sys.argv
# clear sys.ps1
# clear sys.ps2
# clear sys.exitfunc
# clear sys.exc_type
# clear sys.exc_value
# clear sys.exc_traceback
# clear sys.last_type
# clear sys.last_value
# clear sys.last_traceback
# clear sys.path_hooks
# clear sys.path_importer_cache
# clear sys.meta_path
# restore sys.stdin
# restore sys.stdout
# restore sys.stderr
# cleanup __main__
# cleanup[1] site
# cleanup[1] encodings
# cleanup[1] _codecs
# cleanup[1] zipimport
# cleanup[1] warnings
# cleanup[1] encodings.ascii
# cleanup[1] codecs
# cleanup[1] types
# cleanup[1] signal
# cleanup[1] linecache
# cleanup[1] posix
# cleanup[1] encodings.aliases
# cleanup[1] time
# cleanup[1] exceptions
# cleanup[2] copy_reg
# cleanup[2] posixpath
# cleanup[2] os.path
# cleanup[2] stat
# cleanup[2] UserDict
# cleanup[2] os
# cleanup sys
# cleanup __builtin__
# cleanup ints: 8 unfreed ints in 1 out of 3 blocks
# cleanup floats
root@monsterpenguin milot #
emerge --pretend love | genlop --pretend
Top
Post Reply

8 posts • Page 1 of 1

Return to “Documentation, Tips & Tricks”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Authors
Gentoo is a trademark of the Gentoo Foundation, Inc. and of Förderverein Gentoo e.V.
The contents of this document, unless otherwise expressly stated, are licensed under the CC-BY-SA-4.0 license.
The Gentoo Name and Logo Usage Guidelines apply.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy