process rules

def process(dest, rulefiles):
    """process rules"""
    deploy = False
    while not rulefiles.empty():
        rulefile = rulefiles.get()
        base = os.path.basename(rulefile)
        dest = os.path.join(dest, base)
        if os.path.exists(dest):
            # check if older
            oldtime = os.stat(rulefile).st_mtime
            newtime = os.stat(dest).st_mtime
            if oldtime > newtime:
                deploy = True
                deploy_file(rulefile, dest)
        else:
            deploy = True
            deploy_file(rulefile, dest)
    return deploy