def METHOD_NAME(sudo):
    print('Removing old build and distribution directories...')
    print("""The distribution is built as root, so the files have the correct
    permissions when installed by the user.  Chown them to user for removal.""")
    if os.path.exists(BUILD_DIR):
        cmd = 'chown -R %s %s' % (getuser(), BUILD_DIR)
        if sudo:
            cmd = 'sudo ' + cmd
        shellcmd(cmd)
        shutil.rmtree(BUILD_DIR)
    if os.path.exists(DIST_DIR):
        cmd = 'sudo chown -R %s %s' % (getuser(), DIST_DIR)
        if sudo:
            cmd = 'sudo ' + cmd
        shellcmd(cmd)
        shutil.rmtree(DIST_DIR)