def validate_component_name(component_name, allow_slashes=False):
    """Check that component name starts with an alphanumeric character, and
    disalllow all non-alphanumeric characters except underscore, hyphen, colon,
    and period in component names.
    """
    allowed = '_', '-', ':', '.'
    if allow_slashes:
        allowed += '/',
    if len(component_name) == 0:
        return False
    if not component_name[0].isalnum():
        return False
    for c in component_name:
        if c not in allowed and not c.isalnum():
            return False
    return True
