Reintroduce script_base_dirname variable and rename base_dirname into cache_dirname.