Skip to content

Commit

Permalink
Support builds with no package output
Browse files Browse the repository at this point in the history
This feature adds support for buildfiles which include a build()
function but produces no package output (no files installed in $PKG).
  • Loading branch information
lundmar committed Dec 1, 2014
1 parent f19ad0a commit c7c001e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/buildfile.cc
Expand Up @@ -43,6 +43,7 @@ CBuildFile::CBuildFile(string filename)
{
CBuildFile::filename = filename;
CBuildFile::build = false;
CBuildFile::have_pkg = false;
CBuildFile::visited = false;
CBuildFile::depth = 0;
CBuildFile::description = "";
Expand Down
12 changes: 9 additions & 3 deletions src/buildmanager.cc
Expand Up @@ -93,6 +93,10 @@ void CBuildThread::operator()()

Do("build", buildfile);

// Test for produced package output
if (FileExist(PackagePath(buildfile)))
buildfile->have_pkg = true;

// Remove buildfile from active builds
pthread_mutex_lock(&active_builds_mutex);
BuildManager.active_builds.remove(buildfile);
Expand All @@ -109,8 +113,8 @@ void CBuildThread::operator()()
BuildOutputPrint();
pthread_mutex_unlock(&cout_mutex);

// Don't add last build
if (buildfile != last_build)
// Don't add last build or builds which have no package output
if ((buildfile != last_build) && buildfile->have_pkg)
{
pthread_mutex_lock(&add_mutex);

Expand Down Expand Up @@ -144,7 +148,9 @@ void CBuildThread::operator()()
Cursor.reset_ymaxpos();
BuildOutputPrint();
pthread_mutex_unlock(&cout_mutex);
} else
}

if (buildfile == last_build)
{
// Clear line if it is the last build
pthread_mutex_lock(&cout_mutex);
Expand Down
1 change: 1 addition & 0 deletions src/include/buildgear/buildfile.h
Expand Up @@ -59,6 +59,7 @@ class CBuildFile : public CUtility
string layer;
char *control_fifo;
bool build;
bool have_pkg;
bool visited;
int depth;
float x;
Expand Down

0 comments on commit c7c001e

Please sign in to comment.