SHA256
1
0
forked from pool/rpmlint-mini

Accepting request 1088515 from home:dgarcia:branches:devel:openSUSE:Factory:rpmlint

- Add patches to avoid bogus errors in post-build checks:
  * 0001-validate-support-SingleMainWindow-key-from-1.5.patch
  * 0002-validate-Support-version-1.5.patch
  * desktop-file-utils-suse-keys.patch
- Update desktop-file-utils source to 0.26:
  * Support for Autotools removed in the next release.
  * update-desktop-database
    + Fix erroneous installation as "desktop-file-update"
      when using the Meson build system
- Update to version 0.25:
  * common
    + Add Meson build system
  * desktop-file-validate
    + Allow desktop file spec version 1.4.
    + Make it possible to deprecate keys starting with "X-".
    + Add the "Implements" field from spec version 1.2.
    + Add the "PrefersNonDefaultGPU" key and deprecate "X-KDE-RunOnDiscreteGpu".
    + Set locale for correct output message encoding.
    + Add coloured output support.
    + Fix parsing of escaped double quote in quoted strings.
    + Add GNOME Flashback, GNOME Classic desktops.

OBS-URL: https://build.opensuse.org/request/show/1088515
OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint-mini?expand=0&rev=175
This commit is contained in:
Dirk Mueller 2023-05-23 08:04:39 +00:00 committed by Git OBS Bridge
parent 96bdde7188
commit 9236ebbc8c
7 changed files with 143 additions and 11 deletions

View File

