Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 May 2019 12:52:42 +0000 (UTC)
From:      Adriaan de Groot <adridg@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r502101 - in head/devel/kf5-kcoreaddons: . files
Message-ID:  <201905201252.x4KCqgpw006293@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201905201252.x4KCqgpw006293>