Skip to content

Commit 5bc3085

Browse files
authored
Merge branch 'OpenAtom-Linyaps:master' into master
2 parents 51ab872 + b24d059 commit 5bc3085

File tree

4 files changed

+2
-62
lines changed

4 files changed

+2
-62
lines changed

CMakeLists.txt

-8
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,6 @@ if(NOT ("${LINGLONG_VERSION}" STREQUAL ""))
2020
set(PROJECT_VERSION ${LINGLONG_VERSION})
2121
endif()
2222

23-
set(UAB_SPECIAL_INSTALL
24-
OFF
25-
CACHE BOOL "enable special installation of UAB")
26-
27-
if(${UAB_SPECIAL_INSTALL})
28-
add_definitions(-DUAB_SPECIAL_INSTALL)
29-
endif()
30-
3123
set(ENABLE_UAB
3224
OFF
3325
CACHE BOOL "enable building UAB")

external/http/src/apiClient.c

+1
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,7 @@ void apiClient_invoke(apiClient_t *apiClient,
437437
apiClient);
438438
curl_easy_setopt(handle, CURLOPT_HTTPHEADER, headers);
439439
curl_easy_setopt(handle, CURLOPT_VERBOSE, 0); // to get curl debug msg 0: to disable, 1L:to enable
440+
curl_easy_setopt(handle, CURLOPT_CONNECTTIMEOUT, 1);
440441

441442

442443
if(bodyParameters != NULL) {

libs/linglong/src/linglong/cli/cli.cpp

-54
Original file line numberDiff line numberDiff line change
@@ -464,18 +464,6 @@ int Cli::run([[maybe_unused]] CLI::App *subcommand)
464464
return -1;
465465
}
466466

467-
// NOTE: this is for the new behavior of 'll-cli install xxx.uab'.
468-
// old behavior: install->installFromFile->PM
469-
// new behavior: install->installFromFile->(Execute xxx.uab)->install->installFromFile->PM
470-
// We want to let uab check itself once by executing it. But executing uab will cause it to run
471-
// directly. So we use an environment variable to skip the running step. Another implementation
472-
// is to add other parameters to uab.
473-
auto skipRunning = qgetenv("LINGLONG_UAB_SKIP_RUNNING");
474-
if (!skipRunning.isEmpty()) {
475-
qDebug() << "LINGLONG_UAB_SKIP_RUNNING is set, skip running";
476-
return 0;
477-
}
478-
479467
auto userContainerDir = std::filesystem::path{ "/run/linglong" } / std::to_string(::getuid());
480468
if (auto ret = ensureDirectory(userContainerDir); !ret) {
481469
this->printer.printErr(ret.error());
@@ -997,53 +985,11 @@ void Cli::cancelCurrentTask()
997985
}
998986
}
999987

1000-
bool isUAB(const QString &file)
1001-
{
1002-
return file.endsWith(".uab");
1003-
}
1004-
1005988
int Cli::installFromFile(const QFileInfo &fileInfo, const api::types::v1::CommonOptions &options)
1006989
{
1007990
auto filePath = fileInfo.absoluteFilePath();
1008991
LINGLONG_TRACE(QString{ "install from file %1" }.arg(filePath));
1009992

1010-
#ifdef UAB_SPECIAL_INSTALL
1011-
if (fileInfo.suffix() == "uab") {
1012-
auto parent = getppid();
1013-
1014-
QFileInfo info(QString("/proc/%1/exe").arg(parent));
1015-
auto parentBin = info.symLinkTarget();
1016-
if (!isUAB(parentBin)) {
1017-
qDebug() << "The parent" << parentBin << "is not UAB.";
1018-
auto newParentBin = fileInfo.absoluteFilePath();
1019-
char *argv[] = { newParentBin.toLocal8Bit().data(), NULL };
1020-
1021-
QProcessEnvironment sysEnv = QProcessEnvironment::systemEnvironment();
1022-
QStringList envList = sysEnv.toStringList();
1023-
1024-
auto targetEnvc = envList.size();
1025-
std::vector<const char *> targetEnvv;
1026-
1027-
for (int i = 0; i < targetEnvc; i++) {
1028-
targetEnvv.push_back(envList.at(i).toLocal8Bit().constData());
1029-
}
1030-
targetEnvv.push_back("LINGLONG_UAB_SKIP_RUNNING=true");
1031-
targetEnvv.push_back(nullptr);
1032-
1033-
auto ret = ::execve(newParentBin.toLocal8Bit().constData(),
1034-
argv,
1035-
const_cast<char **>(targetEnvv.data()));
1036-
if (ret < 0) {
1037-
this->printer.printErr(
1038-
LINGLONG_ERRV(QString("execve %1 failed, errno: %2")
1039-
.arg(newParentBin, QString::fromStdString(::strerror(errno)))));
1040-
return ret;
1041-
}
1042-
}
1043-
qDebug() << "The parent is UAB:" << parentBin;
1044-
}
1045-
#endif
1046-
1047993
QDBusReply<QString> authReply = this->authorization();
1048994
if (!authReply.isValid() && authReply.error().type() == QDBusError::AccessDenied) {
1049995
auto args = QCoreApplication::instance()->arguments();

tools/openapi-c-libcurl-client/apiClient.c.mustache

+1
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,7 @@ void apiClient_invoke(apiClient_t *apiClient,
494494
apiClient);
495495
curl_easy_setopt(handle, CURLOPT_HTTPHEADER, headers);
496496
curl_easy_setopt(handle, CURLOPT_VERBOSE, 0); // to get curl debug msg 0: to disable, 1L:to enable
497+
curl_easy_setopt(handle, CURLOPT_CONNECTTIMEOUT, 1);
497498

498499
{{#hasAuthMethods}}
499500
{{#authMethods}}

0 commit comments

Comments
 (0)