def apply_pack_permissions(pack_path):
    """
    Recursively apply permission 775 to pack and its contents.
    """
    # These mask is same as mode = 775
    mode = stat.S_IRWXU | stat.S_IRWXG | stat.S_IROTH | stat.S_IXOTH
    os.chmod(pack_path, mode)

    # Yuck! Since os.chmod does not support chmod -R walk manually.
    for root, dirs, files in os.walk(pack_path):
        for d in dirs:
            os.chmod(os.path.join(root, d), mode)
        for f in files:
            os.chmod(os.path.join(root, f), mode)

    Recursively apply permission 775 to pack and its contents.
    
st2common/st2common/util/pack_management.py