Compare commits

...

27 Commits
f26 ... rawhide

Author SHA1 Message Date
Fedora Release Engineering
98ea16e241 Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-07-21 19:27:19 +00:00
Fedora Release Engineering
f774c91a47 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-01-20 17:40:40 +00:00
Fedora Release Engineering
506141b4bf - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-07-22 12:47:24 +00:00
Fedora Release Engineering
20ba68a0f0 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-01-26 18:22:08 +00:00
Tom Stellard
0aedbb9955 Add BuildRequires: make
https://fedoraproject.org/wiki/Changes/Remove_make_from_BuildRoot
2021-01-05 03:07:54 +00:00
Gwyn Ciesla
93abb30a9b Disable env -i check. 2020-08-05 14:41:59 -05:00
Fedora Release Engineering
7b48ebcd3f - Second attempt - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-08-01 04:13:45 +00:00
Fedora Release Engineering
2b4ce5d827 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-07-28 05:57:24 +00:00
Fedora Release Engineering
6257c98240 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-01-29 10:50:36 +00:00
Fedora Release Engineering
4d2a30a68b - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-07-25 14:46:56 +00:00
Gwyn Ciesla
8ee4a5329c Enhance testing. 2019-04-01 13:54:08 -05:00
Gwyn Ciesla
373005e21f patch fix. 2019-04-01 11:10:35 -05:00
Gwyn Ciesla
bc9dd3c808 Handle undefined homedir. 2019-04-01 09:59:26 -05:00
Gwyn Ciesla
0a141ec06b Fix valgrind patches. 2019-02-13 11:34:19 -06:00
Gwyn Ciesla
81d4aafc46 Valgrind patches. 2019-02-13 11:33:38 -06:00
Gwyn Ciesla
c5e349fc14 OOB patch, new upstream. 2019-02-12 09:21:48 -06:00
Fedora Release Engineering
fe730d3511 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-02-01 08:36:23 +00:00
Igor Gnatenko
e7fcc3cb03 Remove obsolete Group tag
References: https://fedoraproject.org/wiki/Changes/Remove_Group_Tag
2019-01-28 20:24:13 +01:00
Igor Gnatenko
7139a211b3
Remove obsolete ldconfig scriptlets
References: https://fedoraproject.org/wiki/Changes/RemoveObsoleteScriptlets
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-01-22 18:40:17 +01:00
Fedora Release Engineering
44a0030835 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-07-13 09:05:44 +00:00
Jason Tibbitts
1bda44decb Remove needless use of %defattr 2018-07-10 01:49:10 -05:00
Igor Gnatenko
d7a34557f5 add BuildRequires: gcc
Reference: https://fedoraproject.org/wiki/Changes/Remove_GCC_from_BuildRoot
2018-07-09 19:06:48 +02:00
Igor Gnatenko
027585b952
Remove %clean section
None of currently supported distributions need that.
Last one was EL5 which is EOL for a while.

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-02-14 08:18:23 +01:00
Igor Gnatenko
2357eb0743 Remove BuildRoot definition
None of currently supported distributions need that.
It was needed last for EL5 which is EOL now

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-02-13 23:44:34 +01:00
Fedora Release Engineering
845ab0eca4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-02-07 23:45:05 +00:00
Fedora Release Engineering
f752dc66e2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild 2017-08-03 02:32:53 +00:00
Fedora Release Engineering
4599150c1b - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild 2017-07-26 20:01:03 +00:00
5 changed files with 246 additions and 21 deletions

View File

@ -0,0 +1,13 @@
diff --git a/src/basedir.c b/src/basedir.c
index 68ab879..1a2a8c4 100644
--- a/src/basedir.c
+++ b/src/basedir.c
@@ -574,7 +574,7 @@ static char * xdgGetRelativeHome(const char *envname, const char *relativefallba
unsigned int homelen;
if (!(home = xdgGetEnv("HOME")))
return NULL;
- if (!(relhome = (char*)malloc((homelen = strlen(home))+fallbacklength))) return NULL;
+ if (!(relhome = (char*)malloc((homelen = strlen(home))+fallbacklength+1))) return NULL;
memcpy(relhome, home, homelen);
memcpy(relhome+homelen, relativefallback, fallbacklength+1);
}

View File

