Accepting request 1038939 from multimedia:apps

- Update to 1.12.0:
  * Support for NFO files as additional resources: Set up in resources
    and place nfo-files (https://kodi.wiki/view/NFO_files/Templates) next to your media files.
  * Tweaking mimetypes for clients
  * Editing Flags in web UI
  * More statistics on web UI
  * Add support for ip subnets in client config
  * Defaults for virtual container upnp class
  * Configuration for SQLite database modes
  * Offline mode for initial scan large libraries
- Add disable-test.patch until https://github.com/gerbera/gerbera/issues/2755
  is fixed. These two tests (UpnpClientsTest.getHostName and ParserTest.SortTrackNumber)
  were added with this release.
- Remove 2635.patch
- Remove fix-fmt9.patch

OBS-URL: https://build.opensuse.org/request/show/1038939
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/gerbera?expand=0&rev=9
This commit is contained in:
Dominique Leuenberger 2022-11-30 13:59:59 +00:00 committed by Git OBS Bridge
commit 1759047d43
9 changed files with 65 additions and 181 deletions

View File

@ -1,134 +0,0 @@
From ae46ab4684bd31df4537475dc33234ae85c9b1e6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Karl=20Strau=C3=9Fberger?= <k_straussberger@netzland.net>
Date: Tue, 17 May 2022 18:13:55 +0200
Subject: [PATCH] This and that
May even solve:
---
src/metadata/resolution.cc | 4 ++--
src/upnp_xml.cc | 4 ++--
src/util/process_executor.cc | 3 ++-
src/util/tools.cc | 18 +++++++++++++++---
test/content/test_resolution.cc | 6 +++---
5 files changed, 24 insertions(+), 11 deletions(-)
diff --git a/src/metadata/resolution.cc b/src/metadata/resolution.cc
index 031cb5788..476c644e5 100644
--- a/src/metadata/resolution.cc
+++ b/src/metadata/resolution.cc
@@ -33,7 +33,7 @@ Resolution::Resolution(const std::string& string)
if (!parts[0].empty()) {
auto x = stoulString(trimString(parts[0]));
- if (x == 0 || x == std::numeric_limits<unsigned int>::max()) {
+ if (x == 0 || x == std::numeric_limits<uint64_t>::max()) {
throw_std_runtime_error("Failed to parse '{}' to valid resolution", string);
}
_x = x;
@@ -41,7 +41,7 @@ Resolution::Resolution(const std::string& string)
if (!parts[1].empty()) {
auto y = stoulString(trimString(parts[1]));
- if (y == 0 || y == std::numeric_limits<unsigned int>::max()) {
+ if (y == 0 || y == std::numeric_limits<uint64_t>::max()) {
throw_std_runtime_error("Failed to parse '{}' to valid resolution", string);
}
_y = y;
diff --git a/src/upnp_xml.cc b/src/upnp_xml.cc
index d2d6bc60b..2ed9c7bef 100644
--- a/src/upnp_xml.cc
+++ b/src/upnp_xml.cc
@@ -508,9 +508,9 @@ std::string UpnpXMLBuilder::renderExtension(const std::string& contentType, cons
}
if (!location.empty() && location.has_extension()) {
- std::string extension = location.filename().extension();
+ std::string extension = urlEscape(location.filename().extension().string());
if (!language.empty())
- return fmt::format("{}.{}{}", urlExt, language, extension);
+ return fmt::format("{}.{}{}", urlExt, urlEscape(language), extension);
return fmt::format("{}{}", urlExt, extension);
}
diff --git a/src/util/process_executor.cc b/src/util/process_executor.cc
index 5f238058a..8557175fe 100644
--- a/src/util/process_executor.cc
+++ b/src/util/process_executor.cc
@@ -70,7 +70,8 @@ ProcessExecutor::ProcessExecutor(const std::string& command, const std::vector<s
log_debug("setenv: {}='{}'", eName, eValue);
}
log_debug("Launching process: {} {}", command, fmt::join(arglist, " "));
- execvp(command.c_str(), const_cast<char**>(argv.data()));
+ if (execvp(command.c_str(), const_cast<char**>(argv.data())))
+ log_error("Failed to execvp {} {}", command, fmt::join(arglist, " "));
break;
default:
break;
diff --git a/src/util/tools.cc b/src/util/tools.cc
index 119b74f5b..4470b6f17 100644
--- a/src/util/tools.cc
+++ b/src/util/tools.cc
@@ -110,7 +110,13 @@ int stoiString(const std::string& str, int def, int base)
if (str.empty() || (str[0] == '-' && !std::isdigit(*str.substr(1).c_str())) || (str[0] != '-' && !std::isdigit(*str.c_str())))
return def;
- return std::stoi(str, nullptr, base);
+ try {
+ std::size_t pos;
+ return std::stoi(str, &pos, base);
+ } catch (const std::exception& ex) {
+ log_error("{} (input {})", ex.what(), str);
+ }
+ return def;
}
unsigned long stoulString(const std::string& str, int def, int base)
@@ -118,7 +124,13 @@ unsigned long stoulString(const std::string& str, int def, int base)
if (str.empty() || (str[0] == '-' && !std::isdigit(*str.substr(1).c_str())) || (str[0] != '-' && !std::isdigit(*str.c_str())))
return def;
- return std::stoul(str, nullptr, base);
+ try {
+ std::size_t pos;
+ return std::stoul(str, &pos, base);
+ } catch (const std::exception& ex) {
+ log_error("{} (input {})", ex.what(), str);
+ }
+ return def;
}
void reduceString(std::string& str, char ch)
@@ -252,7 +264,7 @@ std::string urlEscape(std::string_view str)
if ((i + cplen) > str.length())
cplen = 1;
- if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || c == '_' || c == '-') {
+ if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || c == '_' || c == '-' || c == '.') {
buf << char(c);
} else {
int hi = c >> 4;
diff --git a/test/content/test_resolution.cc b/test/content/test_resolution.cc
index 6d4a75610..c30c5c489 100644
--- a/test/content/test_resolution.cc
+++ b/test/content/test_resolution.cc
@@ -3,10 +3,10 @@
#include "metadata//resolution.h"
TEST(ResolutionTest, parse) {
- auto res = Resolution("122586668x54589448448485");
+ auto res = Resolution("122586668x448448485");
EXPECT_EQ(res.x(), 122586668);
- EXPECT_EQ(res.y(), 54589448448485);
+ EXPECT_EQ(res.y(), 448448485);
}
TEST(ResolutionTest, parseWithSpace) {
@@ -38,4 +38,4 @@ TEST(ResolutionTest, throwOnBad) {
EXPECT_THROW(Resolution("0x"), std::runtime_error);
EXPECT_THROW(Resolution("0x1"), std::runtime_error);
EXPECT_THROW(Resolution("1x0"), std::runtime_error);
-}
\ No newline at end of file
+}

33
disable-test.patch Normal file
View File

@ -0,0 +1,33 @@
--- gerbera-1.12.0/test/util/test_upnp_clients.cc.orig 2022-11-29 17:34:42.902179228 +0100
+++ gerbera-1.12.0/test/util/test_upnp_clients.cc 2022-11-29 17:34:48.322206084 +0100
@@ -163,16 +163,6 @@
EXPECT_EQ(pInfo->flags, 456);
}
-TEST_F(UpnpClientsTest, getHostName)
-{
- auto addr = std::make_shared<GrbNet>("192.168.99.100");
- auto hostname = addr->getHostName();
- EXPECT_EQ(hostname, "192.168.99.100");
- addr->setHostName("Wombat");
- hostname = addr->getHostName();
- EXPECT_EQ(hostname, "Wombat");
-}
-
TEST_F(UpnpClientsTest, netmask4)
{
auto addr = GrbNet("192.168.2.100");
--- gerbera-1.12.0/test/core/test_searchhandler.cc.orig 2022-11-29 17:42:07.064382208 +0100
+++ gerbera-1.12.0/test/core/test_searchhandler.cc 2022-11-29 17:42:11.748405460 +0100
@@ -503,11 +503,3 @@
"_t_._id_ ASC, _t_._property_value_ ASC"));
}
-TEST_F(ParserTest, SortTrackNumber)
-{
- EXPECT_EQ(OTN, "unknown");
- EXPECT_EQ(otn, "upnp:originalTrackNumber");
- EXPECT_EQ(MetadataHandler::getMetaFieldName(M_TRACKNUMBER), "upnp:originalTrackNumber");
- EXPECT_TRUE(executeSortParserTest("+upnp:originalTrackNumber",
- "_t_._number1_ ASC, _t_._number2_ ASC"));
-}

