3 from zeroinstall
import zerostore
, SafeException
4 from zeroinstall
.zerostore
import cli
, manifest
6 # Make all system files world-readable, even if the default
7 # system umask is more strict.
10 # import logging; logging.getLogger().setLevel(logging.DEBUG)
13 if 'ENV_NOT_CLEARED' in os
.environ
:
14 raise SafeException("Environment not cleared. Check your sudoers file.")
15 if os
.environ
['HOME'] == 'Unclean':
16 raise SafeException("$HOME not set. Check your sudoers file has 'always_set_home' turned on for zeroinst.")
18 if len(sys
.argv
) != 2:
19 raise cli
.UsageError('Usage: %s DIGEST' % sys
.argv
[0])
20 required_digest
= sys
.argv
[1]
22 manifest_data
= file('.manifest', 'rb').read()
24 stores
= zerostore
.Stores()
26 manifest
.copy_tree_with_verify('.', '/var/cache/0install.net/implementations',
27 manifest_data
, required_digest
)
28 except (IOError, SafeException
) as ex
:
29 print >>sys
.stderr
, ex