Improved error messages in CmdParser. Clear all formats when deleting a device. Sign Mac package with default developer signature.

This commit is contained in:
Gonzalo Exequiel Pedone 2020-08-16 16:33:16 -03:00
parent 35b1b661d1
commit 1cea274ccd
No known key found for this signature in database
GPG key ID: B8B09E63E9B85BAF
4 changed files with 38 additions and 20 deletions

View file

@ -710,11 +710,12 @@ int AkVCam::CmdParserPrivate::removeDevice(const StringMap &flags,
return -1;
}
auto deviceId = args[1];
auto devices = this->m_ipcBridge.devices();
auto it = std::find(devices.begin(), devices.end(), args[1]);
auto it = std::find(devices.begin(), devices.end(), deviceId);
if (it == devices.end()) {
std::cerr << "Device doesn't exists." << std::endl;
std::cerr << "'" << deviceId << "' doesn't exists." << std::endl;
return -1;
}
@ -748,11 +749,12 @@ int AkVCam::CmdParserPrivate::showDeviceType(const StringMap &flags,
return -1;
}
auto deviceId = args[1];
auto devices = this->m_ipcBridge.devices();
auto it = std::find(devices.begin(), devices.end(), args[1]);
auto it = std::find(devices.begin(), devices.end(), deviceId);
if (it == devices.end()) {
std::cerr << "device doesn't exists." << std::endl;
std::cerr << "'" << deviceId << "' doesn't exists." << std::endl;
return -1;
}
@ -776,11 +778,12 @@ int AkVCam::CmdParserPrivate::showDeviceDescription(const StringMap &flags,
return -1;
}
auto deviceId = args[1];
auto devices = this->m_ipcBridge.devices();
auto it = std::find(devices.begin(), devices.end(), args[1]);
auto it = std::find(devices.begin(), devices.end(), deviceId);
if (it == devices.end()) {
std::cerr << "Device doesn't exists." << std::endl;
std::cerr << "'" << deviceId << "' doesn't exists." << std::endl;
return -1;
}
@ -803,10 +806,10 @@ int AkVCam::CmdParserPrivate::setDeviceDescription(const AkVCam::StringMap &flag
auto deviceId = args[1];
auto devices = this->m_ipcBridge.devices();
auto dit = std::find(devices.begin(), devices.end(), args[1]);
auto dit = std::find(devices.begin(), devices.end(), deviceId);
if (dit == devices.end()) {
std::cerr << "device doesn't exists." << std::endl;
std::cerr << "'" << deviceId << "' doesn't exists." << std::endl;
return -1;
}
@ -854,11 +857,12 @@ int AkVCam::CmdParserPrivate::showFormats(const StringMap &flags,
return -1;
}
auto deviceId = args[1];
auto devices = this->m_ipcBridge.devices();
auto it = std::find(devices.begin(), devices.end(), args[1]);
auto it = std::find(devices.begin(), devices.end(), deviceId);
if (it == devices.end()) {
std::cerr << "device doesn't exists." << std::endl;
std::cerr << "'" << deviceId << "' doesn't exists." << std::endl;
return -1;
}
@ -910,10 +914,10 @@ int AkVCam::CmdParserPrivate::addFormat(const StringMap &flags,
auto deviceId = args[1];
auto devices = this->m_ipcBridge.devices();
auto dit = std::find(devices.begin(), devices.end(), args[1]);
auto dit = std::find(devices.begin(), devices.end(), deviceId);
if (dit == devices.end()) {
std::cerr << "device doesn't exists." << std::endl;
std::cerr << "'" << deviceId << "' doesn't exists." << std::endl;
return -1;
}
@ -998,10 +1002,10 @@ int AkVCam::CmdParserPrivate::removeFormat(const StringMap &flags,
auto deviceId = args[1];
auto devices = this->m_ipcBridge.devices();
auto dit = std::find(devices.begin(), devices.end(), args[1]);
auto dit = std::find(devices.begin(), devices.end(), deviceId);
if (dit == devices.end()) {
std::cerr << "device doesn't exists." << std::endl;
std::cerr << "'" << deviceId << "' doesn't exists." << std::endl;
return -1;
}
@ -1041,10 +1045,10 @@ int AkVCam::CmdParserPrivate::removeFormats(const AkVCam::StringMap &flags,
auto deviceId = args[1];
auto devices = this->m_ipcBridge.devices();
auto dit = std::find(devices.begin(), devices.end(), args[1]);
auto dit = std::find(devices.begin(), devices.end(), deviceId);
if (dit == devices.end()) {
std::cerr << "device doesn't exists." << std::endl;
std::cerr << "'" << deviceId << "' doesn't exists." << std::endl;
return -1;
}
@ -1083,10 +1087,10 @@ int AkVCam::CmdParserPrivate::showConnections(const StringMap &flags,
auto deviceId = args[1];
auto devices = this->m_ipcBridge.devices();
auto dit = std::find(devices.begin(), devices.end(), args[1]);
auto dit = std::find(devices.begin(), devices.end(), deviceId);
if (dit == devices.end()) {
std::cerr << "device doesn't exists." << std::endl;
std::cerr << "'" << deviceId << "' doesn't exists." << std::endl;
return -1;
}

View file

@ -370,6 +370,8 @@ void AkVCam::Preferences::removeCamera(const std::string &path)
if (cameraIndex < 0)
return;
cameraSetFormats(cameraIndex, {});
auto nCameras = camerasCount();
deleteAllKeys("cameras." + std::to_string(cameraIndex));

View file

@ -73,6 +73,8 @@ class Deploy(deploy_base.DeployBase, tools.qt5.DeployToolsQt):
self.binaryInstallDir)
print('\nWritting build system information\n')
self.writeBuildInfo()
print('\nSigning bundle\n')
self.signPackage(self.appBundleDir)
def commitHash(self):
try:
@ -189,6 +191,16 @@ class Deploy(deploy_base.DeployBase, tools.qt5.DeployToolsQt):
return size
def signPackage(self, package):
process = subprocess.Popen(['codesign', # nosec
'--force',
'--sign',
'-',
package],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
process.communicate()
def createAppInstaller(self, mutex):
packagePath = self.createInstaller()

View file

@ -26,11 +26,11 @@ Component.prototype.createOperations = function()
component.addElevatedOperation("Execute",
"chmod",
"+x",
"a+x",
"@TargetDir@/@Name@.plugin/Contents/Resources/AkVCamAssistant");
component.addElevatedOperation("Execute",
"chmod",
"+x",
"a+x",
"@TargetDir@/@Name@.plugin/Contents/Resources/AkVCamManager");
}