View File

@ -1,32 +0,0 @@
From d7b8fafbc94405c20753fed569abd8878cccde89 Mon Sep 17 00:00:00 2001
From: Felix Yan <felixonmars@archlinux.org>
Date: Fri, 19 Aug 2022 15:22:10 +0300
Subject: [PATCH] Fix build with fmt 9.0
Fixes #2681
---
src/database/sql_format.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/database/sql_format.h b/src/database/sql_format.h
index 32dc00efa..e4e1909a8 100644
--- a/src/database/sql_format.h
+++ b/src/database/sql_format.h
@@ -42,7 +42,7 @@ struct SQLIdentifier {
template <>
struct fmt::formatter<SQLIdentifier> : formatter<std::string_view> {
template <typename FormatContext>
- auto format(const SQLIdentifier& tn, FormatContext& ctx) -> decltype(ctx.out())
+ auto format(const SQLIdentifier& tn, FormatContext& ctx) const -> decltype(ctx.out())
{
return format_to(ctx.out(), "{}{}{}", tn.quote_begin, tn.name, tn.quote_end);
}
@@ -61,7 +61,7 @@ struct ColumnUpdate {
template <>
struct fmt::formatter<ColumnUpdate> : formatter<std::string_view> {
template <typename FormatContext>
- auto format(const ColumnUpdate& a, FormatContext& ctx) -> decltype(ctx.out())
+ auto format(const ColumnUpdate& a, FormatContext& ctx) const -> decltype(ctx.out())
{
return format_to(ctx.out(), "{} = {}", a.column, a.value);
}

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0c13049792a28ec0e3086ba61c7f9675626a1dbadb043650a452192727418be7
size 4115178

3
gerbera-1.12.0.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bb04a4e4432b8ae149bdd5ea7f33f3af39cb226d3d52ec0aed3f8273023f1edd
size 4363130

View File

@ -1,3 +1,22 @@
-------------------------------------------------------------------
Tue Nov 29 14:19:26 UTC 2022 - Paolo Stivanin <info@paolostivanin.com>
- Update to 1.12.0:
* Support for NFO files as additional resources: Set up in resources
and place nfo-files (https://kodi.wiki/view/NFO_files/Templates) next to your media files.
* Tweaking mimetypes for clients
* Editing Flags in web UI
* More statistics on web UI
* Add support for ip subnets in client config
* Defaults for virtual container upnp class
* Configuration for SQLite database modes
* Offline mode for initial scan large libraries
- Add disable-test.patch until https://github.com/gerbera/gerbera/issues/2755
is fixed. These two tests (UpnpClientsTest.getHostName and ParserTest.SortTrackNumber)
were added with this release.
- Remove 2635.patch
- Remove fix-fmt9.patch
-------------------------------------------------------------------
Sat Oct 15 09:52:05 UTC 2022 - Paolo Stivanin <info@paolostivanin.com>

View File

@ -17,7 +17,7 @@
Name: gerbera
Version: 1.11.0
Version: 1.12.0
Release: 0
Summary: UPnP Media Server
License: GPL-2.0-only
@ -27,10 +27,8 @@ Source0: https://github.com/gerbera/gerbera/archive/v%{version}.tar.gz#/%
Source1: config.xml
Source2: gerbera.sysusers.in
Patch0: harden_gerbera.service.patch
#PATCH-FIX-UPSTREAM https://github.com/gerbera/gerbera/pull/2635
Patch1: 2635.patch
#PATCH-FIX-UPSTREAM https://github.com/gerbera/gerbera/issues/2681
Patch2: fix-fmt9.patch
# PATCH-FIX-UPSTREAM https://github.com/gerbera/gerbera/issues/2755
Patch1: disable-test.patch
BuildRequires: ccache
BuildRequires: cmake >= 3.13
BuildRequires: fdupes

View File

@ -1,2 +1,2 @@
u @USER@ - "Gerbera daemon user" /var/lib/gerbera
m @GROUP@ video
u gerbera - "Gerbera daemon user" /var/lib/gerbera
m gerbera video

View File

@ -1,9 +1,9 @@
Index: gerbera-1.9.1/scripts/systemd/gerbera.service.cmake
Index: gerbera-1.12.0/scripts/systemd/gerbera.service.cmake
===================================================================
--- gerbera-1.9.1.orig/scripts/systemd/gerbera.service.cmake
+++ gerbera-1.9.1/scripts/systemd/gerbera.service.cmake
@@ -3,6 +3,20 @@ Description=${SYSTEMD_DESCRIPTION}
After=${SYSTEMD_AFTER_TARGET}
--- gerbera-1.12.0.orig/scripts/systemd/gerbera.service.cmake
+++ gerbera-1.12.0/scripts/systemd/gerbera.service.cmake
@@ -4,6 +4,20 @@ After=${SYSTEMD_AFTER_TARGET}
Wants=${SYSTEMD_WANTS_TARGET}
[Service]
+# added automatically, for details please see