Beispiel #1
0
    def mark_artifact_sources_dirty(self, artifacts):
        """Given a list of artifacts this will mark all of their sources
        as dirty so that they will be rebuilt next time.
        """
        sources = set()
        for artifact in artifacts:
            for source in artifact.sources:
                sources.add(self.to_source_filename(source))

        if not sources:
            return

        con = self.connect_to_database()
        try:
            cur = con.cursor()
            cur.executemany(
                """
                insert or replace into dirty_sources (source) values (?)
            """,
                [(x,) for x in sources],
            )
            con.commit()
        finally:
            con.close()

        reporter.report_dirty_flag(True)
Beispiel #2
0
 def operation(con):
     sources = [self.build_state.to_source_filename(x)
                for x in self.sources]
     cur = con.cursor()
     cur.execute('''
         delete from dirty_sources where source in (%s)
     ''' % ', '.join(['?'] * len(sources)), list(sources))
     cur.close()
     reporter.report_dirty_flag(False)
Beispiel #3
0
 def operation(con):
     sources = [self.build_state.to_source_filename(x)
                for x in self.sources]
     cur = con.cursor()
     cur.execute('''
         delete from dirty_sources where source in (%s)
     ''' % ', '.join(['?'] * len(sources)), list(sources))
     cur.close()
     reporter.report_dirty_flag(False)
Beispiel #4
0
    def clear_dirty_flag(self):
        """Clears the dirty flag for all sources."""
        sources = [self.build_state.to_source_filename(x)
                   for x in self.sources]
        con = self.get_connection()
        cur = con.cursor()
        cur.execute('''
            delete from dirty_sources where source in (%s)
        ''' % ', '.join(['?'] * len(sources)), sources)
        cur.close()

        reporter.report_dirty_flag(False)
Beispiel #5
0
        def operation(con):
            sources = set()
            for source in self.sources:
                sources.add(self.build_state.to_source_filename(source))

            if not sources:
                return

            cur = con.cursor()
            cur.executemany('''
                insert or replace into dirty_sources (source) values (?)
            ''', [(x,) for x in sources])
            cur.close()

            reporter.report_dirty_flag(True)
Beispiel #6
0
        def operation(con):
            sources = set()
            for source in self.sources:
                sources.add(self.build_state.to_source_filename(source))

            if not sources:
                return

            cur = con.cursor()
            cur.executemany('''
                insert or replace into dirty_sources (source) values (?)
            ''', [(x,) for x in sources])
            cur.close()

            reporter.report_dirty_flag(True)
Beispiel #7
0
    def clear_dirty_flag(self):
        """Clears the dirty flag for all sources."""
        sources = [self.build_state.to_source_filename(x) for x in self.sources]
        con = self.get_connection()
        cur = con.cursor()
        cur.execute(
            """
            delete from dirty_sources where source in (%s)
        """
            % ", ".join(["?"] * len(sources)),
            sources,
        )
        cur.close()

        reporter.report_dirty_flag(False)
Beispiel #8
0
    def mark_artifact_sources_dirty(self, artifacts):
        """Given a list of artifacts this will mark all of their sources
        as dirty so that they will be rebuilt next time.
        """
        sources = set()
        for artifact in artifacts:
            for source in artifact.sources:
                sources.add(self.to_source_filename(source))

        if not sources:
            return

        con = self.connect_to_database()
        try:
            cur = con.cursor()
            cur.executemany('''
                insert or replace into dirty_sources (source) values (?)
            ''', [(x,) for x in sources])
            con.commit()
        finally:
            con.close()

        reporter.report_dirty_flag(True)