svn commit: r502101 - in head/devel/kf5-kcoreaddons: . files

Adriaan de Groot adridg at FreeBSD.org
Mon May 20 12:52:43 UTC 2019


Author: adridg
Date: Mon May 20 12:52:42 2019
New Revision: 502101
URL: https://svnweb.freebsd.org/changeset/ports/502101

Log:
  Make KOSRelease class find our os-release
  
   - After much hemming and hawing we ended up with /usr/local/etc/os-release, which isn't one
     of the standard paths (according to freedesktop.org) so in spite of us **having** it,
     not all software that looks for it will find it. Patch in the correct path.

Added:
  head/devel/kf5-kcoreaddons/files/
  head/devel/kf5-kcoreaddons/files/patch-src_lib_util_kosrelease.cpp   (contents, props changed)
Modified:
  head/devel/kf5-kcoreaddons/Makefile

Modified: head/devel/kf5-kcoreaddons/Makefile
==============================================================================
--- head/devel/kf5-kcoreaddons/Makefile	Mon May 20 10:48:12 2019	(r502100)
+++ head/devel/kf5-kcoreaddons/Makefile	Mon May 20 12:52:42 2019	(r502101)
@@ -2,6 +2,7 @@
 
 PORTNAME=	kcoreaddons
 DISTVERSION=	${KDE_FRAMEWORKS_VERSION}
+PORTREVISION=	1
 CATEGORIES=	devel kde kde-frameworks
 
 MAINTAINER=	kde at FreeBSD.org

Added: head/devel/kf5-kcoreaddons/files/patch-src_lib_util_kosrelease.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/kf5-kcoreaddons/files/patch-src_lib_util_kosrelease.cpp	Mon May 20 12:52:42 2019	(r502101)
@@ -0,0 +1,27 @@
+--- src/lib/util/kosrelease.cpp.orig	2019-05-08 08:27:20 UTC
++++ src/lib/util/kosrelease.cpp
+@@ -76,13 +76,18 @@ static QStringList splitEntry(const QString &line)
+ 
+ static QString defaultFilePath()
+ {
+-    if (QFile::exists(QStringLiteral("/etc/os-release"))) {
+-        return QStringLiteral("/etc/os-release");
+-    } else if (QFile::exists(QStringLiteral("/usr/lib/os-release"))) {
+-        return QStringLiteral("/usr/lib/os-release");
+-    } else {
+-        return QString();
++    for (const auto& path : { 
++#ifdef Q_OS_FREEBSD
++        QStringLiteral("/usr/local/etc/os-release"),
++#endif
++        QStringLiteral("/etc/os-release"),
++        QStringLiteral("/usr/lib/os-release")
++        }) {
++        if (QFile::exists(path)) {
++            return path;
++        }
+     }
++    return QString();
+ }
+ 
+ class Q_DECL_HIDDEN KOSRelease::Private


More information about the svn-ports-head mailing list