Compare commits

..

No commits in common. "rawhide" and "f41" have entirely different histories.

5 changed files with 223 additions and 68 deletions

View file

@ -1,19 +0,0 @@
# See the documentation for more information:
# https://packit.dev/docs/configuration/
specfile_path: xlsfonts.spec
copy_upstream_release_description: false
jobs:
- job: pull_from_upstream
trigger: release
dist_git_branches:
- fedora-rawhide
- job: koji_build
trigger: commit
allowed_committers: ['packit','all_admins']
dist_git_branches:
- fedora-rawhide

172
2b9d8f5bac5d.patch Normal file
View file

@ -0,0 +1,172 @@
From 2b9d8f5bac5d2352f8021548b4852014ed683b2c Mon Sep 17 00:00:00 2001
From: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Tue, 5 Dec 2023 15:41:28 -0800
Subject: [PATCH] Fix -Wincompatible-pointer-types warning from gcc (issue #1)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
xlsfonts.c: In function get_list:
xlsfonts.c:204:23: warning: assignment to char ** from incompatible
pointer type const char ** [-Wincompatible-pointer-types]
204 | fonts = &pattern;
| ^
v2: Split the open vs. list code to allow preserving the constness
of the argument to get_list, at the cost of less code sharing between
the two paths
Closes: #1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
---
xlsfonts.c | 105 ++++++++++++++++++++++++++++++-----------------------
1 file changed, 59 insertions(+), 46 deletions(-)
diff --git a/xlsfonts.c b/xlsfonts.c
index b834637..0afc53f 100644
--- a/xlsfonts.c
+++ b/xlsfonts.c
@@ -58,7 +58,7 @@ static int font_cnt = 0;
static int min_max;
typedef struct {
- char *name;
+ const char *name;
XFontStruct *info;
} FontList;
@@ -73,7 +73,7 @@ static int IgnoreError(Display *disp, XErrorEvent *event);
static void PrintProperty(XFontProp *prop);
static void ComputeFontType(XFontStruct *fs);
static void print_character_metrics(register XFontStruct *info);
-static void do_query_font(Display *dpy, char *name);
+static void do_query_font(Display *dpy, const char *name);
void
usage(const char *errmsg)
@@ -191,57 +191,70 @@ main(int argc, char **argv)
static void
get_list(const char *pattern)
{
- int available = nnames + 1, i;
- char **fonts;
XFontStruct *info;
- /* Get list of fonts matching pattern */
- for (;;) {
- if (open_instead_of_list) {
- info = XLoadQueryFont(dpy, pattern);
+ if (open_instead_of_list) {
+ info = XLoadQueryFont(dpy, pattern);
- if (info) {
- fonts = &pattern;
- available = 1;
- XUnloadFont(dpy, info->fid);
- }
- else {
- fonts = NULL;
- }
- break;
+ if (info == NULL) {
+ fprintf(stderr, "%s: pattern \"%s\" unmatched\n",
+ program_name, pattern);
+ return;
}
- if (long_list == L_MEDIUM)
- fonts = XListFontsWithInfo(dpy, pattern, nnames, &available, &info);
- else
- fonts = XListFonts(dpy, pattern, nnames, &available);
- if (fonts == NULL || available < nnames)
- break;
- if (long_list == L_MEDIUM)
- XFreeFontInfo(fonts, info, available);
- else
- XFreeFontNames(fonts);
- nnames = available * 2;
- }
-
- if (fonts == NULL) {
- fprintf(stderr, "%s: pattern \"%s\" unmatched\n",
- program_name, pattern);
- return;
- }
-
- font_list = realloc(font_list, (font_cnt + available) * sizeof(FontList));
- if (font_list == NULL)
- Fatal_Error("Out of memory!");
- for (i = 0; i < available; i++) {
- font_list[font_cnt].name = fonts[i];
- if (long_list == L_MEDIUM)
- font_list[font_cnt].info = info + i;
- else
+ font_list = realloc(font_list, (font_cnt + 1) * sizeof(FontList));
+ if (font_list == NULL)
+ Fatal_Error("Out of memory!");
+ font_list[font_cnt].name = pattern;
+ if (long_list == L_MEDIUM) {
+ font_list[font_cnt].info = info;
+ XUnloadFont(dpy, info->fid);
+ }
+ else {
font_list[font_cnt].info = NULL;
-
+ XFreeFont(dpy, info);
+ }
font_cnt++;
}
+ else {
+ /* Get list of fonts matching pattern */
+ int available = nnames + 1;
+ char **fonts;
+
+ for (;;) {
+ if (long_list == L_MEDIUM)
+ fonts = XListFontsWithInfo(dpy, pattern, nnames, &available,
+ &info);
+ else
+ fonts = XListFonts(dpy, pattern, nnames, &available);
+ if (fonts == NULL) {
+ fprintf(stderr, "%s: pattern \"%s\" unmatched\n",
+ program_name, pattern);
+ return;
+ }
+ if (available < nnames)
+ break;
+ if (long_list == L_MEDIUM)
+ XFreeFontInfo(fonts, info, available);
+ else
+ XFreeFontNames(fonts);
+ nnames = available * 2;
+ }
+
+ font_list = realloc(font_list,
+ (font_cnt + available) * sizeof(FontList));
+ if (font_list == NULL)
+ Fatal_Error("Out of memory!");
+ for (int i = 0; i < available; i++) {
+ font_list[font_cnt].name = fonts[i];
+ if (long_list == L_MEDIUM)
+ font_list[font_cnt].info = info + i;
+ else
+ font_list[font_cnt].info = NULL;
+
+ font_cnt++;
+ }
+ }
}
static int
@@ -625,7 +638,7 @@ print_character_metrics(register XFontStruct *info)
}
static void
-do_query_font(Display *display, char *name)
+do_query_font(Display *display, const char *name)
{
register int i;
register XFontStruct *info = XLoadQueryFont(display, name);
--
GitLab

View file

@ -1,34 +0,0 @@
* Sat Jul 20 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.7-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Thu Feb 22 2024 Ali Erdinc Koroglu <aekoroglu@fedoraproject.org> - 1.0.7-6
- Fix RHBZ #2261808
* Sat Jan 27 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.7-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sat Jul 22 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.7-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Sat Jan 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.7-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.7-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Mon Apr 4 2022 Ali Erdinc Koroglu <aekoroglu@fedoraproject.org> - 1.0.7-1
- New upstream release 1.0.7
* Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.6-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.6-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Fri Apr 16 2021 Peter Hutterer <peter.hutterer@redhat.com> - 1.0.6-2
- Add Obsoletes for xorg-x11-utils
- Use the make_build rpm macro
* Tue Jan 19 2021 Adam Jackson <ajax@redhat.com> - 1.0.6-1
- Initial split packaging (#1918037)

View file

@ -1,2 +1 @@
SHA512 (xlsfonts-1.0.9.tar.xz) = c08d8ad107eabcd8ffc2653de172b2b3192c3823890e95feb226c5689335b8cb3d8d3a78168f62f07b7f84bf55b1cf8e2230df2fed1c414a56f36cfa150224b1
SHA512 (xlsfonts-1.0.9.tar.xz.sig) = 906d809665b8b57016fba45e33e6623101bd46fcb2f5a635247af2766afdcd3f48817549bc5dbe9a6490b5896f65bd2e306aad445513ddc5aa2d27152d565324
SHA512 (xlsfonts-1.0.7.tar.xz) = ec82be0a97500a9e64fb5a6adbbec470b249b1267c3081c2bd44cd3e7148107517d1234c1da2f81b0405230ab03ad2943ea53756c3380f4d561665b38d0cedc0

View file

@ -1,14 +1,21 @@
Summary: X font list utility
Name: xlsfonts
Version: 1.0.9
Release: %autorelease
Version: 1.0.7
Release: 7%{?dist}
License: MIT
URL: https://www.x.org
Source: https://www.x.org/pub/individual/app/%{name}-%{version}.tar.xz
URL: http://www.x.org
Source0: https://www.x.org/pub/individual/app/%{name}-%{version}.tar.xz
# https://gitlab.freedesktop.org/xorg/app/xlsfonts/-/commit/2b9d8f5bac5d
Patch0: 2b9d8f5bac5d.patch
BuildRequires: gcc
BuildRequires: meson
BuildRequires: make
BuildRequires: gettext-devel
BuildRequires: libtool
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(xproto)
Obsoletes: xorg-x11-utils < 7.5-39
%description
xlsfonts lists the fonts available on an X server.
@ -17,14 +24,11 @@ xlsfonts lists the fonts available on an X server.
%autosetup -p1
%build
%meson
%meson_build
%configure
%make_build
%install
%meson_install
%check
%meson_test
%make_install
%files
%doc README.md
@ -33,4 +37,37 @@ xlsfonts lists the fonts available on an X server.
%{_mandir}/man1/xlsfonts.1*
%changelog
%autochangelog
* Sat Jul 20 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.7-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Thu Feb 22 2024 Ali Erdinc Koroglu <aekoroglu@fedoraproject.org> - 1.0.7-6
- Fix RHBZ #2261808
* Sat Jan 27 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.7-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sat Jul 22 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.7-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Sat Jan 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.7-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.7-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Mon Apr 4 2022 Ali Erdinc Koroglu <aekoroglu@fedoraproject.org> - 1.0.7-1
- New upstream release 1.0.7
* Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.6-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.6-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Fri Apr 16 2021 Peter Hutterer <peter.hutterer@redhat.com> - 1.0.6-2
- Add Obsoletes for xorg-x11-utils
- Use the make_build rpm macro
* Tue Jan 19 2021 Adam Jackson <ajax@redhat.com> - 1.0.6-1
- Initial split packaging (#1918037)