Compare commits
5 Commits
aa140fd4ec
...
53faaeb396
| Author | SHA1 | Date | |
|---|---|---|---|
| 53faaeb396 | |||
| 2928a690b8 | |||
| 220ce225f8 | |||
| ac89c499ab | |||
| 8d1c97da04 |
@@ -211,14 +211,14 @@ PRIVATE_DEFINITION_START(PIProcess)
|
|||||||
while (1) {
|
while (1) {
|
||||||
# ifdef WINDOWS
|
# ifdef WINDOWS
|
||||||
DWORD available = 0;
|
DWORD available = 0;
|
||||||
bytes_read = 0;
|
bytes_read = 0;
|
||||||
PeekNamedPipe(pipes[pipe_type][PipeRead], nullptr, 0, nullptr, &available, nullptr);
|
PeekNamedPipe(pipes[pipe_type][PipeRead], nullptr, 0, nullptr, &available, nullptr);
|
||||||
if (available > 0) {
|
if (available > 0) {
|
||||||
BOOL ok = ReadFile(pipes[pipe_type][PipeRead],
|
BOOL ok = ReadFile(pipes[pipe_type][PipeRead],
|
||||||
read_buffer.data(offset),
|
read_buffer.data(offset),
|
||||||
piMini(available, read_buffer.size() - offset),
|
piMini(available, read_buffer.size() - offset),
|
||||||
&bytes_read,
|
&bytes_read,
|
||||||
nullptr);
|
nullptr);
|
||||||
if (!ok) bytes_read = 0;
|
if (!ok) bytes_read = 0;
|
||||||
}
|
}
|
||||||
# else
|
# else
|
||||||
@@ -244,7 +244,7 @@ PRIVATE_DEFINITION_START(PIProcess)
|
|||||||
# else
|
# else
|
||||||
sz = ::write(pipes[StdIn][PipeWrite], data.data(), data.size());
|
sz = ::write(pipes[StdIn][PipeWrite], data.data(), data.size());
|
||||||
# endif
|
# endif
|
||||||
return sz == data.size_s();
|
return sz == (SizeType)data.size_s();
|
||||||
}
|
}
|
||||||
|
|
||||||
PRIVATE_DEFINITION_END(PIProcess)
|
PRIVATE_DEFINITION_END(PIProcess)
|
||||||
@@ -354,7 +354,7 @@ void PIProcess::startProc(bool detached) {
|
|||||||
if (WIFEXITED(exit_code)) {
|
if (WIFEXITED(exit_code)) {
|
||||||
exec_finished = WEXITSTATUS(exit_code) != 127;
|
exec_finished = WEXITSTATUS(exit_code) != 127;
|
||||||
}
|
}
|
||||||
pid_ = 0;
|
pid_ = 0;
|
||||||
if (!detached) PRIVATE->pid = pid_;
|
if (!detached) PRIVATE->pid = pid_;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -462,13 +462,15 @@ bool procDpkg(const PIString & l) {
|
|||||||
PIFile::FileInfo fi;
|
PIFile::FileInfo fi;
|
||||||
fi.path = l;
|
fi.path = l;
|
||||||
PIString cmd = dpkg + dpkgdir + " -S " + fi.name() + ign_err_suffix;
|
PIString cmd = dpkg + dpkgdir + " -S " + fi.name() + ign_err_suffix;
|
||||||
// PICout(true) << cmd;
|
// PICout(true) << "** dpkg:" << cmd;
|
||||||
PIString vs = execute(cmd).trim();
|
PIString vs = execute(cmd).trim();
|
||||||
if (!vs.isEmpty()) {
|
if (!vs.isEmpty()) {
|
||||||
PIStringList lines = vs.split('\n').reverse();
|
PIStringList lines = vs.split('\n').reverse();
|
||||||
for (auto l: lines) {
|
for (auto l: lines) {
|
||||||
l = l.left(l.find(":"));
|
auto sl = l;
|
||||||
if (!l.isEmpty() && !l.endsWith("-cross")) all_deps << l;
|
l = l.left(l.find(":"));
|
||||||
|
if (!l.isEmpty() && !l.endsWith("-cross") && !l.contains(' ')) all_deps << l;
|
||||||
|
// PICout(true) << "** found \"" << l << "\" in \"" << sl << "\"";
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user