[-- Attachment #1: Type: text/plain, Size: 1639 bytes --] There is a new pull request by FollieHiyuki against master on the void-packages repository https://github.com/FollieHiyuki/void-packages snapper-update https://github.com/void-linux/void-packages/pull/30391 [WIP] snapper: update to 0.9.0 <!-- Mark items with [x] where applicable --> #### General - [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements) #### Have the results of the proposed changes been tested? - [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me - [ ] I generally don't use the affected packages but briefly tested this PR <!-- If GitHub CI cannot be used to validate the build result (for example, if the build is likely to take several hours), make sure to [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration). When skipping CI, uncomment and fill out the following section. Note: for builds that are likely to complete in less than 2 hours, it is not acceptable to skip CI. --> <!-- #### Does it build and run successfully? (Please choose at least one native build and, if supported, at least one cross build. More are better.) - [ ] I built this PR locally for my native architecture, (ARCH-LIBC) - [ ] I built this PR locally for these architectures (if supported. mark crossbuilds): - [ ] aarch64-musl - [ ] armv7l - [ ] armv6l-musl --> We probably should wait for #29547 to be merged first. A patch file from https://github.com/void-linux/void-packages/pull/30391.patch is attached [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: github-pr-snapper-update-30391.patch --] [-- Type: text/x-diff, Size: 11904 bytes --] From 8e98365ab422020c48c52075e1cd61e0b81a21c9 Mon Sep 17 00:00:00 2001 From: FollieHiyuki <folliekazetani@protonmail.com> Date: Tue, 20 Apr 2021 18:20:02 +0300 Subject: [PATCH] snapper: update to 0.9.0; adopt --- .../patches/0001-disable-locale-tests.patch | 29 ++-- .../0002-backport-equal-date-test.patch | 164 ------------------ .../patches/0002-fix-32bit-musl-build.patch | 13 ++ .../0003-backport-fix-jsonc-linkage.patch | 19 -- srcpkgs/snapper/template | 6 +- 5 files changed, 26 insertions(+), 205 deletions(-) delete mode 100644 srcpkgs/snapper/patches/0002-backport-equal-date-test.patch create mode 100644 srcpkgs/snapper/patches/0002-fix-32bit-musl-build.patch delete mode 100644 srcpkgs/snapper/patches/0003-backport-fix-jsonc-linkage.patch diff --git a/srcpkgs/snapper/patches/0001-disable-locale-tests.patch b/srcpkgs/snapper/patches/0001-disable-locale-tests.patch index 05e589dbfc5d..cec07312a0ea 100644 --- a/srcpkgs/snapper/patches/0001-disable-locale-tests.patch +++ b/srcpkgs/snapper/patches/0001-disable-locale-tests.patch @@ -1,31 +1,22 @@ -These 4 tests fail with error: -std::runtime_error: locale::facet::_S_create_c_locale name not valid - diff --git testsuite/Makefile.am testsuite/Makefile.am -index d7e30b8..001f834 100644 +index ccb84d3..331376e 100644 --- testsuite/Makefile.am +++ testsuite/Makefile.am -@@ -7,8 +7,8 @@ AM_CPPFLAGS = -I$(top_srcdir) $(DBUS_CFLAGS) +@@ -7,7 +7,7 @@ AM_CPPFLAGS = -I$(top_srcdir) $(DBUS_CFLAGS) LDADD = ../snapper/libsnapper.la ../dbus/libdbus.la -lboost_unit_test_framework check_PROGRAMS = sysconfig-get1.test dirname1.test basename1.test \ -- equal-date.test dbus-escape.test cmp-lt.test humanstring.test \ -- table.test table-formatter.test csv-formatter.test json-formatter.test \ -+ equal-date.test dbus-escape.test \ -+ csv-formatter.test json-formatter.test \ - getopts.test +- equal-date.test dbus-escape.test cmp-lt.test humanstring.test uuid.test \ ++ equal-date.test dbus-escape.test uuid.test \ + table.test table-formatter.test csv-formatter.test json-formatter.test \ + getopts.test scan-datetime.test root-prefix.test range.test limit.test - if ENABLE_BTRFS_QUOTA -@@ -27,12 +27,6 @@ EXTRA_DIST = $(noinst_SCRIPTS) sysconfig-get1.txt sysconfig-set1.txt +@@ -29,8 +29,6 @@ equal_date_test_LDADD = -lboost_unit_test_framework ../client/utils/libutils.la - equal_date_test_LDADD = -lboost_unit_test_framework ../client/utils/libutils.la + scan_datetime_test_LDADD = -lboost_unit_test_framework ../client/utils/libutils.la -humanstring_test_LDADD = -lboost_unit_test_framework ../client/utils/libutils.la - --table_test_LDADD = -lboost_unit_test_framework ../client/utils/libutils.la -- --table_formatter_test_LDADD = -lboost_unit_test_framework ../client/utils/libutils.la -- - csv_formatter_test_LDADD = -lboost_unit_test_framework ../client/utils/libutils.la + uuid_test_LDADD = -lboost_unit_test_framework ../client/utils/libutils.la - json_formatter_test_LDADD = -lboost_unit_test_framework ../client/utils/libutils.la $(JSONC_LIBS) + table_test_LDADD = -lboost_unit_test_framework ../client/utils/libutils.la diff --git a/srcpkgs/snapper/patches/0002-backport-equal-date-test.patch b/srcpkgs/snapper/patches/0002-backport-equal-date-test.patch deleted file mode 100644 index 688ab7e1f27d..000000000000 --- a/srcpkgs/snapper/patches/0002-backport-equal-date-test.patch +++ /dev/null @@ -1,164 +0,0 @@ -diff --git package/snapper.changes package/snapper.changes -index 9235de3..5570cf1 100644 ---- package/snapper.changes -+++ package/snapper.changes -@@ -1,3 +1,8 @@ -+------------------------------------------------------------------- -+Mon Jan 25 11:29:45 CET 2021 - aschnell@suse.com -+ -+- fixed testsuite for equal-date (gh#openSUSE/snapper#526) -+ - ------------------------------------------------------------------- - Thu Dec 17 12:20:59 CET 2020 - aschnell@suse.com - -diff --git testsuite/Makefile.am testsuite/Makefile.am -index d7e30b8..cfd1002 100644 ---- testsuite/Makefile.am -+++ testsuite/Makefile.am -@@ -9,7 +9,7 @@ LDADD = ../snapper/libsnapper.la ../dbus/libdbus.la -lboost_unit_test_framework - check_PROGRAMS = sysconfig-get1.test dirname1.test basename1.test \ - equal-date.test dbus-escape.test \ - csv-formatter.test json-formatter.test \ -- getopts.test -+ getopts.test scan-datetime.test - - if ENABLE_BTRFS_QUOTA - check_PROGRAMS += qgroup1.test -@@ -27,6 +27,8 @@ EXTRA_DIST = $(noinst_SCRIPTS) sysconfig-get1.txt sysconfig-set1.txt - - equal_date_test_LDADD = -lboost_unit_test_framework ../client/utils/libutils.la - -+scan_datetime_test_LDADD = -lboost_unit_test_framework ../client/utils/libutils.la -+ - csv_formatter_test_LDADD = -lboost_unit_test_framework ../client/utils/libutils.la - - json_formatter_test_LDADD = -lboost_unit_test_framework ../client/utils/libutils.la $(JSONC_LIBS) -diff --git testsuite/equal-date.cc testsuite/equal-date.cc -index 42e00d8..8d8eda8 100644 ---- testsuite/equal-date.cc -+++ testsuite/equal-date.cc -@@ -5,18 +5,25 @@ - #include <boost/test/unit_test.hpp> - - #include "../client/utils/equal-date.h" -+#include "../snapper/AppUtil.h" -+ -+using namespace snapper; - - - bool - equal_week(const char* s1, const char* s2) - { -+ // use interim time_t since strptime on musl does not set tm_yday -+ -+ time_t t1 = scan_datetime(s1, true); - struct tm tmp1; - memset(&tmp1, 0, sizeof(tmp1)); -- strptime(s1, "%Y-%m-%d", &tmp1); -+ gmtime_r(&t1, &tmp1); - -+ time_t t2 = scan_datetime(s2, true); - struct tm tmp2; - memset(&tmp2, 0, sizeof(tmp2)); -- strptime(s2, "%Y-%m-%d", &tmp2); -+ gmtime_r(&t2, &tmp2); - - return equal_week(tmp1, tmp2); - } -@@ -25,46 +32,46 @@ equal_week(const char* s1, const char* s2) - BOOST_AUTO_TEST_CASE(test1) - { - // 2012 is a leap year -- BOOST_CHECK(equal_week("2011-12-31", "2012-01-01")); -- BOOST_CHECK(equal_week("2012-01-01", "2011-12-31")); -+ BOOST_CHECK(equal_week("2011-12-31 00:00:00", "2012-01-01 00:00:00")); -+ BOOST_CHECK(equal_week("2012-01-01 00:00:00", "2011-12-31 00:00:00")); - } - - - BOOST_AUTO_TEST_CASE(test2) - { - // 2012 is a leap year -- BOOST_CHECK(equal_week("2012-12-31", "2013-01-01")); -- BOOST_CHECK(equal_week("2013-01-01", "2012-12-31")); -+ BOOST_CHECK(equal_week("2012-12-31 00:00:00", "2013-01-01 00:00:00")); -+ BOOST_CHECK(equal_week("2013-01-01 00:00:00", "2012-12-31 00:00:00")); - } - - - BOOST_AUTO_TEST_CASE(test3) - { - // Saturday and Sunday -- BOOST_CHECK(equal_week("2014-01-04", "2014-01-05")); -- BOOST_CHECK(equal_week("2014-01-05", "2014-01-04")); -+ BOOST_CHECK(equal_week("2014-01-04 00:00:00", "2014-01-05 00:00:00")); -+ BOOST_CHECK(equal_week("2014-01-05 00:00:00", "2014-01-04 00:00:00")); - - // Sunday and Monday -- BOOST_CHECK(!equal_week("2014-01-05", "2014-01-06")); -- BOOST_CHECK(!equal_week("2014-01-06", "2014-01-05")); -+ BOOST_CHECK(!equal_week("2014-01-05 00:00:00", "2014-01-06 00:00:00")); -+ BOOST_CHECK(!equal_week("2014-01-06 00:00:00", "2014-01-05 00:00:00")); - - // Monday and Tuesday -- BOOST_CHECK(equal_week("2014-01-06", "2014-01-07")); -- BOOST_CHECK(equal_week("2014-01-07", "2014-01-06")); -+ BOOST_CHECK(equal_week("2014-01-06 00:00:00", "2014-01-07 00:00:00")); -+ BOOST_CHECK(equal_week("2014-01-07 00:00:00", "2014-01-06 00:00:00")); - } - - - BOOST_AUTO_TEST_CASE(test4) - { - // 2014-12-31 is a Wednesday, 2015-01-01 is a Thursday -- BOOST_CHECK(equal_week("2014-12-31", "2015-01-01")); -- BOOST_CHECK(equal_week("2015-01-01", "2014-12-31")); -+ BOOST_CHECK(equal_week("2014-12-31 00:00:00", "2015-01-01 00:00:00")); -+ BOOST_CHECK(equal_week("2015-01-01 00:00:00", "2014-12-31 00:00:00")); - } - - - BOOST_AUTO_TEST_CASE(test5) - { - // 2017-12-31 is a Sunday, 2018-01-01 is a Monday -- BOOST_CHECK(!equal_week("2017-12-31", "2018-01-01")); -- BOOST_CHECK(!equal_week("2018-01-01", "2017-12-31")); -+ BOOST_CHECK(!equal_week("2017-12-31 00:00:00", "2018-01-01 00:00:00")); -+ BOOST_CHECK(!equal_week("2018-01-01 00:00:00", "2017-12-31 00:00:00")); - } -diff --git testsuite/scan-datetime.cc testsuite/scan-datetime.cc -new file mode 100644 -index 0000000..8f0d1c0 ---- /dev/null -+++ testsuite/scan-datetime.cc -@@ -0,0 +1,30 @@ -+ -+#define BOOST_TEST_DYN_LINK -+#define BOOST_TEST_MODULE snapper -+ -+#include <boost/test/unit_test.hpp> -+ -+#include "../snapper/AppUtil.h" -+ -+using namespace snapper; -+ -+ -+BOOST_AUTO_TEST_CASE(test1) -+{ -+ time_t t1 = scan_datetime("2020-03-04 12:34:56", true); -+ -+ struct tm tmp1; -+ memset(&tmp1, 0, sizeof(tmp1)); -+ gmtime_r(&t1, &tmp1); -+ -+ BOOST_CHECK_EQUAL(tmp1.tm_year, 2020 - 1900); -+ BOOST_CHECK_EQUAL(tmp1.tm_mon, 3 - 1); -+ BOOST_CHECK_EQUAL(tmp1.tm_mday, 4); -+ -+ BOOST_CHECK_EQUAL(tmp1.tm_yday, 31 + 28 + 4); -+ BOOST_CHECK_EQUAL(tmp1.tm_wday, 3); -+ -+ BOOST_CHECK_EQUAL(tmp1.tm_hour, 12); -+ BOOST_CHECK_EQUAL(tmp1.tm_min, 34); -+ BOOST_CHECK_EQUAL(tmp1.tm_sec, 56); -+} diff --git a/srcpkgs/snapper/patches/0002-fix-32bit-musl-build.patch b/srcpkgs/snapper/patches/0002-fix-32bit-musl-build.patch new file mode 100644 index 000000000000..41eb8053a62d --- /dev/null +++ b/srcpkgs/snapper/patches/0002-fix-32bit-musl-build.patch @@ -0,0 +1,13 @@ +diff --git client/cleanup.cc client/cleanup.cc +index 801c0f5..e57a0a8 100644 +--- client/cleanup.cc ++++ client/cleanup.cc +@@ -51,7 +51,7 @@ struct Parameters + MinFreeLimit free_limit; + + +- void read(const ProxyConfig& config, const char* name, long int& value) ++ void read(const ProxyConfig& config, const char* name, time_t& value) + { + const map<string, string>& raw = config.getAllValues(); + map<string, string>::const_iterator pos = raw.find(name); diff --git a/srcpkgs/snapper/patches/0003-backport-fix-jsonc-linkage.patch b/srcpkgs/snapper/patches/0003-backport-fix-jsonc-linkage.patch deleted file mode 100644 index 2582dfb1d87c..000000000000 --- a/srcpkgs/snapper/patches/0003-backport-fix-jsonc-linkage.patch +++ /dev/null @@ -1,19 +0,0 @@ -This patch fixes the issue, that the build doesn't link against json-c -when --disable-zypp flag is enabled. -See openSUSE/snapper#617 - -diff --git configure.ac configure.ac -index 839d012..06e4721 100644 ---- configure.ac -+++ configure.ac -@@ -194,9 +194,7 @@ fi - - PKG_CHECK_MODULES(DBUS, dbus-1) - PKG_CHECK_MODULES(XML2, libxml-2.0) --if test "x$with_zypp" = "xyes"; then -- PKG_CHECK_MODULES(JSONC, json-c, [], [AC_MSG_WARN([Cannot find json-c. Please install libjson-c-devel])]) --fi -+PKG_CHECK_MODULES(JSONC, json-c, [], [AC_MSG_WARN([Cannot find json-c. Please install libjson-c-devel])]) - - AC_CHECK_HEADER(acl/libacl.h,[],[AC_MSG_ERROR([Cannout find libacl headers. Please install libacl-devel])]) - diff --git a/srcpkgs/snapper/template b/srcpkgs/snapper/template index 481f94c13c5e..bd58ab951c24 100644 --- a/srcpkgs/snapper/template +++ b/srcpkgs/snapper/template @@ -1,6 +1,6 @@ # Template file for 'snapper' pkgname=snapper -version=0.8.15 +version=0.9.0 revision=1 build_style=gnu-configure configure_args="--disable-zypp --disable-systemd --with-conf=/etc/conf.d" @@ -13,11 +13,11 @@ makedepends="acl-devel boost-devel dbus-devel e2fsprogs-devel libbtrfs-devel json-c-devel" depends="dbus" short_desc="Tool for Linux filesystem snapshot management" -maintainer="Orphaned <orphan@voidlinux.org>" +maintainer="FollieHiyuki <folliekazetani@protonmail.com>" license="GPL-2.0-only" homepage="http://snapper.io" distfiles="https://github.com/openSUSE/snapper/archive/v${version}.tar.gz" -checksum=fe0e32912275713f8fad17dbe510f32dbba8526365a849e3f7d6c786d43cfca2 +checksum=ca7b17d0213aa5281ff08d968b4e029b78bb3870eb79fd7bc7f879b17f5c969e lib32disabled=yes if [ "$XBPS_TARGET_LIBC" = musl ]
[-- Attachment #1: Type: text/plain, Size: 1644 bytes --] There is an updated pull request by FollieHiyuki against master on the void-packages repository https://github.com/FollieHiyuki/void-packages snapper-update https://github.com/void-linux/void-packages/pull/30391 [WIP] snapper: update to 0.9.0 <!-- Mark items with [x] where applicable --> #### General - [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements) #### Have the results of the proposed changes been tested? - [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me - [ ] I generally don't use the affected packages but briefly tested this PR <!-- If GitHub CI cannot be used to validate the build result (for example, if the build is likely to take several hours), make sure to [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration). When skipping CI, uncomment and fill out the following section. Note: for builds that are likely to complete in less than 2 hours, it is not acceptable to skip CI. --> <!-- #### Does it build and run successfully? (Please choose at least one native build and, if supported, at least one cross build. More are better.) - [ ] I built this PR locally for my native architecture, (ARCH-LIBC) - [ ] I built this PR locally for these architectures (if supported. mark crossbuilds): - [ ] aarch64-musl - [ ] armv7l - [ ] armv6l-musl --> We probably should wait for #29547 to be merged first. A patch file from https://github.com/void-linux/void-packages/pull/30391.patch is attached [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: github-pr-snapper-update-30391.patch --] [-- Type: text/x-diff, Size: 12306 bytes --] From 3002228557c336074fda050b7bbf188b11b9804c Mon Sep 17 00:00:00 2001 From: FollieHiyuki <folliekazetani@protonmail.com> Date: Tue, 20 Apr 2021 18:20:02 +0300 Subject: [PATCH] snapper: update to 0.9.0; adopt --- .../patches/0001-disable-locale-tests.patch | 29 ++-- .../0002-backport-equal-date-test.patch | 164 ------------------ .../patches/0002-fix-32bit-musl-build.patch | 13 ++ .../0003-backport-fix-jsonc-linkage.patch | 19 -- srcpkgs/snapper/template | 6 +- 5 files changed, 35 insertions(+), 196 deletions(-) delete mode 100644 srcpkgs/snapper/patches/0002-backport-equal-date-test.patch create mode 100644 srcpkgs/snapper/patches/0002-fix-32bit-musl-build.patch delete mode 100644 srcpkgs/snapper/patches/0003-backport-fix-jsonc-linkage.patch diff --git a/srcpkgs/snapper/patches/0001-disable-locale-tests.patch b/srcpkgs/snapper/patches/0001-disable-locale-tests.patch index 05e589dbfc5d..834ffdeffcbb 100644 --- a/srcpkgs/snapper/patches/0001-disable-locale-tests.patch +++ b/srcpkgs/snapper/patches/0001-disable-locale-tests.patch @@ -1,27 +1,28 @@ -These 4 tests fail with error: -std::runtime_error: locale::facet::_S_create_c_locale name not valid - diff --git testsuite/Makefile.am testsuite/Makefile.am -index d7e30b8..001f834 100644 +index ccb84d3..9774a9c 100644 --- testsuite/Makefile.am +++ testsuite/Makefile.am -@@ -7,8 +7,8 @@ AM_CPPFLAGS = -I$(top_srcdir) $(DBUS_CFLAGS) +@@ -7,9 +7,9 @@ AM_CPPFLAGS = -I$(top_srcdir) $(DBUS_CFLAGS) LDADD = ../snapper/libsnapper.la ../dbus/libdbus.la -lboost_unit_test_framework check_PROGRAMS = sysconfig-get1.test dirname1.test basename1.test \ -- equal-date.test dbus-escape.test cmp-lt.test humanstring.test \ +- equal-date.test dbus-escape.test cmp-lt.test humanstring.test uuid.test \ - table.test table-formatter.test csv-formatter.test json-formatter.test \ -+ equal-date.test dbus-escape.test \ +- getopts.test scan-datetime.test root-prefix.test range.test limit.test ++ equal-date.test dbus-escape.test uuid.test \ + csv-formatter.test json-formatter.test \ - getopts.test ++ getopts.test scan-datetime.test root-prefix.test if ENABLE_BTRFS_QUOTA -@@ -27,12 +27,6 @@ EXTRA_DIST = $(noinst_SCRIPTS) sysconfig-get1.txt sysconfig-set1.txt + check_PROGRAMS += qgroup1.test +@@ -29,14 +29,8 @@ equal_date_test_LDADD = -lboost_unit_test_framework ../client/utils/libutils.la - equal_date_test_LDADD = -lboost_unit_test_framework ../client/utils/libutils.la + scan_datetime_test_LDADD = -lboost_unit_test_framework ../client/utils/libutils.la -humanstring_test_LDADD = -lboost_unit_test_framework ../client/utils/libutils.la - + uuid_test_LDADD = -lboost_unit_test_framework ../client/utils/libutils.la + -table_test_LDADD = -lboost_unit_test_framework ../client/utils/libutils.la - -table_formatter_test_LDADD = -lboost_unit_test_framework ../client/utils/libutils.la @@ -29,3 +30,11 @@ index d7e30b8..001f834 100644 csv_formatter_test_LDADD = -lboost_unit_test_framework ../client/utils/libutils.la json_formatter_test_LDADD = -lboost_unit_test_framework ../client/utils/libutils.la $(JSONC_LIBS) +@@ -44,7 +38,3 @@ json_formatter_test_LDADD = -lboost_unit_test_framework ../client/utils/libutils + getopts_test_LDADD = -lboost_unit_test_framework ../client/utils/libutils.la + + lvm_utils_test_LDADD = -lboost_unit_test_framework ../snapper/libsnapper.la +- +-range_test_LDADD = -lboost_unit_test_framework ../client/utils/libutils.la +- +-limit_test_LDADD = -lboost_unit_test_framework ../client/utils/libutils.la diff --git a/srcpkgs/snapper/patches/0002-backport-equal-date-test.patch b/srcpkgs/snapper/patches/0002-backport-equal-date-test.patch deleted file mode 100644 index 688ab7e1f27d..000000000000 --- a/srcpkgs/snapper/patches/0002-backport-equal-date-test.patch +++ /dev/null @@ -1,164 +0,0 @@ -diff --git package/snapper.changes package/snapper.changes -index 9235de3..5570cf1 100644 ---- package/snapper.changes -+++ package/snapper.changes -@@ -1,3 +1,8 @@ -+------------------------------------------------------------------- -+Mon Jan 25 11:29:45 CET 2021 - aschnell@suse.com -+ -+- fixed testsuite for equal-date (gh#openSUSE/snapper#526) -+ - ------------------------------------------------------------------- - Thu Dec 17 12:20:59 CET 2020 - aschnell@suse.com - -diff --git testsuite/Makefile.am testsuite/Makefile.am -index d7e30b8..cfd1002 100644 ---- testsuite/Makefile.am -+++ testsuite/Makefile.am -@@ -9,7 +9,7 @@ LDADD = ../snapper/libsnapper.la ../dbus/libdbus.la -lboost_unit_test_framework - check_PROGRAMS = sysconfig-get1.test dirname1.test basename1.test \ - equal-date.test dbus-escape.test \ - csv-formatter.test json-formatter.test \ -- getopts.test -+ getopts.test scan-datetime.test - - if ENABLE_BTRFS_QUOTA - check_PROGRAMS += qgroup1.test -@@ -27,6 +27,8 @@ EXTRA_DIST = $(noinst_SCRIPTS) sysconfig-get1.txt sysconfig-set1.txt - - equal_date_test_LDADD = -lboost_unit_test_framework ../client/utils/libutils.la - -+scan_datetime_test_LDADD = -lboost_unit_test_framework ../client/utils/libutils.la -+ - csv_formatter_test_LDADD = -lboost_unit_test_framework ../client/utils/libutils.la - - json_formatter_test_LDADD = -lboost_unit_test_framework ../client/utils/libutils.la $(JSONC_LIBS) -diff --git testsuite/equal-date.cc testsuite/equal-date.cc -index 42e00d8..8d8eda8 100644 ---- testsuite/equal-date.cc -+++ testsuite/equal-date.cc -@@ -5,18 +5,25 @@ - #include <boost/test/unit_test.hpp> - - #include "../client/utils/equal-date.h" -+#include "../snapper/AppUtil.h" -+ -+using namespace snapper; - - - bool - equal_week(const char* s1, const char* s2) - { -+ // use interim time_t since strptime on musl does not set tm_yday -+ -+ time_t t1 = scan_datetime(s1, true); - struct tm tmp1; - memset(&tmp1, 0, sizeof(tmp1)); -- strptime(s1, "%Y-%m-%d", &tmp1); -+ gmtime_r(&t1, &tmp1); - -+ time_t t2 = scan_datetime(s2, true); - struct tm tmp2; - memset(&tmp2, 0, sizeof(tmp2)); -- strptime(s2, "%Y-%m-%d", &tmp2); -+ gmtime_r(&t2, &tmp2); - - return equal_week(tmp1, tmp2); - } -@@ -25,46 +32,46 @@ equal_week(const char* s1, const char* s2) - BOOST_AUTO_TEST_CASE(test1) - { - // 2012 is a leap year -- BOOST_CHECK(equal_week("2011-12-31", "2012-01-01")); -- BOOST_CHECK(equal_week("2012-01-01", "2011-12-31")); -+ BOOST_CHECK(equal_week("2011-12-31 00:00:00", "2012-01-01 00:00:00")); -+ BOOST_CHECK(equal_week("2012-01-01 00:00:00", "2011-12-31 00:00:00")); - } - - - BOOST_AUTO_TEST_CASE(test2) - { - // 2012 is a leap year -- BOOST_CHECK(equal_week("2012-12-31", "2013-01-01")); -- BOOST_CHECK(equal_week("2013-01-01", "2012-12-31")); -+ BOOST_CHECK(equal_week("2012-12-31 00:00:00", "2013-01-01 00:00:00")); -+ BOOST_CHECK(equal_week("2013-01-01 00:00:00", "2012-12-31 00:00:00")); - } - - - BOOST_AUTO_TEST_CASE(test3) - { - // Saturday and Sunday -- BOOST_CHECK(equal_week("2014-01-04", "2014-01-05")); -- BOOST_CHECK(equal_week("2014-01-05", "2014-01-04")); -+ BOOST_CHECK(equal_week("2014-01-04 00:00:00", "2014-01-05 00:00:00")); -+ BOOST_CHECK(equal_week("2014-01-05 00:00:00", "2014-01-04 00:00:00")); - - // Sunday and Monday -- BOOST_CHECK(!equal_week("2014-01-05", "2014-01-06")); -- BOOST_CHECK(!equal_week("2014-01-06", "2014-01-05")); -+ BOOST_CHECK(!equal_week("2014-01-05 00:00:00", "2014-01-06 00:00:00")); -+ BOOST_CHECK(!equal_week("2014-01-06 00:00:00", "2014-01-05 00:00:00")); - - // Monday and Tuesday -- BOOST_CHECK(equal_week("2014-01-06", "2014-01-07")); -- BOOST_CHECK(equal_week("2014-01-07", "2014-01-06")); -+ BOOST_CHECK(equal_week("2014-01-06 00:00:00", "2014-01-07 00:00:00")); -+ BOOST_CHECK(equal_week("2014-01-07 00:00:00", "2014-01-06 00:00:00")); - } - - - BOOST_AUTO_TEST_CASE(test4) - { - // 2014-12-31 is a Wednesday, 2015-01-01 is a Thursday -- BOOST_CHECK(equal_week("2014-12-31", "2015-01-01")); -- BOOST_CHECK(equal_week("2015-01-01", "2014-12-31")); -+ BOOST_CHECK(equal_week("2014-12-31 00:00:00", "2015-01-01 00:00:00")); -+ BOOST_CHECK(equal_week("2015-01-01 00:00:00", "2014-12-31 00:00:00")); - } - - - BOOST_AUTO_TEST_CASE(test5) - { - // 2017-12-31 is a Sunday, 2018-01-01 is a Monday -- BOOST_CHECK(!equal_week("2017-12-31", "2018-01-01")); -- BOOST_CHECK(!equal_week("2018-01-01", "2017-12-31")); -+ BOOST_CHECK(!equal_week("2017-12-31 00:00:00", "2018-01-01 00:00:00")); -+ BOOST_CHECK(!equal_week("2018-01-01 00:00:00", "2017-12-31 00:00:00")); - } -diff --git testsuite/scan-datetime.cc testsuite/scan-datetime.cc -new file mode 100644 -index 0000000..8f0d1c0 ---- /dev/null -+++ testsuite/scan-datetime.cc -@@ -0,0 +1,30 @@ -+ -+#define BOOST_TEST_DYN_LINK -+#define BOOST_TEST_MODULE snapper -+ -+#include <boost/test/unit_test.hpp> -+ -+#include "../snapper/AppUtil.h" -+ -+using namespace snapper; -+ -+ -+BOOST_AUTO_TEST_CASE(test1) -+{ -+ time_t t1 = scan_datetime("2020-03-04 12:34:56", true); -+ -+ struct tm tmp1; -+ memset(&tmp1, 0, sizeof(tmp1)); -+ gmtime_r(&t1, &tmp1); -+ -+ BOOST_CHECK_EQUAL(tmp1.tm_year, 2020 - 1900); -+ BOOST_CHECK_EQUAL(tmp1.tm_mon, 3 - 1); -+ BOOST_CHECK_EQUAL(tmp1.tm_mday, 4); -+ -+ BOOST_CHECK_EQUAL(tmp1.tm_yday, 31 + 28 + 4); -+ BOOST_CHECK_EQUAL(tmp1.tm_wday, 3); -+ -+ BOOST_CHECK_EQUAL(tmp1.tm_hour, 12); -+ BOOST_CHECK_EQUAL(tmp1.tm_min, 34); -+ BOOST_CHECK_EQUAL(tmp1.tm_sec, 56); -+} diff --git a/srcpkgs/snapper/patches/0002-fix-32bit-musl-build.patch b/srcpkgs/snapper/patches/0002-fix-32bit-musl-build.patch new file mode 100644 index 000000000000..41eb8053a62d --- /dev/null +++ b/srcpkgs/snapper/patches/0002-fix-32bit-musl-build.patch @@ -0,0 +1,13 @@ +diff --git client/cleanup.cc client/cleanup.cc +index 801c0f5..e57a0a8 100644 +--- client/cleanup.cc ++++ client/cleanup.cc +@@ -51,7 +51,7 @@ struct Parameters + MinFreeLimit free_limit; + + +- void read(const ProxyConfig& config, const char* name, long int& value) ++ void read(const ProxyConfig& config, const char* name, time_t& value) + { + const map<string, string>& raw = config.getAllValues(); + map<string, string>::const_iterator pos = raw.find(name); diff --git a/srcpkgs/snapper/patches/0003-backport-fix-jsonc-linkage.patch b/srcpkgs/snapper/patches/0003-backport-fix-jsonc-linkage.patch deleted file mode 100644 index 2582dfb1d87c..000000000000 --- a/srcpkgs/snapper/patches/0003-backport-fix-jsonc-linkage.patch +++ /dev/null @@ -1,19 +0,0 @@ -This patch fixes the issue, that the build doesn't link against json-c -when --disable-zypp flag is enabled. -See openSUSE/snapper#617 - -diff --git configure.ac configure.ac -index 839d012..06e4721 100644 ---- configure.ac -+++ configure.ac -@@ -194,9 +194,7 @@ fi - - PKG_CHECK_MODULES(DBUS, dbus-1) - PKG_CHECK_MODULES(XML2, libxml-2.0) --if test "x$with_zypp" = "xyes"; then -- PKG_CHECK_MODULES(JSONC, json-c, [], [AC_MSG_WARN([Cannot find json-c. Please install libjson-c-devel])]) --fi -+PKG_CHECK_MODULES(JSONC, json-c, [], [AC_MSG_WARN([Cannot find json-c. Please install libjson-c-devel])]) - - AC_CHECK_HEADER(acl/libacl.h,[],[AC_MSG_ERROR([Cannout find libacl headers. Please install libacl-devel])]) - diff --git a/srcpkgs/snapper/template b/srcpkgs/snapper/template index 481f94c13c5e..bd58ab951c24 100644 --- a/srcpkgs/snapper/template +++ b/srcpkgs/snapper/template @@ -1,6 +1,6 @@ # Template file for 'snapper' pkgname=snapper -version=0.8.15 +version=0.9.0 revision=1 build_style=gnu-configure configure_args="--disable-zypp --disable-systemd --with-conf=/etc/conf.d" @@ -13,11 +13,11 @@ makedepends="acl-devel boost-devel dbus-devel e2fsprogs-devel libbtrfs-devel json-c-devel" depends="dbus" short_desc="Tool for Linux filesystem snapshot management" -maintainer="Orphaned <orphan@voidlinux.org>" +maintainer="FollieHiyuki <folliekazetani@protonmail.com>" license="GPL-2.0-only" homepage="http://snapper.io" distfiles="https://github.com/openSUSE/snapper/archive/v${version}.tar.gz" -checksum=fe0e32912275713f8fad17dbe510f32dbba8526365a849e3f7d6c786d43cfca2 +checksum=ca7b17d0213aa5281ff08d968b4e029b78bb3870eb79fd7bc7f879b17f5c969e lib32disabled=yes if [ "$XBPS_TARGET_LIBC" = musl ]
[-- Attachment #1: Type: text/plain, Size: 317 bytes --] New comment by FollieHiyuki on void-packages repository https://github.com/void-linux/void-packages/pull/30391#issuecomment-823636653 Comment: Technically not a WIP, I put it there with intention to wait for `btrfs-progs` :) Some of the locale tests ran on musl while failing on glibc, so I just disable them all.
[-- Attachment #1: Type: text/plain, Size: 1465 bytes --] There's a merged pull request on the void-packages repository snapper: update to 0.9.0 https://github.com/void-linux/void-packages/pull/30391 Description: <!-- Mark items with [x] where applicable --> #### General - [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements) #### Have the results of the proposed changes been tested? - [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me - [ ] I generally don't use the affected packages but briefly tested this PR <!-- If GitHub CI cannot be used to validate the build result (for example, if the build is likely to take several hours), make sure to [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration). When skipping CI, uncomment and fill out the following section. Note: for builds that are likely to complete in less than 2 hours, it is not acceptable to skip CI. --> <!-- #### Does it build and run successfully? (Please choose at least one native build and, if supported, at least one cross build. More are better.) - [ ] I built this PR locally for my native architecture, (ARCH-LIBC) - [ ] I built this PR locally for these architectures (if supported. mark crossbuilds): - [ ] aarch64-musl - [ ] armv7l - [ ] armv6l-musl --> We probably should wait for #29547 to be merged first.
[-- Attachment #1: Type: text/plain, Size: 163 bytes --] New comment by Piraty on void-packages repository https://github.com/void-linux/void-packages/pull/30391#issuecomment-826379305 Comment: thanks for adopting it!
[-- Attachment #1: Type: text/plain, Size: 242 bytes --] New comment by FollieHiyuki on void-packages repository https://github.com/void-linux/void-packages/pull/30391#issuecomment-826391823 Comment: @Piraty does this work with our current btrfs-progs 5.9? I run 5.11.1 already so I couldn't test
[-- Attachment #1: Type: text/plain, Size: 253 bytes --] New comment by Piraty on void-packages repository https://github.com/void-linux/void-packages/pull/30391#issuecomment-826565840 Comment: I did not test this as I assumed you (as new maintainer) would have noted otherwise. (you can downgrade though)
[-- Attachment #1: Type: text/plain, Size: 458 bytes --] New comment by FollieHiyuki on void-packages repository https://github.com/void-linux/void-packages/pull/30391#issuecomment-826622280 Comment: Yes sorry about that. I did downgrade for a few hours to test the commands and the cron jobs. But I moved back to 5.11.1 after that. I already noted above that we probably should wait, as I don't trust myself that much with those few hours. Though I can confirm the cron jobs and the commands works as expected.
[-- Attachment #1: Type: text/plain, Size: 292 bytes --] New comment by Piraty on void-packages repository https://github.com/void-linux/void-packages/pull/30391#issuecomment-826782629 Comment: oh I'm sorry, my bad really! i didn't spot the cross-reference to the btrfs-progs PR in the top post. let's keep as is now and revert only if necessary