summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Jamroot.jam2
-rw-r--r--gentoobrowse-api/service/depend.cpp5
-rw-r--r--gentoobrowse-api/service/maintenance/updatesProcessor.cpp4
-rw-r--r--gentoobrowse-api/service/maintenance/useGlobalProcessor.cpp3
-rw-r--r--gentoobrowse-api/service/maintenance/useGroupProcessor.cpp3
-rw-r--r--gentoobrowse-api/service/maintenance/useLocalProcessor.cpp4
-rw-r--r--gentoobrowse-api/service/utils/git.cpp6
-rw-r--r--gentoobrowse-api/unittests/testMaintenance.cpp6
8 files changed, 15 insertions, 18 deletions
diff --git a/Jamroot.jam b/Jamroot.jam
index dd2c8e9..c3877ef 100644
--- a/Jamroot.jam
+++ b/Jamroot.jam
@@ -86,5 +86,5 @@ project gentoobrowse-api : requirements
build-project gentoobrowse-api ;
pkg-config.import libxmlpp : : <name>libxml++-5.0 ;
-pkg-config.import glibmm : : <name>glibmm-2.4 ;
+pkg-config.import glibmm : : <name>glibmm-2.68 ;
diff --git a/gentoobrowse-api/service/depend.cpp b/gentoobrowse-api/service/depend.cpp
index 179eea0..28983d2 100644
--- a/gentoobrowse-api/service/depend.cpp
+++ b/gentoobrowse-api/service/depend.cpp
@@ -7,6 +7,7 @@
#include <lexer-regex.h>
#include <memory>
#include <optional>
+#include <ranges>
#include <string>
namespace Portage::Utils {
@@ -45,8 +46,8 @@ namespace Portage::Utils {
{
std::vector<T> rtn;
if (x) {
- Glib::Regex::split_simple(",", *x).assign_to(rtn);
- std::sort(rtn.begin(), rtn.end());
+ std::ranges::copy(Glib::Regex::split_simple(",", *x), std::back_inserter(rtn));
+ std::ranges::sort(rtn);
}
return rtn;
}
diff --git a/gentoobrowse-api/service/maintenance/updatesProcessor.cpp b/gentoobrowse-api/service/maintenance/updatesProcessor.cpp
index 9e4a536..2d49bdb 100644
--- a/gentoobrowse-api/service/maintenance/updatesProcessor.cpp
+++ b/gentoobrowse-api/service/maintenance/updatesProcessor.cpp
@@ -34,8 +34,8 @@ namespace Glib {
using namespace AdHoc::FileUtils;
namespace Gentoo::Service {
- static Glib::RefPtr<Glib::Regex> move
- = Glib::Regex::create(R"R(^move ([^/]+)/([^ ]+) ([^/]+)/(.+)$)R", Glib::RegexCompileFlags::REGEX_MULTILINE);
+ static auto move
+ = Glib::Regex::create(R"R(^move ([^/]+)/([^ ]+) ([^/]+)/(.+)$)R", Glib::Regex::CompileFlags::MULTILINE);
unsigned char
UpdatesProcessor::phase() const
diff --git a/gentoobrowse-api/service/maintenance/useGlobalProcessor.cpp b/gentoobrowse-api/service/maintenance/useGlobalProcessor.cpp
index 811cd87..7dfe5be 100644
--- a/gentoobrowse-api/service/maintenance/useGlobalProcessor.cpp
+++ b/gentoobrowse-api/service/maintenance/useGlobalProcessor.cpp
@@ -20,8 +20,7 @@ namespace Glib {
using namespace AdHoc::FileUtils;
namespace Gentoo::Service {
- static Glib::RefPtr<Glib::Regex> useDesc
- = Glib::Regex::create(R"(^([^#\s][^ ]*)\s+-\s+(.*)$)", Glib::RegexCompileFlags::REGEX_MULTILINE);
+ static auto useDesc = Glib::Regex::create(R"(^([^#\s][^ ]*)\s+-\s+(.*)$)", Glib::Regex::CompileFlags::MULTILINE);
unsigned char
UseGlobalProcessor::phase() const
diff --git a/gentoobrowse-api/service/maintenance/useGroupProcessor.cpp b/gentoobrowse-api/service/maintenance/useGroupProcessor.cpp
index 5d25a21..77e0ba3 100644
--- a/gentoobrowse-api/service/maintenance/useGroupProcessor.cpp
+++ b/gentoobrowse-api/service/maintenance/useGroupProcessor.cpp
@@ -28,8 +28,7 @@ namespace Glib {
namespace U = Gentoo::Utils;
namespace Gentoo::Service {
- static Glib::RefPtr<Glib::Regex> useDesc
- = Glib::Regex::create(R"(^([^#\s][^ ]*)\s+-\s+(.*)$)", Glib::RegexCompileFlags::REGEX_MULTILINE);
+ static auto useDesc = Glib::Regex::create(R"(^([^#\s][^ ]*)\s+-\s+(.*)$)", Glib::Regex::CompileFlags::MULTILINE);
unsigned char
UseGroupProcessor::phase() const
diff --git a/gentoobrowse-api/service/maintenance/useLocalProcessor.cpp b/gentoobrowse-api/service/maintenance/useLocalProcessor.cpp
index 17fead6..eabe4c0 100644
--- a/gentoobrowse-api/service/maintenance/useLocalProcessor.cpp
+++ b/gentoobrowse-api/service/maintenance/useLocalProcessor.cpp
@@ -24,8 +24,8 @@ namespace Glib {
using namespace AdHoc::FileUtils;
namespace Gentoo::Service {
- static Glib::RefPtr<Glib::Regex> useDesc = Glib::Regex::create(
- R"(^([^#\s][^/]*)/([^:]+):([^ ]+)\s+-\s+(.*)$)", Glib::RegexCompileFlags::REGEX_MULTILINE);
+ static auto useDesc = Glib::Regex::create(
+ R"(^([^#\s][^/]*)/([^:]+):([^ ]+)\s+-\s+(.*)$)", Glib::Regex::CompileFlags::MULTILINE);
unsigned char
UseLocalProcessor::phase() const
diff --git a/gentoobrowse-api/service/utils/git.cpp b/gentoobrowse-api/service/utils/git.cpp
index 140c41f..8fc7c4a 100644
--- a/gentoobrowse-api/service/utils/git.cpp
+++ b/gentoobrowse-api/service/utils/git.cpp
@@ -34,10 +34,8 @@ namespace Gentoo::Utils::Git {
{
auto opts = gitSafeGet(git_fetch_init_options, static_cast<unsigned int>(GIT_FETCH_OPTIONS_VERSION));
opts.prune = GIT_FETCH_PRUNE;
- opts.update_fetchhead = 1;
- auto localBranch = gitSafeGet(git_repository_head, git_reference_free, repo);
- auto localBranchName = gitSafeGet(git_branch_name, localBranch.get());
- auto refspec = RefSpec::get(localBranchName, git_remote_name(remote), remoteBranchName);
+ opts.update_fetchhead = GIT_REMOTE_UPDATE_FETCHHEAD;
+ auto refspec = RefSpec::get(remoteBranchName, git_remote_name(remote), remoteBranchName);
std::array<char *, 1> s {refspec.data()};
git_strarray refs = {s.data(), 1};
gitSafe(git_remote_fetch, remote, &refs, &opts, nullptr);
diff --git a/gentoobrowse-api/unittests/testMaintenance.cpp b/gentoobrowse-api/unittests/testMaintenance.cpp
index 42691e4..4f4179e 100644
--- a/gentoobrowse-api/unittests/testMaintenance.cpp
+++ b/gentoobrowse-api/unittests/testMaintenance.cpp
@@ -274,7 +274,7 @@ BOOST_AUTO_TEST_CASE(testUpdateGitRepository)
git_repository * repo;
BOOST_REQUIRE_EQUAL(0, git_repository_init(&repo, testRepo.c_str(), false));
git_remote * origin;
- BOOST_REQUIRE_EQUAL(0, git_remote_create(&origin, repo, "origin", "http://git.randomdan.homeip.net/git/portage"));
+ BOOST_REQUIRE_EQUAL(0, git_remote_create(&origin, repo, "origin", "https://git.randomdan.homeip.net/git/portage"));
git_remote_free(origin);
auto commitOid = create_initial_commit(repo);
std::array<char, GIT_OID_HEXSZ + 1> commit {};
@@ -287,9 +287,9 @@ BOOST_AUTO_TEST_CASE(testUpdateGitRepository)
insRepo->bindParamS(0, "testrepo");
insRepo->bindParamS(1, testRepo.string());
insRepo->bindParamS(2, "origin");
- insRepo->bindParamS(3, "master");
+ insRepo->bindParamS(3, "main");
insRepo->bindParamS(4, commit.data());
- insRepo->execute();
+ BOOST_REQUIRE_NO_THROW(insRepo->execute());
// Update
m->updateRepositories();