Skip to content

Commit

Permalink
Refuse to install on buster, part 2.
Browse files Browse the repository at this point in the history
  • Loading branch information
rerdavies committed Sep 13, 2024
1 parent 3057d78 commit 6839e5f
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 284 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
build/

#VS Code config files.
.vscode/
# .vscode/ Sort this out later. .gitignore-ing an already tracked file doesn't actually work.
#settings

Testing/
Expand Down
12 changes: 11 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Edge",
"port": 9222,
"request": "attach",
"type": "msedge",
"webRoot": "${workspaceFolder}"
},
{
"name": "(gdb) Attach",
"type": "cppdbg",
Expand Down Expand Up @@ -308,8 +315,11 @@
// Resolved by CMake Tools:
"program": "${command:cmake.launchTargetPath}",
"args": [
"--prefix",
"/usr/sbin",
"--nosudo", // run without sudo (which will fail because of perms, but allow us to debug deeper into install code.)
"--disable-p2p"
"--install"

//"--get-current-port"
//"--install"
//"--enable-p2p" , "CA", "PiPedalTest","12345678","14"
Expand Down
115 changes: 0 additions & 115 deletions src/Lv2Log.cpp

This file was deleted.

167 changes: 0 additions & 167 deletions src/Lv2Log.hpp

This file was deleted.

31 changes: 31 additions & 0 deletions src/SetWifiConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,39 @@ const std::string &pipedal::GetWifiConfigWlanAddress()
return gWlanAddress;
}

static bool gNetworkManagerTestExecuted = false;
static bool gUsingNetworkManager = false;

void pipedal::PretendNetworkManagerIsInstalled()
{
gNetworkManagerTestExecuted = true;
gUsingNetworkManager = true;
}
bool pipedal::UsingNetworkManager()
{
if (gNetworkManagerTestExecuted)
{
return gUsingNetworkManager;
}
bool bResult = false;
auto result = sysExecForOutput("systemctl","is-active NetworkManager");
if (result.exitCode == EXIT_SUCCESS)
{
std::string text = result.output.erase(result.output.find_last_not_of(" \n\r\t")+1);
if (text == "active")
{
bResult = true;
} else if (text == "inactive")
{
bResult = false;
} else {
throw std::runtime_error(SS("UsingNetworkManager: unexpected result (" << text << ")"));
}
gNetworkManagerTestExecuted = true;
gUsingNetworkManager = bResult;
return bResult;
}

// does the neworkManager service path exists?
return std::filesystem::exists(NETWORK_MANAGER_SERVICE_PATH);
}
Expand Down
2 changes: 2 additions & 0 deletions src/SetWifiConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ namespace pipedal {
void OnWifiInstallComplete();

bool UsingNetworkManager();
void PretendNetworkManagerIsInstalled();

} // namespace.

0 comments on commit 6839e5f

Please sign in to comment.