@ -0,0 +1,145 @@
--- a/src/basedir.c 2019-04-01 17:11:52.293770606 +0200
+++ b/src/basedir.c 2019-04-01 14:03:23.465154736 +0200
@@ -142,26 +142,22 @@
/** Free all data in the cache and set pointers to null. */
static void xdgFreeData(xdgCachedData *cache)
{
- if (cache->dataHome);
- {
+ if (cache->dataHome) {
/* the first element of the directory lists is usually the home directory */
if (cache->searchableDataDirectories && cache->searchableDataDirectories[0] != cache->dataHome)
free(cache->dataHome);
cache->dataHome = 0;
}
- if (cache->configHome);
- {
+ if (cache->configHome) {
if (cache->searchableConfigDirectories && cache->searchableConfigDirectories[0] != cache->configHome)
free(cache->configHome);
cache->configHome = 0;
}
- if (cache->cacheHome)
- {
+ if (cache->cacheHome) {
free(cache->cacheHome);
cache->cacheHome = 0;
}
- if (cache->runtimeDirectory)
- {
+ if (cache->runtimeDirectory) {
free(cache->runtimeDirectory);
cache->runtimeDirectory = 0;
}
@@ -327,8 +323,12 @@
if (cache->dataHome && cache->configHome && cache->cacheHome) return TRUE;
- if (!(homeenv = xdgGetEnv("HOME")))
- return FALSE;
+ if (!(homeenv = xdgGetEnv("HOME"))) {
+ cache->dataHome = NULL;
+ cache->configHome = NULL;
+ cache->cacheHome = NULL;
+ return TRUE;
+ }
/* Allocate maximum needed for any of the 3 default values */
if (!(value = (char*)malloc((homelen = strlen(homeenv))+extralen))) return FALSE;
@@ -614,8 +614,8 @@
else
{
char *datahome = (char*)xdgDataHome(NULL);
- char **datadirs = 0;
- if (datahome && !(datadirs = xdgGetDirectoryLists("XDG_DATA_DIRS", datahome, DefaultDataDirectoriesList)))
+ char **datadirs = xdgGetDirectoryLists("XDG_DATA_DIRS", datahome, DefaultDataDirectoriesList);
+ if (datahome && !datadirs)
free(datahome);
return (const char * const *)datadirs;
}
@@ -634,8 +634,8 @@
else
{
char *confighome = (char*)xdgConfigHome(NULL);
- char **configdirs = 0;
- if (confighome && !(configdirs = xdgGetDirectoryLists("XDG_CONFIG_DIRS", confighome, DefaultConfigDirectoriesList)))
+ char **configdirs = xdgGetDirectoryLists("XDG_CONFIG_DIRS", confighome, DefaultConfigDirectoriesList);
+ if (confighome && !configdirs)
free(confighome);
return (const char * const *)configdirs;
}
--- a/tests/testdump.c 2012-01-22 02:29:11.000000000 +0100
+++ b/tests/testdump.c 2019-04-01 14:03:23.463154767 +0200
@@ -24,27 +24,56 @@
#include <basedir.h>
#include <stdio.h>
+#include <stdlib.h>
+
+static void print_item_list(const char * const * item_list, int do_free)
+{
+ const char * const * item;
+ for (item = item_list; *item; item++) {
+ printf("%s%c", *item, (item[1] ? ':' : '\n'));
+ if (do_free) free((void *)*item);
+ }
+ if (do_free) free((void *)item_list);
+}
+
+static void do_test(xdgHandle *handle) {
+ int do_free = (handle == NULL);
+
+ char *dataHome = xdgDataHome(handle);
+ printf("${XDG_DATA_HOME:-$HOME/.local/share}=%s\n", dataHome);
+ if (do_free) free(dataHome);
+
+ char *configHome = xdgConfigHome(handle);
+ printf("${XDG_CONFIG_HOME:-$HOME/.config}=%s\n", configHome);
+ if (do_free) free(configHome);
+
+ printf("${XDG_DATA_DIRS:-/usr/local/share/:/usr/share/}=");
+ print_item_list(xdgDataDirectories(handle), do_free);
+
+ printf("${XDG_DATA_HOME:-$HOME/.local/share}:${XDG_DATA_DIRS:-/usr/local/share/:/usr/share/}=");
+ print_item_list(xdgSearchableDataDirectories(handle), do_free);
+
+ printf("${XDG_CONFIG_DIRS:-/etc/xdg}=");
+ print_item_list(xdgConfigDirectories(handle), do_free);
+
+ printf("${XDG_CONFIG_HOME:-$HOME/.config}:${XDG_CONFIG_DIRS:-/etc/xdg}=");
+ print_item_list(xdgSearchableConfigDirectories(handle), do_free);
+
+ char *cacheHome = xdgCacheHome(handle);
+ printf("${XDG_CACHE_HOME:-$HOME/.cache}=%s\n", cacheHome);
+ if (do_free) free(cacheHome);
+}
int main(int argc, char* argv[])
{
- const char * const * item;
xdgHandle handle;
+
+ printf("UNCACHED\n");
+ do_test(0);
if (!xdgInitHandle(&handle)) return 1;
- printf("${XDG_DATA_HOME:-$HOME/.local/share}=%s\n", xdgDataHome(&handle));
- printf("${XDG_CONFIG_HOME:-$HOME/.config}=%s\n", xdgConfigHome(&handle));
- printf("${XDG_DATA_DIRS:-/usr/local/share/:/usr/share/}=");
- for (item = xdgDataDirectories(&handle); *item; item++)
- printf("%s%c", *item, (item[1] ? ':' : '\n'));
- printf("${XDG_DATA_HOME:-$HOME/.local/share}:${XDG_DATA_DIRS:-/usr/local/share/:/usr/share/}=");
- for (item = xdgSearchableDataDirectories(&handle); *item; item++)
- printf("%s%c", *item, (item[1] ? ':' : '\n'));
- printf("${XDG_CONFIG_DIRS:-/etc/xdg}=");
- for (item = xdgConfigDirectories(&handle); *item; item++)
- printf("%s%c", *item, (item[1] ? ':' : '\n'));
- printf("${XDG_CONFIG_HOME:-$HOME/.config}:${XDG_CONFIG_DIRS:-/etc/xdg}=");
- for (item = xdgSearchableConfigDirectories(&handle); *item; item++)
- printf("%s%c", *item, (item[1] ? ':' : '\n'));
- printf("${XDG_CACHE_HOME:-$HOME/.cache}=%s\n", xdgCacheHome(&handle));
+ printf("CACHED\n");
+ do_test(&handle);
xdgWipeHandle(&handle);
+ printf("DONE\n");
return 0;
}

View File

@ -0,0 +1,11 @@
--- a/tests/query-harness.sh
+++ b/tests/query-harness.sh
@@ -10,7 +10,7 @@ fi
testquery="${top_builddir}/tests/testquery"
if [ -n "$USE_VALGRIND" ] && (type valgrind 1>/dev/null)
then
- output="`valgrind -q --error-exitcode=1 "$testquery" $arguments`"
+ output="`libtool --mode=execute valgrind -q --error-exitcode=1 "$testquery" $arguments`"
else
output="`"$testquery" $arguments`"
fi

View File

@ -1,15 +1,16 @@
Name: libxdg-basedir
Version: 1.2.0
Release: 10%{?dist}
Release: 28%{?dist}
Summary: Implementation of the XDG Base Directory Specifications
Group: System Environment/Libraries
License: MIT
URL: http://n.ethz.ch/student/nevillm/download/libxdg-basedir
Source0: http://n.ethz.ch/student/nevillm/download/libxdg-basedir/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
URL: https://github.com/devnev/libxdg-basedir
Source0: https://github.com/devnev/%{name}/archive/%{name}-%{version}.tar.gz
Patch0: libxdg-basedir-leak.patch
Patch1: libxdg-basedir-valgrind-libtool.patch
Patch2: libxdg-basedir-basedir-bounds-error.patch
Patch3: libxdg-basedir-home-undef.patch
BuildRequires: valgrind libtool
%description
The XDG Base Directory Specification defines where should user files
@ -22,7 +23,6 @@ to the specification and provides a few higher-level functions.
%package devel
Summary: Development files for %{name}
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: pkgconfig
@ -33,9 +33,10 @@ developing applications that use %{name}.
%package doc
Summary: Documentation files for %{name}
Group: Documentation
Requires: %{name} = %{version}-%{release}
BuildRequires: gcc
BuildRequires: doxygen
BuildRequires: make
%description doc
The %{name}-doc package contains doxygen generated files for
@ -46,6 +47,9 @@ developing applications that use %{name}.
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%build
%configure --disable-static
@ -59,33 +63,85 @@ make install DESTDIR="$RPM_BUILD_ROOT"
find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
%clean
rm -rf $RPM_BUILD_ROOT
%check
make check USE_VALGRIND=1
#env -i make check USE_VALGRIND=1
# Check that we get NULL for all things rooted in ENV{HOME} when running
# with HOME unset
env -i ./tests/testdump | grep null > grep.NULL
env -i ./tests/testdump | grep HOME | grep -v DIRS > grep.HOME
diff -u grep.NULL grep.HOME
#%check
#make check
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%ldconfig_scriptlets
%files
%defattr(-,root,root,-)
%{_libdir}/*.so.*
%files devel
%defattr(-,root,root,-)
%{_includedir}/*
%{_libdir}/*.so
%{_libdir}/pkgconfig/%{name}.pc
%files doc
%defattr(-,root,root,-)
%doc doc/html/
%changelog
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.0-28
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.0-27
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.0-26
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.0-25
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.0-24
- Second attempt - Rebuilt for
https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.0-23
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.0-22
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.0-21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Mon Apr 01 2019 Gwyn Ciesla <gwync@protonmail.com> - 1.2.0-20
- Enhance testing.
* Mon Apr 01 2019 Gwyn Ciesla <gwync@protonmail.com> - 1.2.0-19
- Patch correction.
* Mon Apr 01 2019 Gwyn Ciesla <gwync@protonmail.com> - 1.2.0-18
- Patch to handle undefined homedir, BZ 1694706.
* Wed Feb 13 2019 Gwyn Ciesla <gwync@protonmail.com> - 1.2.0-17
- Updated valgrind patch.
* Tue Feb 12 2019 Gwyn Ciesla <gwync@protonmail.com> - 1.2.0-16
- Relocated upstream, crash patch.
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.0-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.0-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.0-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.0-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.0-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.0-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

View File

@ -1 +1 @@
027aaf1495f6ffa4b5a563b511d5d3f3 libxdg-basedir-1.2.0.tar.gz
SHA512 (libxdg-basedir-1.2.0.tar.gz) = b70f4fe7c155b9f9c8d9afab649ac009892b6c913fafe0b4e63b517bff35d028a43d715d8b636a2667904b74fa7b7b7666e5102b0675ca453982c3988cf1f652