]> git.tdb.fi Git - builder.git/commitdiff
Add some output to get_package_source
authorMikko Rasa <tdb@tdb.fi>
Fri, 15 Aug 2008 18:14:03 +0000 (18:14 +0000)
committerMikko Rasa <tdb@tdb.fi>
Fri, 15 Aug 2008 18:14:03 +0000 (18:14 +0000)
Redirect stderr to /dev/null in run_command

source/builder.cpp
source/misc.cpp

index 58288ffbfa096a71e4dfbe82fe360c207824f7b7..b77b8fc3d453f17d755115cdc23f480f3be99b63 100644 (file)
@@ -481,6 +481,9 @@ and if it fails, the package path is searched for matches.
 */
 FS::Path Builder::get_package_location(const string &name)
 {
+       if(verbose>=3)
+               cout<<"Looking for package "<<name<<'\n';
+
        // Try to get source directory with pkgconfig
        list<string> argv;
        argv.push_back("pkg-config");
@@ -504,6 +507,8 @@ FS::Path Builder::get_package_location(const string &name)
                                        pkg_dirs.push_back(full);
                        }
                }
+               if(verbose>=3)
+                       cout<<pkg_dirs.size()<<" packages found in path\n";
        }
 
        bool msp=!name.compare(0, 3, "msp");
index a299f0e54b6f1f36c05d338d8c5397eef36495e8..ab61d9f1fe0f38058917de552b6d8bfc3b0deb19 100644 (file)
@@ -7,6 +7,7 @@ Distributed under the LGPL
 
 #include <iostream>
 #include <sys/wait.h>
+#include <fcntl.h>
 #include <cstdlib>
 #include <cstring>
 #include "misc.h"
@@ -37,7 +38,10 @@ string run_command(const StringList &argv)
 
                close(pfd[0]);
                dup2(pfd[1], 1);
-               dup2(pfd[1], 2);
+               close(pfd[1]);
+               int devnull=open("/dev/null", O_WRONLY);
+               dup2(devnull, 2);
+               close(devnull);
 
                execvp(argv_[0], argv_);
                ::exit(1);