~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: mattgiuca
  • Date: 2007-12-21 03:28:08 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:121
setup: build and install now read command line options

Show diffs side-by-side

added added

removed removed

Lines of Context:
436
436
    return 0
437
437
 
438
438
def build(args):
439
 
    dry = False     # Set to True later if --dry
 
439
    # Get "dry" variable from command line
 
440
    (opts, args) = getopt.gnu_getopt(args, "n", ['dry'])
 
441
    opts = dict(opts)
 
442
    dry = '-n' in opts or '--dry' in opts
 
443
 
 
444
    if dry:
 
445
        print "Dry run (no actions will be executed\n"
440
446
 
441
447
    # Compile the trampoline
442
448
    action_runprog('gcc', ['-Wall', '-o', 'trampoline/trampoline',
464
470
    return 0
465
471
 
466
472
def install(args):
467
 
    # Create the target directory
468
 
    nojail = False  # Set to True later if --nojail
469
 
    dry = False     # Set to True later if --dry
 
473
    # Get "dry" and "nojail" variables from command line
 
474
    (opts, args) = getopt.gnu_getopt(args, "n", ['dry', 'nojail'])
 
475
    opts = dict(opts)
 
476
    dry = '-n' in opts or '--dry' in opts
 
477
    nojail = '--nojail' in opts
 
478
 
 
479
    if dry:
 
480
        print "Dry run (no actions will be executed\n"
470
481
 
471
482
    if not dry and os.geteuid() != 0:
472
483
        print >>sys.stderr, "Must be root to run install"