Hello community, here is the log from the commit of package snapper for openSUSE:Factory checked in at 2015-05-29 09:53:59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/snapper (Old) and /work/SRC/openSUSE:Factory/.snapper.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "snapper" Changes: -------- --- /work/SRC/openSUSE:Factory/snapper/snapper.changes 2015-05-06 11:18:17.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.snapper.new/snapper.changes 2015-05-29 09:54:00.000000000 +0200 @@ -1,0 +2,17 @@ +Mon May 25 11:41:59 UTC 2015 - jreidinger@suse.com + +- allow list-configs command to work on different root + (for fate#317900) + +------------------------------------------------------------------- +Fri May 22 07:15:24 UTC 2015 - igonzalezsosa@suse.com + +- Version 0.2.7 + +------------------------------------------------------------------- +Mon May 18 14:38:17 UTC 2015 - igonzalezsosa@suse.com + +- added a helper to create snapshots without D-Bus + during system installation/upgrade (fate#317973) + +------------------------------------------------------------------- Old: ---- snapper-0.2.6.tar.bz2 New: ---- snapper-0.2.7.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ snapper.spec ++++++ --- /var/tmp/diff_new_pack.fUasEj/_old 2015-05-29 09:54:01.000000000 +0200 +++ /var/tmp/diff_new_pack.fUasEj/_new 2015-05-29 09:54:01.000000000 +0200 @@ -17,7 +17,7 @@ Name: snapper -Version: 0.2.6 +Version: 0.2.7 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build Source: snapper-%{version}.tar.bz2 ++++++ snapper-0.2.6.tar.bz2 -> snapper-0.2.7.tar.bz2 ++++++ ++++ 25767 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.2.6/VERSION new/snapper-0.2.7/VERSION --- old/snapper-0.2.6/VERSION 2015-02-18 18:54:03.000000000 +0100 +++ new/snapper-0.2.7/VERSION 2015-05-25 12:28:17.000000000 +0200 @@ -1 +1 @@ -0.2.6 +0.2.7 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.2.6/client/installation-helper.cc new/snapper-0.2.7/client/installation-helper.cc --- old/snapper-0.2.6/client/installation-helper.cc 2015-03-03 11:07:43.000000000 +0100 +++ new/snapper-0.2.7/client/installation-helper.cc 2015-05-25 12:28:17.000000000 +0200 @@ -195,6 +195,46 @@ cout << "done" << endl; } +bool +step5(const string& root_prefix, const string& description, const string& snapshot_type, + unsigned int pre_num, const map<string, string>& userdata) +{ + // fate #317973 + + // preconditions (maybe incomplete): + // snapper rpms installed + + Snapshots::iterator snapshot; + SCD scd; + + scd.read_only = true; + scd.description = description; + scd.userdata = userdata; + + Snapper snapper("root", root_prefix); + + try + { + if (snapshot_type == "single") { + snapshot = snapper.createSingleSnapshot(scd); + } else if (snapshot_type == "pre") { + snapshot = snapper.createPreSnapshot(scd); + } else if (snapshot_type == "post") { + Snapshots snapshots = snapper.getSnapshots(); + Snapshots::iterator pre = snapshots.find(pre_num); + snapshot = snapper.createPostSnapshot(pre, scd); + } + } + catch (const runtime_error& e) + { + y2err("create snapshot failed, " << e.what()); + return false; + } + + cout << snapshot->getNum() << endl; + return true; +} + void log_do(LogLevel level, const string& component, const char* file, const int line, const char* func, @@ -225,6 +265,8 @@ { "root-prefix", required_argument, 0, 0 }, { "default-subvolume-name", required_argument, 0, 0 }, { "description", required_argument, 0, 0 }, + { "snapshot-type", required_argument, 0, 0 }, + { "pre-num", required_argument, 0, 0 }, { "userdata", required_argument, 0, 'u' }, { 0, 0, 0, 0 } }; @@ -234,6 +276,8 @@ string root_prefix = "/"; string default_subvolume_name; string description; + string snapshot_type = "single"; + unsigned int pre_num = 0; map<string, string> userdata; GetOpts getopts; @@ -259,6 +303,12 @@ if ((opt = opts.find("description")) != opts.end()) description = opt->second; + if ((opt = opts.find("snapshot-type")) != opts.end()) + snapshot_type = opt->second; + + if ((opt = opts.find("pre-num")) != opts.end()) + pre_num = read_num(opt->second); + if ((opt = opts.find("userdata")) != opts.end()) userdata = read_userdata(opt->second); @@ -270,4 +320,6 @@ step3(root_prefix, default_subvolume_name); else if (step == "4") step4(); + else if (step == "5") + return step5(root_prefix, description, snapshot_type, pre_num, userdata) ? EXIT_SUCCESS : EXIT_FAILURE; } 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.2.6/client/snapper.cc new/snapper-0.2.7/client/snapper.cc --- old/snapper-0.2.6/client/snapper.cc 2015-05-05 15:36:17.000000000 +0200 +++ new/snapper-0.2.7/client/snapper.cc 2015-05-27 09:59:22.000000000 +0200 @@ -87,6 +87,7 @@ bool iso = false; string config_name = "root"; bool no_dbus = false; +string target_root = "/"; struct MyFiles : public Files @@ -212,7 +213,7 @@ if (no_dbus) { - list<ConfigInfo> config_infos = Snapper::getConfigs("/"); + list<ConfigInfo> config_infos = Snapper::getConfigs(target_root); for (list<ConfigInfo>::const_iterator it = config_infos.begin(); it != config_infos.end(); ++it) { configs.push_back(make_pair(it->getConfigName(), it->getSubvolume())); @@ -317,7 +318,7 @@ if (no_dbus) { - Snapper::createConfig(config_name, "/", subvolume, fstype, template_name); + Snapper::createConfig(config_name, target_root, subvolume, fstype, template_name); } else { @@ -347,7 +348,7 @@ if (no_dbus) { - Snapper::deleteConfig(config_name, "/"); + Snapper::deleteConfig(config_name, target_root); } else { @@ -384,7 +385,7 @@ if (no_dbus) { - ConfigInfo config_info = Snapper::getConfig(config_name, "/"); + ConfigInfo config_info = Snapper::getConfig(config_name, target_root); map<string, string> raw = config_info.getAllValues(); for (map<string, string>::const_iterator it = raw.begin(); it != raw.end(); ++it) @@ -1278,7 +1279,7 @@ try { - return Filesystem::create(it->second, ci.subvolume, "/"); + return Filesystem::create(it->second, ci.subvolume, target_root); } catch (const InvalidConfigException& e) { @@ -1572,6 +1573,7 @@ << _("\t--table-style, -t <style>\tTable style (integer).") << endl << _("\t--config, -c <name>\t\tSet name of config to use.") << endl << _("\t--no-dbus\t\t\tOperate without DBus.") << endl + << _("\t--root, -r <path>\t\tOperate on target root (works only without DBus).") << endl << _("\t--version\t\t\tPrint version and exit.") << endl << endl; @@ -1623,6 +1625,7 @@ { "table-style", required_argument, 0, 't' }, { "config", required_argument, 0, 'c' }, { "no-dbus", no_argument, 0, 0 }, + { "root", required_argument, 0, 'r' }, { "version", no_argument, 0, 0 }, { "help", no_argument, 0, 0 }, { 0, 0, 0, 0 } @@ -1665,6 +1668,17 @@ if ((opt = opts.find("no-dbus")) != opts.end()) no_dbus = true; + if ((opt = opts.find("root")) != opts.end()) + { + target_root = opt->second; + if (!no_dbus) + { + cerr << _("root argument can be used only together with no-dbus.") << endl + << _("Try 'snapper --help' for more information.") << endl; + exit(EXIT_FAILURE); + } + } + if ((opt = opts.find("version")) != opts.end()) { cout << "snapper " << Snapper::compileVersion() << endl; @@ -1707,7 +1721,7 @@ try { - Snapper* snapper = cmd->needs_snapper ? new Snapper(config_name, "/") : NULL; + Snapper* snapper = cmd->needs_snapper ? new Snapper(config_name, target_root) : NULL; (*cmd->cmd_func)(NULL, 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.2.6/compile new/snapper-0.2.7/compile --- old/snapper-0.2.6/compile 1970-01-01 01:00:00.000000000 +0100 +++ new/snapper-0.2.7/compile 2015-05-27 10:11:41.000000000 +0200 @@ -0,0 +1,347 @@ +#! /bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=2012-10-14.11; # UTC + +# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Written by Tom Tromey <tromey@cygnus.com>. +# +# 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 +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to <bug-automake@gnu.org> or send patches to +# <automake-patches@gnu.org>. + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to <bug-automake@gnu.org>. +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# 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.2.6/config.h.in new/snapper-0.2.7/config.h.in --- old/snapper-0.2.6/config.h.in 2015-05-05 15:38:18.000000000 +0200 +++ new/snapper-0.2.7/config.h.in 2015-05-27 10:11:40.000000000 +0200 @@ -66,8 +66,7 @@ /* Define to 1 if you have the <unistd.h> header file. */ #undef HAVE_UNISTD_H -/* Define to the sub-directory in which libtool stores uninstalled libraries. - */ +/* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Path of lvchange program. */ 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.2.6/configure.ac new/snapper-0.2.7/configure.ac --- old/snapper-0.2.6/configure.ac 2014-09-01 15:52:46.000000000 +0200 +++ new/snapper-0.2.7/configure.ac 2015-05-27 09:59:22.000000000 +0200 @@ -118,6 +118,8 @@ if test "x$enable_rollback" = "xyes"; then AC_DEFINE(ENABLE_ROLLBACK, 1, [Enable rollback support]) + # libmount is needed for rollback feature + AC_CHECK_HEADER(libmount/libmount.h,[],[AC_MSG_ERROR([Cannout find libmount headers. Please install libmount-devel])]) fi AC_ARG_ENABLE([btrfs-quota], AC_HELP_STRING([--disable-btrfs-quota],[Disable btrfs quota support]), @@ -134,6 +136,8 @@ PKG_CHECK_MODULES(DBUS, dbus-1) +AC_CHECK_HEADER(acl/libacl.h,[],[AC_MSG_ERROR([Cannout find libacl headers. Please install libacl-devel])]) + AC_SUBST(VERSION) AC_SUBST(LIBVERSION_MAJOR) AC_SUBST(LIBVERSION_MINOR) 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.2.6/doc/snapper.xml.in new/snapper-0.2.7/doc/snapper.xml.in --- old/snapper-0.2.6/doc/snapper.xml.in 2015-05-05 15:36:17.000000000 +0200 +++ new/snapper-0.2.7/doc/snapper.xml.in 2015-05-27 09:59:22.000000000 +0200 @@ -206,6 +206,12 @@ </listitem> </varlistentry> <varlistentry> + <term><option>-r, --root <replaceable>path</replaceable></option></term> + <listitem> + <para>Operate on target root. Only works together with no-dbus and only for some commands.</para> + </listitem> + </varlistentry> + <varlistentry> <term><option>--version</option></term> <listitem> <para>Print version and exit.</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.2.6/missing new/snapper-0.2.7/missing --- old/snapper-0.2.6/missing 2015-05-05 15:38:18.000000000 +0200 +++ new/snapper-0.2.7/missing 2015-05-27 10:11:41.000000000 +0200 @@ -1,9 +1,9 @@ #! /bin/sh # Common wrapper for a few potentially missing GNU programs. -scriptversion=2012-06-26.16; # UTC +scriptversion=2013-10-28.13; # UTC -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. # This program is free software; you can redistribute it and/or modify @@ -160,7 +160,7 @@ ;; autom4te*) echo "You might have modified some maintainer files that require" - echo "the 'automa4te' program to be rebuilt." + echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) 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.2.6/snapper/Snapper.cc new/snapper-0.2.7/snapper/Snapper.cc --- old/snapper-0.2.6/snapper/Snapper.cc 2015-05-05 15:36:17.000000000 +0200 +++ new/snapper-0.2.7/snapper/Snapper.cc 2015-05-27 09:59:22.000000000 +0200 @@ -251,7 +251,7 @@ try { - SysconfigFile sysconfig(SYSCONFIGFILE); + SysconfigFile sysconfig(prepend_root_prefix(root_prefix, SYSCONFIGFILE)); vector<string> config_names; sysconfig.getValue("SNAPPER_CONFIGS", config_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.2.6/test-driver new/snapper-0.2.7/test-driver --- old/snapper-0.2.6/test-driver 2015-05-05 15:38:19.000000000 +0200 +++ new/snapper-0.2.7/test-driver 2015-05-27 10:11:42.000000000 +0200 @@ -1,9 +1,9 @@ #! /bin/sh # test-driver - basic testsuite driver script. -scriptversion=2012-06-27.10; # UTC +scriptversion=2013-07-13.22; # UTC -# Copyright (C) 2011-2013 Free Software Foundation, Inc. +# Copyright (C) 2011-2014 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 @@ -44,13 +44,12 @@ Usage: test-driver --test-name=NAME --log-file=PATH --trs-file=PATH [--expect-failure={yes|no}] [--color-tests={yes|no}] - [--enable-hard-errors={yes|no}] [--] TEST-SCRIPT + [--enable-hard-errors={yes|no}] [--] + TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS] The '--test-name', '--log-file' and '--trs-file' options are mandatory. END } -# TODO: better error handling in option parsing (in particular, ensure -# TODO: $log_file, $trs_file and $test_name are defined). test_name= # Used for reporting. log_file= # Where to save the output of the test script. trs_file= # Where to save the metadata of the test run. @@ -69,10 +68,23 @@ --enable-hard-errors) enable_hard_errors=$2; shift;; --) shift; break;; -*) usage_error "invalid option: '$1'";; + *) break;; esac shift done +missing_opts= +test x"$test_name" = x && missing_opts="$missing_opts --test-name" +test x"$log_file" = x && missing_opts="$missing_opts --log-file" +test x"$trs_file" = x && missing_opts="$missing_opts --trs-file" +if test x"$missing_opts" != x; then + usage_error "the following mandatory options are missing:$missing_opts" +fi + +if test $# -eq 0; then + usage_error "missing argument" +fi + if test $color_tests = yes; then # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'. red='[0;31m' # Red. @@ -94,11 +106,14 @@ # Test script is run here. "$@" >$log_file 2>&1 estatus=$? + if test $enable_hard_errors = no && test $estatus -eq 99; then - estatus=1 + tweaked_estatus=1 +else + tweaked_estatus=$estatus fi -case $estatus:$expect_failure in +case $tweaked_estatus:$expect_failure in 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; @@ -107,6 +122,12 @@ *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac +# Report the test outcome and exit status in the logs, so that one can +# 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 + # Report outcome to console. echo "${col}${res}${std}: $test_name"