Skip to content

Commit

Permalink
update filter
Browse files Browse the repository at this point in the history
- drop cppunit filter (no longer in dmd sources)

- always filter out hidden files (leading .)
  • Loading branch information
MartinNowak committed Jul 25, 2014
1 parent e944775 commit 4d57e86
Showing 1 changed file with 25 additions and 24 deletions.
49 changes: 25 additions & 24 deletions create_dmd_release/create_dmd_release.d
Expand Up @@ -857,11 +857,10 @@ void createRelease(string branch)
if(exists( osExtrasDir)) copyDir( osExtrasDir, releaseDir);

// Copy sources (should cppunit be omitted??)
auto dmdSrcFilter = (string a) => !a.match("^cppunit[^/]*/");
copyDirVersioned(cloneDir~"/dmd/src", releaseDir~"/dmd2/src/dmd", a => dmdSrcFilter(a));
copyDirVersioned(cloneDir~"/dmd/src", releaseDir~"/dmd2/src/dmd");
copyDirVersioned(cloneDir~"/dmd/ini", releaseDir~"/dmd2");
copyDirVersioned(cloneDir~"/druntime", releaseDir~"/dmd2/src/druntime", a => a != ".gitignore");
copyDirVersioned(cloneDir~"/phobos", releaseDir~"/dmd2/src/phobos", a => a != ".gitignore");
copyDirVersioned(cloneDir~"/druntime", releaseDir~"/dmd2/src/druntime");
copyDirVersioned(cloneDir~"/phobos", releaseDir~"/dmd2/src/phobos");

// druntime/doc doesn't get generated on Windows with --only-64, I don't know why.
if(exists(cloneDir~"/druntime/doc"))
Expand Down Expand Up @@ -1300,33 +1299,35 @@ void copyDir(string src, string dest, bool delegate(string) filter = null)
{
auto relativePath = entry.name.replace("\\", "/").chompPrefix(src);

if(!filter || filter(relativePath))
if (relativePath.baseName.startsWith(".") ||
filter !is null && !filter(relativePath))
{
verboseMsg(" " ~ displayPath(relativePath));
verboseMsg(" Skipping: " ~ displayPath(relativePath));
continue;
}

auto destPath = buildPath(dest, relativePath);
auto srcPath = buildPath(src, relativePath);
verboseMsg(" " ~ displayPath(relativePath));

version(Posix)
{
if(entry.isSymlink)
{
run("cp -P "~srcPath~" "~destPath);
continue;
}
}
auto destPath = buildPath(dest, relativePath);
auto srcPath = buildPath(src, relativePath);

if(entry.isDir)
makeDir(destPath);
else
version(Posix)
{
if(entry.isSymlink)
{
makeDir(dirName(destPath));
copy(srcPath, destPath);
copyAttributes(srcPath, destPath);
run("cp -P "~srcPath~" "~destPath);
continue;
}
}
else if(filter)
verboseMsg(" Skipping: " ~ displayPath(relativePath));

if(entry.isDir)
makeDir(destPath);
else
{
makeDir(dirName(destPath));
copy(srcPath, destPath);
copyAttributes(srcPath, destPath);
}
}
}

Expand Down

0 comments on commit 4d57e86

Please sign in to comment.