mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-09 07:59:19 +00:00
trivial: standalone: Check argument make sense with command
This commit is contained in:
parent
e25675de04
commit
f7d8250e9d
@ -220,13 +220,17 @@ def run_installation (directory, verbose, uninstall):
|
|||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
args = parse_args()
|
args = parse_args()
|
||||||
if 'extract' in args.command:
|
if 'extract' in args.command:
|
||||||
|
if args.uninstall:
|
||||||
|
error ("Uninstall argument doesn't make sense with command %s" % args.command)
|
||||||
if args.directory is None:
|
if args.directory is None:
|
||||||
error ("No directory specified")
|
error ("No directory specified")
|
||||||
if not os.path.exists (args.directory):
|
if not os.path.exists (args.directory):
|
||||||
print ("Creating %s" % args.directory)
|
print ("Creating %s" % args.directory)
|
||||||
os.makedirs (args.directory)
|
os.makedirs (args.directory)
|
||||||
unzip (args.directory)
|
unzip (args.directory)
|
||||||
elif 'install' in args.command:
|
else:
|
||||||
|
if args.directory:
|
||||||
|
error ("Directory argument %s doesn't make sense with command %s" % (args.directory, args.command))
|
||||||
if os.getuid() != 0:
|
if os.getuid() != 0:
|
||||||
error ("This tool must be run as root")
|
error ("This tool must be run as root")
|
||||||
with tempfile.TemporaryDirectory (prefix='fwupd') as target:
|
with tempfile.TemporaryDirectory (prefix='fwupd') as target:
|
||||||
|
Loading…
Reference in New Issue
Block a user