Compare commits

5 Commits

Author SHA1 Message Date
53faaeb396 Merge pull request 'deploy_tool_debug' (#191) from deploy_tool_debug into master
Reviewed-on: #191
2025-09-10 16:08:38 +03:00
2928a690b8 remove debug 2025-09-10 16:07:19 +03:00
220ce225f8 dpkg spaces not valid 2025-09-10 16:05:26 +03:00
ac89c499ab start debug 2025-09-10 15:55:19 +03:00
8d1c97da04 PIProcess code brush 2025-09-10 15:54:55 +03:00
2 changed files with 12 additions and 10 deletions

View File

@@ -211,14 +211,14 @@ PRIVATE_DEFINITION_START(PIProcess)
while (1) {
# ifdef WINDOWS
DWORD available = 0;
bytes_read = 0;
bytes_read = 0;
PeekNamedPipe(pipes[pipe_type][PipeRead], nullptr, 0, nullptr, &available, nullptr);
if (available > 0) {
BOOL ok = ReadFile(pipes[pipe_type][PipeRead],
read_buffer.data(offset),
piMini(available, read_buffer.size() - offset),
&bytes_read,
nullptr);
read_buffer.data(offset),
piMini(available, read_buffer.size() - offset),
&bytes_read,
nullptr);
if (!ok) bytes_read = 0;
}
# else
@@ -244,7 +244,7 @@ PRIVATE_DEFINITION_START(PIProcess)
# else
sz = ::write(pipes[StdIn][PipeWrite], data.data(), data.size());
# endif
return sz == data.size_s();
return sz == (SizeType)data.size_s();
}
PRIVATE_DEFINITION_END(PIProcess)
@@ -354,7 +354,7 @@ void PIProcess::startProc(bool detached) {
if (WIFEXITED(exit_code)) {
exec_finished = WEXITSTATUS(exit_code) != 127;
}
pid_ = 0;
pid_ = 0;
if (!detached) PRIVATE->pid = pid_;
}
}

View File

@@ -462,13 +462,15 @@ bool procDpkg(const PIString & l) {
PIFile::FileInfo fi;
fi.path = l;
PIString cmd = dpkg + dpkgdir + " -S " + fi.name() + ign_err_suffix;
// PICout(true) << cmd;
// PICout(true) << "** dpkg:" << cmd;
PIString vs = execute(cmd).trim();
if (!vs.isEmpty()) {
PIStringList lines = vs.split('\n').reverse();
for (auto l: lines) {
l = l.left(l.find(":"));
if (!l.isEmpty() && !l.endsWith("-cross")) all_deps << l;
auto sl = 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;
}
}