Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package snapper for openSUSE:Factory checked in at 2021-11-20 02:38:21 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/snapper (Old) and /work/SRC/openSUSE:Factory/.snapper.new.1895 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "snapper" Sat Nov 20 02:38:21 2021 rev:132 rq:930646 version:0.9.1 Changes: -------- --- /work/SRC/openSUSE:Factory/snapper/snapper.changes 2021-07-02 13:27:16.804847647 +0200 +++ /work/SRC/openSUSE:Factory/.snapper.new.1895/snapper.changes 2021-11-20 02:38:58.764811985 +0100 @@ -1,0 +2,7 @@ +Tue Sep 21 13:30:29 CEST 2021 - aschn...@suse.com + +- look for most configuration files in /etc/snapper and + /usr/share/snapper (bsc#1189601) +- version 0.9.1 + +------------------------------------------------------------------- Old: ---- snapper-0.9.0.tar.bz2 New: ---- snapper-0.9.1.tar.bz2 snapper-Debian_11.0.dsc snapper-xUbuntu_21.10.dsc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ snapper.spec ++++++ --- /var/tmp/diff_new_pack.5S5UKQ/_old 2021-11-20 02:38:59.716808844 +0100 +++ /var/tmp/diff_new_pack.5S5UKQ/_new 2021-11-20 02:38:59.720808831 +0100 @@ -32,7 +32,7 @@ %bcond_with coverage Name: snapper -Version: 0.9.0 +Version: 0.9.1 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build Source: snapper-%{version}.tar.bz2 @@ -226,10 +226,11 @@ %{_libdir}/libsnapper.so.* %dir %{_sysconfdir}/snapper %dir %{_sysconfdir}/snapper/configs -%dir %{_sysconfdir}/snapper/config-templates -%config(noreplace) %{_sysconfdir}/snapper/config-templates/default -%dir %{_sysconfdir}/snapper/filters -%config(noreplace) %{_sysconfdir}/snapper/filters/*.txt +%dir %{_datadir}/snapper +%dir %{_datadir}/snapper/config-templates +%{_datadir}/snapper/config-templates/default +%dir %{_datadir}/snapper/filters +%{_datadir}/snapper/filters/*.txt %doc %dir %{_defaultdocdir}/snapper %doc %{_defaultdocdir}/snapper/AUTHORS %doc %{_defaultdocdir}/snapper/COPYING @@ -239,6 +240,18 @@ %config(noreplace) %{_sysconfdir}/sysconfig/snapper %endif +%pre -n libsnapper5 +# Migration from /etc/snapper to /usr/share/snapper +for i in config-templates/default filters/base.txt filters/lvm.txt filters/x11.txt ; do + test -f /etc/snapper/${i}.rpmsave && mv -v /etc/snapper/${i}.rpmsave /etc/snapper/${i}.rpmsave.old ||: +done + +%posttrans -n libsnapper5 +# Migration from /etc/snapper to /usr/share/snapper +for i in config-templates/default filters/base.txt filters/lvm.txt filters/x11.txt ; do + test -f /etc/snapper/${i}.rpmsave && mv -v /etc/snapper/${i}.rpmsave /etc/snapper/${i} ||: +done + %post -n libsnapper5 /sbin/ldconfig %if 0%{?suse_version} @@ -288,7 +301,7 @@ %files -n snapper-zypp-plugin %defattr(-,root,root) -%config(noreplace) %{_sysconfdir}/snapper/zypp-plugin.conf +%{_datadir}/snapper/zypp-plugin.conf %if 0%{?suse_version} < 1210 %dir /usr/lib/zypp %dir /usr/lib/zypp/plugins @@ -298,6 +311,18 @@ %doc %{_mandir}/*/snapper-zypp-plugin.8* %doc %{_mandir}/*/snapper-zypp-plugin.conf.5* +%pre -n snapper-zypp-plugin +# Migration from /etc/snapper to /usr/share/snapper +for i in zypp-plugin.conf ; do + test -f /etc/snapper/${i}.rpmsave && mv -v /etc/snapper/${i}.rpmsave /etc/snapper/${i}.rpmsave.old ||: +done + +%posttrans -n snapper-zypp-plugin +# Migration from /etc/snapper to /usr/share/snapper +for i in zypp-plugin.conf ; do + test -f /etc/snapper/${i}.rpmsave && mv -v /etc/snapper/${i}.rpmsave /etc/snapper/${i} ||: +done + %package -n pam_snapper Requires: pam Requires: snapper = %version ++++++ debian.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/debian/changelog new/debian/changelog --- old/debian/changelog 2021-06-22 02:00:00.000000000 +0200 +++ new/debian/changelog 2021-11-10 01:00:00.000000000 +0100 @@ -1,3 +1,9 @@ +snapper (0.9.1) stable; urgency=low + + * Updated to version 0.9.1 + + -- Arvin Schnell <aschn...@suse.com> Wed, 22 Sep 2021 09:16:12 +0000 + snapper (0.9.0) stable; urgency=low * Updated to version 0.9.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/debian/libsnapper.install new/debian/libsnapper.install --- old/debian/libsnapper.install 2021-06-22 02:00:00.000000000 +0200 +++ new/debian/libsnapper.install 2021-11-10 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ -etc/snapper/config-templates etc/snapper/configs -etc/snapper/filters etc/sysconfig/snapper +usr/share/snapper/config-templates +usr/share/snapper/filters usr/lib/libsnapper.so.* usr/share/doc/packages/snapper diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/debian/snapper-zypp-plugin.install new/debian/snapper-zypp-plugin.install --- old/debian/snapper-zypp-plugin.install 2021-06-22 02:00:00.000000000 +0200 +++ new/debian/snapper-zypp-plugin.install 2021-11-10 01:00:00.000000000 +0100 @@ -1,2 +1,2 @@ usr/lib/zypp/plugins/commit/snapper-zypp-plugin -etc/snapper/zypp-plugin.conf +usr/share/snapper/zypp-plugin.conf ++++++ snapper-0.9.0.tar.bz2 -> snapper-0.9.1.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.9.0/Makefile.am new/snapper-0.9.1/Makefile.am --- old/snapper-0.9.0/Makefile.am 2021-06-22 02:00:00.000000000 +0200 +++ new/snapper-0.9.1/Makefile.am 2021-11-10 01:00:00.000000000 +0100 @@ -16,6 +16,7 @@ DEBIAN_FLAVOURS = \ Debian_9.0 \ Debian_10.0 \ + Debian_11.0 \ Debian_Unstable UBUNTU_FLAVOURS = \ @@ -27,7 +28,8 @@ xUbuntu_19.10 \ xUbuntu_20.04 \ xUbuntu_20.10 \ - xUbuntu_21.04 + xUbuntu_21.04 \ + xUbuntu_21.10 RASPBIAN_FLAVOURS = \ Raspbian_10 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.9.0/Makefile.in new/snapper-0.9.1/Makefile.in --- old/snapper-0.9.0/Makefile.in 2021-06-22 02:00:00.000000000 +0200 +++ new/snapper-0.9.1/Makefile.in 2021-11-10 01:00:00.000000000 +0100 @@ -406,6 +406,7 @@ DEBIAN_FLAVOURS = \ Debian_9.0 \ Debian_10.0 \ + Debian_11.0 \ Debian_Unstable UBUNTU_FLAVOURS = \ @@ -417,7 +418,8 @@ xUbuntu_19.10 \ xUbuntu_20.04 \ xUbuntu_20.10 \ - xUbuntu_21.04 + xUbuntu_21.04 \ + xUbuntu_21.10 RASPBIAN_FLAVOURS = \ Raspbian_10 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.9.0/VERSION new/snapper-0.9.1/VERSION --- old/snapper-0.9.0/VERSION 2021-06-22 02:00:00.000000000 +0200 +++ new/snapper-0.9.1/VERSION 2021-11-10 01:00:00.000000000 +0100 @@ -1 +1 @@ -0.9.0 +0.9.1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.9.0/client/installation-helper.cc new/snapper-0.9.1/client/installation-helper.cc --- old/snapper-0.9.0/client/installation-helper.cc 2021-06-22 02:00:00.000000000 +0200 +++ new/snapper-0.9.1/client/installation-helper.cc 2021-11-10 01:00:00.000000000 +0100 @@ -73,7 +73,7 @@ try { - SysconfigFile config(CONFIG_TEMPLATE_DIR "/" "default"); + SysconfigFile config(locate_file("default", ETC_CONFIG_TEMPLATE_DIR, USR_CONFIG_TEMPLATE_DIR)); config.setName(tmp_mount.getFullname() + CONFIGS_DIR "/" "root"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.9.0/data/Makefile.am new/snapper-0.9.1/data/Makefile.am --- old/snapper-0.9.0/data/Makefile.am 2021-06-22 02:00:00.000000000 +0200 +++ new/snapper-0.9.1/data/Makefile.am 2021-11-10 01:00:00.000000000 +0100 @@ -11,12 +11,14 @@ install -D -m 644 snapper.logrotate $(DESTDIR)/etc/logrotate.d/snapper install -d -m 755 $(DESTDIR)/etc/snapper/configs - install -D -m 644 default-config $(DESTDIR)/etc/snapper/config-templates/default - install -d -m 755 $(DESTDIR)/etc/snapper/filters - install -D -m 644 base.txt $(DESTDIR)/etc/snapper/filters/base.txt - install -D -m 644 lvm.txt $(DESTDIR)/etc/snapper/filters/lvm.txt - install -D -m 644 x11.txt $(DESTDIR)/etc/snapper/filters/x11.txt + install -d -m 755 $(DESTDIR)/usr/share/snapper/config-templates + install -D -m 644 default-config $(DESTDIR)/usr/share/snapper/config-templates/default + + install -d -m 755 $(DESTDIR)/usr/share/snapper/filters + install -D -m 644 base.txt $(DESTDIR)/usr/share/snapper/filters/base.txt + install -D -m 644 lvm.txt $(DESTDIR)/usr/share/snapper/filters/lvm.txt + install -D -m 644 x11.txt $(DESTDIR)/usr/share/snapper/filters/x11.txt install -D -m 644 org.opensuse.Snapper.conf $(DESTDIR)/usr/share/dbus-1/system.d/org.opensuse.Snapper.conf install -D -m 644 org.opensuse.Snapper.service $(DESTDIR)/usr/share/dbus-1/system-services/org.opensuse.Snapper.service @@ -32,5 +34,5 @@ endif if HAVE_ZYPP - install -D -m 644 zypp-plugin.conf $(DESTDIR)/etc/snapper/zypp-plugin.conf + install -D -m 644 zypp-plugin.conf $(DESTDIR)/usr/share/snapper/zypp-plugin.conf endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.9.0/data/Makefile.in new/snapper-0.9.1/data/Makefile.in --- old/snapper-0.9.0/data/Makefile.in 2021-06-22 02:00:00.000000000 +0200 +++ new/snapper-0.9.1/data/Makefile.in 2021-11-10 01:00:00.000000000 +0100 @@ -476,12 +476,14 @@ install -D -m 644 snapper.logrotate $(DESTDIR)/etc/logrotate.d/snapper install -d -m 755 $(DESTDIR)/etc/snapper/configs - install -D -m 644 default-config $(DESTDIR)/etc/snapper/config-templates/default - install -d -m 755 $(DESTDIR)/etc/snapper/filters - install -D -m 644 base.txt $(DESTDIR)/etc/snapper/filters/base.txt - install -D -m 644 lvm.txt $(DESTDIR)/etc/snapper/filters/lvm.txt - install -D -m 644 x11.txt $(DESTDIR)/etc/snapper/filters/x11.txt + install -d -m 755 $(DESTDIR)/usr/share/snapper/config-templates + install -D -m 644 default-config $(DESTDIR)/usr/share/snapper/config-templates/default + + install -d -m 755 $(DESTDIR)/usr/share/snapper/filters + install -D -m 644 base.txt $(DESTDIR)/usr/share/snapper/filters/base.txt + install -D -m 644 lvm.txt $(DESTDIR)/usr/share/snapper/filters/lvm.txt + install -D -m 644 x11.txt $(DESTDIR)/usr/share/snapper/filters/x11.txt install -D -m 644 org.opensuse.Snapper.conf $(DESTDIR)/usr/share/dbus-1/system.d/org.opensuse.Snapper.conf install -D -m 644 org.opensuse.Snapper.service $(DESTDIR)/usr/share/dbus-1/system-services/org.opensuse.Snapper.service @@ -494,7 +496,7 @@ @ENABLE_SYSTEMD_TRUE@ install -D -m 644 boot.timer $(DESTDIR)/usr/lib/systemd/system/snapper-boot.timer @ENABLE_SYSTEMD_TRUE@ install -D -m 644 snapperd.service $(DESTDIR)/usr/lib/systemd/system/snapperd.service -@HAVE_ZYPP_TRUE@ install -D -m 644 zypp-plugin.conf $(DESTDIR)/etc/snapper/zypp-plugin.conf +@HAVE_ZYPP_TRUE@ install -D -m 644 zypp-plugin.conf $(DESTDIR)/usr/share/snapper/zypp-plugin.conf # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.9.0/doc/snapper-zypp-plugin.conf.xml.in new/snapper-0.9.1/doc/snapper-zypp-plugin.conf.xml.in --- old/snapper-0.9.0/doc/snapper-zypp-plugin.conf.xml.in 2021-06-22 02:00:00.000000000 +0200 +++ new/snapper-0.9.1/doc/snapper-zypp-plugin.conf.xml.in 2021-11-10 01:00:00.000000000 +0100 @@ -2,13 +2,13 @@ <refentry id='snapper-zypp-plugin.conf5'> <refentryinfo> - <date>2013-11-22</date> + <date>2021-09-21</date> </refentryinfo> <refmeta> <refentrytitle>snapper-zypp-plugin.conf</refentrytitle> <manvolnum>5</manvolnum> - <refmiscinfo class='date'>2013-11-22</refmiscinfo> + <refmiscinfo class='date'>2021-09-21</refmiscinfo> <refmiscinfo class='version'>@VERSION@</refmiscinfo> <refmiscinfo class='manual'>Filesystem Snapshot Management</refmiscinfo> </refmeta> @@ -20,8 +20,10 @@ <refsect1 id='description'> <title>DESCRIPTION</title> - <para>The file <filename>/etc/snapper/zypp-plugin.conf</filename> contains - the configuation for snapper-zypp-plugin.</para> + <para>The file <filename>/etc/snapper/zypp-plugin.conf</filename> + or as a fallback + <filename>/usr/share/snapper/zypp-plugin.conf</filename> contains the + configuation for snapper-zypp-plugin.</para> <para>The file uses XML syntax. For the XML structure have a look at the provided default config.</para> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.9.0/doc/snapper-zypp-plugin.xml.in new/snapper-0.9.1/doc/snapper-zypp-plugin.xml.in --- old/snapper-0.9.0/doc/snapper-zypp-plugin.xml.in 2021-06-22 02:00:00.000000000 +0200 +++ new/snapper-0.9.1/doc/snapper-zypp-plugin.xml.in 2021-11-10 01:00:00.000000000 +0100 @@ -2,13 +2,13 @@ <refentry id='snapper-zypp-plugin8'> <refentryinfo> - <date>2013-11-22</date> + <date>2021-09-21</date> </refentryinfo> <refmeta> <refentrytitle>snapper-zypp-plugin</refentrytitle> <manvolnum>8</manvolnum> - <refmiscinfo class='date'>2013-11-22</refmiscinfo> + <refmiscinfo class='date'>2021-09-21</refmiscinfo> <refmiscinfo class='version'>@VERSION@</refmiscinfo> <refmiscinfo class='manual'>Filesystem Snapshot Management</refmiscinfo> </refmeta> @@ -34,6 +34,12 @@ <para>Configuration file. New in version 0.1.8.</para> </listitem> </varlistentry> + <varlistentry> + <term><filename>/usr/share/snapper/zypp-plugin.conf</filename></term> + <listitem> + <para>Fallback configuration file. New in version 0.9.1.</para> + </listitem> + </varlistentry> </variablelist> </refsect1> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.9.0/doc/snapper.xml.in new/snapper-0.9.1/doc/snapper.xml.in --- old/snapper-0.9.0/doc/snapper.xml.in 2021-06-22 02:00:00.000000000 +0200 +++ new/snapper-0.9.1/doc/snapper.xml.in 2021-11-10 01:00:00.000000000 +0100 @@ -2,13 +2,13 @@ <refentry id='snapper8' xmlns:xlink="http://www.w3.org/1999/xlink"> <refentryinfo> - <date>2020-06-15</date> + <date>2021-09-21</date> </refentryinfo> <refmeta> <refentrytitle>snapper</refentrytitle> <manvolnum>8</manvolnum> - <refmiscinfo class='date'>2020-06-15</refmiscinfo> + <refmiscinfo class='date'>2021-09-21</refmiscinfo> <refmiscinfo class='version'>@VERSION@</refmiscinfo> <refmiscinfo class='manual'>Filesystem Snapshot Management</refmiscinfo> </refmeta> @@ -175,11 +175,13 @@ e.g. <filename>/etc/mtab</filename>. Such files should never be reverted. To help users, snapper allows one to ignore these files.</para> - <para>Each line in all - files <filename>/etc/snapper/filters/*.txt</filename> specifies a - pattern. When snapper computes the difference between two snapshots it - ignores all files and directories matching any of those patterns by - using + <para>Filters are read from the files + <filename>/etc/snapper/filters/*.txt</filename> and + <filename>/usr/share/snapper/filters/*.txt</filename>, where + for files with the same name the former location has precedence. + Each line in those files specifies a pattern. When snapper + computes the difference between two snapshots it ignores all + files and directories matching any of those patterns by using <citerefentry role="nolink"><refentrytitle>fnmatch</refentrytitle><manvolnum>3</manvolnum></citerefentry> with the flag FNM_LEADING_DIR.</para> @@ -859,12 +861,24 @@ </listitem> </varlistentry> <varlistentry> + <term><filename>/usr/share/snapper/config-templates</filename></term> + <listitem> + <para>Fallback directory containing configuration templates.</para> + </listitem> + </varlistentry> + <varlistentry> <term><filename>/etc/snapper/filters/*.txt</filename></term> <listitem> <para>Filter files.</para> </listitem> </varlistentry> <varlistentry> + <term><filename>/usr/share/snapper/filters/*.txt</filename></term> + <listitem> + <para>Fallback filter files.</para> + </listitem> + </varlistentry> + <varlistentry> <term><filename>/var/log/snapper.log</filename></term> <listitem> <para>Logfile. Please include this file in bug reports.</para> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.9.0/snapper/AppUtil.cc new/snapper-0.9.1/snapper/AppUtil.cc --- old/snapper-0.9.0/snapper/AppUtil.cc 2021-06-22 02:00:00.000000000 +0200 +++ new/snapper-0.9.1/snapper/AppUtil.cc 2021-11-10 01:00:00.000000000 +0100 @@ -56,10 +56,10 @@ } - list<string> + vector<string> glob(const string& path, int flags) { - list<string> ret; + vector<string> ret; glob_t globbuf; if (glob(path.c_str(), flags, 0, &globbuf) == 0) @@ -176,6 +176,21 @@ } + string + locate_file(const string& f, const char* p1, const char* p2) + { + string f1 = string(p1) + "/" + f; + if (access(f1.c_str(), R_OK) == 0) + return f1; + + string f2 = string(p2) + "/" + f; + if (access(f2.c_str(), R_OK) == 0) + return f2; + + throw runtime_error(sformat("file '%s' not found in '%s' nor '%s'", f.c_str(), p1, p2)); + } + + unsigned pagesize() { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.9.0/snapper/AppUtil.h new/snapper-0.9.1/snapper/AppUtil.h --- old/snapper-0.9.0/snapper/AppUtil.h 2021-06-22 02:00:00.000000000 +0200 +++ new/snapper-0.9.1/snapper/AppUtil.h 2021-11-10 01:00:00.000000000 +0100 @@ -33,7 +33,6 @@ #include <sstream> #include <locale> #include <string> -#include <list> #include <map> #include <vector> #include <stdexcept> @@ -43,14 +42,13 @@ namespace snapper { using std::string; - using std::list; using std::map; using std::vector; bool checkDir(const string& Path_Cv); - list<string> glob(const string& path, int flags); + vector<string> glob(const string& path, int flags); bool clonefile(int src_fd, int dest_fd); bool copyfile(int src_fd, int dest_fd); @@ -68,6 +66,12 @@ string basename(const string& name); + /** + * Locate the file f first in p1 and second in p2. + */ + string locate_file(const string& f, const char* p1, const char* p2); + + struct MtabData { string device; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.9.0/snapper/AppUtil2.cc new/snapper-0.9.1/snapper/AppUtil2.cc --- old/snapper-0.9.0/snapper/AppUtil2.cc 2021-06-22 02:00:00.000000000 +0200 +++ new/snapper-0.9.1/snapper/AppUtil2.cc 2021-11-10 01:00:00.000000000 +0100 @@ -21,7 +21,7 @@ // This tiny file is separated from AppUtil.cc to allow setting specific -// defines. Unsetting _GNU_SOURCE in AppUtil.cc causes may errors. See +// defines. Unsetting _GNU_SOURCE in AppUtil.cc causes many errors. See // https://github.com/openSUSE/snapper/pull/581. // Defines to get the XSI-compliant strerror_r. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.9.0/snapper/Btrfs.cc new/snapper-0.9.1/snapper/Btrfs.cc --- old/snapper-0.9.0/snapper/Btrfs.cc 2021-06-22 02:00:00.000000000 +0200 +++ new/snapper-0.9.1/snapper/Btrfs.cc 2021-11-10 01:00:00.000000000 +0100 @@ -478,8 +478,11 @@ } catch (const IOErrorException& e) { + SN_CAUGHT(e); + // TODO the openInfoDir above logs an error although when this // function is used from nextNumber the failure is ok + return false; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.9.0/snapper/Enum.cc new/snapper-0.9.1/snapper/Enum.cc --- old/snapper-0.9.0/snapper/Enum.cc 2021-06-22 02:00:00.000000000 +0200 +++ new/snapper-0.9.1/snapper/Enum.cc 2021-11-10 01:00:00.000000000 +0100 @@ -27,11 +27,8 @@ namespace snapper { - static const string snapshot_type_names[] = { + const vector<string> EnumInfo<SnapshotType>::names({ "single", "pre", "post" - }; - - const vector<string> EnumInfo<SnapshotType>::names(snapshot_type_names, snapshot_type_names + - lengthof(snapshot_type_names)); + }); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.9.0/snapper/Filesystem.cc new/snapper-0.9.1/snapper/Filesystem.cc --- old/snapper-0.9.0/snapper/Filesystem.cc 2021-06-22 02:00:00.000000000 +0200 +++ new/snapper-0.9.1/snapper/Filesystem.cc 2021-11-10 01:00:00.000000000 +0100 @@ -57,7 +57,7 @@ vector<string> Filesystem::filter_mount_options(const vector<string>& options) { - static const char* ign_opt[] = { + static const char* ign_opts[] = { "ro", "rw", "exec", "noexec", "suid", "nosuid", "dev", "nodev", "atime", "noatime", "diratime", "nodiratime", @@ -66,8 +66,8 @@ vector<string> ret = options; - for (size_t i = 0; i < lengthof(ign_opt); ++i) - ret.erase(remove(ret.begin(), ret.end(), ign_opt[i]), ret.end()); + for (const char* ign_opt : ign_opts) + ret.erase(remove(ret.begin(), ret.end(), ign_opt), ret.end()); return ret; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.9.0/snapper/Snapper.cc new/snapper-0.9.1/snapper/Snapper.cc --- old/snapper-0.9.0/snapper/Snapper.cc 2021-06-22 02:00:00.000000000 +0200 +++ new/snapper-0.9.1/snapper/Snapper.cc 2021-11-10 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ /* * Copyright (c) [2011-2015] Novell, Inc. - * Copyright (c) [2016-2020] SUSE LLC + * Copyright (c) [2016-2021] SUSE LLC * * All Rights Reserved. * @@ -158,12 +158,29 @@ void Snapper::loadIgnorePatterns() { - const list<string> files = glob(FILTERS_DIR "/*.txt", GLOB_NOSORT); - for (list<string>::const_iterator it = files.begin(); it != files.end(); ++it) + const vector<string> etc_files = glob(ETC_FILTERS_DIR "/*.txt", GLOB_NOSORT); + const vector<string> usr_files = glob(USR_FILTERS_DIR "/*.txt", GLOB_NOSORT); + + // all files from /etc + vector<string> files = etc_files; + + // files from /usr where no corresponding file in /etc exists + for (const string& usr_file : usr_files) + { + string b1 = basename(usr_file); + + if (none_of(etc_files.begin(), etc_files.end(), [&b1](const string& etc_file) { + string b2 = basename(etc_file); + return b1 == b2; + })) + files.push_back(usr_file); + } + + for (const string& file : files) { try { - AsciiFileReader asciifile(*it); + AsciiFileReader asciifile(file); string line; while (asciifile.getline(line)) @@ -335,7 +352,13 @@ } } - if (access(string(CONFIG_TEMPLATE_DIR "/" + template_name).c_str(), R_OK) != 0) + string template_file; + + try + { + template_file = locate_file(template_name, ETC_CONFIG_TEMPLATE_DIR, USR_CONFIG_TEMPLATE_DIR); + } + catch (...) { SN_THROW(CreateConfigFailedException("cannot access template config")); } @@ -374,7 +397,7 @@ try { - SysconfigFile config(CONFIG_TEMPLATE_DIR "/" + template_name); + SysconfigFile config(template_file); config.setName(CONFIGS_DIR "/" + config_name); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.9.0/snapper/SnapperDefines.h new/snapper-0.9.1/snapper/SnapperDefines.h --- old/snapper-0.9.0/snapper/SnapperDefines.h 2021-06-22 02:00:00.000000000 +0200 +++ new/snapper-0.9.1/snapper/SnapperDefines.h 2021-11-10 01:00:00.000000000 +0100 @@ -30,9 +30,12 @@ #define SYSCONFIG_FILE CONF_DIR "/snapper" #define CONFIGS_DIR "/etc/snapper/configs" -#define CONFIG_TEMPLATE_DIR "/etc/snapper/config-templates" -#define FILTERS_DIR "/etc/snapper/filters" +#define ETC_CONFIG_TEMPLATE_DIR "/etc/snapper/config-templates" +#define USR_CONFIG_TEMPLATE_DIR "/usr/share/snapper/config-templates" + +#define ETC_FILTERS_DIR "/etc/snapper/filters" +#define USR_FILTERS_DIR "/usr/share/snapper/filters" #define DEV_DIR "/dev" #define DEV_MAPPER_DIR "/dev/mapper" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.9.0/snapper/SnapperTmpl.h new/snapper-0.9.1/snapper/SnapperTmpl.h --- old/snapper-0.9.0/snapper/SnapperTmpl.h 2021-06-22 02:00:00.000000000 +0200 +++ new/snapper-0.9.1/snapper/SnapperTmpl.h 2021-11-10 01:00:00.000000000 +0100 @@ -116,10 +116,6 @@ return find_if(l.begin(), l.end(), pred) != l.end(); } - - template <class T, unsigned int sz> - inline unsigned int lengthof(T (&)[sz]) { return sz; } - } #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.9.0/snapper/XmlFile.h new/snapper-0.9.1/snapper/XmlFile.h --- old/snapper-0.9.0/snapper/XmlFile.h 2021-06-22 02:00:00.000000000 +0200 +++ new/snapper-0.9.1/snapper/XmlFile.h 2021-11-10 01:00:00.000000000 +0100 @@ -36,6 +36,7 @@ namespace snapper { using std::string; + using std::list; class XmlFile : private boost::noncopyable diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.9.0/snapper.spec.in new/snapper-0.9.1/snapper.spec.in --- old/snapper-0.9.0/snapper.spec.in 2021-06-22 02:00:00.000000000 +0200 +++ new/snapper-0.9.1/snapper.spec.in 2021-11-10 01:00:00.000000000 +0100 @@ -226,10 +226,11 @@ %{_libdir}/libsnapper.so.* %dir %{_sysconfdir}/snapper %dir %{_sysconfdir}/snapper/configs -%dir %{_sysconfdir}/snapper/config-templates -%config(noreplace) %{_sysconfdir}/snapper/config-templates/default -%dir %{_sysconfdir}/snapper/filters -%config(noreplace) %{_sysconfdir}/snapper/filters/*.txt +%dir %{_datadir}/snapper +%dir %{_datadir}/snapper/config-templates +%{_datadir}/snapper/config-templates/default +%dir %{_datadir}/snapper/filters +%{_datadir}/snapper/filters/*.txt %doc %dir %{_defaultdocdir}/snapper %doc %{_defaultdocdir}/snapper/AUTHORS %doc %{_defaultdocdir}/snapper/COPYING @@ -239,6 +240,18 @@ %config(noreplace) %{_sysconfdir}/sysconfig/snapper %endif +%pre -n libsnapper@LIBVERSION_MAJOR@ +# Migration from /etc/snapper to /usr/share/snapper +for i in config-templates/default filters/base.txt filters/lvm.txt filters/x11.txt ; do + test -f /etc/snapper/${i}.rpmsave && mv -v /etc/snapper/${i}.rpmsave /etc/snapper/${i}.rpmsave.old ||: +done + +%posttrans -n libsnapper@LIBVERSION_MAJOR@ +# Migration from /etc/snapper to /usr/share/snapper +for i in config-templates/default filters/base.txt filters/lvm.txt filters/x11.txt ; do + test -f /etc/snapper/${i}.rpmsave && mv -v /etc/snapper/${i}.rpmsave /etc/snapper/${i} ||: +done + %post -n libsnapper@LIBVERSION_MAJOR@ /sbin/ldconfig %if 0%{?suse_version} @@ -288,7 +301,7 @@ %files -n snapper-zypp-plugin %defattr(-,root,root) -%config(noreplace) %{_sysconfdir}/snapper/zypp-plugin.conf +%{_datadir}/snapper/zypp-plugin.conf %if 0%{?suse_version} < 1210 %dir /usr/lib/zypp %dir /usr/lib/zypp/plugins @@ -298,6 +311,18 @@ %doc %{_mandir}/*/snapper-zypp-plugin.8* %doc %{_mandir}/*/snapper-zypp-plugin.conf.5* +%pre -n snapper-zypp-plugin +# Migration from /etc/snapper to /usr/share/snapper +for i in zypp-plugin.conf ; do + test -f /etc/snapper/${i}.rpmsave && mv -v /etc/snapper/${i}.rpmsave /etc/snapper/${i}.rpmsave.old ||: +done + +%posttrans -n snapper-zypp-plugin +# Migration from /etc/snapper to /usr/share/snapper +for i in zypp-plugin.conf ; do + test -f /etc/snapper/${i}.rpmsave && mv -v /etc/snapper/${i}.rpmsave /etc/snapper/${i} ||: +done + %package -n pam_snapper Requires: pam Requires: snapper = %version diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.9.0/zypp-plugin/snapper_zypp_plugin.cc new/snapper-0.9.1/zypp-plugin/snapper_zypp_plugin.cc --- old/snapper-0.9.0/zypp-plugin/snapper_zypp_plugin.cc 2021-06-22 02:00:00.000000000 +0200 +++ new/snapper-0.9.1/zypp-plugin/snapper_zypp_plugin.cc 2021-11-10 01:00:00.000000000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) [2019-2020] SUSE LLC + * Copyright (c) [2019-2021] SUSE LLC * * All Rights Reserved. * @@ -68,27 +68,29 @@ } // Normally the only configuration this program needs is -// the /etc/snapper/zypp-plugin.conf file. +// the zypp-plugin.conf file in /etc/snapper or /usr/share/snapper. // But for testing we need more places to inject mocks. // This is done with SNAPPER_ZYPP_PLUGIN_* environment variables. // (Using argv is not useful since libzypp does not use it in the // plugin protocol.) -class ProgramOptions { +class ProgramOptions +{ + public: + string plugin_config; - string snapper_config; - DBusBusType bus; + string snapper_config = "root"; + DBusBusType bus = DBUS_BUS_SYSTEM; ProgramOptions() - : plugin_config("/etc/snapper/zypp-plugin.conf") - , snapper_config("root") - , bus(DBUS_BUS_SYSTEM) { const char* s; s = getenv("SNAPPER_ZYPP_PLUGIN_CONFIG"); if (s) plugin_config = s; + else + plugin_config = locate_file("zypp-plugin.conf", "/etc/snapper", "/usr/share/snapper"); s = getenv("SNAPPER_ZYPP_PLUGIN_SNAPPER_CONFIG"); if (s) @@ -98,6 +100,7 @@ if (s) bus = DBUS_BUS_SESSION; } + }; class SnapperZyppPlugin : public ZyppCommitPlugin { ++++++ snapper-Debian_10.0.dsc ++++++ --- /var/tmp/diff_new_pack.5S5UKQ/_old 2021-11-20 02:39:00.224807168 +0100 +++ /var/tmp/diff_new_pack.5S5UKQ/_new 2021-11-20 02:39:00.228807155 +0100 @@ -1,6 +1,6 @@ Format: 1.0 Source: snapper -Version: 0.9.0-1 +Version: 0.9.1-1 Binary: snapper Maintainer: Arvin Schnell <aschn...@suse.com> Architecture: any @@ -11,4 +11,4 @@ # 423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz # Files: -2eef45af33426414604d8f03467c0e6c 638839 snapper-0.9.0.tar.bz2 +9207fe474f5af47d0621faae026547e2 639804 snapper-0.9.1.tar.bz2 ++++++ snapper-Debian_11.0.dsc ++++++ Format: 1.0 Source: snapper Version: 0.9.1-1 Binary: snapper Maintainer: Arvin Schnell <aschn...@suse.com> Architecture: any Build-Depends: debhelper (>= 4.1.16), acl-dev, dbus, g++, libboost-dev, libboost-thread-dev, libboost-system-dev, libboost-test-dev, libxml2-dev, libz-dev, libdbus-1-dev, libjson-c-dev, libpam-dev, xsltproc, docbook-xsl, locales-all, ncurses-dev # # The 'Files' line is generated during 'make package': # Files: # 423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz # Files: 9207fe474f5af47d0621faae026547e2 639804 snapper-0.9.1.tar.bz2 ++++++ snapper-Debian_9.0.dsc ++++++ --- /var/tmp/diff_new_pack.5S5UKQ/_old 2021-11-20 02:39:00.264807036 +0100 +++ /var/tmp/diff_new_pack.5S5UKQ/_new 2021-11-20 02:39:00.264807036 +0100 @@ -1,6 +1,6 @@ Format: 1.0 Source: snapper -Version: 0.9.0-1 +Version: 0.9.1-1 Binary: snapper Maintainer: Arvin Schnell <aschn...@suse.com> Architecture: any @@ -11,4 +11,4 @@ # 423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz # Files: -2eef45af33426414604d8f03467c0e6c 638839 snapper-0.9.0.tar.bz2 +9207fe474f5af47d0621faae026547e2 639804 snapper-0.9.1.tar.bz2 ++++++ snapper-Debian_Unstable.dsc ++++++ --- /var/tmp/diff_new_pack.5S5UKQ/_old 2021-11-20 02:39:00.280806983 +0100 +++ /var/tmp/diff_new_pack.5S5UKQ/_new 2021-11-20 02:39:00.280806983 +0100 @@ -1,6 +1,6 @@ Format: 1.0 Source: snapper -Version: 0.9.0-1 +Version: 0.9.1-1 Binary: snapper Maintainer: Arvin Schnell <aschn...@suse.com> Architecture: any @@ -11,4 +11,4 @@ # 423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz # Files: -2eef45af33426414604d8f03467c0e6c 638839 snapper-0.9.0.tar.bz2 +9207fe474f5af47d0621faae026547e2 639804 snapper-0.9.1.tar.bz2 ++++++ snapper-Raspbian_10.dsc ++++++ --- /var/tmp/diff_new_pack.5S5UKQ/_old 2021-11-20 02:39:00.296806930 +0100 +++ /var/tmp/diff_new_pack.5S5UKQ/_new 2021-11-20 02:39:00.296806930 +0100 @@ -1,6 +1,6 @@ Format: 1.0 Source: snapper -Version: 0.9.0-1 +Version: 0.9.1-1 Binary: snapper Maintainer: Arvin Schnell <aschn...@suse.com> Architecture: any ++++++ snapper-xUbuntu_17.04.dsc ++++++ --- /var/tmp/diff_new_pack.5S5UKQ/_old 2021-11-20 02:39:00.312806878 +0100 +++ /var/tmp/diff_new_pack.5S5UKQ/_new 2021-11-20 02:39:00.316806864 +0100 @@ -1,6 +1,6 @@ Format: 1.0 Source: snapper -Version: 0.9.0-1 +Version: 0.9.1-1 Binary: snapper Maintainer: Arvin Schnell <aschn...@suse.com> Architecture: any @@ -11,4 +11,4 @@ # 423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz # Files: -2eef45af33426414604d8f03467c0e6c 638839 snapper-0.9.0.tar.bz2 +9207fe474f5af47d0621faae026547e2 639804 snapper-0.9.1.tar.bz2 ++++++ snapper-xUbuntu_17.10.dsc ++++++ --- /var/tmp/diff_new_pack.5S5UKQ/_old 2021-11-20 02:39:00.328806825 +0100 +++ /var/tmp/diff_new_pack.5S5UKQ/_new 2021-11-20 02:39:00.332806811 +0100 @@ -1,6 +1,6 @@ Format: 1.0 Source: snapper -Version: 0.9.0-1 +Version: 0.9.1-1 Binary: snapper Maintainer: Arvin Schnell <aschn...@suse.com> Architecture: any @@ -11,4 +11,4 @@ # 423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz # Files: -2eef45af33426414604d8f03467c0e6c 638839 snapper-0.9.0.tar.bz2 +9207fe474f5af47d0621faae026547e2 639804 snapper-0.9.1.tar.bz2 ++++++ snapper-xUbuntu_18.04.dsc ++++++ --- /var/tmp/diff_new_pack.5S5UKQ/_old 2021-11-20 02:39:00.348806759 +0100 +++ /var/tmp/diff_new_pack.5S5UKQ/_new 2021-11-20 02:39:00.348806759 +0100 @@ -1,6 +1,6 @@ Format: 1.0 Source: snapper -Version: 0.9.0-1 +Version: 0.9.1-1 Binary: snapper Maintainer: Arvin Schnell <aschn...@suse.com> Architecture: any @@ -11,4 +11,4 @@ # 423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz # Files: -2eef45af33426414604d8f03467c0e6c 638839 snapper-0.9.0.tar.bz2 +9207fe474f5af47d0621faae026547e2 639804 snapper-0.9.1.tar.bz2 ++++++ snapper-xUbuntu_18.10.dsc ++++++ --- /var/tmp/diff_new_pack.5S5UKQ/_old 2021-11-20 02:39:00.364806706 +0100 +++ /var/tmp/diff_new_pack.5S5UKQ/_new 2021-11-20 02:39:00.364806706 +0100 @@ -1,6 +1,6 @@ Format: 1.0 Source: snapper -Version: 0.9.0-1 +Version: 0.9.1-1 Binary: snapper Maintainer: Arvin Schnell <aschn...@suse.com> Architecture: any @@ -11,4 +11,4 @@ # 423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz # Files: -2eef45af33426414604d8f03467c0e6c 638839 snapper-0.9.0.tar.bz2 +9207fe474f5af47d0621faae026547e2 639804 snapper-0.9.1.tar.bz2 ++++++ snapper-xUbuntu_19.04.dsc ++++++ --- /var/tmp/diff_new_pack.5S5UKQ/_old 2021-11-20 02:39:00.380806653 +0100 +++ /var/tmp/diff_new_pack.5S5UKQ/_new 2021-11-20 02:39:00.380806653 +0100 @@ -1,6 +1,6 @@ Format: 1.0 Source: snapper -Version: 0.9.0-1 +Version: 0.9.1-1 Binary: snapper Maintainer: Arvin Schnell <aschn...@suse.com> Architecture: any @@ -11,4 +11,4 @@ # 423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz # Files: -2eef45af33426414604d8f03467c0e6c 638839 snapper-0.9.0.tar.bz2 +9207fe474f5af47d0621faae026547e2 639804 snapper-0.9.1.tar.bz2 ++++++ snapper-xUbuntu_19.10.dsc ++++++ --- /var/tmp/diff_new_pack.5S5UKQ/_old 2021-11-20 02:39:00.396806600 +0100 +++ /var/tmp/diff_new_pack.5S5UKQ/_new 2021-11-20 02:39:00.396806600 +0100 @@ -1,6 +1,6 @@ Format: 1.0 Source: snapper -Version: 0.9.0-1 +Version: 0.9.1-1 Binary: snapper Maintainer: Arvin Schnell <aschn...@suse.com> Architecture: any @@ -11,4 +11,4 @@ # 423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz # Files: -2eef45af33426414604d8f03467c0e6c 638839 snapper-0.9.0.tar.bz2 +9207fe474f5af47d0621faae026547e2 639804 snapper-0.9.1.tar.bz2 ++++++ snapper-xUbuntu_20.04.dsc ++++++ --- /var/tmp/diff_new_pack.5S5UKQ/_old 2021-11-20 02:39:00.416806534 +0100 +++ /var/tmp/diff_new_pack.5S5UKQ/_new 2021-11-20 02:39:00.420806521 +0100 @@ -1,6 +1,6 @@ Format: 1.0 Source: snapper -Version: 0.9.0-1 +Version: 0.9.1-1 Binary: snapper Maintainer: Arvin Schnell <aschn...@suse.com> Architecture: any @@ -11,4 +11,4 @@ # 423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz # Files: -2eef45af33426414604d8f03467c0e6c 638839 snapper-0.9.0.tar.bz2 +9207fe474f5af47d0621faae026547e2 639804 snapper-0.9.1.tar.bz2 ++++++ snapper-xUbuntu_20.10.dsc ++++++ --- /var/tmp/diff_new_pack.5S5UKQ/_old 2021-11-20 02:39:00.436806468 +0100 +++ /var/tmp/diff_new_pack.5S5UKQ/_new 2021-11-20 02:39:00.436806468 +0100 @@ -1,6 +1,6 @@ Format: 1.0 Source: snapper -Version: 0.9.0-1 +Version: 0.9.1-1 Binary: snapper Maintainer: Arvin Schnell <aschn...@suse.com> Architecture: any @@ -11,4 +11,4 @@ # 423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz # Files: -2eef45af33426414604d8f03467c0e6c 638839 snapper-0.9.0.tar.bz2 +9207fe474f5af47d0621faae026547e2 639804 snapper-0.9.1.tar.bz2 ++++++ snapper-xUbuntu_21.04.dsc ++++++ --- /var/tmp/diff_new_pack.5S5UKQ/_old 2021-11-20 02:39:00.452806415 +0100 +++ /var/tmp/diff_new_pack.5S5UKQ/_new 2021-11-20 02:39:00.452806415 +0100 @@ -1,6 +1,6 @@ Format: 1.0 Source: snapper -Version: 0.9.0-1 +Version: 0.9.1-1 Binary: snapper Maintainer: Arvin Schnell <aschn...@suse.com> Architecture: any @@ -11,4 +11,4 @@ # 423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz # Files: -2eef45af33426414604d8f03467c0e6c 638839 snapper-0.9.0.tar.bz2 +9207fe474f5af47d0621faae026547e2 639804 snapper-0.9.1.tar.bz2 ++++++ snapper-xUbuntu_21.10.dsc ++++++ Format: 1.0 Source: snapper Version: 0.9.1-1 Binary: snapper Maintainer: Arvin Schnell <aschn...@suse.com> Architecture: any Build-Depends: debhelper (>= 4.1.16), acl-dev, dbus, g++, libboost-dev, libboost-thread-dev, libboost-system-dev, libboost-test-dev, libxml2-dev, libz-dev, libdbus-1-dev, libjson-c-dev, libpam-dev, xsltproc, docbook-xsl, language-pack-en, language-pack-de, language-pack-fr, ncurses-dev # # The 'Files' line is generated during 'make package': # Files: # 423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz # Files: 9207fe474f5af47d0621faae026547e2 639804 snapper-0.9.1.tar.bz2