Example #1
0
def main():
    # Prepare CLI arguments
    parser = argparse.ArgumentParser(formatter_class=RawTextHelpFormatter)
    parser.name = 'PackBacker'
    parser.description = 'PackBacker is a light tool to download and install 3rd party libraries.'
    parser.add_argument("job", help="Job file.")
    parser.epilog = 'PackBacker  Copyright (C) 2014  Christof Pieloth\n' \
                    'This program comes with ABSOLUTELY NO WARRANTY; see LICENSE file.\n' \
                    'This is free software, and you are welcome to redistribute it\n' \
                    'under certain conditions; see LICENSE file.'
    args = parser.parse_args()

    UtilsUI.print('PackBacker started ...')
    # Read job
    job = Job.read_job(args.job)

    # Execute job
    errors = 0
    if job:
        errors += job.execute()
    else:
        UtilsUI.print_error('Could not create job. Cancel installations!')
        errors += 1

    if errors == 0:
        UtilsUI.print('PackBacker finished.')
        return 0
    else:
        UtilsUI.print_error('PackBacker finished with errors: ' + str(errors))
        return 1
Example #2
0
 def _pre_install(self):
     UtilsUI.print(
         "NOTE: Before installing PCL from source, please try to install prebuilt binaries:"
     )
     UtilsUI.print("      http://www.pointclouds.org/downloads/")
     success = True
     success = success and Utils.check_program("git", "--version")
     success = success and Utils.check_program("cmake", "--version")
     success = success and Utils.check_program("make", "--version")
     if not Utils.check_program("g++",
                                "--version") and not Utils.check_program(
                                    "c++", "--version"):
         success = False
     return success