#******************************************************************** # # Copyright (C) 2005-2006 Hari Krishna Dara # # This file is part of p4admin. # # p4admin is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # p4admin is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # #******************************************************************* import logging import string import config import utils import scheduler import notify log = logging.getLogger(__name__) def verifyLocalP4Server(): utils.updateScriptFiles() utils.startPerforceLocal() log.info("-------Started verification...") # # Checkpoint # Verify the depot, p4 verify. # NOTE: We use ///... instead of //... to allow any filters set in # the client view to be effective. This allows us to exclude files that we # know are missing, but there is no way to fix them (this is rare, unless # those files are really not needed, like in age old retired codelines). if config.p4ClientLocal: view = config.p4ClientLocal+'/' else: view = '' result = utils.execute('p4 '+config.p4OptionsLocal+' verify -q //'+view+ '...') # Currently verify never return a failure, so a non-zero exit would mean # that p4 itself couldn't be run. The only indication that verify failed is # a non-empty output. if utils.shell_error != 0: notify.sendError("verify failed to run: " + result) result = string.strip(result) if len(result) != 0: notify.sendError('verify returned some failures: ' + result) log.info("-------Finished verification.") return len(result) if __name__ == "__main__": verifyLocalP4Server()