#include <cstdio>
#include <cstdlib>
#include <functional>
+#include <regex>
#include "tpk/tpk_app_query_interface.h"
bf::directory_iterator(dir), bf::directory_iterator())) {
if (dir_entry.path().string().find("smoke") != std::string::npos &&
bf::is_directory(dir_entry)) {
- if (Uninstall(dir_entry.path().filename().string(), is_readonly,
- RequestResult::NORMAL) != ci::AppInstaller::Result::OK) {
- LOG(ERROR) << "Cannot uninstall smoke test app: "
- << dir_entry.path().filename().string();
+ std::string package = dir_entry.path().filename().string();
+ std::regex pkg_regex("smoke[a-zA-Z]{3,}[1-9]{2,}");
+ if (std::regex_match(package, pkg_regex)) {
+ if (Uninstall(package, is_readonly, RequestResult::NORMAL) !=
+ ci::AppInstaller::Result::OK) {
+ LOG(ERROR) << "Cannot uninstall smoke test app: " << package;
+ }
}
}
}