Update to 0.11 (#2135328)

This commit is contained in:
David King 2022-12-19 16:48:01 +00:00
parent 85e002d4b9
commit 14f366793e
4 changed files with 17 additions and 107 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
xdg-user-dirs-gtk-0.8.tar.bz2
/xdg-user-dirs-gtk-0.9.tar.xz
/xdg-user-dirs-gtk-0.10.tar.xz
/xdg-user-dirs-gtk-0.11.tar.xz

View File

@ -1,91 +0,0 @@
From 9c19d7fedadf38cc4fec21efdb3908572448f658 Mon Sep 17 00:00:00 2001
From: Matthias Clasen <mclasen@redhat.com>
Date: Thu, 30 May 2013 19:21:11 -0400
Subject: [PATCH] Make the 'Don't ask again' checkbox work properly
We used to remove the user-dirs.locale file when this is checked,
but that prevents xdg-user-dirs-gtk-update from ever running again.
Instead, update it with the current locale. This has the effect
of keeping xdg-user-dirs-gtk-update from running until the locale
changes again, which is probably closer to the intended effect.
https://bugzilla.redhat.com/show_bug.cgi?id=968955
---
update.c | 40 +++++++++++++++++++++++++++++++---------
1 file changed, 31 insertions(+), 9 deletions(-)
diff --git a/update.c b/update.c
index 4697913..8710c79 100644
--- a/update.c
+++ b/update.c
@@ -48,12 +48,40 @@ has_xdg_translation (void)
if (strncmp (locale, "en_US", 5) == 0 ||
strcmp (locale, "C") == 0)
return TRUE;
-
+
str = "Desktop";
return dgettext ("xdg-user-dirs", str) != str;
}
static void
+save_locale (void)
+{
+ FILE *file;
+ char *user_locale_file;
+ char *locale, *dot;
+
+ user_locale_file = g_build_filename (g_get_user_config_dir (),
+ "user-dirs.locale", NULL);
+ file = fopen (user_locale_file, "w");
+ g_free (user_locale_file);
+
+ if (file == NULL)
+ {
+ fprintf (stderr, "Can't save user-dirs.locale\n");
+ return;
+ }
+
+ locale = g_strdup (setlocale (LC_MESSAGES, NULL));
+ /* Skip encoding part */
+ dot = strchr (locale, '.');
+ if (dot)
+ *dot = 0;
+ fprintf (file, "%s", locale);
+ g_free (locale);
+ fclose (file);
+}
+
+static void
update_locale (XdgDirEntry *old_entries)
{
XdgDirEntry *new_entries, *entry;
@@ -91,10 +119,9 @@ update_locale (XdgDirEntry *old_entries)
g_free (std_out);
g_free (std_err);
g_free (cmdline);
-
if (!WIFEXITED(exit_status) || WEXITSTATUS(exit_status) != 0)
return;
-
+
new_entries = parse_xdg_dirs (filename);
g_unlink (filename);
g_free (filename);
@@ -254,12 +281,7 @@ update_locale (XdgDirEntry *old_entries)
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check)))
{
- char *file;
-
- file = g_build_filename (g_get_user_config_dir (),
- "user-dirs.locale", NULL);
- g_unlink (file);
- g_free (file);
+ save_locale ();
}
g_free (new_entries);
--
1.8.2.1

View File

@ -1 +1 @@
c4469eeeb0416d734a4592f8030d1bcf xdg-user-dirs-gtk-0.10.tar.xz
SHA512 (xdg-user-dirs-gtk-0.11.tar.xz) = 2a650c6372126f807ac90fb0508e1b11636b38b5960a3037b547e9f1bb1a6b82653f20da7d5aae1144eebec040e3af89a02fbf70c1768724019b384f6d9cf85a

View File

@ -1,23 +1,21 @@
Name: xdg-user-dirs-gtk
Version: 0.10
Release: 23%{?dist}
Version: 0.11
Release: 1%{?dist}
Summary: Gnome integration of special directories
License: GPL+
URL: http://freedesktop.org/wiki/Software/xdg-user-dirs
Source0: http://download.gnome.org/sources/xdg-user-dirs-gtk/%{version}/%{name}-%{version}.tar.xz
License: GPL-2.0-or-later
URL: https://gitlab.gnome.org/GNOME/xdg-user-dirs-gtk
Source0: https://download.gnome.org/sources/xdg-user-dirs-gtk/%{version}/%{name}-%{version}.tar.xz
# upstream fix
Patch0: 0001-Make-the-Don-t-ask-again-checkbox-work-properly.patch
Patch0: show-in-mate.patch
Patch1: show-in-mate.patch
BuildRequires: make
BuildRequires: gcc
BuildRequires: desktop-file-utils
BuildRequires: gcc
BuildRequires: gettext
BuildRequires: gtk3-devel
BuildRequires: intltool
BuildRequires: make
BuildRequires: xdg-user-dirs
BuildRequires: pkgconfig(gtk+-3.0)
Requires: xdg-user-dirs
@ -27,9 +25,7 @@ desktop, including creating default bookmarks and detecting
locale changes.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%autosetup -p1
%build
%configure
@ -45,12 +41,16 @@ desktop-file-validate $RPM_BUILD_ROOT%{_sysconfdir}/xdg/autostart/user-dirs-upda
%files -f %{name}.lang
%doc NEWS AUTHORS README ChangeLog COPYING
%doc NEWS AUTHORS README ChangeLog
%license COPYING
%{_bindir}/*
%config(noreplace) %{_sysconfdir}/xdg/autostart/user-dirs-update-gtk.desktop
%changelog
* Mon Dec 19 2022 David King <amigadave@amigadave.com> - 0.11-1
- Update to 0.11 (#2135328)
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.10-23
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild