make env-update a bit more flexible by adding a --no-ldconfig option
[portage.git] / bin / env-update
1 #!/usr/bin/python -O
2 # Copyright 1999-2006 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4 # $Id: /var/cvsroot/gentoo-src/portage/bin/env-update,v 1.9 2004/10/04 13:56:50 vapier Exp $
5
6 import os,sys
7 os.environ["PORTAGE_CALLER"] = "env-update"
8 sys.path = ["/usr/lib/portage/pym"]+sys.path
9
10 def usage(status):
11         print "Usage: env-update"
12         print ""
13         print "See the env-update(1) man page for more info"
14         sys.exit(status)
15
16 if "-h" in sys.argv or "--help" in sys.argv:
17         usage(0)
18
19 makelinks=1
20 if "--no-ldconfig" in sys.argv:
21         makelinks=0
22         sys.argv.pop(sys.argv.index("--no-ldconfig"))
23
24 if len(sys.argv) > 1:
25         print "!!! Invalid command line options!\n"
26         usage(1)
27
28 import portage
29 portage.env_update(makelinks)