コード例 #1
0
 def _notify_led(self):
     # @fixme Make sure this fails fast...
     # Set the status indicator to INSTALLING.
     from moab.linux.lib.statusled import StatusLED
     led = StatusLED()
     if led.waitForStart():
         led.setInstalling()
     return
コード例 #2
0
def install(options):
    led = StatusLED()
    led.setInstalling()

    # Current working directory.
    cwd = os.getcwd()

    # Get the package database.
    package_db = {}
    status = build_pkg_db(cwd, options, package_db)
    if status:
        led.setError()
        return status

    # Display the database if that's what the user wants.
    if options.show_list:
        display_pgk_db(options, package_db)
        return 0

    #
    # Get the list of packages to install from the command line.  If none were
    # specified, then install all available packages.
    #
    packages = options.arguments
    if 'rz.omega' in packages:
        for mfw_nbm in packages:
            if mfw_nbm.startswith('mfw.nbm'):
                break
        else:
            options.normal_message(
                "package 'rz.omega' is no longer a top level package, "
                "defaulting to 'mfw.nbm' for reverse compatibility.")
            packages.remove('rz.omega')
            packages.append('mfw.nbm')
    if not packages:
        packages = package_db.keys()
    #
    # Check for errors and build the dependency graph.
    #
    graph = DirectedGraph()
    for p in packages:
        if not p in package_db.keys():
            options.error_message("package '%s' not found" % p)
            return 1
        result = add_pkg_to_graph(graph, options, package_db, p)
        if result != 0:
            led.setError()
            return result

    #
    # Determine the package installation order.
    #
    try:
        sorted_packages = graph.sort()
    except ECycleDetected, e:
        options.error_message(str(e))
        led.setError()
        return 3
コード例 #3
0
    def _notify_led(self):
        # @fixme Make sure this fails fast...
        # Set the status indicator to INSTALLING.
        from moab.linux.lib.statusled import StatusLED

        led = StatusLED()
        if led.waitForStart():
            led.setInstalling()
        return
コード例 #4
0
ファイル: install.py プロジェクト: mcruse/monotone
def install( options ):
    led = StatusLED()
    led.setInstalling()

    # Current working directory.
    cwd = os.getcwd()

    # Get the package database.
    package_db = {}
    status = build_pkg_db( cwd, options, package_db )
    if status:
        led.setError()
        return status

    # Display the database if that's what the user wants.
    if options.show_list:
        display_pgk_db( options, package_db )
        return 0

    #
    # Get the list of packages to install from the command line.  If none were
    # specified, then install all available packages.
    #
    packages = options.arguments
    if 'rz.omega' in packages:
        for mfw_nbm in packages:
            if mfw_nbm.startswith('mfw.nbm'):
                break
        else:
            options.normal_message(
                "package 'rz.omega' is no longer a top level package, "
                "defaulting to 'mfw.nbm' for reverse compatibility."
                )
            packages.remove('rz.omega')
            packages.append('mfw.nbm')
    if not packages:
        packages = package_db.keys()
    #
    # Check for errors and build the dependency graph.
    #
    graph = DirectedGraph()
    for p in packages:
        if not p in package_db.keys():
            options.error_message( "package '%s' not found" % p )
            return 1
        result = add_pkg_to_graph( graph, options, package_db, p )
        if result != 0:
            led.setError()
            return result

    #
    # Determine the package installation order.
    #
    try:
        sorted_packages = graph.sort()
    except ECycleDetected, e:
        options.error_message( str( e ) )
        led.setError()
        return 3
コード例 #5
0
ファイル: status.py プロジェクト: mcruse/monotone
    def __init__( self ):
        CompositeNode.__init__( self )
        StatusLED.__init__( self )

        self.stateDict = { 'idle'      : self.setIdle,
                           'installing': self.setInstalling,
                           'running'   : self.setRunning,
                           'error'     : self.setError,
                           'panic'     : self.setPanic }

        self.isStarted = 0
        self.stateName = ''
        self.stateSetFunction = None
        self.sched_id = None
コード例 #6
0
    def __init__(self):
        CompositeNode.__init__(self)
        StatusLED.__init__(self)

        self.stateDict = {
            'idle': self.setIdle,
            'installing': self.setInstalling,
            'running': self.setRunning,
            'error': self.setError,
            'panic': self.setPanic
        }

        self.isStarted = 0
        self.stateName = ''
        self.stateSetFunction = None
        self.sched_id = None