Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package snapper for openSUSE:Factory checked in at 2022-01-29 20:57:28 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/snapper (Old) and /work/SRC/openSUSE:Factory/.snapper.new.1898 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "snapper" Sat Jan 29 20:57:28 2022 rev:134 rq:949593 version:0.9.1 Changes: -------- --- /work/SRC/openSUSE:Factory/snapper/snapper.changes 2021-11-22 23:08:09.773130963 +0100 +++ /work/SRC/openSUSE:Factory/.snapper.new.1898/snapper.changes 2022-01-29 20:57:33.296473946 +0100 @@ -1,0 +2,12 @@ +Wed Nov 24 14:20:38 CET 2021 - aschn...@suse.com + +- added bash completion provided by community + +------------------------------------------------------------------- +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.mIq8bk/_old 2022-01-29 20:57:34.156468369 +0100 +++ /var/tmp/diff_new_pack.mIq8bk/_new 2022-01-29 20:57:34.160468343 +0100 @@ -1,7 +1,7 @@ # # spec file for package snapper # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -32,9 +32,12 @@ %bcond_with coverage Name: snapper -Version: 0.9.0 +Version: 0.9.1 Release: 0 -BuildRoot: %{_tmppath}/%{name}-%{version}-build +Summary: Tool for filesystem snapshot management +License: GPL-2.0-only +Group: System/Packages +URL: http://snapper.io/ Source: snapper-%{version}.tar.bz2 %if 0%{?suse_version} > 1325 BuildRequires: libboost_system-devel @@ -49,7 +52,7 @@ BuildRequires: libtool BuildRequires: libxml2-devel BuildRequires: ncurses-devel -%if 0%{?suse_version} > 1230 +%if 0%{?suse_version} BuildRequires: libbtrfs-devel %endif %if 0%{?suse_version} > 1310 @@ -65,6 +68,8 @@ BuildRequires: glibc-langpack-de BuildRequires: glibc-langpack-en BuildRequires: glibc-langpack-fr +%else +BuildRequires: glibc-locale %endif %if ! 0%{?mandriva_version} %if 0%{?fedora_version} >= 23 @@ -81,7 +86,7 @@ BuildRequires: libdbus-1-devel BuildRequires: xsltproc %endif -%if (0%{?suse_version} && 0%{?suse_version} >= 1210) +%if 0%{?suse_version} BuildRequires: libzypp(plugin:commit) %endif BuildRequires: pam-devel @@ -100,16 +105,12 @@ Recommends: logrotate snapper-zypp-plugin Supplements: btrfsprogs %endif -Summary: Tool for filesystem snapshot management -License: GPL-2.0-only -Group: System/Packages -URL: http://snapper.io/ %description This package contains snapper, a tool for filesystem snapshot management. %prep -%setup +%setup -q %build %if %{with coverage} @@ -194,9 +195,9 @@ %endif %dir %{_prefix}/lib/snapper %{_prefix}/lib/snapper/*-helper -%doc %{_mandir}/*/snapper.8* -%doc %{_mandir}/*/snapperd.8* -%doc %{_mandir}/*/snapper-configs.5* +%{_mandir}/*/snapper.8* +%{_mandir}/*/snapperd.8* +%{_mandir}/*/snapper-configs.5* %if 0%{?suse_version} > 1310 %doc %{_mandir}/*/mksubvolume.8* %endif @@ -207,6 +208,7 @@ %endif %{_datadir}/dbus-1/system.d/org.opensuse.Snapper.conf %{_datadir}/dbus-1/system-services/org.opensuse.Snapper.service +%{_datadir}/bash-completion/completions/snapper %package -n libsnapper5 Summary: Library for filesystem snapshot management @@ -222,23 +224,35 @@ This package contains libsnapper, a library for filesystem snapshot management. %files -n libsnapper5 -%defattr(-,root,root) +%license %{_defaultdocdir}/snapper/COPYING +%doc %dir %{_defaultdocdir}/snapper +%doc %{_defaultdocdir}/snapper/AUTHORS %{_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 -%doc %dir %{_defaultdocdir}/snapper -%doc %{_defaultdocdir}/snapper/AUTHORS -%doc %{_defaultdocdir}/snapper/COPYING +%dir %{_datadir}/snapper +%dir %{_datadir}/snapper/config-templates +%{_datadir}/snapper/config-templates/default +%dir %{_datadir}/snapper/filters +%{_datadir}/snapper/filters/*.txt %if 0%{?suse_version} %{_fillupdir}/sysconfig.snapper %else %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} @@ -258,7 +272,7 @@ Requires: libsnapper5 = %version Requires: libstdc++-devel Requires: libxml2-devel -%if 0%{?suse_version} > 1230 +%if 0%{?suse_version} Requires: libbtrfs-devel %endif %if 0%{?suse_version} > 1310 @@ -272,7 +286,6 @@ libsnapper. %files -n libsnapper-devel -%defattr(-,root,root) %{_libdir}/libsnapper.so %{_includedir}/snapper @@ -287,17 +300,23 @@ snapper during commits. %files -n snapper-zypp-plugin -%defattr(-,root,root) -%config(noreplace) %{_sysconfdir}/snapper/zypp-plugin.conf -%if 0%{?suse_version} < 1210 -%dir /usr/lib/zypp -%dir /usr/lib/zypp/plugins -%dir /usr/lib/zypp/plugins/commit -%endif +%{_datadir}/snapper/zypp-plugin.conf /usr/lib/zypp/plugins/commit/snapper-zypp-plugin %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 @@ -308,7 +327,6 @@ A PAM module for calling snapper during user login and logout. %files -n pam_snapper -%defattr(-,root,root) /%{pam_security_dir}/pam_snapper.so %dir /usr/lib/pam_snapper /usr/lib/pam_snapper/*.sh @@ -322,7 +340,6 @@ Tests to be run in a scratch machine to test that snapper operates as expected. %files testsuite -%defattr(-,root,root) %dir %{_libdir}/snapper %dir %{_libdir}/snapper/testsuite %{_libdir}/snapper/testsuite/* ++++++ 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 2022-01-28 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 2022-01-28 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 2022-01-28 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 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/debian/snapper.install new/debian/snapper.install --- old/debian/snapper.install 2021-06-22 02:00:00.000000000 +0200 +++ new/debian/snapper.install 2022-01-28 01:00:00.000000000 +0100 @@ -6,4 +6,5 @@ usr/share/dbus-1/system.d/org.opensuse.Snapper.conf usr/share/dbus-1/system-services/org.opensuse.Snapper.service usr/share/locale/*/LC_MESSAGES/snapper.mo +usr/share/bash-completion/completions/snapper usr/lib/systemd/system/snapperd.service ++++++ snapper-0.9.0.tar.bz2 -> snapper-0.9.1.tar.bz2 ++++++ ++++ 4946 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 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 2022-01-28 01:00:00.000000000 +0100 @@ -14,20 +14,19 @@ snapper-$(VERSION).tar.bz2: dist-bzip2 DEBIAN_FLAVOURS = \ - Debian_9.0 \ Debian_10.0 \ + Debian_11.0 \ Debian_Unstable UBUNTU_FLAVOURS = \ - xUbuntu_17.04 \ - xUbuntu_17.10 \ xUbuntu_18.04 \ xUbuntu_18.10 \ xUbuntu_19.04 \ 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' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/snapper-0.9.0/README.md new/snapper-0.9.1/README.md --- old/snapper-0.9.0/README.md 1970-01-01 01:00:00.000000000 +0100 +++ new/snapper-0.9.1/README.md 2022-01-28 01:00:00.000000000 +0100 @@ -0,0 +1,101 @@ + +Snapper +======= + +Snapper is a tool for Linux file system snapshot management. Apart from the +obvious creation and deletion of snapshots it can compare snapshots and +revert differences between them. In simple terms, this allows root and +non-root users to view older versions of files and revert changes. + +For more information visit [snapper.io](http://snapper.io/). + + +Development +----------- + +For compiling and developing Snapper you need to setup the development +environment first. + +### Development Environment + +In the SUSE Linux Enterprise and openSUSE distributions you can install the needed +packages by using these commands: + +```sh +# install the basic development environment (SUSE Linux Enterprise, the SDK extension is needed) +sudo zypper install -t pattern SDK-C-C++ +# install the basic development environment (openSUSE) +sudo zypper install -t pattern devel_C_C++ +# install the extra packages for snapper development (both SLE and openSUSE) +sudo zypper install git libmount-devel dbus-1-devel libacl-devel \ + docbook-xsl-stylesheets libxml2-devel libbtrfs-devel +``` + +### Building Snapper + +You can download the sources and build Snapper by using these commands: + +```sh +git clone g...@github.com:<your_fork>/snapper.git +cd snapper +make -f Makefile.repo +# parallelize the build using more processors, use plain `make` if it does not work +make -j`nproc` +``` + +### Installing and Running Snapper + +To run the freshly built Snapper use this: + +```sh +sudo make install +# kill the currently running DBus process if present +sudo killall snapperd +# try your changes (the DBus service is started automatically) +(sudo) snapper ... +``` + +### Running Tests + +Snapper includes some internal unit tests to avoid some bugs and regressions. +The tests are located in the `testsuite` subdirectory and you can start them +using the `make check` command. + +There are also some additional tests in the `testsuite-real` subdirectory, +but be careful. *These tests really execute snapper commands and they can +destroy your data! Run these tests only in a testing environment!* + +### Releasing + +- Before releasing the Snapper package ensure that the changes made to the +package are mentioned in the `package/snapper.changes` file, update also the +`dists/debian/changelog` file. + +- Make sure the units tests still passes ([see above](#running-tests)). + +- When the version is increased then the Git repo has to be tagged, use the + `vX.Y.Z` format for the tag. Also the [filesystems:snapper][] + OBS project has to be updated. + +- To create the package use command `make package`. Then use the common + work-flow to submit the +package to the build service. For [openSUSE:Factory][] + send at first the package to the devel project [filesystems:snapper][] in OBS. + + *Please note that this OBS project builds for more distributions + so more metadata files have to be updated. See the OBS documentation + for more info ([cross distribution howto][xdist], [Debian builds][]).* + +[filesystems:snapper]: https://build.opensuse.org/project/show/filesystems:snapper +[openSUSE:Factory]: https://build.opensuse.org/project/show/openSUSE:Factory +[xdist]: https://en.opensuse.org/openSUSE:Build_Service_cross_distribution_howto +[Debian builds]: https://en.opensuse.org/openSUSE:Build_Service_Debian_builds + +- The generated bzip2 tarball has to be also placed at + <https://ftp.suse.com/pub/projects/snapper/>. + +- When the documentation changes e.g. the man page or an important + functionality then also the [snapper.io](http://snapper.io/) web pages + have to be updated. They are hosted as GitHub pages + in the [gh-pages branch](https://github.com/openSUSE/snapper/tree/gh-pages) + in the Snapper Git repository. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 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 2022-01-28 01:00:00.000000000 +0100 @@ -1 +1 @@ -0.9.0 +0.9.1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 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 2022-01-28 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' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/snapper-0.9.0/compile new/snapper-0.9.1/compile --- old/snapper-0.9.0/compile 2021-06-22 02:00:00.000000000 +0200 +++ new/snapper-0.9.1/compile 2022-01-28 01:00:00.000000000 +0100 @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # Written by Tom Tromey <tro...@cygnus.com>. # # This program is free software; you can redistribute it and/or modify diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 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 2022-01-28 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' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 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 2022-01-28 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' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 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 2022-01-28 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' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 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 2022-01-28 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' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/snapper-0.9.0/missing new/snapper-0.9.1/missing --- old/snapper-0.9.0/missing 2021-06-22 02:00:00.000000000 +0200 +++ new/snapper-0.9.1/missing 2022-01-28 01:00:00.000000000 +0100 @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard <pin...@iro.umontreal.ca>, 1996. # This program is free software; you can redistribute it and/or modify diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/snapper-0.9.0/scripts/Makefile.am new/snapper-0.9.1/scripts/Makefile.am --- old/snapper-0.9.0/scripts/Makefile.am 2021-06-22 02:00:00.000000000 +0200 +++ new/snapper-0.9.1/scripts/Makefile.am 2022-01-28 01:00:00.000000000 +0100 @@ -14,9 +14,10 @@ endif -EXTRA_DIST = snapper-hourly snapper-daily $(pam_snapper_SCRIPTS) +EXTRA_DIST = snapper-hourly snapper-daily bash-completion.bash $(pam_snapper_SCRIPTS) install-data-local: install -D snapper-hourly $(DESTDIR)/etc/cron.hourly/suse.de-snapper install -D snapper-daily $(DESTDIR)/etc/cron.daily/suse.de-snapper + install -D --mode a+r,u+w bash-completion.bash $(DESTDIR)/usr/share/bash-completion/completions/snapper diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/snapper-0.9.0/scripts/bash-completion.bash new/snapper-0.9.1/scripts/bash-completion.bash --- old/snapper-0.9.0/scripts/bash-completion.bash 1970-01-01 01:00:00.000000000 +0100 +++ new/snapper-0.9.1/scripts/bash-completion.bash 2022-01-28 01:00:00.000000000 +0100 @@ -0,0 +1,269 @@ +# snapper(8) autocompletion + +_snapper() +{ + local configdir="/etc/snapper/configs" + local cur prev words cword + _init_completion || return + + local GLOBAL_SNAPPER_OPTIONS=' + -q --quiet + -v --verbose + --utc + --iso + -t --table-style + --abbreviate + --machine-readable + --csvout + --jsonout + --separator + -c --config + --no-dbus + -r --root + -a --ambit + --version + --help + ' + + # see if the user selected a command already + local COMMANDS=( + "list-configs" "create-config" "delete-config" "get-config" "set-config" + "list" "ls" + "create" "modify" "delete" "remove" "rm" + "mount" "umount" + "status" "diff" "xadiff" + "undochange" "rollback" + "setup-quota" + "cleanup") + + local command i + for (( i=0; i < ${#words[@]}-1; i++ )); do + # Match word only either from start of string or after space to prevent options + # like -c from matching commands that have -c in them, like list-configs + if [[ ${COMMANDS[@]} =~ (^| )"${words[i]}" ]]; then + command=${words[i]} + break + fi + done + + # Global options autocomplete + case $prev in + --version|--help) + return 0 + ;; + --config|-c) + local configs=() + # Get basenames of config files in "$configdir" + for configfile in "$configdir"/*; do + configs+=("${configfile##*/}") + done + COMPREPLY=( $( compgen -W "${configs[*]}" -- "$cur" ) ) + return 0 + ;; + --machine-readable) + COMPREPLY=( $( compgen -W 'csv json' -- "$cur" ) ) + return 0 + ;; + --root|-r) + COMPREPLY=( $( compgen -f -- "$cur" ) ) + return 0 + ;; + esac + + # supported options per command + if [[ "$cur" == -* ]]; then + case $command in + list-configs) + # --columns completion not implemented + COMPREPLY=( $( compgen -W '--columns + ' -- "$cur" )) + return 0 + ;; + create-config) + COMPREPLY=( $( compgen -W '--fstype -f + --template -t' -- "$cur" ) ) + return 0 + ;; + list|ls) + COMPREPLY=( $( compgen -W '--type -t + --disable-used-space + --all-configs -a + --columns' -- "$cur" ) ) + return 0 + ;; + create) + COMPREPLY=( $( compgen -W '--type -t + --pre-number + --print-number -p + --description -d + --cleanup-algorithm -c + --userdata -u + --command + --read-only + --read-write + --from' -- "$cur" ) ) + return 0 + ;; + modify) + COMPREPLY=( $( compgen -W '--description -d + --cleanup-algorithm -c + --userdata -u' -- "$cur" ) ) + return 0 + ;; + delete|remove|rm) + COMPREPLY=( $( compgen -W '--sync -s + ' -- "$cur" ) ) + return 0 + ;; + status) + COMPREPLY=( $( compgen -W '--output -o + ' -- "$cur" ) ) + return 0 + ;; + diff) + COMPREPLY=( $( compgen -W '--input -i + --diff-cmd + --extensions -x' -- "$cur" ) ) + return 0 + ;; + undochange) + COMPREPLY=( $( compgen -W '--input -i + ' -- "$cur" ) ) + return 0 + ;; + rollback) + COMPREPLY=( $( compgen -W '--print-number -p + --description -d + --cleanup-algorithm -c + --userdata -u' -- "$cur" ) ) + return 0 + ;; + cleanup) + COMPREPLY=( $( compgen -W '--path --free-space + ' -- "$cur" ) ) + return 0 + ;; + *) + COMPREPLY=( $( compgen -W "$GLOBAL_SNAPPER_OPTIONS" -- "$cur" ) ) + return 0 + ;; + esac + fi + + # specific command arguments + if [[ -n $command ]]; then + case $command in + list-configs) + case "$prev" in + --columns) + COMPREPLY=( $( compgen -W 'config subvolume + ' -- "$cur" ) ) + ;; + esac + return 0 + ;; + create-config) + case "$prev" in + --fstype|-f) + COMPREPLY=( $( compgen -W 'btrfs ext4 lvm(xfs) lvm(ext4) + ' -- "$cur" ) ) + ;; + --template|-t) + ;; + *) + COMPREPLY=( $( compgen -f -- "$cur" ) ) + ;; + esac + return 0 + ;; + list) + case "$prev" in + --type|-t) + COMPREPLY=( $( compgen -W 'all single pre-post + ' -- "$cur" ) ) + ;; + --columns) + COMPREPLY=( $( compgen -W 'config subvolume number + default active type date user used-space cleanup + description userdata pre-number post-number + post-date + ' -- "$cur" ) ) + ;; + esac + return 0 + ;; + create) + case "$prev" in + --type|-t) + COMPREPLY=( $( compgen -W 'single pre post + ' -- "$cur" ) ) + ;; + --pre-number) + COMPREPLY=( $( compgen -W ' + ' -- "$cur" ) ) + ;; + --cleanup-algorithm|-c) + COMPREPLY=( $( compgen -W 'empty-pre-post timeline number + ' -- "$cur" ) ) + ;; + esac + return 0 + ;; + modify) + case "$prev" in + --cleanup-algorithm|-c) + COMPREPLY=( $( compgen -W 'empty-pre-post timeline number + ' -- "$cur" ) ) + ;; + esac + return 0 + ;; + status) + case "$prev" in + --output|-o) + COMPREPLY=( $( compgen -f -- "$cur" ) ) + ;; + esac + return 0 + ;; + cleanup) + case "$prev" in + empty-pre-post|timeline|number) + ;; + --path) + COMPREPLY=( $( compgen -f -- "$cur" ) ) + ;; + *) + COMPREPLY=( $( compgen -W 'empty-pre-post timeline number + ' -- "$cur" ) ) + ;; + esac + return 0 + ;; + diff) + return 0 + ;; + undochange) + return 0 + ;; + rollback) + case "$prev" in + --cleanup-algorithm|-c) + COMPREPLY=( $( compgen -W 'empty-pre-post timeline number + ' -- "$cur" ) ) + ;; + esac + return 0 + ;; + esac + fi + + # no command yet, show what commands we have + if [ "$command" = "" ]; then + #COMPREPLY=( $( compgen -W '${COMMANDS[@]} ${GLOBAL_SNAPPER_OPTIONS[@]}' -- "$cur" ) ) + COMPREPLY=( $( compgen -W "${COMMANDS[*]}" -- "$cur" ) ) + fi + + return 0 +} && +complete -F _snapper snapper diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/snapper-0.9.0/server/Client.cc new/snapper-0.9.1/server/Client.cc --- old/snapper-0.9.0/server/Client.cc 2021-06-22 02:00:00.000000000 +0200 +++ new/snapper-0.9.1/server/Client.cc 2022-01-28 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ /* * Copyright (c) [2012-2015] Novell, Inc. - * Copyright (c) [2016-2021] SUSE LLC + * Copyright (c) [2016-2022] SUSE LLC * * All Rights Reserved. * @@ -38,8 +38,8 @@ boost::shared_mutex big_mutex; -Client::Client(const string& name, const Clients& clients) - : name(name), clients(clients) +Client::Client(const string& name, uid_t uid, const Clients& clients) + : name(name), uid(uid), clients(clients) { } @@ -394,7 +394,7 @@ void Client::check_permission(DBus::Connection& conn, DBus::Message& msg) const { - unsigned long uid = conn.get_unix_userid(msg); + // Check if the uid of the dbus-user is root. if (uid == 0) return; @@ -406,14 +406,12 @@ Client::check_permission(DBus::Connection& conn, DBus::Message& msg, const MetaSnapper& meta_snapper) const { - unsigned long uid = conn.get_unix_userid(msg); - // Check if the uid of the dbus-user is root. if (uid == 0) return; // Check if the uid of the dbus-user is included in the allowed uids. - if (contains(meta_snapper.uids, uid)) + if (contains(meta_snapper.get_allowed_uids(), uid)) return; string username; @@ -422,7 +420,7 @@ if (get_uid_username_gid(uid, username, gid)) { // Check if the primary gid of the dbus-user is included in the allowed gids. - if (contains(meta_snapper.gids, gid)) + if (contains(meta_snapper.get_allowed_gids(), gid)) return; vector<gid_t> gids = getgrouplist(username.c_str(), gid); @@ -430,7 +428,7 @@ // Check if any (primary or secondary) gid of the dbus-user is included in the allowed // gids. for (vector<gid_t>::const_iterator it = gids.begin(); it != gids.end(); ++it) - if (contains(meta_snapper.gids, *it)) + if (contains(meta_snapper.get_allowed_gids(), *it)) return; } @@ -892,7 +890,7 @@ MetaSnappers::iterator it = meta_snappers.find(config_name); check_permission(conn, msg, *it); - scd.uid = conn.get_unix_userid(msg); + scd.uid = uid; Snapper* snapper = it->getSnapper(); @@ -927,7 +925,7 @@ MetaSnappers::iterator it = meta_snappers.find(config_name); check_permission(conn, msg, *it); - scd.uid = conn.get_unix_userid(msg); + scd.uid = uid; Snapper* snapper = it->getSnapper(); @@ -965,7 +963,7 @@ MetaSnappers::iterator it = meta_snappers.find(config_name); check_permission(conn, msg, *it); - scd.uid = conn.get_unix_userid(msg); + scd.uid = uid; Snapper* snapper = it->getSnapper(); @@ -999,7 +997,7 @@ MetaSnappers::iterator it = meta_snappers.find(config_name); check_permission(conn, msg, *it); - scd.uid = conn.get_unix_userid(msg); + scd.uid = uid; Snapper* snapper = it->getSnapper(); @@ -1034,7 +1032,7 @@ MetaSnappers::iterator it = meta_snappers.find(config_name); check_permission(conn, msg, *it); - scd.uid = conn.get_unix_userid(msg); + scd.uid = uid; Snapper* snapper = it->getSnapper(); Snapshots& snapshots = snapper->getSnapshots(); @@ -1596,7 +1594,7 @@ for (Clients::const_iterator it = clients.begin(); it != clients.end(); ++it) { std::ostringstream s; - s << " name:'" << it->name << "'"; + s << " name:'" << it->name << "', uid:" << it->uid; if (&*it == this) s << ", myself"; if (it->zombie) @@ -1957,11 +1955,11 @@ Clients::iterator -Clients::add(const string& name) +Clients::add(const string& name, uid_t uid) { assert(find(name) == entries.end()); - entries.emplace_back(name, *this); + entries.emplace_back(name, uid, *this); return --entries.end(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/snapper-0.9.0/server/Client.h new/snapper-0.9.1/server/Client.h --- old/snapper-0.9.0/server/Client.h 2021-06-22 02:00:00.000000000 +0200 +++ new/snapper-0.9.1/server/Client.h 2022-01-28 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ /* * Copyright (c) [2012-2015] Novell, Inc. - * Copyright (c) [2016,2018] SUSE LLC + * Copyright (c) [2016-2022] SUSE LLC * * All Rights Reserved. * @@ -120,7 +120,7 @@ void dispatch(DBus::Connection& conn, DBus::Message& msg); - Client(const string& name, const Clients& clients); + Client(const string& name, uid_t uid, const Clients& clients); ~Client(); list<Comparison*>::iterator find_comparison(Snapper* snapper, unsigned int number1, @@ -140,6 +140,7 @@ void remove_mount(const string& config_name, unsigned int number); const string name; + const uid_t uid; list<Comparison*> comparisons; @@ -192,7 +193,8 @@ iterator find(const string& name); - iterator add(const string& name); + iterator add(const string& name, uid_t uid); + void remove_zombies(); bool has_zombies() const; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/snapper-0.9.0/server/MetaSnapper.cc new/snapper-0.9.1/server/MetaSnapper.cc --- old/snapper-0.9.0/server/MetaSnapper.cc 2021-06-22 02:00:00.000000000 +0200 +++ new/snapper-0.9.1/server/MetaSnapper.cc 2022-01-28 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ /* * Copyright (c) [2012-2015] Novell, Inc. - * Copyright (c) 2018 SUSE LLC + * Copyright (c) [2018-2022] SUSE LLC * * All Rights Reserved. * @@ -124,37 +124,37 @@ void MetaSnapper::set_permissions() { - uids.clear(); + allowed_uids.clear(); vector<string> users; if (config_info.getValue(KEY_ALLOW_USERS, users)) { - for (vector<string>::const_iterator it = users.begin(); it != users.end(); ++it) + for (const string& user : users) { uid_t tmp; - if (get_user_uid(it->c_str(), tmp)) - uids.push_back(tmp); + if (get_user_uid(user.c_str(), tmp)) + allowed_uids.push_back(tmp); } } - sort(uids.begin(), uids.end()); - uids.erase(unique(uids.begin(), uids.end()), uids.end()); + sort(allowed_uids.begin(), allowed_uids.end()); + allowed_uids.erase(unique(allowed_uids.begin(), allowed_uids.end()), allowed_uids.end()); - gids.clear(); + allowed_gids.clear(); vector<string> groups; if (config_info.getValue(KEY_ALLOW_GROUPS, groups)) { - for (vector<string>::const_iterator it = groups.begin(); it != groups.end(); ++it) + for (const string& group : groups) { gid_t tmp; - if (get_group_gid(it->c_str(), tmp)) - gids.push_back(tmp); + if (get_group_gid(group.c_str(), tmp)) + allowed_gids.push_back(tmp); } } - sort(gids.begin(), gids.end()); - gids.erase(unique(gids.begin(), gids.end()), gids.end()); + sort(allowed_gids.begin(), allowed_gids.end()); + allowed_gids.erase(unique(allowed_gids.begin(), allowed_gids.end()), allowed_gids.end()); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/snapper-0.9.0/server/MetaSnapper.h new/snapper-0.9.1/server/MetaSnapper.h --- old/snapper-0.9.0/server/MetaSnapper.h 2021-06-22 02:00:00.000000000 +0200 +++ new/snapper-0.9.1/server/MetaSnapper.h 2022-01-28 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ /* * Copyright (c) [2012-2015] Novell, Inc. - * Copyright (c) 2018 SUSE LLC + * Copyright (c) [2018-2022] SUSE LLC * * All Rights Reserved. * @@ -94,8 +94,8 @@ const ConfigInfo& getConfigInfo() const { return config_info; } void setConfigInfo(const map<string, string>& raw); - vector<uid_t> uids; - vector<gid_t> gids; + const vector<uid_t>& get_allowed_uids() const { return allowed_uids; } + const vector<gid_t>& get_allowed_gids() const { return allowed_gids; } Snapper* getSnapper(); @@ -111,6 +111,9 @@ Snapper* snapper = nullptr; + vector<uid_t> allowed_uids; + vector<gid_t> allowed_gids; + }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/snapper-0.9.0/server/snapperd.cc new/snapper-0.9.1/server/snapperd.cc --- old/snapper-0.9.0/server/snapperd.cc 2021-06-22 02:00:00.000000000 +0200 +++ new/snapper-0.9.1/server/snapperd.cc 2022-01-28 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ /* * Copyright (c) [2012-2015] Novell, Inc. - * Copyright (c) [2018-2021] SUSE LLC + * Copyright (c) [2018-2022] SUSE LLC * * All Rights Reserved. * @@ -93,12 +93,14 @@ { boost::unique_lock<boost::shared_mutex> lock(big_mutex); - Clients::iterator client = clients.find(msg.get_sender()); + const string name = msg.get_sender(); + + Clients::iterator client = clients.find(name); if (client == clients.end()) { - y2deb("client connected invisible '" << msg.get_sender() << "'"); - add_client_match(msg.get_sender()); - client = clients.add(msg.get_sender()); + y2deb("client connected invisible '" << name << "'"); + add_client_match(name); + client = clients.add(name, get_unix_userid(msg)); set_idle_timeout(seconds(-1)); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 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 2022-01-28 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' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 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 2022-01-28 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' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 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 2022-01-28 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' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 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 2022-01-28 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' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 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 2022-01-28 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' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 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 2022-01-28 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' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 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 2022-01-28 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' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 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 2022-01-28 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' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 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 2022-01-28 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' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 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 2022-01-28 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' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 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 2022-01-28 01:00:00.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package snapper # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -34,7 +34,10 @@ Name: snapper Version: @VERSION@ Release: 0 -BuildRoot: %{_tmppath}/%{name}-%{version}-build +Summary: Tool for filesystem snapshot management +License: GPL-2.0-only +Group: System/Packages +URL: http://snapper.io/ Source: snapper-%{version}.tar.bz2 %if 0%{?suse_version} > 1325 BuildRequires: libboost_system-devel @@ -49,7 +52,7 @@ BuildRequires: libxml2-devel BuildRequires: e2fsprogs-devel BuildRequires: ncurses-devel -%if 0%{?suse_version} > 1230 +%if 0%{?suse_version} BuildRequires: libbtrfs-devel %endif %if 0%{?suse_version} > 1310 @@ -65,6 +68,8 @@ BuildRequires: glibc-langpack-de BuildRequires: glibc-langpack-fr BuildRequires: glibc-langpack-en +%else +BuildRequires: glibc-locale %endif %if ! 0%{?mandriva_version} %if 0%{?fedora_version} >= 23 @@ -81,7 +86,7 @@ BuildRequires: libdbus-1-devel BuildRequires: xsltproc %endif -%if (0%{?suse_version} && 0%{?suse_version} >= 1210) +%if 0%{?suse_version} BuildRequires: libzypp(plugin:commit) %endif BuildRequires: pam-devel @@ -100,16 +105,12 @@ Recommends: logrotate snapper-zypp-plugin Supplements: btrfsprogs %endif -Summary: Tool for filesystem snapshot management -License: GPL-2.0-only -Group: System/Packages -URL: http://snapper.io/ %description This package contains snapper, a tool for filesystem snapshot management. %prep -%setup +%setup -q %build %if %{with coverage} @@ -194,9 +195,9 @@ %endif %dir %{_prefix}/lib/snapper %{_prefix}/lib/snapper/*-helper -%doc %{_mandir}/*/snapper.8* -%doc %{_mandir}/*/snapperd.8* -%doc %{_mandir}/*/snapper-configs.5* +%{_mandir}/*/snapper.8* +%{_mandir}/*/snapperd.8* +%{_mandir}/*/snapper-configs.5* %if 0%{?suse_version} > 1310 %doc %{_mandir}/*/mksubvolume.8* %endif @@ -207,6 +208,7 @@ %endif %{_datadir}/dbus-1/system.d/org.opensuse.Snapper.conf %{_datadir}/dbus-1/system-services/org.opensuse.Snapper.service +%{_datadir}/bash-completion/completions/snapper %package -n libsnapper@LIBVERSION_MAJOR@ Summary: Library for filesystem snapshot management @@ -222,23 +224,35 @@ This package contains libsnapper, a library for filesystem snapshot management. %files -n libsnapper@LIBVERSION_MAJOR@ -%defattr(-,root,root) +%license %{_defaultdocdir}/snapper/COPYING +%doc %dir %{_defaultdocdir}/snapper +%doc %{_defaultdocdir}/snapper/AUTHORS %{_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 -%doc %dir %{_defaultdocdir}/snapper -%doc %{_defaultdocdir}/snapper/AUTHORS -%doc %{_defaultdocdir}/snapper/COPYING +%dir %{_datadir}/snapper +%dir %{_datadir}/snapper/config-templates +%{_datadir}/snapper/config-templates/default +%dir %{_datadir}/snapper/filters +%{_datadir}/snapper/filters/*.txt %if 0%{?suse_version} %{_fillupdir}/sysconfig.snapper %else %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} @@ -254,11 +268,11 @@ Requires: boost-devel %endif Requires: gcc-c++ -Requires: libacl-devel +Requires: libacl-devel Requires: libsnapper@LIBVERSION_MAJOR@ = %version Requires: libstdc++-devel Requires: libxml2-devel -%if 0%{?suse_version} > 1230 +%if 0%{?suse_version} Requires: libbtrfs-devel %endif %if 0%{?suse_version} > 1310 @@ -272,7 +286,6 @@ libsnapper. %files -n libsnapper-devel -%defattr(-,root,root) %{_libdir}/libsnapper.so %{_includedir}/snapper @@ -287,17 +300,23 @@ snapper during commits. %files -n snapper-zypp-plugin -%defattr(-,root,root) -%config(noreplace) %{_sysconfdir}/snapper/zypp-plugin.conf -%if 0%{?suse_version} < 1210 -%dir /usr/lib/zypp -%dir /usr/lib/zypp/plugins -%dir /usr/lib/zypp/plugins/commit -%endif +%{_datadir}/snapper/zypp-plugin.conf /usr/lib/zypp/plugins/commit/snapper-zypp-plugin %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 @@ -308,7 +327,6 @@ A PAM module for calling snapper during user login and logout. %files -n pam_snapper -%defattr(-,root,root) /%{pam_security_dir}/pam_snapper.so %dir /usr/lib/pam_snapper /usr/lib/pam_snapper/*.sh @@ -322,7 +340,6 @@ Tests to be run in a scratch machine to test that snapper operates as expected. %files testsuite -%defattr(-,root,root) %dir %{_libdir}/snapper %dir %{_libdir}/snapper/testsuite %{_libdir}/snapper/testsuite/* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/snapper-0.9.0/test-driver new/snapper-0.9.1/test-driver --- old/snapper-0.9.0/test-driver 2021-06-22 02:00:00.000000000 +0200 +++ new/snapper-0.9.1/test-driver 2022-01-28 01:00:00.000000000 +0100 @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 2011-2020 Free Software Foundation, Inc. +# Copyright (C) 2011-2021 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -110,8 +110,11 @@ trap "st=141; $do_exit" 13 trap "st=143; $do_exit" 15 -# Test script is run here. -"$@" >$log_file 2>&1 +# Test script is run here. We create the file first, then append to it, +# to ameliorate tests themselves also writing to the log file. Our tests +# don't, but others can (automake bug#35762). +: >"$log_file" +"$@" >>"$log_file" 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then @@ -133,7 +136,7 @@ # know whether the test passed or failed simply by looking at the '.log' # file, without the need of also peaking into the corresponding '.trs' # file (automake bug#11814). -echo "$res $test_name (exit status: $estatus)" >>$log_file +echo "$res $test_name (exit status: $estatus)" >>"$log_file" # Report outcome to console. echo "${col}${res}${std}: $test_name" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/snapper-0.9.0/testsuite-real/README.md new/snapper-0.9.1/testsuite-real/README.md --- old/snapper-0.9.0/testsuite-real/README.md 1970-01-01 01:00:00.000000000 +0100 +++ new/snapper-0.9.1/testsuite-real/README.md 2022-01-28 01:00:00.000000000 +0100 @@ -0,0 +1,21 @@ +CAUTION +------- + +RUN THESE TESTS IN A SCRATCH MACHINE. + +The tests in this directory only work when run as the root user. + +They operate +- on a scratch BTRFS filesystem (`/testsuite`) +- created in a loopback-mounted file (`/testsuite-of-snapper.img`), +- using a scratch Snapper configuration (`testsuite`). + +However bugs do happen so it is recommended that you +run these tests in a scratch machine. A bug may cause +LOSS OR CORRUPTION OF YOUR OWN BTRFS SNAPSHOTS AND DATA. + +See `setup-and-run-all` for the scratch setup and `run-all` for the actual +test set. + +The tests conform to the Test Anything Protocol (sloppily). +`prove setup-and-run-all` works. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 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 2022-01-28 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.mIq8bk/_old 2022-01-29 20:57:34.696464868 +0100 +++ /var/tmp/diff_new_pack.mIq8bk/_new 2022-01-29 20:57:34.700464841 +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,5 +11,5 @@ # 423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz # Files: -2eef45af33426414604d8f03467c0e6c 638839 snapper-0.9.0.tar.bz2 +1d86c1e69feda48fab2b5dc2c28cfed8 646394 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: 1d86c1e69feda48fab2b5dc2c28cfed8 646394 snapper-0.9.1.tar.bz2 ++++++ snapper-Debian_9.0.dsc ++++++ --- /var/tmp/diff_new_pack.mIq8bk/_old 2022-01-29 20:57:34.744464556 +0100 +++ /var/tmp/diff_new_pack.mIq8bk/_new 2022-01-29 20:57:34.748464530 +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,5 +11,5 @@ # 423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz # Files: -2eef45af33426414604d8f03467c0e6c 638839 snapper-0.9.0.tar.bz2 +9b416dc94342ddd6e5ae26daf02edb29 642769 snapper-0.9.1.tar.bz2 ++++++ snapper-Debian_Unstable.dsc ++++++ --- /var/tmp/diff_new_pack.mIq8bk/_old 2022-01-29 20:57:34.772464374 +0100 +++ /var/tmp/diff_new_pack.mIq8bk/_new 2022-01-29 20:57:34.776464349 +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,5 +11,5 @@ # 423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz # Files: -2eef45af33426414604d8f03467c0e6c 638839 snapper-0.9.0.tar.bz2 +1d86c1e69feda48fab2b5dc2c28cfed8 646394 snapper-0.9.1.tar.bz2 ++++++ snapper-Raspbian_10.dsc ++++++ --- /var/tmp/diff_new_pack.mIq8bk/_old 2022-01-29 20:57:34.796464219 +0100 +++ /var/tmp/diff_new_pack.mIq8bk/_new 2022-01-29 20:57:34.800464193 +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.mIq8bk/_old 2022-01-29 20:57:34.824464037 +0100 +++ /var/tmp/diff_new_pack.mIq8bk/_new 2022-01-29 20:57:34.828464012 +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,5 +11,5 @@ # 423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz # Files: -2eef45af33426414604d8f03467c0e6c 638839 snapper-0.9.0.tar.bz2 +9b416dc94342ddd6e5ae26daf02edb29 642769 snapper-0.9.1.tar.bz2 ++++++ snapper-xUbuntu_17.10.dsc ++++++ --- /var/tmp/diff_new_pack.mIq8bk/_old 2022-01-29 20:57:34.856463830 +0100 +++ /var/tmp/diff_new_pack.mIq8bk/_new 2022-01-29 20:57:34.860463804 +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,5 +11,5 @@ # 423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz # Files: -2eef45af33426414604d8f03467c0e6c 638839 snapper-0.9.0.tar.bz2 +9b416dc94342ddd6e5ae26daf02edb29 642769 snapper-0.9.1.tar.bz2 ++++++ snapper-xUbuntu_18.04.dsc ++++++ --- /var/tmp/diff_new_pack.mIq8bk/_old 2022-01-29 20:57:34.884463648 +0100 +++ /var/tmp/diff_new_pack.mIq8bk/_new 2022-01-29 20:57:34.888463623 +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,5 +11,5 @@ # 423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz # Files: -2eef45af33426414604d8f03467c0e6c 638839 snapper-0.9.0.tar.bz2 +1d86c1e69feda48fab2b5dc2c28cfed8 646394 snapper-0.9.1.tar.bz2 ++++++ snapper-xUbuntu_18.10.dsc ++++++ --- /var/tmp/diff_new_pack.mIq8bk/_old 2022-01-29 20:57:34.908463493 +0100 +++ /var/tmp/diff_new_pack.mIq8bk/_new 2022-01-29 20:57:34.912463466 +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,5 +11,5 @@ # 423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz # Files: -2eef45af33426414604d8f03467c0e6c 638839 snapper-0.9.0.tar.bz2 +1d86c1e69feda48fab2b5dc2c28cfed8 646394 snapper-0.9.1.tar.bz2 ++++++ snapper-xUbuntu_19.04.dsc ++++++ --- /var/tmp/diff_new_pack.mIq8bk/_old 2022-01-29 20:57:34.936463311 +0100 +++ /var/tmp/diff_new_pack.mIq8bk/_new 2022-01-29 20:57:34.940463285 +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,5 +11,5 @@ # 423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz # Files: -2eef45af33426414604d8f03467c0e6c 638839 snapper-0.9.0.tar.bz2 +1d86c1e69feda48fab2b5dc2c28cfed8 646394 snapper-0.9.1.tar.bz2 ++++++ snapper-xUbuntu_19.10.dsc ++++++ --- /var/tmp/diff_new_pack.mIq8bk/_old 2022-01-29 20:57:34.964463129 +0100 +++ /var/tmp/diff_new_pack.mIq8bk/_new 2022-01-29 20:57:34.968463104 +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,5 +11,5 @@ # 423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz # Files: -2eef45af33426414604d8f03467c0e6c 638839 snapper-0.9.0.tar.bz2 +1d86c1e69feda48fab2b5dc2c28cfed8 646394 snapper-0.9.1.tar.bz2 ++++++ snapper-xUbuntu_20.04.dsc ++++++ --- /var/tmp/diff_new_pack.mIq8bk/_old 2022-01-29 20:57:34.992462948 +0100 +++ /var/tmp/diff_new_pack.mIq8bk/_new 2022-01-29 20:57:34.996462922 +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,5 +11,5 @@ # 423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz # Files: -2eef45af33426414604d8f03467c0e6c 638839 snapper-0.9.0.tar.bz2 +1d86c1e69feda48fab2b5dc2c28cfed8 646394 snapper-0.9.1.tar.bz2 ++++++ snapper-xUbuntu_20.10.dsc ++++++ --- /var/tmp/diff_new_pack.mIq8bk/_old 2022-01-29 20:57:35.016462792 +0100 +++ /var/tmp/diff_new_pack.mIq8bk/_new 2022-01-29 20:57:35.020462767 +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,5 +11,5 @@ # 423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz # Files: -2eef45af33426414604d8f03467c0e6c 638839 snapper-0.9.0.tar.bz2 +1d86c1e69feda48fab2b5dc2c28cfed8 646394 snapper-0.9.1.tar.bz2 ++++++ snapper-xUbuntu_21.04.dsc ++++++ --- /var/tmp/diff_new_pack.mIq8bk/_old 2022-01-29 20:57:35.044462611 +0100 +++ /var/tmp/diff_new_pack.mIq8bk/_new 2022-01-29 20:57:35.048462585 +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,5 +11,5 @@ # 423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz # Files: -2eef45af33426414604d8f03467c0e6c 638839 snapper-0.9.0.tar.bz2 +1d86c1e69feda48fab2b5dc2c28cfed8 646394 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: 1d86c1e69feda48fab2b5dc2c28cfed8 646394 snapper-0.9.1.tar.bz2