Beispiel #1
0
def main(args):
    module = args.moduleset[args.package]
    try:
        fetch(module)
        return 0
    except Exception, e:
        print red(e)
        return 1
Beispiel #2
0
def main(args):
    module = args.moduleset[args.package]
    try:
        fetch(module)
        return 0
    except Exception, e:
        print red(e)
        return 1
Beispiel #3
0
def main(args):
    for mod_name in sorted(args.moduleset):
        try:
            module = args.moduleset[mod_name]
            print blue("Fetching '%s' from '%s'" % (module.name, module['Source']))
            fetch(module)
        except Exception, e:
            print red(e)
            status = 1
Beispiel #4
0
def main(args):
    for mod_name in args.moduleset:
        try:
            module = args.moduleset[mod_name]
            print blue("Building '%s'" % module.name)
            build(module, args)
        except Exception, e:
            print red("Exception %s: %s" % (e.__class__.__name__, e))
            return 1
Beispiel #5
0
def main(args):
    for mod_name in sorted(args.moduleset):
        try:
            module = args.moduleset[mod_name]
            print blue("Fetching '%s' from '%s'" %
                       (module.name, module['Source']))
            fetch(module)
        except Exception, e:
            print red(e)
            status = 1
Beispiel #6
0
def main(args):
    # Get the user name.
    # Remember we are supposed to be ran with sudo
    user = env.get_user_name()
    uid = env.get_uid()

    if not user or not uid:
        print "You should run 'novabuild prepare' using sudo."
        return 1

    ########################################################################

    print blue("Configuring APT")

    # Here we save a custom APT configuration, for a space-saving non-interactive
    # apt-get.

    f = file('/etc/apt/apt.conf.d/95novabuild', 'w')
    f.write("""
    APT::Get::Assume-Yes "true";
    APT::Get::AllowUnauthenticated "true";
    APT::Get::Clean "always";
    APT::Install-Recommends "false";
    """)
    f.close()

    ########################################################################

    print blue("Configuring sudo")

    f = file('/etc/sudoers.d/95novabuild', 'w')
    f.write("%s    ALL = NOPASSWD: ALL" % user)
    f.close()

    os.chmod('/etc/sudoers.d/95novabuild', 0440)

    ########################################################################

    print blue("Installing software required for packaging")

    # What packages should we install?
    to_install = (
        'dpkg-dev',
        'debhelper',
        'dpatch',
        'kernel-package',
        'fakeroot',
        'bzip2',
        'dialog',
        'vim',
    )

    code = system('apt-get install ' + ' '.join(to_install), root=True)
    if code != 0:
        print red("Could not install additional packages")
        return 1

    ########################################################################

    print blue("Bootstraping done")
    return 0