2 # Copyright 2010-2013 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
7 sys.path.insert(0, os.environ['PORTAGE_PYM_PATH'])
9 portage._internal_caller = True
10 portage._disable_legacy_globals()
14 if args and isinstance(args[0], bytes):
15 for i, x in enumerate(args):
16 args[i] = portage._unicode_decode(x, errors='strict')
18 # Make locks quiet since unintended locking messages displayed on
19 # stdout would corrupt the intended output of this program.
20 portage.locks._quiet = True
21 lock_obj = portage.locks.lockfile(args[0], wantnewlockfile=True)
22 sys.stdout.write('\0')
25 portage.locks.unlockfile(lock_obj)
26 return portage.os.EX_OK
28 if __name__ == "__main__":
29 rval = main(sys.argv[1:])