From 32036082c7489c7d7c6c4807a7ef4d36d6061254 Mon Sep 17 00:00:00 2001 From: guibuilder_pel7x64builder0 Date: Mon, 26 Nov 2018 13:51:37 +0100 Subject: [PATCH] xdg-user-dirs-gtk package update Signed-off-by: guibuilder_pel7x64builder0 --- ...n-t-ask-again-checkbox-work-properly.patch | 91 ++++++++++++ SPECS/xdg-user-dirs-gtk.spec | 134 ++++++++++++++++++ 2 files changed, 225 insertions(+) create mode 100644 SOURCES/0001-Make-the-Don-t-ask-again-checkbox-work-properly.patch create mode 100644 SPECS/xdg-user-dirs-gtk.spec diff --git a/SOURCES/0001-Make-the-Don-t-ask-again-checkbox-work-properly.patch b/SOURCES/0001-Make-the-Don-t-ask-again-checkbox-work-properly.patch new file mode 100644 index 0000000..ba59170 --- /dev/null +++ b/SOURCES/0001-Make-the-Don-t-ask-again-checkbox-work-properly.patch @@ -0,0 +1,91 @@ +From 9c19d7fedadf38cc4fec21efdb3908572448f658 Mon Sep 17 00:00:00 2001 +From: Matthias Clasen +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 + diff --git a/SPECS/xdg-user-dirs-gtk.spec b/SPECS/xdg-user-dirs-gtk.spec new file mode 100644 index 0000000..f1ff8a3 --- /dev/null +++ b/SPECS/xdg-user-dirs-gtk.spec @@ -0,0 +1,134 @@ +Name: xdg-user-dirs-gtk +Version: 0.10 +Release: 4%{?dist} +Summary: Gnome integration of special directories + +Group: User Interface/Desktops +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 + +# upstream fix +Patch0: 0001-Make-the-Don-t-ask-again-checkbox-work-properly.patch +BuildRequires: desktop-file-utils +BuildRequires: gettext +BuildRequires: gtk3-devel +BuildRequires: intltool +BuildRequires: xdg-user-dirs + +Requires: xdg-user-dirs + +%description +Contains some integration of xdg-user-dirs with the gnome +desktop, including creating default bookmarks and detecting +locale changes. + +%prep +%setup -q +%patch0 -p1 + +%build +%configure +make %{?_smp_mflags} + + +%install +make install DESTDIR=$RPM_BUILD_ROOT + +%find_lang %name + +desktop-file-validate $RPM_BUILD_ROOT%{_sysconfdir}/xdg/autostart/user-dirs-update-gtk.desktop + + +%files -f %{name}.lang +%doc NEWS AUTHORS README ChangeLog COPYING +%{_bindir}/* +%config(noreplace) %{_sysconfdir}/xdg/autostart/user-dirs-update-gtk.desktop + + +%changelog +* Fri Jan 24 2014 Daniel Mach - 0.10-4 +- Mass rebuild 2014-01-24 + +* Fri Dec 27 2013 Daniel Mach - 0.10-3 +- Mass rebuild 2013-12-27 + +* Thu May 30 2013 Matthias Clasen - 0.10-2 +- Make 'Don't ask again' checkbox work properly (#968955) + +* Wed Feb 06 2013 Kalev Lember - 0.10-1 +- Update to 0.10 + +* Sun Jul 22 2012 Fedora Release Engineering - 0.9-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Wed Apr 11 2012 Kalev Lember - 0.9-1 +- Update to 0.9 +- Adjust BuildRequires to build with gtk3 +- Drop lxde patch, merged upstream +- Validate the desktop file + +* Sat Jan 14 2012 Fedora Release Engineering - 0.8-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Fri Nov 18 2011 Adam Jackson 0.8-7 +- Rebuild to break bogus libpng dep + +* Mon Feb 07 2011 Fedora Release Engineering - 0.8-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Sat Feb 13 2010 Matthias Clasen +- Work in LXDE too (#563827) + +* Mon Jul 27 2009 Fedora Release Engineering - 0.8-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Thu Feb 26 2009 Fedora Release Engineering - 0.8-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Mon Sep 8 2008 Tomas Bzatek - 0.8-2 +- Require intltool + +* Fri Sep 5 2008 Matthias Clasen - 0.8-1 +- Update to 0.8 + +* Tue Aug 12 2008 Jason L Tibbitts III - 0.7-2 +- Fix license tag. + +* Tue Feb 12 2008 Alexander Larsson - 0.7-1 +- Update to 0.7 +- Uncomment missing patches + +* Sun Nov 4 2007 Matthias Clasen - 0.6-4 +- Correct the URL + +* Mon Oct 1 2007 Matthias Clasen - 0.6-2 +- Fix the special case for en_US (#307881) + +* Tue Aug 21 2007 Alexander Larsson - 0.6-1 +- Update to 0.6 (new translations) + +* Fri Jul 6 2007 Matthias Clasen - 0.5-2 +- Make the autostart file work in KDE (#247304) + +* Wed Apr 25 2007 - 0.5-1 +- Update to 0.5 +- Fixes silly dialog when no translations (#237384) + +* Wed Apr 11 2007 Alexander Larsson - 0.4-1 +- update to 0.4 (#234512) + +* Tue Mar 6 2007 Alexander Larsson - 0.3-1 +- update to 0.3 +- Add xdg-user-dirs buildreq + +* Fri Mar 2 2007 Alexander Larsson - 0.2-1 +- Update to 0.2 + +* Fri Mar 2 2007 Alexander Larsson - 0.1-2 +- Add buildrequires +- Mark autostart file as config + +* Wed Feb 28 2007 Alexander Larsson - 0.1-1 +- Initial version +