public static function removeFiles($ficlist, $distpath)
    {
        $distdir = Fs\DirUtils::normalizeDir($distpath);

        $fs = self::getFileSystem($distdir);

        $script = file($ficlist);

        $currentdestdir = '';

        foreach ($script as $nbline => $line) {
            ++$nbline;
            if (preg_match(';^(cd|rmd)?\s+([a-zA-Z0-9\/.\-_]+)\s*$;m', $line, $m)) {
                if ($m[1] == 'rmd') {
                    $fs->removeDir(Fs\DirUtils::normalizeDir($m[2]));
                } elseif ($m[1] == 'cd') {
                    $currentdestdir = Fs\DirUtils::normalizeDir($m[2]);
                } else {
                    if ($m[2] == '') {
                        throw new \Exception("$ficlist : file required on line $nbline \n");
                    }

                    $destfile = $currentdestdir.$m[2];
                    if (!file_exists($distdir.$destfile)) {
                        if (self::$verbose) {
                            echo "cannot remove $destfile. It doesn't exist anymore.\n";
                        }
                        continue;
                    }
                    if (self::$verbose) {
                        echo 'remove  '.$destfile."\n";
                    }
                    if (!$fs->removeFile($destfile)) {
                        throw new \Exception(" $ficlist: cannot remove file ".$m[2].", line $nbline \n");
                    }
                }
            } elseif (preg_match("!^\s*(\#.*)?$!", $line)) {
                // we ignore comments
            } else {
                throw new \Exception("$ficlist : syntax error on line $nbline \n");
            }
        }
    }