@ -0,0 +1,27 @@
From 47ab968995ae864d3681833040e17b8f1af4cb38 Mon Sep 17 00:00:00 2001
From: David King <amigadave@amigadave.com>
Date: Tue, 15 Feb 2022 10:54:40 +0000
Subject: [PATCH] validate: support SingleMainWindow key from 1.5
Fixes https://gitlab.freedesktop.org/xdg/desktop-file-utils/-/issues/59
---
src/validate.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/validate.c b/src/validate.c
index 821be7d..10d1872 100644
--- a/src/validate.c
+++ b/src/validate.c
@@ -329,6 +329,9 @@ static DesktopKeyDefinition registered_desktop_keys[] = {
/* SuSE specific */
{ DESKTOP_BOOLEAN_TYPE, "X-SuSE-translate", FALSE, FALSE, FALSE, NULL },
+ /* Since 1.5 */
+ { DESKTOP_BOOLEAN_TYPE, "SingleMainWindow", FALSE, FALSE, FALSE, NULL },
+
/* Keys reserved for KDE */
/* since 0.9.4 */
--
2.36.1

View File

@ -0,0 +1,55 @@
From e1f28bc5673f6cb281f3f4bdd8d8264d8ced6253 Mon Sep 17 00:00:00 2001
From: David King <amigadave@amigadave.com>
Date: Tue, 15 Feb 2022 10:56:04 +0000
Subject: [PATCH] validate: Support version 1.5
Bump CURRENT_SPEC_VERSION to 1.5.
---
man/desktop-file-validate.1 | 2 +-
src/validate.c | 3 +++
src/validate.h | 2 +-
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/man/desktop-file-validate.1 b/man/desktop-file-validate.1
index 8e17411..ce87c47 100644
--- a/man/desktop-file-validate.1
+++ b/man/desktop-file-validate.1
@@ -9,7 +9,7 @@ desktop-file-validate \- Validate desktop entry files
.B desktop-file-validate [\-\-no-hints] [\-\-no-warn-deprecated] [\-\-warn-kde] FILE...
.SH DESCRIPTION
The \fIdesktop-file-validate\fP program is a tool to validate desktop
-entry files according to the Desktop Entry specification 1.4.
+entry files according to the Desktop Entry specification 1.5.
.PP
The specification describes a file format to provide information such as
name, icon and description for an application. Such a file can then be
diff --git a/src/validate.c b/src/validate.c
index 10d1872..87f196e 100644
--- a/src/validate.c
+++ b/src/validate.c
@@ -964,6 +964,9 @@ handle_version_key (kf_validator *kf,
const char *locale_key,
const char *value)
{
+ if (!strcmp (value, "1.5"))
+ return TRUE;
+
if (!strcmp (value, "1.4"))
return TRUE;
diff --git a/src/validate.h b/src/validate.h
index e6efd93..a7952cd 100644
--- a/src/validate.h
+++ b/src/validate.h
@@ -30,7 +30,7 @@
#include <glib.h>
-#define CURRENT_SPEC_VERSION "1.4"
+#define CURRENT_SPEC_VERSION "1.5"
#define GROUP_KDE_DESKTOP_ENTRY "KDE Desktop Entry"
#define GROUP_DESKTOP_ACTION "Desktop Action "
--
2.36.1

View File

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

BIN
desktop-file-utils-0.26.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,17 @@
diff -r -U 5 a/src/validate.c b/src/validate.c
--- a/src/validate.c 2020-06-19
+++ b/src/validate.c 2020-06-29
@@ -324,10 +324,13 @@
{ DESKTOP_BOOLEAN_TYPE, "DBusActivatable", FALSE, FALSE, FALSE, handle_dbus_activatable_key },
/* Since 1.4 */
{ DESKTOP_BOOLEAN_TYPE, "PrefersNonDefaultGPU", FALSE, FALSE, FALSE, NULL },
+ /* SuSE specific */
+ { DESKTOP_BOOLEAN_TYPE, "X-SuSE-translate", FALSE, FALSE, FALSE, NULL },
+
/* Keys reserved for KDE */
/* since 0.9.4 */
{ DESKTOP_STRING_TYPE, "ServiceTypes", FALSE, FALSE, TRUE, NULL },
{ DESKTOP_STRING_TYPE, "DocPath", FALSE, FALSE, TRUE, NULL },

View File

@ -1,3 +1,30 @@
-------------------------------------------------------------------
Tue May 23 06:25:06 UTC 2023 - Daniel Garcia <daniel.garcia@suse.com>
- Add patches to avoid bogus errors in post-build checks:
* 0001-validate-support-SingleMainWindow-key-from-1.5.patch
* 0002-validate-Support-version-1.5.patch
* desktop-file-utils-suse-keys.patch
- Update desktop-file-utils source to 0.26:
* Support for Autotools removed in the next release.
* update-desktop-database
+ Fix erroneous installation as "desktop-file-update"
when using the Meson build system
- Update to version 0.25:
* common
+ Add Meson build system
* desktop-file-validate
+ Allow desktop file spec version 1.4.
+ Make it possible to deprecate keys starting with "X-".
+ Add the "Implements" field from spec version 1.2.
+ Add the "PrefersNonDefaultGPU" key and deprecate "X-KDE-RunOnDiscreteGpu".
+ Set locale for correct output message encoding.
+ Add coloured output support.
+ Fix parsing of escaped double quote in quoted strings.
+ Add GNOME Flashback, GNOME Classic desktops.
-------------------------------------------------------------------
Wed Mar 29 10:43:27 UTC 2023 - Martin Liška <mliska@suse.cz>

View File

@ -27,10 +27,17 @@ Release: 0
Summary: RPM file correctness checker
License: GPL-2.0-or-later
URL: https://github.com/rpm-software-management/rpmlint
Source0: desktop-file-utils-0.24.tar.xz
Source0: desktop-file-utils-0.26.tar.xz
Source1: stdlib.txt
Source2: rpmlint.wrapper
Source3: rpmlint-mini.rpmlintrc
# PATCH-FEATURE-OPENSUSE desktop-file-utils-suse-keys.patch vuntz@opensuse.org -- Handle SUSE-specific keys in validator. This is not strictly necessary, since they are prefixed with X-, but we can verify that the value has the right type.
Patch0: desktop-file-utils-suse-keys.patch
# PATCH-FIX-UPSTREAM -- SingleMainWindow is present in xdg-specs 1.5 and can be used by both GNOME and KDE
Patch2: 0001-validate-support-SingleMainWindow-key-from-1.5.patch
Patch3: 0002-validate-Support-version-1.5.patch
# need to fetch the file from there
BuildRequires: checkbashisms
# the main package rpmlint's python3 runtime requirements do not necessarily match our target flavor
@ -49,6 +56,7 @@ BuildRequires: glib2-devel
BuildRequires: glib2-devel-static
BuildRequires: libedit-devel
BuildRequires: libtool
BuildRequires: meson
BuildRequires: pkgconfig
BuildRequires: python-rpm-macros
BuildRequires: rpmlint >= 2
@ -61,14 +69,12 @@ rpmlint is a tool to check common errors on RPM packages. Binary and
source packages can be checked.
%prep
%setup -q -n desktop-file-utils-0.24
%autosetup -p1 -n desktop-file-utils-0.26
<COPYING
%build
%configure
cd src
%make_build desktop-file-validate \
DESKTOP_FILE_UTILS_LIBS="%{_libdir}/libglib-2.0.a -lpthread -lrt"
%meson
%meson_build
%install
# Check that rpmlint works at all, with the primary flavor
@ -85,7 +91,7 @@ done
# We don't need activation
rm %{buildroot}/opt/testing/bin/activate*
# We need these available
cp -a src/desktop-file-validate %{buildroot}/opt/testing/bin
cp -a %{_vpath_builddir}/src/desktop-file-validate %{buildroot}/opt/testing/bin
cp -a %{_bindir}/dash %{_bindir}/checkbashisms %{buildroot}/opt/testing/bin
cp -a %{_libdir}/libedit.so.0* %{buildroot}/opt/testing/lib
# Install config files
@ -134,7 +140,7 @@ install -m 755 -D %{SOURCE2} %{buildroot}/opt/testing/bin/rpmlint
%check
# check rpmlint-mini with the custom flavor
%make_build check
%meson_test
sed -e 's|/opt|%{buildroot}/opt|' -e 's|exec|%my_python|' %{buildroot}/opt/testing/bin/rpmlint > myrpmlint
chmod +x myrpmlint
set +e