openSUSE Commits
Threads by month
- ----- 2024 -----
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
November 2015
- 1 participants
- 1310 discussions
Hello community,
here is the log from the commit of package diskscan for openSUSE:Factory checked in at 2015-11-28 15:19:18
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/diskscan (Old)
and /work/SRC/openSUSE:Factory/.diskscan.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "diskscan"
Changes:
--------
--- /work/SRC/openSUSE:Factory/diskscan/diskscan.changes 2015-11-16 18:51:32.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.diskscan.new/diskscan.changes 2015-11-28 15:19:19.000000000 +0100
@@ -1,0 +2,8 @@
+Thu Nov 26 13:18:40 UTC 2015 - mpluskal(a)suse.com
+
+- Update to 0.19
+ * When a partition is write mounted do not attempt to fix it as
+ it will mess the filesystem.
+ * Also fix building on Debian/kFreeBSD.
+
+-------------------------------------------------------------------
Old:
----
0.18.tar.gz
New:
----
0.19.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ diskscan.spec ++++++
--- /var/tmp/diff_new_pack.GPZFaw/_old 2015-11-28 15:19:19.000000000 +0100
+++ /var/tmp/diff_new_pack.GPZFaw/_new 2015-11-28 15:19:19.000000000 +0100
@@ -17,7 +17,7 @@
Name: diskscan
-Version: 0.18
+Version: 0.19
Release: 0
Summary: Scan disk for bad or near failure sectors
License: GPL-3.0+
++++++ 0.18.tar.gz -> 0.19.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/diskscan-0.18/CMakeLists.txt new/diskscan-0.19/CMakeLists.txt
--- old/diskscan-0.18/CMakeLists.txt 2015-11-06 20:07:24.000000000 +0100
+++ new/diskscan-0.19/CMakeLists.txt 2015-11-15 21:56:05.000000000 +0100
@@ -1,11 +1,16 @@
cmake_minimum_required(VERSION 3.0.2)
project(diskscan
- VERSION 0.18)
+ VERSION 0.19)
export(PACKAGE diskscan)
set(PACKAGE_VERSION ${PROJECT_VERSION})
+# Default to a debug build
+if(NOT CMAKE_BUILD_TYPE)
+ set(CMAKE_BUILD_TYPE Debug)
+endif(NOT CMAKE_BUILD_TYPE)
+
# Pull in zlib
find_package(ZLIB REQUIRED)
@@ -24,14 +29,18 @@
find_library(tinfo_LIBRARY NAMES tinfo curses)
# Architecture files
+message("SYSTEM NAME: ${CMAKE_SYSTEM_NAME}")
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(ARCH_SRC "arch/arch-linux.c")
set(ARCH_INCLUDE "arch/arch-linux.h")
+elseif (${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD")
+ set(ARCH_SRC "arch/arch-freebsd.c")
+ set(ARCH_INCLUDE "arch/arch-posix.h")
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
set(ARCH_SRC "arch/arch-freebsd.c")
set(ARCH_INCLUDE "arch/arch-posix.h")
else()
- set(ARCH_SRC "arch/arch-posix.c")
+ set(ARCH_SRC "arch/arch-generic.c")
set(ARCH_INCLUDE "arch/arch-posix.h")
endif()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/diskscan-0.18/DEVELOP.md new/diskscan-0.19/DEVELOP.md
--- old/diskscan-0.18/DEVELOP.md 2015-11-06 20:07:24.000000000 +0100
+++ new/diskscan-0.19/DEVELOP.md 2015-11-15 21:56:05.000000000 +0100
@@ -1,5 +1,11 @@
# Developing
+## Debug build
+
+To create a debug build you can tell cmake:
+
+ cmake -DCMAKE_BUILD_TYPE=DEBUG .
+
## Updating Libraries
Update libscsicmd:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/diskscan-0.18/arch/arch-freebsd.c new/diskscan-0.19/arch/arch-freebsd.c
--- old/diskscan-0.18/arch/arch-freebsd.c 2015-11-06 20:07:24.000000000 +0100
+++ new/diskscan-0.19/arch/arch-freebsd.c 2015-11-15 21:56:05.000000000 +0100
@@ -3,6 +3,9 @@
#include <sys/disk.h>
#include <sys/ioctl.h>
#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/ucred.h>
+#include <sys/mount.h>
#include "arch-posix.c"
#include <net/if.h>
@@ -33,6 +36,37 @@
return 0;
}
+disk_mount_e disk_dev_mount_state(const char *path)
+{
+ int num_mounts;
+ struct statfs *mntbuf;
+ disk_mount_e last_state;
+ int i;
+
+ num_mounts = getmntinfo(&mntbuf, MNT_WAIT);
+ if (num_mounts == 0) {
+ ERROR("Failed to get the mount information, errno=%d", errno);
+ return DISK_MOUNTED_RW;
+ }
+
+ last_state = DISK_NOT_MOUNTED;
+ for (i = 0; i < num_mounts; i++) {
+ struct statfs *mnt = &mntbuf[i];
+
+ if (strncmp(path, mnt->f_mntfromname, strlen(path)) == 0) {
+ disk_mount_e cur_state = DISK_NOT_MOUNTED;
+ if (mnt->f_flags == MNT_RDONLY)
+ cur_state = DISK_MOUNTED_RO;
+ else
+ cur_state = DISK_MOUNTED_RW;
+
+ if (cur_state > last_state)
+ last_state = cur_state;
+ }
+ }
+
+ return last_state;
+}
void mac_read(unsigned char *buf, int len)
{
struct ifreq ifr;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/diskscan-0.18/arch/arch-generic.c new/diskscan-0.19/arch/arch-generic.c
--- old/diskscan-0.18/arch/arch-generic.c 2015-11-06 20:07:24.000000000 +0100
+++ new/diskscan-0.19/arch/arch-generic.c 2015-11-15 21:56:05.000000000 +0100
@@ -17,3 +17,22 @@
return 0;
}
+
+int disk_dev_identify(disk_dev_t *dev, char *vendor, char *model, char *fw_rev, char *serial, bool *is_ata, unsigned char *ata_buf, unsigned *ata_buf_len)
+{
+ (void)dev;
+ strcpy(vendor, "UNKNOWN");
+ strcpy(model, "UNKNOWN");
+ strcpy(fw_rev, "UNKN");
+ strcpy(serial, "UNKNOWN");
+ *is_ata = 0;
+ *ata_buf_len = 0;
+ *ata_buf = 0;
+ return 0;
+}
+
+void mac_read(unsigned char *buf, int len)
+{
+ (void)len;
+ *buf = 0;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/diskscan-0.18/arch/arch-linux.c new/diskscan-0.19/arch/arch-linux.c
--- old/diskscan-0.18/arch/arch-linux.c 2015-11-06 20:07:24.000000000 +0100
+++ new/diskscan-0.19/arch/arch-linux.c 2015-11-15 21:56:05.000000000 +0100
@@ -18,6 +18,7 @@
#include <errno.h>
#include <net/if.h>
#include <netinet/in.h>
+#include <mntent.h>
static void strtrim(char *s)
{
@@ -237,6 +238,79 @@
return 0;
}
+static disk_mount_e mount_point_check(struct mntent *mnt)
+{
+ char *next = mnt->mnt_opts;
+ char *opt;
+
+ /* Device is mounted, check it */
+ while ((opt = strtok(next, ", \t\r\n")) != NULL) {
+ next = NULL; // continue scanning for this string
+ if (strcmp(opt, "rw") == 0)
+ return DISK_MOUNTED_RW;
+ }
+
+ return DISK_MOUNTED_RO;
+}
+
+disk_mount_e disk_dev_mount_state(const char *path)
+{
+ struct stat dev_st_buf;
+ struct stat st_buf;
+ FILE *f = NULL;
+ struct mntent *mnt;
+ disk_mount_e state = DISK_MOUNTED_RW; // assume the worst
+
+ f = setmntent("/proc/mounts", "r");
+ if (f == NULL) {
+ ERROR("Failed to open /proc/mounts to know the state, errno=%d", errno);
+ goto Exit;
+ }
+
+ if (stat(path, &dev_st_buf) != 0) {
+ ERROR("Failed to stat the path %s, errno=%d", path, errno);
+ goto Exit;
+ }
+
+ if (!S_ISBLK(dev_st_buf.st_mode)) {
+ ERROR("Device %s is not a block device", path);
+ goto Exit; // We only want block devices
+ }
+
+ // From here we assume the disk is not mounted
+ state = DISK_NOT_MOUNTED;
+
+ while ((mnt = getmntent(f)) != NULL) {
+ disk_mount_e cur_state = DISK_NOT_MOUNTED;
+
+ /* Ignore non-full-path entries */
+ if (mnt->mnt_fsname[0] != '/')
+ continue;
+ /* Check for a name prefix match, we may check a full block device and a partition is mounted */
+ if (strncmp(path, mnt->mnt_fsname, strlen(path)) == 0) {
+ cur_state = mount_point_check(mnt);
+ if (cur_state > state)
+ state = cur_state;
+ continue;
+ }
+ /* Check for an underlying device match (name may have changed in between actions) */
+ if (stat(mnt->mnt_fsname, &st_buf) == 0) {
+ if (!S_ISBLK(st_buf.st_mode))
+ continue;
+ if (dev_st_buf.st_rdev == st_buf.st_rdev) {
+ cur_state = mount_point_check(mnt);
+ if (cur_state > state)
+ state = cur_state;
+ }
+ }
+ }
+
+Exit:
+ if (f)
+ endmntent(f);
+ return state;
+}
+
bool disk_dev_open(disk_dev_t *dev, const char *path)
{
dev->fd = open(path, O_RDWR|O_DIRECT);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/diskscan-0.18/arch/arch-posix.c new/diskscan-0.19/arch/arch-posix.c
--- old/diskscan-0.18/arch/arch-posix.c 2015-11-06 20:07:24.000000000 +0100
+++ new/diskscan-0.19/arch/arch-posix.c 2015-11-15 21:56:05.000000000 +0100
@@ -4,8 +4,10 @@
#include <unistd.h>
#include <memory.h>
#include <errno.h>
+#include <stdbool.h>
#include "verbose.h"
+#include "arch.h"
bool disk_dev_open(disk_dev_t *dev, const char *path)
{
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/diskscan-0.18/cli/cli.c new/diskscan-0.19/cli/cli.c
--- old/diskscan-0.18/cli/cli.c 2015-11-06 20:07:24.000000000 +0100
+++ new/diskscan-0.19/cli/cli.c 2015-11-15 21:56:05.000000000 +0100
@@ -47,6 +47,7 @@
unsigned scan_size;
char *data_log_name;
char *data_log_raw_name;
+ disk_mount_e allowed_mount;
};
static void print_header(void)
@@ -67,6 +68,8 @@
printf(" -e, --size <size> - Scan size (default to 64K, must be multiple of 512)\n");
printf(" -o, --output <file> - Output file (json)\n");
printf(" -r, --raw-log <file> - Raw log of all scan results (json)\n");
+ printf(" --force-mounted - Allow checking a read-only mounted disk\n");
+ printf(" --force-mounted-rw - Allow checking a read-write mounted disk\n");
printf("\n");
return 1;
}
@@ -203,6 +206,7 @@
{
int c;
int unknown = 0;
+ static int allowed_mount = DISK_NOT_MOUNTED;
opts->scan_size = 64*1024;
@@ -215,6 +219,8 @@
{"size", required_argument, 0, 'e'},
{"raw-log", required_argument, 0, 'r'},
{"output", required_argument, 0, 'o'},
+ {"force-mounted", no_argument, &allowed_mount, DISK_MOUNTED_RO},
+ {"force-mounted-rw", no_argument, &allowed_mount, DISK_MOUNTED_RW},
{0, 0, 0, 0}
};
@@ -276,6 +282,7 @@
}
opts->disk_path = argv[optind];
+ opts->allowed_mount = allowed_mount;
return 0;
}
@@ -306,8 +313,10 @@
{
int ret;
options_t opts;
+
memset(&opts, 0, sizeof(opts));
opts.mode = SCAN_MODE_SEQ;
+ opts.allowed_mount = DISK_NOT_MOUNTED;
if (parse_args(argc, argv, &opts))
return 1;
@@ -317,7 +326,7 @@
setup_signals();
- if (disk_open(&disk, opts.disk_path, opts.fix, 70))
+ if (disk_open(&disk, opts.disk_path, opts.fix, 70, opts.allowed_mount))
return 1;
/*
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/diskscan-0.18/distclean.sh new/diskscan-0.19/distclean.sh
--- old/diskscan-0.18/distclean.sh 1970-01-01 01:00:00.000000000 +0100
+++ new/diskscan-0.19/distclean.sh 2015-11-15 21:56:05.000000000 +0100
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+# distclean.sh for diskscan
+# Copyright 2015 Joao Eriberto Mota Filho <eriberto(a)eriberto.pro.br>
+# v2015111402
+# This file can used under GPL-3+ license or BSD-3-Clause.
+
+PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+
+PREFIX="."
+
+# Files and directories to remove
+
+OBJS=" CMakeFiles/ \
+ Makefile \
+ CMakeCache.txt \
+ Documentation/diskscan.1 \
+ cmake_install.cmake \
+ install_manifest.txt \
+ libscsicmd/src/CMakeFiles/ \
+ libscsicmd/src/Makefile \
+ libscsicmd/src/cmake_install.cmake \
+ tags"
+
+# Main procedures
+
+remove_files () {
+ if [ -e "$PREFIX/$TARGET" ]; then
+ echo "Removing $PREFIX/$TARGET"
+ rm -rf "${PREFIX:?}/$TARGET"
+ else
+ echo "$PREFIX/$TARGET NOT FOUND."
+ fi
+}
+
+# Distclean
+
+echo "DOING DISTCLEAN..."
+
+for TARGET in $OBJS
+do
+ remove_files
+done
+
+echo "DONE."
+echo
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/diskscan-0.18/include/arch.h new/diskscan-0.19/include/arch.h
--- old/diskscan-0.18/include/arch.h 2015-11-06 20:07:24.000000000 +0100
+++ new/diskscan-0.19/include/arch.h 2015-11-15 21:56:05.000000000 +0100
@@ -29,6 +29,14 @@
unsigned sense_len;
} io_result_t;
+typedef enum {
+ DISK_NOT_MOUNTED = 0,
+ DISK_MOUNTED_RO = 1,
+ DISK_MOUNTED_RW = 2,
+} disk_mount_e;
+
+disk_mount_e disk_dev_mount_state(const char *path);
+
bool disk_dev_open(disk_dev_t *dev, const char *path);
void disk_dev_close(disk_dev_t *dev);
void disk_dev_cdb_out(disk_dev_t *dev, unsigned char *cdb, unsigned cdb_len, unsigned char *buf, unsigned buf_size, unsigned *buf_read,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/diskscan-0.18/include/diskscan.h new/diskscan-0.19/include/diskscan.h
--- old/diskscan-0.18/include/diskscan.h 2015-11-06 20:07:24.000000000 +0100
+++ new/diskscan-0.19/include/diskscan.h 2015-11-15 21:56:05.000000000 +0100
@@ -87,7 +87,7 @@
data_log_t data_log;
} disk_t;
-int disk_open(disk_t *disk, const char *path, int fix, unsigned latency_graph_len);
+int disk_open(disk_t *disk, const char *path, int fix, unsigned latency_graph_len, disk_mount_e allowed_mount);
int disk_scan(disk_t *disk, enum scan_mode mode, unsigned data_size);
int disk_close(disk_t *disk);
void disk_scan_stop(disk_t *disk);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/diskscan-0.18/lib/diskscan.c new/diskscan-0.19/lib/diskscan.c
--- old/diskscan-0.18/lib/diskscan.c 2015-11-06 20:07:24.000000000 +0100
+++ new/diskscan-0.19/lib/diskscan.c 2015-11-15 21:56:05.000000000 +0100
@@ -269,7 +269,33 @@
(void)disk;
}
-int disk_open(disk_t *disk, const char *path, int fix, unsigned latency_graph_len)
+static const char *disk_mount_str(disk_mount_e mount)
+{
+ switch (mount) {
+ case DISK_NOT_MOUNTED: return "not mounted";
+ case DISK_MOUNTED_RO: return "mounted read-only";
+ case DISK_MOUNTED_RW: return "mounted read-write";
+ default: return "unknown";
+ }
+}
+
+static int disk_mount_allowed(const char *path, disk_mount_e allowed_mount)
+{
+ const disk_mount_e mount_state = disk_dev_mount_state(path);
+
+ if (mount_state > allowed_mount) {
+ ERROR("Disk is currently %s and we only allow %s, use --force-mounted or --force-mounted-rw if the risk of problems is acceptable", disk_mount_str(mount_state), disk_mount_str(allowed_mount));
+ return 0;
+ }
+
+ if (mount_state != DISK_NOT_MOUNTED) {
+ INFO("Disk is %s but this is allowed with a force option", disk_mount_str(mount_state));
+ }
+
+ return 1;
+}
+
+int disk_open(disk_t *disk, const char *path, int fix, unsigned latency_graph_len, disk_mount_e allowed_mount)
{
memset(disk, 0, sizeof(*disk));
disk->fix = fix;
@@ -286,6 +312,11 @@
return 1;
}
+ if (fix && !disk_mount_allowed(path, allowed_mount)) {
+ ERROR("Better not fix with the disk mounted, mounted fs may get confused when data is possibly modified under its feet");
+ return 1;
+ }
+
if (!disk_dev_open(&disk->dev, path)) {
ERROR("Failed to open path %s, errno=%d: %s", path, errno, strerror(errno));
return 1;
1
0
Hello community,
here is the log from the commit of package libkdumpfile for openSUSE:Factory checked in at 2015-11-28 15:19:16
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libkdumpfile (Old)
and /work/SRC/openSUSE:Factory/.libkdumpfile.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libkdumpfile"
Changes:
--------
--- /work/SRC/openSUSE:Factory/libkdumpfile/libkdumpfile.changes 2015-08-27 08:56:50.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.libkdumpfile.new/libkdumpfile.changes 2015-11-28 15:19:17.000000000 +0100
@@ -1,0 +2,22 @@
+Thu Nov 26 09:54:56 UTC 2015 - ptesarik(a)suse.com
+
+- Remove autoreconf invocation (fix build on SLE10).
+
+-------------------------------------------------------------------
+Wed Nov 25 13:29:56 UTC 2015 - ptesarik(a)suse.com
+
+- Add pkg-config to BuildRequires (adds back zlib support).
+- libkdumpfile-fallback-for-old-zlib.patch: Fall back to
+ AC_SEARCH_LIBS if there is no pkg-config file for zlib.
+
+-------------------------------------------------------------------
+Wed Nov 25 12:50:16 UTC 2015 - ptesarik(a)suse.cz
+
+- upgrade to libkdumpfile-0.1.5
+ * Improved support of Xen dumpcore files.
+ * Basic support for MIPS architecture.
+ * Fix support for LKCD dumps on s390x.
+- Add libkdumpfile.pc pkg-config file to -devel package.
+- libkdumpfile-remove-ARCH_PPC64LE.patch: Fix build on ppc64le.
+
+-------------------------------------------------------------------
Old:
----
libkdumpfile-0.1.4.tar.bz2
New:
----
libkdumpfile-0.1.5.tar.bz2
libkdumpfile-fallback-for-old-zlib.patch
libkdumpfile-remove-ARCH_PPC64LE.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libkdumpfile.spec ++++++
--- /var/tmp/diff_new_pack.R6CIR7/_old 2015-11-28 15:19:18.000000000 +0100
+++ /var/tmp/diff_new_pack.R6CIR7/_new 2015-11-28 15:19:18.000000000 +0100
@@ -33,7 +33,7 @@
# End compatibility cruft
Name: libkdumpfile
-Version: 0.1.4
+Version: 0.1.5
Release: 0
Summary: Kernel dump file access library
License: LGPL-3.0+ or GPL-2.0+
@@ -41,8 +41,10 @@
Url: https://github.com/ptesarik/libkdumpfile
Source: https://github.com/ptesarik/libkdumpfile/releases/download/v%version/%name-…
Patch1: %{name}-add-EM_AARCH64.patch
-BuildRequires: libtool >= 2
+Patch2: %{name}-remove-ARCH_PPC64LE.patch
+Patch3: %{name}-fallback-for-old-zlib.patch
BuildRequires: lzo-devel
+BuildRequires: pkgconfig
BuildRequires: zlib-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} < 1030
@@ -81,11 +83,12 @@
%prep
%setup -q
%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+# Avoid autotools recheck after patching config*
+touch aclocal.m4 Makefile.in config.h.in configure
%build
-if [ ! -e configure ]; then
- autoreconf -fiv
-fi
%configure --disable-static
make %{?_smp_mflags}
@@ -106,5 +109,6 @@
%defattr(-,root,root)
%{_libdir}/libkdumpfile.so
%{_includedir}/kdumpfile.h
+%{_libdir}/pkgconfig/libkdumpfile.pc
%changelog
++++++ libkdumpfile-0.1.4.tar.bz2 -> libkdumpfile-0.1.5.tar.bz2 ++++++
++++ 2013 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/libkdumpfile-0.1.4/Makefile.am new/libkdumpfile-0.1.5/Makefile.am
--- old/libkdumpfile-0.1.4/Makefile.am 2014-12-05 17:29:35.000000000 +0100
+++ new/libkdumpfile-0.1.5/Makefile.am 2015-11-25 13:17:33.000000000 +0100
@@ -43,7 +43,7 @@
EXTRA_libkdumpfile_la_DEPENDENCIES = libkdumpfile.map
-libkdumpfile_la_LDFLAGS = -version-info 3:0:3
+libkdumpfile_la_LDFLAGS = -version-info 4:0:4
libkdumpfile_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libkdumpfile.map
include_HEADERS = \
@@ -58,3 +58,6 @@
COPYING.LGPLv3 \
README.md \
libkdumpfile.map
+
+pkgconfigdir=$(libdir)/pkgconfig
+pkgconfig_DATA=libkdumpfile.pc
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/libkdumpfile-0.1.4/NEWS new/libkdumpfile-0.1.5/NEWS
--- old/libkdumpfile-0.1.4/NEWS 2014-12-05 17:27:29.000000000 +0100
+++ new/libkdumpfile-0.1.5/NEWS 2015-11-25 13:16:57.000000000 +0100
@@ -1,3 +1,9 @@
+0.1.5
+-----
+ * improved support of Xen dumpcore files
+ * basic support for MIPS architecture
+ * fix support for LKCD dumps on s390x
+
0.1.4
-----
* support for IA32 (32-bit x86) architecture
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/libkdumpfile-0.1.4/config.h.in new/libkdumpfile-0.1.5/config.h.in
--- old/libkdumpfile-0.1.4/config.h.in 2014-12-05 17:30:01.000000000 +0100
+++ new/libkdumpfile-0.1.5/config.h.in 2015-11-25 13:20:59.000000000 +0100
@@ -64,7 +64,7 @@
/* Define to enable support for snappy compression using -lsnappy */
#undef USE_SNAPPY
-/* Define to enable support for zlib compression using -lz */
+/* Define to enable support for zlib compression */
#undef USE_ZLIB
/* Version number of package */
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/libkdumpfile-0.1.4/configure.ac new/libkdumpfile-0.1.5/configure.ac
--- old/libkdumpfile-0.1.4/configure.ac 2014-12-05 17:29:10.000000000 +0100
+++ new/libkdumpfile-0.1.5/configure.ac 2015-11-25 13:17:52.000000000 +0100
@@ -19,7 +19,7 @@
dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
AC_INIT([Library for reading kernel core dumps],
- [0.1.4],[ptesarik(a)suse.cz],[libkdumpfile])
+ [0.1.5],[ptesarik(a)suse.cz],[libkdumpfile])
AC_CONFIG_SRCDIR([diskdump.c])
AC_CONFIG_MACRO_DIR([m4])
@@ -32,13 +32,26 @@
LT_INIT
-kdump_COMPRESSION(zlib, ZLIB, z, uncompress)
+AC_SUBST(REQUIRES_PRIVATE)
+AC_SUBST(LIBS_PRIVATE)
+
+dnl This makes sure pkg.m4 is available.
+m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
+
+PKG_CHECK_MODULES(ZLIB, zlib,
+ [ REQUIRES_PRIVATE="zlib $REQUIRES_PRIVATE"
+ AC_DEFINE(USE_ZLIB, 1, [Define to enable support for zlib compression])
+ ],[# ignore if missing])
+AS_VAR_APPEND([CFLAGS], " $ZLIB_CFLAGS")
+AS_VAR_APPEND([LIBS], " $ZLIB_LIBS")
+
kdump_COMPRESSION(lzo, LZO, lzo2, lzo1x_decompress_safe)
kdump_COMPRESSION(snappy, SNAPPY, snappy, snappy_uncompress)
AC_CONFIG_FILES([
Makefile
doc/Makefile
+ libkdumpfile.pc
])
AC_OUTPUT
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/libkdumpfile-0.1.4/context.c new/libkdumpfile-0.1.5/context.c
--- old/libkdumpfile-0.1.4/context.c 2014-11-28 17:21:04.000000000 +0100
+++ new/libkdumpfile-0.1.5/context.c 2015-07-23 11:50:55.000000000 +0200
@@ -66,9 +66,9 @@
[ARCH_ALPHA] = "alpha",
[ARCH_ARM] = "arm",
[ARCH_IA64] = "ia64",
+ [ARCH_MIPS] = "mips",
[ARCH_PPC] = "ppc",
[ARCH_PPC64] = "ppc64",
- [ARCH_PPC64LE] = "ppc64le",
[ARCH_S390] = "s390",
[ARCH_S390X] = "s390x",
[ARCH_X86] = "i386",
@@ -245,3 +245,11 @@
return vmcoreinfo_symbol(ctx, ctx->vmcoreinfo_xen, symname, symvalue);
}
+
+kdump_get_symbol_val_fn *
+kdump_cb_get_symbol_val(kdump_ctx *ctx, kdump_get_symbol_val_fn *cb)
+{
+ kdump_get_symbol_val_fn *ret = ctx->cb_get_symbol_val;
+ ctx->cb_get_symbol_val = cb ?: kdump_vmcoreinfo_symbol;
+ 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/libkdumpfile-0.1.4/diskdump.c new/libkdumpfile-0.1.5/diskdump.c
--- old/libkdumpfile-0.1.4/diskdump.c 2014-12-03 17:18:23.000000000 +0100
+++ new/libkdumpfile-0.1.5/diskdump.c 2015-07-23 12:30:58.000000000 +0200
@@ -150,6 +150,9 @@
struct disk_dump_priv {
unsigned char *bitmap; /* for compressed dumps */
off_t descoff; /* position of page descriptor table */
+
+ void *xen_map;
+ unsigned long xen_map_size;
};
struct setup_data {
@@ -170,6 +173,8 @@
| DUMP_DH_COMPRESSED_SNAPPY \
)
+static const struct format_ops xen_dom0_ops;
+
static void diskdump_cleanup(kdump_ctx *ctx);
static inline int
@@ -209,6 +214,7 @@
if (!page_is_dumpable(ctx, pfn)) {
memset(ctx->page, 0, ctx->page_size);
+ ctx->last_pfn = -(kdump_paddr_t)1;
return kdump_ok;
}
@@ -308,6 +314,166 @@
}
static kdump_status
+diskdump_read_xen_dom0(kdump_ctx *ctx, kdump_pfn_t pfn)
+{
+ struct disk_dump_priv *ddp = ctx->fmtdata;
+ unsigned fpp = ctx->page_size / ctx->ptr_size;
+ uint64_t mfn_idx, frame_idx;
+ kdump_status ret;
+
+ mfn_idx = pfn / fpp;
+ frame_idx = pfn % fpp;
+ if (mfn_idx >= ddp->xen_map_size)
+ return set_error(ctx, kdump_nodata, "Out-of-bounds PFN");
+
+ pfn = (ctx->ptr_size == 8)
+ ? ((uint64_t*)ddp->xen_map)[mfn_idx]
+ : ((uint32_t*)ddp->xen_map)[mfn_idx];
+ ret = diskdump_read_page(ctx, pfn);
+ if (ret != kdump_ok)
+ return set_error(ctx, ret, "Cannot read MFN %llx",
+ (unsigned long long) pfn);
+
+ pfn = (ctx->ptr_size == 8)
+ ? ((uint64_t*)ctx->page)[frame_idx]
+ : ((uint32_t*)ctx->page)[frame_idx];
+ ret = diskdump_read_page(ctx, pfn);
+ return set_error(ctx, ret, "Cannot read MFN %llx",
+ (unsigned long long) pfn);
+}
+
+static kdump_status
+initialize_xen_map64(kdump_ctx *ctx, void *dir)
+{
+ struct disk_dump_priv *ddp = ctx->fmtdata;
+ unsigned fpp = ctx->page_size / ctx->ptr_size;
+ uint64_t *dirp, *p, *map;
+ uint64_t pfn;
+ unsigned long mfns;
+ kdump_status ret;
+
+ mfns = 0;
+ for (dirp = dir, pfn = 0; *dirp && pfn < ctx->max_pfn;
+ ++dirp, pfn += fpp * fpp) {
+ ret = diskdump_read_page(ctx, *dirp);
+ if (ret == kdump_nodata)
+ ret = kdump_dataerr;
+ if (ret != kdump_ok)
+ return set_error(ctx, ret,
+ "Cannot read Xen P2M map MFN 0x%llx",
+ (unsigned long long) *dirp);
+
+ for (p = ctx->page; (void*)p < ctx->page + ctx->page_size; ++p)
+ if (*p)
+ ++mfns;
+ }
+
+ map = ctx_malloc(mfns * sizeof(uint64_t), ctx, "Xen P2M map");
+ if (!map)
+ return kdump_syserr;
+ ddp->xen_map = map;
+ ddp->xen_map_size = mfns;
+
+ for (dirp = dir; mfns; ++dirp) {
+ ret = diskdump_read_page(ctx, *dirp);
+ if (ret == kdump_nodata)
+ ret = kdump_dataerr;
+ if (ret != kdump_ok)
+ return set_error(ctx, ret,
+ "Cannot read Xen P2M map MFN 0x%llx",
+ (unsigned long long) *dirp);
+
+ for (p = ctx->page; (void*)p < ctx->page + ctx->page_size; ++p)
+ if (*p) {
+ *map++ = dump64toh(ctx, *p);
+ --mfns;
+ }
+ }
+
+ return kdump_ok;
+}
+
+static kdump_status
+initialize_xen_map32(kdump_ctx *ctx, void *dir)
+{
+ struct disk_dump_priv *ddp = ctx->fmtdata;
+ unsigned fpp = ctx->page_size / ctx->ptr_size;
+ uint32_t *dirp, *p, *map;
+ uint32_t pfn;
+ unsigned long mfns;
+ kdump_status ret;
+
+ mfns = 0;
+ for (dirp = dir, pfn = 0; *dirp && pfn < ctx->max_pfn;
+ ++dirp, pfn += fpp * fpp) {
+ ret = diskdump_read_page(ctx, *dirp);
+ if (ret == kdump_nodata)
+ ret = kdump_dataerr;
+ if (ret != kdump_ok)
+ return set_error(ctx, ret,
+ "Cannot read Xen P2M map MFN 0x%llx",
+ (unsigned long long) *dirp);
+
+ for (p = ctx->page; (void*)p < ctx->page + ctx->page_size; ++p)
+ if (*p)
+ ++mfns;
+ }
+
+ map = ctx_malloc(mfns * sizeof(uint32_t), ctx, "Xen P2M map");
+ if (!map)
+ return kdump_syserr;
+ ddp->xen_map = map;
+ ddp->xen_map_size = mfns;
+
+ for (dirp = dir; mfns; ++dirp) {
+ ret = diskdump_read_page(ctx, *dirp);
+ if (ret == kdump_nodata)
+ ret = kdump_dataerr;
+ if (ret != kdump_ok)
+ return set_error(ctx, ret,
+ "Cannot read Xen P2M map MFN 0x%llx",
+ (unsigned long long) *dirp);
+
+ for (p = ctx->page; (void*)p < ctx->page + ctx->page_size; ++p)
+ if (*p) {
+ *map++ = dump32toh(ctx, *p);
+ --mfns;
+ }
+ }
+
+ return kdump_ok;
+}
+
+static kdump_status
+initialize_xen_map(kdump_ctx *ctx)
+{
+ void *dir, *page;
+ kdump_status ret;
+
+ ret = diskdump_read_page(ctx, ctx->xen_p2m_mfn);
+ if (ret != kdump_ok)
+ return set_error(ctx, ret,
+ "Cannot read Xen P2M directory MFN 0x%llx",
+ (unsigned long long) ctx->xen_p2m_mfn);
+
+ dir = ctx->page;
+ page = ctx_malloc(ctx->page_size, ctx, "page buffer");
+ if (page == NULL)
+ return kdump_syserr;
+ ctx->page = page;
+
+ ret = (ctx->ptr_size == 8)
+ ? initialize_xen_map64(ctx, dir)
+ : initialize_xen_map32(ctx, dir);
+
+ if (ret == kdump_ok)
+ ctx->ops = &xen_dom0_ops;
+
+ free(dir);
+ return ret;
+}
+
+static kdump_status
read_vmcoreinfo(kdump_ctx *ctx, off_t off, size_t size)
{
void *info;
@@ -657,6 +823,12 @@
if (ret != kdump_ok)
goto err_cleanup;
+ if (ctx->xen_p2m_mfn) {
+ ret = initialize_xen_map(ctx);
+ if (ret != kdump_ok)
+ return ret;
+ }
+
return ret;
err_cleanup:
@@ -699,3 +871,9 @@
.read_page = diskdump_read_page,
.cleanup = diskdump_cleanup,
};
+
+static const struct format_ops xen_dom0_ops = {
+ .read_page = diskdump_read_xen_dom0,
+ .read_xenmach_page = diskdump_read_page,
+ .cleanup = diskdump_cleanup,
+};
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/libkdumpfile-0.1.4/elfdump.c new/libkdumpfile-0.1.5/elfdump.c
--- old/libkdumpfile-0.1.4/elfdump.c 2014-11-28 17:17:52.000000000 +0100
+++ new/libkdumpfile-0.1.5/elfdump.c 2015-03-30 10:31:26.000000000 +0200
@@ -93,6 +93,7 @@
case EM_FAKE_ALPHA:
return ARCH_ALPHA;
case EM_IA_64: return ARCH_IA64;
+ case EM_MIPS: return ARCH_MIPS;
case EM_PPC: return ARCH_PPC;
case EM_PPC64: return ARCH_PPC64;
case EM_S390: return ARCH_S390;
@@ -173,7 +174,7 @@
}
static unsigned long
-pfn_to_mfn(struct elfdump_priv *edp, unsigned long pfn)
+pfn_to_idx(struct elfdump_priv *edp, kdump_pfn_t pfn)
{
unsigned long i;
@@ -193,19 +194,78 @@
}
static kdump_status
-elf_read_xen_domU(kdump_ctx *ctx, unsigned long pfn)
+elf_read_xen_domU(kdump_ctx *ctx, kdump_pfn_t pfn)
{
struct elfdump_priv *edp = ctx->fmtdata;
- unsigned long mfn;
+ unsigned long idx;
off_t offset;
ssize_t rd;
- if ((mfn = pfn_to_mfn(edp, pfn)) == ~0UL)
+ idx = pfn_to_idx(edp, pfn);
+ if (idx == ~0UL)
return set_error(ctx, kdump_nodata,
"No machine address for PFN: 0x%llx",
(unsigned long long) pfn);
- offset = edp->xen_pages_offset + (off_t)mfn * ctx->page_size;
+ offset = edp->xen_pages_offset + (off_t)idx * ctx->page_size;
+ rd = pread(ctx->fd, ctx->page, ctx->page_size, offset);
+ if (rd != ctx->page_size)
+ return set_error(ctx, read_error(rd),
+ "Cannot read page data at %llu: %s",
+ (unsigned long long) offset,
+ read_err_str(rd));
+
+ return 0;
+}
+
+static unsigned long
+mfn_to_idx(struct elfdump_priv *edp, kdump_pfn_t mfn)
+{
+ unsigned long i;
+
+ if (edp->xen_map_type == xen_map_p2m) {
+ struct xen_p2m *p = edp->xen_map;
+ for (i = 0; i < edp->xen_map_size; ++i, ++p)
+ if (p->gmfn == mfn)
+ return i;
+ }
+
+ return ~0UL;
+}
+
+static kdump_status
+elf_mfn_to_pfn(kdump_ctx *ctx, kdump_pfn_t mfn, kdump_pfn_t *pfn)
+{
+ struct elfdump_priv *edp = ctx->fmtdata;
+ unsigned long i;
+
+ if (edp->xen_map_type == xen_map_p2m) {
+ struct xen_p2m *p = edp->xen_map;
+ for (i = 0; i < edp->xen_map_size; ++i, ++p)
+ if (p->gmfn == mfn) {
+ *pfn = p->pfn;
+ return kdump_ok;
+ }
+ } else
+ return set_error(ctx, kdump_unsupported,
+ "No MFN-to-PFN translation table");
+
+ return set_error(ctx, kdump_nodata, "MFN not found");
+}
+
+static kdump_status
+elf_read_xenmach_domU(kdump_ctx *ctx, kdump_pfn_t mfn)
+{
+ struct elfdump_priv *edp = ctx->fmtdata;
+ unsigned long idx;
+ off_t offset;
+ ssize_t rd;
+
+ idx = mfn_to_idx(edp, mfn);
+ if (idx == ~0UL)
+ return set_error(ctx, kdump_nodata, "Page not found");
+
+ offset = edp->xen_pages_offset + (off_t)idx * ctx->page_size;
rd = pread(ctx->fd, ctx->page, ctx->page_size, offset);
if (rd != ctx->page_size)
return set_error(ctx, read_error(rd),
@@ -486,7 +546,7 @@
unsigned fpp = ctx->page_size / ctx->ptr_size;
uint64_t *dirp, *p, *map;
uint64_t pfn;
- unsigned mfns;
+ unsigned long mfns;
kdump_status ret;
mfns = 0;
@@ -537,7 +597,7 @@
unsigned fpp = ctx->page_size / ctx->ptr_size;
uint32_t *dirp, *p, *map;
uint32_t pfn;
- unsigned mfns;
+ unsigned long mfns;
kdump_status ret;
mfns = 0;
@@ -705,6 +765,7 @@
strerror(errno));
edp->xen_map_type = xen_map_p2m;
edp->xen_map_size = sect->size /sizeof(struct xen_p2m);
+ ctx->xen_pte_is_mach = 1;
} else if (!strcmp(name, ".xen_pfn")) {
edp->xen_map = read_elf_sect(ctx, sect);
if (!edp->xen_map)
@@ -712,6 +773,17 @@
strerror(errno));
edp->xen_map_type = xen_map_pfn;
edp->xen_map_size = sect->size / sizeof(uint64_t);
+ ctx->xen_pte_is_mach = 0;
+ } else if (!strcmp(name, ".note.Xen")) {
+ notes = read_elf_sect(ctx, sect);
+ if (!notes)
+ return set_error(ctx, kdump_syserr,
+ strerror(errno));
+ ret = process_notes(ctx, notes, sect->size);
+ free(notes);
+ if (ret != kdump_ok)
+ return set_error(ctx, ret,
+ "Cannot process Xen notes");
}
}
@@ -815,6 +887,7 @@
static const struct format_ops xen_domU_ops = {
.read_page = elf_read_xen_domU,
- .read_xenmach_page = elf_read_page,
+ .read_xenmach_page = elf_read_xenmach_domU,
+ .mfn_to_pfn = elf_mfn_to_pfn,
.cleanup = elf_cleanup,
};
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/libkdumpfile-0.1.4/ia32.c new/libkdumpfile-0.1.5/ia32.c
--- old/libkdumpfile-0.1.4/ia32.c 2014-11-28 17:14:24.000000000 +0100
+++ new/libkdumpfile-0.1.5/ia32.c 2015-03-26 18:27:03.000000000 +0100
@@ -214,7 +214,7 @@
kdump_status ret;
size_t sz;
- ret = kdump_vmcoreinfo_symbol(ctx, "swapper_pg_dir", &pgtaddr);
+ ret = get_symbol_val(ctx, "swapper_pg_dir", &pgtaddr);
if (ret != kdump_ok)
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/libkdumpfile-0.1.4/kdumpfile-priv.h new/libkdumpfile-0.1.5/kdumpfile-priv.h
--- old/libkdumpfile-0.1.4/kdumpfile-priv.h 2014-12-04 11:05:34.000000000 +0100
+++ new/libkdumpfile-0.1.5/kdumpfile-priv.h 2015-07-23 11:50:55.000000000 +0200
@@ -55,9 +55,9 @@
ARCH_ALPHA,
ARCH_ARM,
ARCH_IA64,
+ ARCH_MIPS,
ARCH_PPC,
ARCH_PPC64,
- ARCH_PPC64LE,
ARCH_S390,
ARCH_S390X,
ARCH_X86,
@@ -107,6 +107,14 @@
*/
kdump_status (*read_xenmach_page)(kdump_ctx *, kdump_pfn_t);
+ /* Translate a machine frame number to physical frame number.
+ * ctx->fmtdata initialized in probe()
+ * Return:
+ * kdump_ok output variable contains translated PFN
+ * kdump_nodata given MFN was not found
+ */
+ kdump_status (*mfn_to_pfn)(kdump_ctx *, kdump_pfn_t, kdump_pfn_t *);
+
/* Clean up all private data.
*/
void (*cleanup)(kdump_ctx *);
@@ -230,10 +238,13 @@
kdump_xen_version_t xen_ver; /* Xen hypervisor version */
kdump_vaddr_t xen_extra_ver;
kdump_pfn_t xen_p2m_mfn;
+ int xen_pte_is_mach;
void *fmtdata; /* format-specific private data */
void *archdata; /* arch-specific private data */
+ kdump_get_symbol_val_fn *cb_get_symbol_val;
+
char *err_str; /* error string */
char err_buf[ERRBUF]; /* buffer for error string */
};
@@ -338,6 +349,10 @@
#define cksum32 INTERNAL_NAME(cksum32)
uint32_t cksum32(void *buffer, size_t size, uint32_t csum);
+#define get_symbol_val INTERNAL_NAME(get_symbol_val)
+kdump_status get_symbol_val(kdump_ctx *ctx, const char *name,
+ kdump_addr_t *val);
+
/* ELF notes */
#define process_notes INTERNAL_NAME(process_notes)
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/libkdumpfile-0.1.4/kdumpfile.h new/libkdumpfile-0.1.5/kdumpfile.h
--- old/libkdumpfile-0.1.4/kdumpfile.h 2014-12-04 19:01:07.000000000 +0100
+++ new/libkdumpfile-0.1.5/kdumpfile.h 2015-07-23 11:50:56.000000000 +0200
@@ -294,9 +294,9 @@
* - arm
* - i386
* - ia64
+ * - mips
* - ppc
* - ppc64
- * - ppc64le
* - s390
* - s390x
* - x86_64
@@ -467,6 +467,25 @@
*/
void kdump_xen_version(kdump_ctx *ctx, kdump_xen_version_t *version);
+/** Type for the get_symbol_val callback function.
+ * @param ctx Dump file object of the caller.
+ * @param[in] name Name of the symbol.
+ * @param[out] val Symbol value.
+ * @returns Error status.
+ *
+ * This type is used for @ref kdump_cb_get_symbol_val.
+ */
+typedef kdump_status kdump_get_symbol_val_fn(
+ kdump_ctx *ctx, const char *name, kdump_addr_t *val);
+
+/** Set the get_symbol_val callback
+ * @param ctx Dump file object.
+ * @param cb New callback function.
+ * @return the Previous callback function.
+ */
+kdump_get_symbol_val_fn *
+kdump_cb_get_symbol_val(kdump_ctx *ctx, kdump_get_symbol_val_fn *cb);
+
#ifdef __cplusplus
}
#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/libkdumpfile-0.1.4/libkdumpfile.map new/libkdumpfile-0.1.5/libkdumpfile.map
--- old/libkdumpfile-0.1.4/libkdumpfile.map 2014-12-03 17:49:52.000000000 +0100
+++ new/libkdumpfile-0.1.5/libkdumpfile.map 2015-07-23 11:50:56.000000000 +0200
@@ -34,6 +34,7 @@
kdump_vmcoreinfo_symbol;
kdump_vmcoreinfo_symbol_xen;
kdump_xen_version;
+ kdump_cb_get_symbol_val;
local:
*;
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/libkdumpfile-0.1.4/libkdumpfile.pc.in new/libkdumpfile-0.1.5/libkdumpfile.pc.in
--- old/libkdumpfile-0.1.4/libkdumpfile.pc.in 1970-01-01 01:00:00.000000000 +0100
+++ new/libkdumpfile-0.1.5/libkdumpfile.pc.in 2015-09-24 09:53:41.000000000 +0200
@@ -0,0 +1,15 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: libkdumpfile
+Description: Kernel coredump file access
+URL: https://github.com/ptesarik/libkdumpfile
+Version: @VERSION@
+
+Requires:
+Requires.private: @REQUIRES_PRIVATE@
+Libs: -L${libdir} -lkdumpfile
+Libs.private: @LIBS_PRIVATE@
+Cflags: -I${includedir}
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/libkdumpfile-0.1.4/lkcd.c new/libkdumpfile-0.1.5/lkcd.c
--- old/libkdumpfile-0.1.4/lkcd.c 2014-11-28 17:15:04.000000000 +0100
+++ new/libkdumpfile-0.1.5/lkcd.c 2015-11-24 21:00:31.000000000 +0100
@@ -317,6 +317,8 @@
char format[MAX_FORMAT_NAME];
};
+static void lkcd_cleanup(kdump_ctx *ctx);
+
static off_t
find_page(kdump_ctx *ctx, off_t off, unsigned pfn, struct dump_page *dp)
{
@@ -656,10 +658,6 @@
if (ret != kdump_ok)
goto err_free;
- ret = set_arch(ctx, machine_arch(ctx->utsname.machine));
- if (ret != kdump_ok)
- goto err_free;
-
max_idx1 = pfn_idx1(ctx->max_pfn - 1) + 1;
lkcdp->pfn_level1 = calloc(max_idx1, sizeof(struct pfn_level2*));
if (!lkcdp->pfn_level1) {
@@ -669,10 +667,14 @@
goto err_free;
}
+ ret = set_arch(ctx, machine_arch(ctx->utsname.machine));
+ if (ret != kdump_ok)
+ goto err_free;
+
return kdump_ok;
err_free:
- free(lkcdp);
+ lkcd_cleanup(ctx);
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/libkdumpfile-0.1.4/m4/compression.m4 new/libkdumpfile-0.1.5/m4/compression.m4
--- old/libkdumpfile-0.1.4/m4/compression.m4 2014-10-30 10:48:33.000000000 +0100
+++ new/libkdumpfile-0.1.5/m4/compression.m4 2015-09-24 10:10:35.000000000 +0200
@@ -7,6 +7,7 @@
[AC_SEARCH_LIBS([$4],[$3],
[AC_DEFINE(USE_$2, 1,
[Define to enable support for $1 compression using -l$3])
+ AS_VAR_APPEND(LIBS_PRIVATE, " -l$3")
],[
if test "x$with_$1" != xcheck; then
AC_MSG_FAILURE([--with-$1 was given, but test for $1 failed])
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/libkdumpfile-0.1.4/m4/libtool.m4 new/libkdumpfile-0.1.5/m4/libtool.m4
--- old/libkdumpfile-0.1.4/m4/libtool.m4 2014-12-05 17:11:38.000000000 +0100
+++ new/libkdumpfile-0.1.5/m4/libtool.m4 2015-09-24 10:10:51.000000000 +0200
@@ -1312,7 +1312,7 @@
rm -rf conftest*
;;
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
@@ -1326,7 +1326,10 @@
x86_64-*linux*)
LD="${LD-ld} -m elf_i386"
;;
- ppc64-*linux*|powerpc64-*linux*)
+ powerpc64le-*linux*)
+ LD="${LD-ld} -m elf32lppclinux"
+ ;;
+ powerpc64-*linux*)
LD="${LD-ld} -m elf32ppclinux"
;;
s390x-*linux*)
@@ -1345,7 +1348,10 @@
x86_64-*linux*)
LD="${LD-ld} -m elf_x86_64"
;;
- ppc*-*linux*|powerpc*-*linux*)
+ powerpcle-*linux*)
+ LD="${LD-ld} -m elf64lppc"
+ ;;
+ powerpc-*linux*)
LD="${LD-ld} -m elf64ppc"
;;
s390*-*linux*|s390*-*tpf*)
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/libkdumpfile-0.1.4/notes.c new/libkdumpfile-0.1.5/notes.c
--- old/libkdumpfile-0.1.4/notes.c 2014-11-28 16:02:16.000000000 +0100
+++ new/libkdumpfile-0.1.5/notes.c 2015-11-24 23:44:46.000000000 +0100
@@ -74,6 +74,50 @@
/* Additional arch-dependent and version-dependent fields */
};
+#define XEN_EXTRA_VERSION_SZ 16
+#define XEN_COMPILER_SZ 64
+#define XEN_COMPILE_BY_SZ 16
+#define XEN_COMPLE_DOMAIN_SZ 32
+#define XEN_COMPILE_DATE_SZ 32
+#define XEN_CAPABILITIES_SZ 1024
+#define XEN_CHANGESET_SZ 64
+
+struct xen_dumpcore_elfnote_xen_version_32 {
+ uint64_t major_version;
+ uint64_t minor_version;
+ char extra_version[XEN_EXTRA_VERSION_SZ];
+ struct {
+ char compiler[XEN_COMPILER_SZ];
+ char compile_by[XEN_COMPILE_BY_SZ];
+ char compile_domain[XEN_COMPLE_DOMAIN_SZ];
+ char compile_date[XEN_COMPILE_DATE_SZ];
+ } compile_info;
+ char capabilities[XEN_CAPABILITIES_SZ];
+ char changeset[XEN_CHANGESET_SZ];
+ struct {
+ uint32_t virt_start;
+ } platform_parameters;
+ uint64_t pagesize;
+};
+
+struct xen_dumpcore_elfnote_xen_version_64 {
+ uint64_t major_version;
+ uint64_t minor_version;
+ char extra_version[XEN_EXTRA_VERSION_SZ];
+ struct {
+ char compiler[XEN_COMPILER_SZ];
+ char compile_by[XEN_COMPILE_BY_SZ];
+ char compile_domain[XEN_COMPLE_DOMAIN_SZ];
+ char compile_date[XEN_COMPILE_DATE_SZ];
+ } compile_info;
+ char capabilities[XEN_CAPABILITIES_SZ];
+ char changeset[XEN_CHANGESET_SZ];
+ struct {
+ uint64_t virt_start;
+ } platform_parameters;
+ uint64_t pagesize;
+};
+
typedef kdump_status do_note_fn(kdump_ctx *ctx, Elf32_Word type,
const char *name, size_t namesz,
void *desc, size_t descsz);
@@ -100,7 +144,7 @@
* endian
* ptr_size
*/
-static void
+static kdump_status
process_xen_crash_info(kdump_ctx *ctx, void *data, size_t len)
{
unsigned words = len / ctx->ptr_size;
@@ -120,6 +164,41 @@
ctx->xen_extra_ver = dump32toh(ctx, info->xen_extra_version);
ctx->xen_p2m_mfn = dump32toh(ctx, ((uint32_t*)data)[words-1]);
}
+
+ return kdump_ok;
+}
+
+static kdump_status
+process_xen_dumpcore_version(kdump_ctx *ctx, void *data, size_t len)
+{
+ const char *ver_extra = NULL;
+
+ if (ctx->ptr_size == 8 &&
+ len >= sizeof(struct xen_dumpcore_elfnote_xen_version_64)) {
+ struct xen_dumpcore_elfnote_xen_version_64 *ver = data;
+ ctx->xen_ver.major = dump64toh(ctx, ver->major_version);
+ ctx->xen_ver.minor = dump64toh(ctx, ver->minor_version);
+ ver_extra = ver->extra_version;
+ } else if(ctx->ptr_size == 4 &&
+ len >= sizeof(struct xen_dumpcore_elfnote_xen_version_32)) {
+ struct xen_dumpcore_elfnote_xen_version_32 *ver = data;
+ ctx->xen_ver.major = dump64toh(ctx, ver->major_version);
+ ctx->xen_ver.minor = dump64toh(ctx, ver->minor_version);
+ ver_extra = ver->extra_version;
+ }
+
+ if (ver_extra) {
+ char *newextra;
+ newextra = ctx_malloc(XEN_EXTRA_VERSION_SZ + 1,
+ ctx, "Xen extra version");
+ if (!newextra)
+ return kdump_syserr;
+ memcpy(newextra, ver_extra, XEN_EXTRA_VERSION_SZ);
+ newextra[XEN_EXTRA_VERSION_SZ] = '\0';
+ ctx->xen_ver.extra = newextra;
+ }
+
+ return kdump_ok;
}
/* These fields in kdump_ctx must be initialised:
@@ -127,14 +206,19 @@
* endian
* ptr_size
*/
-static void
+static kdump_status
process_xen_note(kdump_ctx *ctx, uint32_t type,
void *desc, size_t descsz)
{
+ kdump_status ret = kdump_ok;
+
if (type == XEN_ELFNOTE_CRASH_INFO)
- process_xen_crash_info(ctx, desc, descsz);
+ ret = process_xen_crash_info(ctx, desc, descsz);
+ else if (type == XEN_ELFNOTE_DUMPCORE_XEN_VERSION)
+ process_xen_dumpcore_version(ctx, desc, descsz);
ctx->flags |= DIF_XEN;
+ return ret;
}
/* These fields in kdump_ctx must be initialised:
@@ -228,7 +312,7 @@
if (note_equal("CORE", name, namesz))
return process_core_note(ctx, type, desc, descsz);
else if (note_equal("Xen", name, namesz))
- process_xen_note(ctx, type, desc, descsz);
+ return process_xen_note(ctx, type, desc, descsz);
else if (note_equal(".note.Xen", name, namesz))
return process_xc_xen_note(ctx, type, desc, descsz);
@@ -247,6 +331,8 @@
return do_arch_note(ctx, type, name, namesz, desc, descsz);
}
+#define roundup_size(sz) (((size_t)(sz)+3) & ~(size_t)3)
+
static kdump_status
do_notes(kdump_ctx *ctx, void *data, size_t size, do_note_fn *do_note)
{
@@ -258,15 +344,19 @@
Elf32_Word namesz = dump32toh(ctx, hdr->n_namesz);
Elf32_Word descsz = dump32toh(ctx, hdr->n_descsz);
Elf32_Word type = dump32toh(ctx, hdr->n_type);
- size_t descoff = sizeof(Elf32_Nhdr) + ((namesz + 3) & ~3);
+ size_t descoff = sizeof(Elf32_Nhdr) + roundup_size(namesz);
- if (size < descoff + ((descsz + 3) & ~3))
+ if (size < descoff + descsz)
break;
- size -= descoff + ((descsz + 3) & ~3);
name = (char*) (hdr + 1);
desc = (char*)hdr + descoff;
- hdr = (Elf32_Nhdr*) (desc + ((descsz + 3) & ~3));
+ size -= descoff;
+
+ hdr = (Elf32_Nhdr*) (desc + roundup_size(descsz));
+ size = (size >= roundup_size(descsz))
+ ? size - roundup_size(descsz)
+ : 0;
ret = do_note(ctx, type, name, namesz, desc, descsz);
}
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/libkdumpfile-0.1.4/open.c new/libkdumpfile-0.1.5/open.c
--- old/libkdumpfile-0.1.4/open.c 2014-12-03 18:05:49.000000000 +0100
+++ new/libkdumpfile-0.1.5/open.c 2015-11-24 21:20:11.000000000 +0100
@@ -63,6 +63,7 @@
return NULL;
ctx->last_pfn = -(kdump_paddr_t)1;
+ ctx->cb_get_symbol_val = kdump_vmcoreinfo_symbol;
return ctx;
}
@@ -157,7 +158,7 @@
size_t rd;
kdump_status ret;
- ret = kdump_vmcoreinfo_symbol(ctx, "init_uts_ns", &init_uts_ns);
+ ret = get_symbol_val(ctx, "init_uts_ns", &init_uts_ns);
if (ret != kdump_ok)
return ret;
@@ -184,7 +185,7 @@
size_t rd;
kdump_status ret;
- ret = kdump_vmcoreinfo_symbol(ctx, "system_utsname", &uts_name);
+ ret = get_symbol_val(ctx, "system_utsname", &uts_name);
if (ret == kdump_nodata) {
clear_error(ctx);
ret = uts_name_from_init_uts_ns(ctx, &uts_name);
@@ -261,5 +262,7 @@
free(ctx->vmcoreinfo);
if (ctx->vmcoreinfo_xen)
free(ctx->vmcoreinfo_xen);
+ if (ctx->xen_ver.extra)
+ free((void*)ctx->xen_ver.extra);
free(ctx);
}
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/libkdumpfile-0.1.4/s390x.c new/libkdumpfile-0.1.5/s390x.c
--- old/libkdumpfile-0.1.4/s390x.c 2014-12-04 12:59:26.000000000 +0100
+++ new/libkdumpfile-0.1.5/s390x.c 2015-03-26 18:27:30.000000000 +0100
@@ -274,7 +274,7 @@
return ret;
}
- ret = kdump_vmcoreinfo_symbol(ctx, "high_memory", &addr);
+ ret = get_symbol_val(ctx, "high_memory", &addr);
if (ret == kdump_ok) {
uint64_t highmem;
size_t sz = sizeof(highmem);
@@ -466,7 +466,7 @@
process_lowcore_info(ctx);
clear_error(ctx);
- ret = kdump_vmcoreinfo_symbol(ctx, "swapper_pg_dir", &pgtaddr);
+ ret = get_symbol_val(ctx, "swapper_pg_dir", &pgtaddr);
if (ret == kdump_ok) {
ret = read_pgt(ctx, pgtaddr);
if (ret != kdump_ok)
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/libkdumpfile-0.1.4/util.c new/libkdumpfile-0.1.5/util.c
--- old/libkdumpfile-0.1.4/util.c 2014-12-04 11:05:52.000000000 +0100
+++ new/libkdumpfile-0.1.5/util.c 2015-07-23 11:50:56.000000000 +0200
@@ -103,13 +103,13 @@
case ARCH_ALPHA:
case ARCH_IA64:
case ARCH_PPC64:
- case ARCH_PPC64LE:
case ARCH_S390X:
case ARCH_X86_64:
return 8; /* 64 bits */
case ARCH_ARM:
case ARCH_PPC:
+ case ARCH_MIPS:
case ARCH_S390:
case ARCH_X86:
default:
@@ -125,12 +125,13 @@
return ARCH_ALPHA;
else if (!strcmp(machine, "ia64"))
return ARCH_IA64;
+ else if (!strcmp(machine, "mips"))
+ return ARCH_MIPS;
else if (!strcmp(machine, "ppc"))
return ARCH_PPC;
- else if (!strcmp(machine, "ppc64"))
+ else if (!strcmp(machine, "ppc64") ||
+ !strcmp(machine, "ppc64le"))
return ARCH_PPC64;
- else if (!strcmp(machine, "ppc64le"))
- return ARCH_PPC64LE;
else if (!strcmp(machine, "s390"))
return ARCH_S390;
else if (!strcmp(machine, "s390x"))
@@ -158,9 +159,9 @@
[ARCH_ALPHA]= 13,
[ARCH_ARM] = 12,
[ARCH_IA64] = 0,
+ [ARCH_MIPS] = 12,
[ARCH_PPC] = 0,
[ARCH_PPC64] = 0,
- [ARCH_PPC64LE] = 0,
[ARCH_S390] = 12,
[ARCH_S390X] = 12,
[ARCH_X86] = 12,
@@ -180,9 +181,9 @@
case ARCH_ALPHA:
case ARCH_ARM:
case ARCH_IA64:
+ case ARCH_MIPS:
case ARCH_PPC:
case ARCH_PPC64:
- case ARCH_PPC64LE:
case ARCH_S390:
/* TODO */
break;
@@ -446,3 +447,10 @@
return csum;
}
+
+kdump_status
+get_symbol_val(kdump_ctx *ctx, const char *name, kdump_addr_t *val)
+{
+ kdump_status ret = ctx->cb_get_symbol_val(ctx, name, val);
+ return set_error(ctx, ret, "Cannot resolve \"%s\"", 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/libkdumpfile-0.1.4/vtop.c new/libkdumpfile-0.1.5/vtop.c
--- old/libkdumpfile-0.1.4/vtop.c 2014-11-28 16:31:26.000000000 +0100
+++ new/libkdumpfile-0.1.5/vtop.c 2015-03-30 11:02:05.000000000 +0200
@@ -182,7 +182,6 @@
"VTOP translation not initialized");
return ctx->arch_ops->vtop(ctx, vaddr, paddr);
- /* fall through */
case KDUMP_XLAT_DIRECT:
*paddr = vaddr - phys_off;
return kdump_ok;
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/libkdumpfile-0.1.4/x86_64.c new/libkdumpfile-0.1.5/x86_64.c
--- old/libkdumpfile-0.1.4/x86_64.c 2014-11-28 17:17:33.000000000 +0100
+++ new/libkdumpfile-0.1.5/x86_64.c 2015-10-05 11:41:51.000000000 +0200
@@ -296,7 +296,7 @@
kdump_status ret;
size_t sz;
- ret = kdump_vmcoreinfo_symbol(ctx, "init_level4_pgt", &pgtaddr);
+ ret = get_symbol_val(ctx, "init_level4_pgt", &pgtaddr);
if (ret != kdump_ok)
return ret;
@@ -446,6 +446,8 @@
"Out-of-bounds register number: %u (max %u)",
index, ELF_NGREG);
+ cpu = ctx->num_cpus - cpu - 1;
+
for (i = 0, cs = archdata->cpu_state; i < cpu && cs; ++i)
cs = cs->next;
if (!cs)
@@ -488,7 +490,8 @@
}
static kdump_status
-x86_64_vtop(kdump_ctx *ctx, kdump_vaddr_t vaddr, kdump_paddr_t *paddr)
+x86_64_pt_walk(kdump_ctx *ctx, kdump_vaddr_t vaddr, kdump_paddr_t *paddr,
+ int rdflags)
{
struct x86_64_data *archdata = ctx->archdata;
uint64_t tbl[PTRS_PER_PAGE];
@@ -511,7 +514,7 @@
base = pgd & ~PHYSADDR_MASK & PAGE_MASK;
sz = PAGE_SIZE;
- ret = kdump_readp(ctx, base, tbl, &sz, KDUMP_PHYSADDR);
+ ret = kdump_readp(ctx, base, tbl, &sz, rdflags);
if (ret != kdump_ok)
return ret;
@@ -530,7 +533,7 @@
base = pud & ~PHYSADDR_MASK & PAGE_MASK;
sz = PAGE_SIZE;
- ret = kdump_readp(ctx, base, tbl, &sz, KDUMP_PHYSADDR);
+ ret = kdump_readp(ctx, base, tbl, &sz, rdflags);
if (ret != kdump_ok)
return ret;
@@ -548,7 +551,7 @@
base = pmd & ~PHYSADDR_MASK & PAGE_MASK;
sz = PAGE_SIZE;
- ret = kdump_readp(ctx, base, tbl, &sz, KDUMP_PHYSADDR);
+ ret = kdump_readp(ctx, base, tbl, &sz, rdflags);
if (ret != kdump_ok)
return ret;
@@ -564,6 +567,38 @@
return kdump_ok;
}
+static kdump_status
+x86_64_vtop(kdump_ctx *ctx, kdump_vaddr_t vaddr, kdump_paddr_t *paddr)
+{
+ kdump_status ret;
+
+ if (ctx->flags & DIF_XEN && ctx->xen_pte_is_mach) {
+ kdump_addr_t maddr;
+ kdump_pfn_t mfn, pfn;
+
+ if (!ctx->ops->mfn_to_pfn)
+ return set_error(ctx, kdump_nodata,
+ "No MFN-to-PFN translation method");
+
+ ret = x86_64_pt_walk(ctx, vaddr, &maddr, KDUMP_XENMACHADDR);
+ if (ret != kdump_ok)
+ return ret;
+
+ mfn = maddr >> ctx->page_shift;
+ ret = ctx->ops->mfn_to_pfn(ctx, mfn, &pfn);
+ if (ret != kdump_ok)
+ return set_error(ctx, ret,
+ "Cannot translate MFN 0x%llx",
+ (unsigned long long) mfn);
+
+ *paddr = (pfn << ctx->page_shift) |
+ (maddr & (ctx->page_size - 1));
+ return kdump_ok;
+ }
+
+ return x86_64_pt_walk(ctx, vaddr, paddr, KDUMP_PHYSADDR);
+}
+
const struct arch_ops x86_64_ops = {
.init = x86_64_init,
.vtop_init = x86_64_vtop_init,
++++++ libkdumpfile-fallback-for-old-zlib.patch ++++++
From: Petr Tesarik <ptesarik(a)suse.com>
Subject: Fall back to AC_SEARCH_LIBS if there is no pkg-config file for zlib
Patch-mainline: never, support of legacy products only
Old version of zlib (before 1.2.7?) did not install a pkg-config file. As
a result, support for zlib compression is missing from SLE11 SP2 and older.
This is suboptimal, since most dump files for those products acutally use
that compression algorithm.
Signed-off-by: Petr Tesarik <ptesarik(a)suse.com>
---
configure | 166 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
configure.ac | 2
2 files changed, 165 insertions(+), 3 deletions(-)
--- a/configure.ac
+++ b/configure.ac
@@ -41,7 +41,7 @@ m4_pattern_forbid([^_?PKG_[A-Z_]+$],[***
PKG_CHECK_MODULES(ZLIB, zlib,
[ REQUIRES_PRIVATE="zlib $REQUIRES_PRIVATE"
AC_DEFINE(USE_ZLIB, 1, [Define to enable support for zlib compression])
- ],[# ignore if missing])
+ ],[kdump_COMPRESSION(zlib, ZLIB, z, uncompress)])
AS_VAR_APPEND([CFLAGS], " $ZLIB_CFLAGS")
AS_VAR_APPEND([LIBS], " $ZLIB_LIBS")
--- a/configure
+++ b/configure
@@ -767,6 +767,7 @@ enable_fast_install
with_gnu_ld
with_sysroot
enable_libtool_lock
+with_zlib
with_lzo
with_snappy
'
@@ -1422,6 +1423,7 @@ Optional Packages:
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
--with-sysroot=DIR Search for dependent libraries within DIR
(or the compiler's sysroot if not specified).
+ --with-zlib support for zlib compression [default=check]
--with-lzo support for lzo compression [default=check]
--with-snappy support for snappy compression [default=check]
@@ -11621,11 +11623,171 @@ fi
# Put the nasty error message in config.log where it belongs
echo "$ZLIB_PKG_ERRORS" >&5
- # ignore if missing
+
+# Check whether --with-zlib was given.
+if test "${with_zlib+set}" = set; then :
+ withval=$with_zlib;
+else
+ with_zlib=check
+fi
+
+if test "x$with_zlib" != xno; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing uncompress" >&5
+$as_echo_n "checking for library containing uncompress... " >&6; }
+if ${ac_cv_search_uncompress+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char uncompress ();
+int
+main ()
+{
+return uncompress ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' z; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_uncompress=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_uncompress+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_uncompress+:} false; then :
+
+else
+ ac_cv_search_uncompress=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_uncompress" >&5
+$as_echo "$ac_cv_search_uncompress" >&6; }
+ac_res=$ac_cv_search_uncompress
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define USE_ZLIB 1" >>confdefs.h
+
+ as_fn_append LIBS_PRIVATE " -lz"
+
+else
+
+ if test "x$with_zlib" != xcheck; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "--with-zlib was given, but test for zlib failed
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+
+fi
+
+
+fi
+
elif test $pkg_failed = untried; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
- # ignore if missing
+
+# Check whether --with-zlib was given.
+if test "${with_zlib+set}" = set; then :
+ withval=$with_zlib;
+else
+ with_zlib=check
+fi
+
+if test "x$with_zlib" != xno; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing uncompress" >&5
+$as_echo_n "checking for library containing uncompress... " >&6; }
+if ${ac_cv_search_uncompress+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char uncompress ();
+int
+main ()
+{
+return uncompress ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' z; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_uncompress=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_uncompress+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_uncompress+:} false; then :
+
+else
+ ac_cv_search_uncompress=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_uncompress" >&5
+$as_echo "$ac_cv_search_uncompress" >&6; }
+ac_res=$ac_cv_search_uncompress
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define USE_ZLIB 1" >>confdefs.h
+
+ as_fn_append LIBS_PRIVATE " -lz"
+
+else
+
+ if test "x$with_zlib" != xcheck; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "--with-zlib was given, but test for zlib failed
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+
+fi
+
+
+fi
+
else
ZLIB_CFLAGS=$pkg_cv_ZLIB_CFLAGS
ZLIB_LIBS=$pkg_cv_ZLIB_LIBS
++++++ libkdumpfile-remove-ARCH_PPC64LE.patch ++++++
From: Petr Tesarik <ptesarik(a)suse.com>
Subject: Remove last reference to ARCH_PPC64LE
Patch-mainline: v0.1.6
Git-commit: 3667f3cad92e6ae9c1ede51ec95e2df2cdbd9f4a
Commit 048a00d1e350212164e48c61cd9b94981f8dcd20 merged the ppc64le
architecture into ppc64, but this reference was forgotten, so
libkdumpfile no longer builds on ppc64le.
Signed-off-by: Petr Tesarik <ptesarik(a)suse.com>
---
devmem.c | 4 ----
1 file changed, 4 deletions(-)
--- a/devmem.c
+++ b/devmem.c
@@ -132,11 +132,7 @@ devmem_probe(kdump_ctx *ctx)
#elif defined(__i386__)
ret = set_arch(ctx, ARCH_X86);
#elif defined(__powerpc64__)
-# if __BYTE_ORDER == __LITTLE_ENDIAN
- ret = set_arch(ctx, ARCH_PPC64LE);
-# else
ret = set_arch(ctx, ARCH_PPC64);
-# endif
#elif defined(__powerpc__)
ret = set_arch(ctx, ARCH_PPC);
#elif defined(__s390x__)
1
0
Hello community,
here is the log from the commit of package rubygem-mysql2 for openSUSE:Factory checked in at 2015-11-28 15:19:15
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-mysql2 (Old)
and /work/SRC/openSUSE:Factory/.rubygem-mysql2.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-mysql2"
Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-mysql2/rubygem-mysql2.changes 2015-10-28 17:30:09.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.rubygem-mysql2.new/rubygem-mysql2.changes 2015-11-28 15:19:16.000000000 +0100
@@ -1,0 +2,6 @@
+Thu Nov 26 05:33:34 UTC 2015 - coolo(a)suse.com
+
+- updated to version 0.4.2
+ see installed CHANGELOG.md
+
+-------------------------------------------------------------------
Old:
----
mysql2-0.4.1.gem
New:
----
mysql2-0.4.2.gem
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rubygem-mysql2.spec ++++++
--- /var/tmp/diff_new_pack.qeQR5P/_old 2015-11-28 15:19:17.000000000 +0100
+++ /var/tmp/diff_new_pack.qeQR5P/_new 2015-11-28 15:19:17.000000000 +0100
@@ -24,7 +24,7 @@
#
Name: rubygem-mysql2
-Version: 0.4.1
+Version: 0.4.2
Release: 0
%define mod_name mysql2
%define mod_full_name %{mod_name}-%{version}
++++++ mysql2-0.4.1.gem -> mysql2-0.4.2.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/README.md new/README.md
--- old/README.md 1970-01-01 01:00:00.000000000 +0100
+++ new/README.md 1970-01-01 01:00:00.000000000 +0100
@@ -58,6 +58,20 @@
are located somewhere different than on your build system.
This overrides any rpath calculated by default or by the options above.
+* `--with-sanitize[=address,cfi,integer,memory,thread,undefined]` -
+Enable sanitizers for Clang / GCC. If no argument is given, try to enable
+all sanitizers or fail if none are available. If a command-separated list of
+specific sanitizers is given, configure will fail unless they all are available.
+Note that the some sanitizers may incur a performance penalty, and the Address
+Sanitizer may require a runtime library.
+To see line numbers in backtraces, declare these environment variables
+(adjust the llvm-symbolizer path as needed for your system):
+
+``` sh
+ export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer-3.4
+ export ASAN_OPTIONS=symbolize=1
+```
+
### Linux and other Unixes
You may need to install a package such as `libmysqlclient-dev` or `mysql-devel`;
@@ -258,15 +272,26 @@
next_result: Unknown column 'A' in 'field list' (Mysql2::Error)
```
-See https://gist.github.com/1367987 for using MULTI_STATEMENTS with Active Record.
-
### Secure auth
Starting wih MySQL 5.6.5, secure_auth is enabled by default on servers (it was disabled by default prior to this).
When secure_auth is enabled, the server will refuse a connection if the account password is stored in old pre-MySQL 4.1 format.
The MySQL 5.6.5 client library may also refuse to attempt a connection if provided an older format password.
-To bypass this restriction in the client, pass the option :secure_auth => false to Mysql2::Client.new().
-If using ActiveRecord, your database.yml might look something like this:
+To bypass this restriction in the client, pass the option `:secure_auth => false` to Mysql2::Client.new().
+
+### Flags option parsing
+
+The `:flags` parameter accepts an integer, a string, or an array. The integer
+form allows the client to assemble flags from constants defined under
+`Mysql2::Client` such as `Mysql2::Client::FOUND_ROWS`. Use a bitwise `|` (OR)
+to specify several flags.
+
+The string form will be split on whitespace and parsed as with the array form:
+Plain flags are added to the default flags, while flags prefixed with `-`
+(minus) are removed from the default flags.
+
+This allows easier use with ActiveRecord's database.yml, avoiding the need for magic flag numbers.
+For example, to disable protocol compression, and enable multiple statements and result sets:
``` yaml
development:
@@ -277,13 +302,17 @@
password: my_password
host: 127.0.0.1
port: 3306
+ flags:
+ - -COMPRESS
+ - FOUND_ROWS
+ - MULTI_STATEMENTS
secure_auth: false
```
### Reading a MySQL config file
You may read configuration options from a MySQL configuration file by passing
-the `:default_file` and `:default_group` paramters. For example:
+the `:default_file` and `:default_group` parameters. For example:
``` ruby
Mysql2::Client.new(:default_file => '/user/.my.cnf', :default_group => 'client')
@@ -291,7 +320,7 @@
### Initial command on connect and reconnect
-If you specify the init_command option, the SQL string you provide will be executed after the connection is established.
+If you specify the `:init_command` option, the SQL string you provide will be executed after the connection is established.
If `:reconnect` is set to `true`, init_command will also be executed after a successful reconnect.
It is useful if you want to provide session options which survive reconnection.
Files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ext/mysql2/client.c new/ext/mysql2/client.c
--- old/ext/mysql2/client.c 1970-01-01 01:00:00.000000000 +0100
+++ new/ext/mysql2/client.c 1970-01-01 01:00:00.000000000 +0100
@@ -133,7 +133,7 @@
static void *nogvl_init(void *ptr) {
MYSQL *client;
- mysql_client_wrapper *wrapper = (mysql_client_wrapper *)ptr;
+ mysql_client_wrapper *wrapper = ptr;
/* may initialize embedded server and read /etc/services off disk */
client = mysql_init(wrapper->client);
@@ -213,6 +213,7 @@
if (wrapper->client) {
mysql_close(wrapper->client);
+ xfree(wrapper->client);
wrapper->client = NULL;
wrapper->connected = 0;
wrapper->active_thread = Qnil;
@@ -223,7 +224,7 @@
/* this is called during GC */
static void rb_mysql_client_free(void *ptr) {
- mysql_client_wrapper *wrapper = (mysql_client_wrapper *)ptr;
+ mysql_client_wrapper *wrapper = ptr;
decr_mysql2_client(wrapper);
}
@@ -249,7 +250,6 @@
#endif
nogvl_close(wrapper);
- xfree(wrapper->client);
xfree(wrapper);
}
}
@@ -437,10 +437,9 @@
}
static void *nogvl_do_result(void *ptr, char use_result) {
- mysql_client_wrapper *wrapper;
+ mysql_client_wrapper *wrapper = ptr;
MYSQL_RES *result;
- wrapper = (mysql_client_wrapper *)ptr;
if (use_result) {
result = mysql_use_result(wrapper->client);
} else {
@@ -533,14 +532,13 @@
}
static VALUE do_query(void *args) {
- struct async_query_args *async_args;
+ struct async_query_args *async_args = args;
struct timeval tv;
- struct timeval* tvp;
+ struct timeval *tvp;
long int sec;
int retval;
VALUE read_timeout;
- async_args = (struct async_query_args *)args;
read_timeout = rb_iv_get(async_args->self, "@read_timeout");
tvp = NULL;
@@ -578,11 +576,9 @@
}
#else
static VALUE finish_and_mark_inactive(void *args) {
- VALUE self;
+ VALUE self = args;
MYSQL_RES *result;
- self = (VALUE)args;
-
GET_CLIENT(self);
if (!NIL_P(wrapper->active_thread)) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ext/mysql2/extconf.rb new/ext/mysql2/extconf.rb
--- old/ext/mysql2/extconf.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/ext/mysql2/extconf.rb 1970-01-01 01:00:00.000000000 +0100
@@ -105,31 +105,55 @@
'-Wno-missing-field-initializers', # gperf generates bad code
'-Wno-missing-variable-declarations', # missing symbols due to ruby native ext initialization
'-Wno-padded', # mysql :(
+ '-Wno-reserved-id-macro', # rubby :(
'-Wno-sign-conversion', # gperf generates bad code
'-Wno-static-in-inline', # gperf generates bad code
'-Wno-switch-enum', # result.c -- enum_field_types (when not fully covered, e.g. mysql 5.6+)
'-Wno-undef', # rubinius :(
+ '-Wno-unreachable-code', # rubby :(
'-Wno-used-but-marked-unused', # rubby :(
]
-if ENV['CI']
- wishlist += [
- '-Werror',
- '-fsanitize=address',
- '-fsanitize=cfi',
- '-fsanitize=integer',
- '-fsanitize=memory',
- '-fsanitize=thread',
- '-fsanitize=undefined',
- ]
-end
-
usable_flags = wishlist.select do |flag|
- try_link('int main() {return 0;}', flag)
+ try_link('int main() {return 0;}', "-Werror #{flag}")
end
$CFLAGS << ' ' << usable_flags.join(' ')
+enabled_sanitizers = disabled_sanitizers = []
+# Specify a commna-separated list of sanitizers, or try them all by default
+sanitizers = with_config('sanitize')
+case sanitizers
+when true
+ # Try them all, turn on whatever we can
+ enabled_sanitizers = %w(address cfi integer memory thread undefined).select do |s|
+ try_link('int main() {return 0;}', "-Werror -fsanitize=#{s}")
+ end
+ abort "-----\nCould not enable any sanitizers!\n-----" if enabled_sanitizers.empty?
+when String
+ # Figure out which sanitizers are supported
+ enabled_sanitizers, disabled_sanitizers = sanitizers.split(',').partition do |s|
+ try_link('int main() {return 0;}', "-Werror -fsanitize=#{s}")
+ end
+end
+
+unless disabled_sanitizers.empty?
+ abort "-----\nCould not enable requested sanitizers: #{disabled_sanitizers.join(',')}\n-----"
+end
+
+unless enabled_sanitizers.empty?
+ warn "-----\nEnabling sanitizers: #{enabled_sanitizers.join(',')}\n-----"
+ enabled_sanitizers.each do |s|
+ # address sanitizer requires runtime support
+ if s == 'address' # rubocop:disable Style/IfUnlessModifier
+ have_library('asan') || $LDFLAGS << ' -fsanitize=address'
+ end
+ $CFLAGS << " -fsanitize=#{s}"
+ end
+ # Options for line numbers in backtraces
+ $CFLAGS << ' -g -fno-omit-frame-pointer'
+end
+
if RUBY_PLATFORM =~ /mswin|mingw/
# Build libmysql.a interface link library
require 'rake'
@@ -155,8 +179,8 @@
# Make sure the generated interface library works (if cross-compiling, trust without verifying)
unless RbConfig::CONFIG['host_os'] =~ /mswin|mingw/
- abort "-----\nCannot find libmysql.a\n----" unless have_library('libmysql')
- abort "-----\nCannot link to libmysql.a (my_init)\n----" unless have_func('my_init')
+ abort "-----\nCannot find libmysql.a\n-----" unless have_library('libmysql')
+ abort "-----\nCannot link to libmysql.a (my_init)\n-----" unless have_func('my_init')
end
# Vendor libmysql.dll
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ext/mysql2/result.c new/ext/mysql2/result.c
--- old/ext/mysql2/result.c 1970-01-01 01:00:00.000000000 +0100
+++ new/ext/mysql2/result.c 1970-01-01 01:00:00.000000000 +0100
@@ -48,7 +48,7 @@
#define MYSQL2_MIN_TIME 62171150401ULL
#endif
-#define GET_RESULT(obj) \
+#define GET_RESULT(self) \
mysql2_result_wrapper *wrapper; \
Data_Get_Struct(self, mysql2_result_wrapper, wrapper);
@@ -91,16 +91,18 @@
if (wrapper->resultFreed != 1) {
if (wrapper->stmt_wrapper) {
- mysql_stmt_free_result(wrapper->stmt_wrapper->stmt);
+ if (!wrapper->stmt_wrapper->closed) {
+ mysql_stmt_free_result(wrapper->stmt_wrapper->stmt);
- /* MySQL BUG? If the statement handle was previously used, and so
- * mysql_stmt_bind_result was called, and if that result set and bind buffers were freed,
- * MySQL still thinks the result set buffer is available and will prefetch the
- * first result in mysql_stmt_execute. This will corrupt or crash the program.
- * By setting bind_result_done back to 0, we make MySQL think that a result set
- * has never been bound to this statement handle before to prevent the prefetch.
- */
- wrapper->stmt_wrapper->stmt->bind_result_done = 0;
+ /* MySQL BUG? If the statement handle was previously used, and so
+ * mysql_stmt_bind_result was called, and if that result set and bind buffers were freed,
+ * MySQL still thinks the result set buffer is available and will prefetch the
+ * first result in mysql_stmt_execute. This will corrupt or crash the program.
+ * By setting bind_result_done back to 0, we make MySQL think that a result set
+ * has never been bound to this statement handle before to prevent the prefetch.
+ */
+ wrapper->stmt_wrapper->stmt->bind_result_done = 0;
+ }
if (wrapper->result_buffers) {
unsigned int i;
@@ -203,7 +205,7 @@
#ifdef HAVE_RUBY_ENCODING_H
static VALUE mysql2_set_field_string_encoding(VALUE val, MYSQL_FIELD field, rb_encoding *default_internal_enc, rb_encoding *conn_enc) {
- /* if binary flag is set, respect it's wishes */
+ /* if binary flag is set, respect its wishes */
if (field.flags & BINARY_FLAG && field.charsetnr == 63) {
rb_enc_associate(val, binaryEncoding);
} else if (!field.charsetnr) {
@@ -309,11 +311,10 @@
case MYSQL_TYPE_SET: // char[]
case MYSQL_TYPE_ENUM: // char[]
case MYSQL_TYPE_GEOMETRY: // char[]
+ default:
wrapper->result_buffers[i].buffer = xmalloc(fields[i].max_length);
wrapper->result_buffers[i].buffer_length = fields[i].max_length;
break;
- default:
- rb_raise(cMysql2Error, "unhandled mysql type: %d", fields[i].type);
}
wrapper->result_buffers[i].is_null = &wrapper->is_null[i];
@@ -491,14 +492,12 @@
case MYSQL_TYPE_SET: // char[]
case MYSQL_TYPE_ENUM: // char[]
case MYSQL_TYPE_GEOMETRY: // char[]
+ default:
val = rb_str_new(result_buffer->buffer, *(result_buffer->length));
#ifdef HAVE_RUBY_ENCODING_H
val = mysql2_set_field_string_encoding(val, fields[i], default_internal_enc, conn_enc);
#endif
break;
- default:
- rb_raise(cMysql2Error, "unhandled buffer type: %d",
- result_buffer->buffer_type);
}
}
@@ -858,6 +857,10 @@
GET_RESULT(self);
+ if (wrapper->stmt_wrapper && wrapper->stmt_wrapper->closed) {
+ rb_raise(cMysql2Error, "Statement handle already closed");
+ }
+
defaults = rb_iv_get(self, "@query_options");
Check_Type(defaults, T_HASH);
if (rb_scan_args(argc, argv, "01&", &opts, &block) == 1) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ext/mysql2/statement.c new/ext/mysql2/statement.c
--- old/ext/mysql2/statement.c 1970-01-01 01:00:00.000000000 +0100
+++ new/ext/mysql2/statement.c 1970-01-01 01:00:00.000000000 +0100
@@ -8,18 +8,19 @@
#define GET_STATEMENT(self) \
mysql_stmt_wrapper *stmt_wrapper; \
Data_Get_Struct(self, mysql_stmt_wrapper, stmt_wrapper); \
- if (!stmt_wrapper->stmt) { rb_raise(cMysql2Error, "Invalid statement handle"); }
+ if (!stmt_wrapper->stmt) { rb_raise(cMysql2Error, "Invalid statement handle"); } \
+ if (stmt_wrapper->closed) { rb_raise(cMysql2Error, "Statement handle already closed"); }
static void rb_mysql_stmt_mark(void * ptr) {
- mysql_stmt_wrapper* stmt_wrapper = (mysql_stmt_wrapper *)ptr;
+ mysql_stmt_wrapper *stmt_wrapper = ptr;
if (!stmt_wrapper) return;
rb_gc_mark(stmt_wrapper->client);
}
static void *nogvl_stmt_close(void * ptr) {
- mysql_stmt_wrapper *stmt_wrapper = (mysql_stmt_wrapper *)ptr;
+ mysql_stmt_wrapper *stmt_wrapper = ptr;
if (stmt_wrapper->stmt) {
mysql_stmt_close(stmt_wrapper->stmt);
stmt_wrapper->stmt = NULL;
@@ -28,7 +29,7 @@
}
static void rb_mysql_stmt_free(void * ptr) {
- mysql_stmt_wrapper* stmt_wrapper = (mysql_stmt_wrapper *)ptr;
+ mysql_stmt_wrapper *stmt_wrapper = ptr;
decr_mysql2_stmt(stmt_wrapper);
}
@@ -93,7 +94,7 @@
}
VALUE rb_mysql_stmt_new(VALUE rb_client, VALUE sql) {
- mysql_stmt_wrapper* stmt_wrapper;
+ mysql_stmt_wrapper *stmt_wrapper;
VALUE rb_stmt;
#ifdef HAVE_RUBY_ENCODING_H
rb_encoding *conn_enc;
@@ -105,6 +106,7 @@
{
stmt_wrapper->client = rb_client;
stmt_wrapper->refcount = 1;
+ stmt_wrapper->closed = 0;
stmt_wrapper->stmt = NULL;
}
@@ -461,6 +463,7 @@
*/
static VALUE rb_mysql_stmt_close(VALUE self) {
GET_STATEMENT(self);
+ stmt_wrapper->closed = 1;
rb_thread_call_without_gvl(nogvl_stmt_close, stmt_wrapper, RUBY_UBF_IO, 0);
return Qnil;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ext/mysql2/statement.h new/ext/mysql2/statement.h
--- old/ext/mysql2/statement.h 1970-01-01 01:00:00.000000000 +0100
+++ new/ext/mysql2/statement.h 1970-01-01 01:00:00.000000000 +0100
@@ -7,6 +7,7 @@
VALUE client;
MYSQL_STMT *stmt;
int refcount;
+ int closed;
} mysql_stmt_wrapper;
void init_mysql2_statement(void);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/mysql2/client.rb new/lib/mysql2/client.rb
--- old/lib/mysql2/client.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/lib/mysql2/client.rb 1970-01-01 01:00:00.000000000 +0100
@@ -10,7 +10,7 @@
:symbolize_keys => false, # return field names as symbols instead of strings
:database_timezone => :local, # timezone Mysql2 will assume datetime objects are stored in
:application_timezone => nil, # timezone Mysql2 will convert to before handing the object back to the caller
- :cache_rows => true, # tells Mysql2 to use it's internal row cache for results
+ :cache_rows => true, # tells Mysql2 to use its internal row cache for results
:connect_flags => REMEMBER_OPTIONS | LONG_PASSWORD | LONG_FLAG | TRANSACTIONS | PROTOCOL_41 | SECURE_CONNECTION,
:cast => true,
:default_file => nil,
@@ -48,10 +48,18 @@
ssl_options = opts.values_at(:sslkey, :sslcert, :sslca, :sslcapath, :sslcipher)
ssl_set(*ssl_options) if ssl_options.any?
+ case opts[:flags]
+ when Array
+ flags = parse_flags_array(opts[:flags], @query_options[:connect_flags])
+ when String
+ flags = parse_flags_array(opts[:flags].split(' '), @query_options[:connect_flags])
+ when Integer
+ flags = @query_options[:connect_flags] | opts[:flags]
+ else
+ flags = @query_options[:connect_flags]
+ end
+
# SSL verify is a connection flag rather than a mysql_ssl_set option
- flags = 0
- flags |= @query_options[:connect_flags]
- flags |= opts[:flags] if opts[:flags]
flags |= SSL_VERIFY_SERVER_CERT if opts[:sslverify] && ssl_options.any?
if [:user, :pass, :hostname, :dbname, :db, :sock].any? { |k| @query_options.key?(k) }
@@ -79,6 +87,20 @@
connect user, pass, host, port, database, socket, flags
end
+ def parse_flags_array(flags, initial = 0)
+ flags.reduce(initial) do |memo, f|
+ fneg = f.start_with?('-') ? f[1..-1] : nil
+ if fneg && fneg =~ /^\w+$/ && Mysql2::Client.const_defined?(fneg)
+ memo & ~ Mysql2::Client.const_get(fneg)
+ elsif f && f =~ /^\w+$/ && Mysql2::Client.const_defined?(f)
+ memo | Mysql2::Client.const_get(f)
+ else
+ warn "Unknown MySQL connection flag: '#{f}'"
+ memo
+ end
+ end
+ end
+
if Thread.respond_to?(:handle_interrupt)
def query(sql, options = {})
Thread.handle_interrupt(::Mysql2::Util::TimeoutError => :never) do
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/mysql2/version.rb new/lib/mysql2/version.rb
--- old/lib/mysql2/version.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/lib/mysql2/version.rb 1970-01-01 01:00:00.000000000 +0100
@@ -1,3 +1,3 @@
module Mysql2
- VERSION = "0.4.1"
+ VERSION = "0.4.2"
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata
--- old/metadata 1970-01-01 01:00:00.000000000 +0100
+++ new/metadata 1970-01-01 01:00:00.000000000 +0100
@@ -1,7 +1,7 @@
--- !ruby/object:Gem::Specification
name: mysql2
version: !ruby/object:Gem::Version
- version: 0.4.1
+ version: 0.4.2
platform: ruby
authors:
- Brian Lopez
@@ -9,7 +9,7 @@
autorequire:
bindir: bin
cert_chain: []
-date: 2015-09-16 00:00:00.000000000 Z
+date: 2015-11-25 00:00:00.000000000 Z
dependencies: []
description:
email:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec/mysql2/client_spec.rb new/spec/mysql2/client_spec.rb
--- old/spec/mysql2/client_spec.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/spec/mysql2/client_spec.rb 1970-01-01 01:00:00.000000000 +0100
@@ -43,27 +43,33 @@
}.not_to raise_error
end
- it "should accept connect flags and pass them to #connect" do
- klient = Class.new(Mysql2::Client) do
- attr_reader :connect_args
- def connect(*args)
- @connect_args ||= []
- @connect_args << args
- end
+ Klient = Class.new(Mysql2::Client) do
+ attr_reader :connect_args
+ def connect(*args)
+ @connect_args ||= []
+ @connect_args << args
end
- client = klient.new :flags => Mysql2::Client::FOUND_ROWS
+ end
+
+ it "should accept connect flags and pass them to #connect" do
+ client = Klient.new :flags => Mysql2::Client::FOUND_ROWS
expect(client.connect_args.last[6] & Mysql2::Client::FOUND_ROWS).to be > 0
end
+ it "should parse flags array" do
+ client = Klient.new :flags => %w( FOUND_ROWS -PROTOCOL_41 )
+ expect(client.connect_args.last[6] & Mysql2::Client::FOUND_ROWS).to eql(Mysql2::Client::FOUND_ROWS)
+ expect(client.connect_args.last[6] & Mysql2::Client::PROTOCOL_41).to eql(0)
+ end
+
+ it "should parse flags string" do
+ client = Klient.new :flags => "FOUND_ROWS -PROTOCOL_41"
+ expect(client.connect_args.last[6] & Mysql2::Client::FOUND_ROWS).to eql(Mysql2::Client::FOUND_ROWS)
+ expect(client.connect_args.last[6] & Mysql2::Client::PROTOCOL_41).to eql(0)
+ end
+
it "should default flags to (REMEMBER_OPTIONS, LONG_PASSWORD, LONG_FLAG, TRANSACTIONS, PROTOCOL_41, SECURE_CONNECTION)" do
- klient = Class.new(Mysql2::Client) do
- attr_reader :connect_args
- def connect(*args)
- @connect_args ||= []
- @connect_args << args
- end
- end
- client = klient.new
+ client = Klient.new
client_flags = Mysql2::Client::REMEMBER_OPTIONS |
Mysql2::Client::LONG_PASSWORD |
Mysql2::Client::LONG_FLAG |
1
0
Hello community,
here is the log from the commit of package python3-matplotlib for openSUSE:Factory checked in at 2015-11-28 15:19:11
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python3-matplotlib (Old)
and /work/SRC/openSUSE:Factory/.python3-matplotlib.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python3-matplotlib"
Changes:
--------
--- /work/SRC/openSUSE:Factory/python3-matplotlib/python3-matplotlib.changes 2015-11-04 15:33:14.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.python3-matplotlib.new/python3-matplotlib.changes 2015-11-28 15:19:13.000000000 +0100
@@ -1,0 +2,5 @@
+Wed Nov 25 22:21:42 UTC 2015 - p.drouand(a)gmail.com
+
+- Drop agg-devel dependenxy; useless
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python3-matplotlib.spec ++++++
--- /var/tmp/diff_new_pack.HUqqUa/_old 2015-11-28 15:19:16.000000000 +0100
+++ /var/tmp/diff_new_pack.HUqqUa/_new 2015-11-28 15:19:16.000000000 +0100
@@ -25,8 +25,6 @@
Url: http://matplotlib.org
Source: https://pypi.python.org/packages/source/m/matplotlib/matplotlib-%{version}.…
Source1: matplotlib-setup.cfg
-BuildRoot: %{_tmppath}/%{name}-%{version}-build
-BuildRequires: agg-devel
BuildRequires: fdupes
BuildRequires: fltk-devel
BuildRequires: freetype2-devel >= 2.3
@@ -252,15 +250,11 @@
%build
cp %{SOURCE1} ./setup.cfg
-%if 0%{?suse_version} > 1310
export XDG_RUNTIME_DIR=/tmp
-%endif
python3 setup.py build
%install
-%if 0%{?suse_version} > 1310
export XDG_RUNTIME_DIR=/tmp
-%endif
python3 setup.py install --root=%{buildroot} --prefix=%{_prefix}
%fdupes %{buildroot}%{python3_sitearch}
1
0
Hello community,
here is the log from the commit of package bundle-lang-common for openSUSE:Factory checked in at 2015-11-28 15:19:07
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/bundle-lang-common (Old)
and /work/SRC/openSUSE:Factory/.bundle-lang-common.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "bundle-lang-common"
Changes:
--------
--- /work/SRC/openSUSE:Factory/bundle-lang-common/bundle-lang-common.changes 2015-11-17 14:23:09.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.bundle-lang-common.new/bundle-lang-common.changes 2015-11-28 15:19:08.000000000 +0100
@@ -1,0 +2,5 @@
+Wed Nov 25 08:58:13 UTC 2015 - dimstar(a)opensuse.org
+
+- Update package list.
+
+-------------------------------------------------------------------
bundle-lang-gnome.changes: same change
bundle-lang-kde.changes: same change
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ bundle-lang-common.spec ++++++
++++ 667 lines (skipped)
++++ between /work/SRC/openSUSE:Factory/bundle-lang-common/bundle-lang-common.spec
++++ and /work/SRC/openSUSE:Factory/.bundle-lang-common.new/bundle-lang-common.spec
bundle-lang-gnome.spec: same change
bundle-lang-other.spec: same change
++++++ packages.txt ++++++
--- /var/tmp/diff_new_pack.B9DaGV/_old 2015-11-28 15:19:10.000000000 +0100
+++ /var/tmp/diff_new_pack.B9DaGV/_new 2015-11-28 15:19:10.000000000 +0100
@@ -12,13 +12,12 @@
accerciser-lang gnome-extras
accountsservice-lang common
aisleriot-lang gnome
-alacarte-lang gnome
+alacarte-lang gnome-extras
almanah-lang gnome-extras
amarok-lang kde
anjuta-extras-lang gnome-extras
anjuta-lang gnome-extras
appstream-glib-lang gnome-extras
-arista-lang gnome-extras
at-spi-lang gnome-extras
at-spi2-core-lang gnome-extras
atk-lang gnome-extras
@@ -46,7 +45,7 @@
clutter-lang gnome
cogl-lang gnome
colord-gtk-lang gnome
-colord-lang gnome
+colord-lang gnome-extras
comix-lang gnome-extras
computertemp-lang gnome-extras
conduit-lang gnome-extras
@@ -103,7 +102,7 @@
gedit-plugins-lang gnome-extras
geeqie-lang gnome-extras
gegl-0_2-lang gnome
-gegl-0_3-lang gnome-extras
+gegl-0_3-lang gnome
genius-lang gnome-extras
gftp-common-lang gnome-extras
ghex-lang gnome-extras
@@ -138,7 +137,7 @@
gnome-chess-lang gnome
gnome-clocks-lang gnome
gnome-color-chooser-lang gnome-extras
-gnome-color-manager-lang gnome
+gnome-color-manager-lang gnome-extras
gnome-commander-lang gnome-extras
gnome-contacts-lang gnome
gnome-control-center-lang gnome
@@ -222,11 +221,6 @@
grisbi-lang gnome-extras
gsettings-desktop-schemas-lang common
gspell-lang gnome-extras
-gstreamer-0_10-lang common
-gstreamer-0_10-plugins-bad-lang gnome-extras
-gstreamer-0_10-plugins-base-lang common
-gstreamer-0_10-plugins-good-lang gnome-extras
-gstreamer-0_10-plugins-ugly-lang gnome-extras
gstreamer-lang common
gstreamer-plugins-bad-lang gnome
gstreamer-plugins-base-lang common
@@ -255,12 +249,13 @@
gupnp-tools-lang gnome-extras
gvfs-lang gnome
gwget-lang gnome-extras
-hamster-time-tracker-lang gnome-extras
hitori-lang gnome-extras
homebank-lang gnome-extras
iagno-lang gnome
+ibus-lang gnome
+icewm-lang common
inkscape-lang gnome-extras
-iso-codes-lang gnome
+iso-codes-lang gnome-extras
istanbul-lang gnome-extras
jhbuild-lang gnome-extras
json-glib-lang common
@@ -373,6 +368,7 @@
libwnck2-lang gnome-extras
liferea-lang gnome
lightsoff-lang gnome
+m17n-db-lang gnome
meld-lang gnome-extras
memprof-lang gnome-extras
metacity-lang gnome-extras
@@ -424,7 +420,7 @@
seahorse-sharing-lang gnome-extras
sed-lang common
shared-mime-info-lang common
-shotwell-lang gnome
+shotwell-lang gnome-extras
simple-scan-lang gnome
smuxi-engine-campfire-lang gnome-extras
smuxi-engine-irc-lang gnome-extras
1
0
Hello community,
here is the log from the commit of package cutecom for openSUSE:Factory checked in at 2015-11-28 15:19:05
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/cutecom (Old)
and /work/SRC/openSUSE:Factory/.cutecom.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "cutecom"
Changes:
--------
--- /work/SRC/openSUSE:Factory/cutecom/cutecom.changes 2012-03-05 17:59:23.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.cutecom.new/cutecom.changes 2015-11-28 15:19:07.000000000 +0100
@@ -1,0 +2,6 @@
+Tue Nov 17 10:35:42 UTC 2015 - opensuse(a)dstoecker.de
+
+- fix build for Leap 42.1
+- correct FSF address
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ cutecom.spec ++++++
--- /var/tmp/diff_new_pack.nLRoSE/_old 2015-11-28 15:19:08.000000000 +0100
+++ /var/tmp/diff_new_pack.nLRoSE/_new 2015-11-28 15:19:08.000000000 +0100
@@ -1,7 +1,7 @@
#
# spec file for package cutecom
#
-# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,7 +16,6 @@
#
-
Name: cutecom
Version: 0.22.0
Release: 0
@@ -34,12 +33,6 @@
Patch: cutecom-0.22.0-nolinebreak.diff
Patch1: cutecom-0.22.0-license.diff
-%if 0%{?suse_version}
-# for >= 11.1 validity tests
-BuildRequires: gnome-icon-theme
-BuildRequires: kdelibs3
-%endif
-
%description
Qt based serial terminal
++++++ cutecom-0.22.0-license.diff ++++++
--- /var/tmp/diff_new_pack.nLRoSE/_old 2015-11-28 15:19:08.000000000 +0100
+++ /var/tmp/diff_new_pack.nLRoSE/_new 2015-11-28 15:19:08.000000000 +0100
@@ -1,6 +1,20 @@
-diff -ur cutecom-0.22.0/qcppdialogimpl.cpp cutecom-0.22.0_fix/qcppdialogimpl.cpp
+diff -u cutecom-0.22.0/COPYING cutecom-0.22.0_fix/COPYING
+--- cutecom-0.22.0/COPYING 2004-07-09 21:41:58.000000000 +0200
++++ cutecom-0.22.0_fix/COPYING 2015-11-17 11:33:45.177568776 +0100
+@@ -1,8 +1,8 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+- 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
++ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
++ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+diff -u cutecom-0.22.0/qcppdialogimpl.cpp cutecom-0.22.0_fix/qcppdialogimpl.cpp
--- cutecom-0.22.0/qcppdialogimpl.cpp 2009-06-25 22:10:49.000000000 +0200
-+++ cutecom-0.22.0_fix/qcppdialogimpl.cpp 2012-02-23 18:06:51.000000000 +0100
++++ cutecom-0.22.0_fix/qcppdialogimpl.cpp 2015-11-17 11:31:16.428463532 +0100
@@ -376,7 +376,7 @@
void QCPPDialogImpl::showAboutMsg()
1
0
Hello community,
here is the log from the commit of package booth for openSUSE:Factory checked in at 2015-11-28 15:19:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/booth (Old)
and /work/SRC/openSUSE:Factory/.booth.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "booth"
Changes:
--------
--- /work/SRC/openSUSE:Factory/booth/booth.changes 2015-11-08 11:26:58.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.booth.new/booth.changes 2015-11-28 15:19:06.000000000 +0100
@@ -1,0 +2,14 @@
+Tue Nov 24 13:11:00 UTC 2015 - dmuhamedagic(a)suse.com
+
+- Update to version v0.2.0_120_gf3d73a5:
+ + arbitrator: mark expired tickets as lost (bsc#956321)
+ + attr: better control of election cause
+
+-------------------------------------------------------------------
+Fri Nov 20 11:37:43 UTC 2015 - dmuhamedagic(a)suse.com
+
+- Update to version v0.2.0_116_g88c3d6a:
+ + attr: attribute prerequisites (fate#318182)
+ + attr: keep attributes in the CIB (fate#318182)
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.amwQe7/_old 2015-11-28 15:19:07.000000000 +0100
+++ /var/tmp/diff_new_pack.amwQe7/_new 2015-11-28 15:19:07.000000000 +0100
@@ -1,4 +1,4 @@
<servicedata>
<service name="tar_scm">
<param name="url">git://github.com/ClusterLabs/booth.git</param>
- <param name="changesrevision">3e73b683b36c38650d1d2ff4c9393cb1bb2056e6</param></service></servicedata>
\ No newline at end of file
+ <param name="changesrevision">88c3d6a865cea676778bdeb7858f715a6ece6b10</param></service></servicedata>
\ No newline at end of file
++++++ booth.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/.git_info new/booth/.git_info
--- old/booth/.git_info 2015-11-06 10:07:54.000000000 +0100
+++ new/booth/.git_info 2015-11-24 14:08:30.000000000 +0100
@@ -1 +1 @@
-v0.2.0-113-gaeef08d
+v0.2.0-120-gf3d73a5
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/configure.ac new/booth/configure.ac
--- old/booth/configure.ac 2015-11-06 09:20:07.000000000 +0100
+++ new/booth/configure.ac 2015-11-23 19:13:11.000000000 +0100
@@ -61,6 +61,7 @@
AC_PATH_PROGS(PKGCONFIG, pkg-config)
AC_PATH_PROGS(ASCIIDOC, asciidoc)
+AC_PATH_PROGS(XML2CONFIG, xml2-config)
AM_CONDITIONAL(BUILD_ASCIIDOC, test x"${ASCIIDOC}" != x"")
@@ -82,6 +83,17 @@
AM_CONDITIONAL(BUILD_AUTH_C, test "x${mhash_installed}" = "xyes")
fi
+AC_MSG_CHECKING(for special libxml2 includes)
+if test "x$XML2CONFIG" = "x"; then
+ AC_MSG_ERROR(libxml2 config not found)
+else
+ XML2HEAD="`$XML2CONFIG --cflags`"
+ AC_MSG_RESULT($XML2HEAD)
+ AC_CHECK_LIB(xml2, xmlReadMemory)
+fi
+
+CPPFLAGS="$CPPFLAGS $XML2HEAD"
+
PKG_CHECK_MODULES(GLIB, [glib-2.0])
# Checks for header files.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/docs/boothd.8.txt new/booth/docs/boothd.8.txt
--- old/booth/docs/boothd.8.txt 2015-11-06 09:20:07.000000000 +0100
+++ new/booth/docs/boothd.8.txt 2015-11-23 19:13:11.000000000 +0100
@@ -325,6 +325,38 @@
The distributed 'service-runnable' script is an example which may
be used to test whether a pacemaker resource can be started.
+*'attr-prereq'*::
+ Sites can have GEO attributes managed with the 'geostore(8)'
+ program. Attributes are within ticket's scope and may be
+ tested by 'boothd' for additional control of ticket failover
+ (automatic) or ticket acquire (manual).
++
+Attributes are typically used to convey extra information about
+resources, for instance database replication status. The
+attributes are commonly updated by resource agents.
++
+Attribute values are referenced in expressions and may be tested
+for equality with the 'eq' binary operator or inequality with the
+'ne' operator. The usage is as follows:
+
+ attr-prereq = <grant_type> <name> <op> <value>
+
+ <grant_type>: "auto" | "manual"
+ <name>: attribute name
+ <op>: "eq" | "ne"
+ <value>: attribute value
++
+The two grant types are 'auto' for ticket failover and 'manual'
+for grants using the booth client. Only in case the expression
+evaluates to true can the ticket be granted.
++
+It is not clear whether the 'manual' grant type has any practical
+use because, obviously, this operation is anyway controlled by a
+human.
++
+Note that there can be no guarantee on whether an attribute value
+is up to date, i.e. if it actually reflects the current state.
+
One example of a booth configuration file:
-----------------------
@@ -345,6 +377,7 @@
retries = 5
renewal-freq = 60
before-acquire-handler = /usr/share/booth/service-runnable db8
+ attr-prereq = auto repl_state eq ACTIVE
-----------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/src/attr.c new/booth/src/attr.c
--- old/booth/src/attr.c 2015-11-06 09:20:07.000000000 +0100
+++ new/booth/src/attr.c 2015-11-23 19:13:11.000000000 +0100
@@ -19,6 +19,7 @@
#include <stdio.h>
#include "attr.h"
#include "ticket.h"
+#include "pacemaker.h"
void print_geostore_usage(void)
{
@@ -243,11 +244,13 @@
g_free(a);
}
-static cmd_result_t attr_set(struct ticket_config *tk, struct boothc_attr_msg *msg)
+int store_geo_attr(struct ticket_config *tk, const char *name, char *val, int notime)
{
struct geo_attr *a;
GDestroyNotify free_geo_attr_notify = free_geo_attr;
+ if (!tk)
+ return -1;
/*
* allocate new, if attr doesn't already exist
* copy the attribute value
@@ -258,21 +261,34 @@
free_geo_attr_notify, g_free);
if (!tk->attr) {
log_error("out of memory");
- return RLT_SYNC_FAIL;
+ return -1;
}
a = (struct geo_attr *)calloc(1, sizeof(struct geo_attr));
if (!a) {
log_error("out of memory");
- return RLT_SYNC_FAIL;
+ return -1;
}
- a->val = g_strdup(msg->attr.val);
- get_time(&a->update_ts);
+ a->val = g_strdup(val);
+ if (!notime)
+ get_time(&a->update_ts);
g_hash_table_insert(tk->attr,
- g_strndup(msg->attr.name, BOOTH_NAME_LEN), a);
+ g_strndup(name, BOOTH_NAME_LEN), a);
+
+ return 0;
+}
+
+static cmd_result_t attr_set(struct ticket_config *tk, struct boothc_attr_msg *msg)
+{
+ int rc;
+ rc = store_geo_attr(tk, msg->attr.name, msg->attr.val, 0);
+ if (rc) {
+ return RLT_SYNC_FAIL;
+ }
+ (void)pcmk_handler.set_attr(tk, msg->attr.name, msg->attr.val);
return RLT_SUCCESS;
}
@@ -296,6 +312,8 @@
rv = g_hash_table_remove(tk->attr, msg->attr.name);
+ (void)pcmk_handler.del_attr(tk, msg->attr.name);
+
return gbool2rlt(rv);
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/src/attr.h new/booth/src/attr.h
--- old/booth/src/attr.h 2015-11-06 09:20:07.000000000 +0100
+++ new/booth/src/attr.h 2015-11-23 19:13:11.000000000 +0100
@@ -34,5 +34,6 @@
int do_attr_command(cmd_request_t cmd);
int process_attr_request(struct client *req_client, void *buf);
int attr_recv(void *buf, struct booth_site *source);
+int store_geo_attr(struct ticket_config *tk, const char *name, char *val, int notime);
#endif /* _ATTR_H */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/src/booth.h new/booth/src/booth.h
--- old/booth/src/booth.h 2015-11-06 09:20:07.000000000 +0100
+++ new/booth/src/booth.h 2015-11-23 19:13:11.000000000 +0100
@@ -244,6 +244,7 @@
RLT_NO_SUCH_ATTR = CHAR2CONST('N', 'A', 't', 'r'),
RLT_CIB_PENDING = CHAR2CONST('P', 'e', 'n', 'd'),
RLT_EXT_FAILED = CHAR2CONST('X', 'P', 'r', 'g'),
+ RLT_ATTR_PREREQ = CHAR2CONST('A', 'P', 'r', 'q'),
RLT_TICKET_IDLE = CHAR2CONST('T', 'i', 'd', 'l'),
RLT_OVERGRANT = CHAR2CONST('O', 'v', 'e', 'r'),
RLT_PROBABLY_SUCCESS = CHAR2CONST('S', 'u', 'c', '?'),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/src/config.c new/booth/src/config.c
--- old/booth/src/config.c 2015-11-06 09:20:07.000000000 +0100
+++ new/booth/src/config.c 2015-11-23 19:13:11.000000000 +0100
@@ -370,6 +370,103 @@
return 0;
}
+struct toktab grant_type[] = {
+ { "auto", GRANT_AUTO},
+ { "manual", GRANT_MANUAL},
+ { NULL, 0},
+};
+
+struct toktab attr_op[] = {
+ {"eq", ATTR_OP_EQ},
+ {"ne", ATTR_OP_NE},
+ {NULL, 0},
+};
+
+static int lookup_tokval(char *key, struct toktab *tab)
+{
+ struct toktab *tp;
+
+ for (tp = tab; tp->str; tp++) {
+ if (!strcmp(tp->str, key))
+ return tp->val;
+ }
+ return 0;
+}
+
+/* attribute prerequisite
+ */
+static int parse_attr_prereq(char *val, struct ticket_config *tk)
+{
+ struct attr_prereq *ap = NULL;
+ char *p;
+
+ ap = (struct attr_prereq *)calloc(1, sizeof(struct attr_prereq));
+ if (!ap) {
+ log_error("out of memory");
+ return -1;
+ }
+
+ p = strtok(val, " \t");
+ if (!p) {
+ log_error("not enough arguments to attr-prereq");
+ goto err_out;
+ }
+ ap->grant_type = lookup_tokval(p, grant_type);
+ if (!ap->grant_type) {
+ log_error("%s is not a grant type", p);
+ goto err_out;
+ }
+
+ p = strtok(NULL, " \t");
+ if (!p) {
+ log_error("not enough arguments to attr-prereq");
+ goto err_out;
+ }
+ if (!(ap->attr_name = strdup(p))) {
+ log_error("out of memory");
+ goto err_out;
+ }
+
+ p = strtok(NULL, " \t");
+ if (!p) {
+ log_error("not enough arguments to attr-prereq");
+ goto err_out;
+ }
+ ap->op = lookup_tokval(p, attr_op);
+ if (!ap->op) {
+ log_error("%s is not an attribute operation", p);
+ goto err_out;
+ }
+
+ p = strtok(NULL, " \t");
+ if (!p) {
+ log_error("not enough arguments to attr-prereq");
+ goto err_out;
+ }
+ if (!(ap->attr_val = strdup(p))) {
+ log_error("out of memory");
+ goto err_out;
+ }
+
+ tk->attr_prereqs = g_list_append(tk->attr_prereqs, ap);
+ if (!tk->attr_prereqs) {
+ log_error("out of memory");
+ goto err_out;
+ }
+
+ return 0;
+
+err_out:
+ if (ap) {
+ if (ap->attr_val)
+ free(ap->attr_val);
+ if (ap->attr_name)
+ free(ap->attr_name);
+ free(ap);
+ }
+ return -1;
+}
+
extern int poll_timeout;
int read_config(const char *path, int type)
@@ -680,6 +777,13 @@
goto err;
}
continue;
+ }
+
+ if (strcmp(key, "attr-prereq") == 0) {
+ if (parse_attr_prereq(val, current_tk)) {
+ goto err;
+ }
+ continue;
}
if (strcmp(key, "weights") == 0) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/src/config.h new/booth/src/config.h
--- old/booth/src/config.h 2015-11-06 09:20:07.000000000 +0100
+++ new/booth/src/config.h 2015-11-23 19:13:11.000000000 +0100
@@ -46,6 +46,28 @@
#define tk_test tk->clu_test
+typedef enum {
+ ATTR_OP_EQ = 1,
+ ATTR_OP_NE,
+} attr_op_e;
+
+typedef enum {
+ GRANT_AUTO = 1,
+ GRANT_MANUAL,
+} grant_type_e;
+
+struct toktab {
+ const char *str;
+ int val;
+};
+
+struct attr_prereq {
+ grant_type_e grant_type; /* grant type */
+ attr_op_e op; /* attribute operation */
+ char *attr_name;
+ char *attr_val;
+};
+
struct ticket_config {
/** \name Configuration items.
* @{ */
@@ -200,6 +222,10 @@
*/
GHashTable *attr;
+ /** Attribute prerequisites
+ */
+ GList *attr_prereqs;
+
/** Whom to vote for the next time.
* Needed to push a ticket to someone else. */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/src/main.c new/booth/src/main.c
--- old/booth/src/main.c 2015-11-06 09:20:07.000000000 +0100
+++ new/booth/src/main.c 2015-11-23 19:13:11.000000000 +0100
@@ -599,6 +599,12 @@
rv = -1;
break;
+ case RLT_ATTR_PREREQ:
+ log_error("attr-prereq for ticket \"%s\" failed, grant denied",
+ cl.msg.ticket.id);
+ rv = -1;
+ break;
+
case RLT_REDIRECT:
/* talk to another site */
rv = 1;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/src/pacemaker.c new/booth/src/pacemaker.c
--- old/booth/src/pacemaker.c 2015-11-06 09:20:07.000000000 +0100
+++ new/booth/src/pacemaker.c 2015-11-23 19:13:11.000000000 +0100
@@ -21,9 +21,14 @@
#include <stdlib.h>
#include <errno.h>
#include <inttypes.h>
+#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
+#include <libxml/parser.h>
+#include <libxml/tree.h>
+#include "ticket.h"
#include "log.h"
+#include "attr.h"
#include "pacemaker.h"
#include "inline-fn.h"
@@ -196,15 +201,10 @@
}
-static int crm_ticket_set(const struct ticket_config *tk, const char *attr, int64_t val)
+static int _run_crm_ticket(char *cmd)
{
- char cmd[COMMAND_MAX];
int i, rv;
-
- snprintf(cmd, COMMAND_MAX,
- "crm_ticket -t '%s' -S '%s' -v %" PRIi64,
- tk->name, attr, val);
/* If there are errors, there's not much we can do but retry ... */
for (i=0; i<3 &&
(rv = system(cmd));
@@ -215,6 +215,36 @@
return rv;
}
+static int crm_ticket_set_int(const struct ticket_config *tk, const char *attr, int64_t val)
+{
+ char cmd[COMMAND_MAX];
+
+ snprintf(cmd, COMMAND_MAX,
+ "crm_ticket -t '%s' -S '%s' -v %" PRIi64,
+ tk->name, attr, val);
+ return _run_crm_ticket(cmd);
+}
+
+static int pcmk_set_attr(struct ticket_config *tk, const char *attr, const char *val)
+{
+ char cmd[COMMAND_MAX];
+
+ snprintf(cmd, COMMAND_MAX,
+ "crm_ticket -t '%s' -S '%s' -v '%s'",
+ tk->name, attr, val);
+ return _run_crm_ticket(cmd);
+}
+
+static int pcmk_del_attr(struct ticket_config *tk, const char *attr)
+{
+ char cmd[COMMAND_MAX];
+
+ snprintf(cmd, COMMAND_MAX,
+ "crm_ticket -t '%s' -D '%s'",
+ tk->name, attr);
+ return _run_crm_ticket(cmd);
+}
+
static int pcmk_store_ticket_nonatomic(struct ticket_config *tk)
{
@@ -222,9 +252,9 @@
/* Always try to store *each* attribute, even if there's an error
* for one of them. */
- rv = crm_ticket_set(tk, "owner", (int32_t)get_node_id(tk->leader));
- rv = crm_ticket_set(tk, "expires", wall_ts(&tk->term_expires)) || rv;
- rv = crm_ticket_set(tk, "term", tk->current_term) || rv;
+ rv = crm_ticket_set_int(tk, "owner", (int32_t)get_node_id(tk->leader));
+ rv = crm_ticket_set_int(tk, "expires", wall_ts(&tk->term_expires)) || rv;
+ rv = crm_ticket_set_int(tk, "term", tk->current_term) || rv;
if (rv)
log_error("setting crm_ticket attributes failed; %s",
@@ -235,19 +265,88 @@
return rv;
}
+typedef int (*attr_f)(struct ticket_config *tk, const char *name, char *val);
+
+struct attr_tab
+{
+ const char *name;
+ attr_f handling_f;
+};
-static int crm_ticket_get(struct ticket_config *tk,
- const char *attr, int64_t *data)
+static int save_expires(struct ticket_config *tk, const char *name, char *val)
+{
+ secs2tv(unwall_ts(atol(val)), &tk->term_expires);
+ return 0;
+}
+
+static int save_term(struct ticket_config *tk, const char *name, char *val)
+{
+ tk->current_term = atol(val);
+ return 0;
+}
+
+static int parse_boolean(char *val)
+{
+ long v;
+
+ if (!strncmp(val, "false", 5)) {
+ v = 0;
+ } else if (!strncmp(val, "true", 4)) {
+ v = 1;
+ } else {
+ v = atol(val);
+ }
+ return v;
+}
+
+static int save_granted(struct ticket_config *tk, const char *name, char *val)
+{
+ tk->is_granted = parse_boolean(val);
+ return 0;
+}
+
+static int save_owner(struct ticket_config *tk, const char *name, char *val)
+{
+ /* No check, node could have been deconfigured. */
+ tk->leader = NULL;
+ return !find_site_by_id(atol(val), &tk->leader);
+}
+
+static int ignore_attr(struct ticket_config *tk, const char *name, char *val)
+{
+ return 0;
+}
+
+static int save_attr(struct ticket_config *tk, const char *name, char *val)
+{
+ /* tell store_geo_attr not to store time, we don't have that
+ * information available
+ */
+ return store_geo_attr(tk, name, val, 1);
+}
+
+struct attr_tab attr_handlers[] = {
+ { "expires", save_expires},
+ { "term", save_term},
+ { "granted", save_granted},
+ { "owner", save_owner},
+ { "id", ignore_attr},
+ { "last-granted", ignore_attr},
+ { NULL, 0},
+};
+
+
+/* get_attr is currently not used and has not been tested
+ */
+static int pcmk_get_attr(struct ticket_config *tk, const char *attr, const char **vp)
{
char cmd[COMMAND_MAX];
- char line[256];
- int rv;
- int64_t v;
+ char line[BOOTH_ATTRVAL_LEN+1];
+ int rv = 0;
FILE *p;
- *data = -1;
- v = 0;
+ *vp = NULL;
snprintf(cmd, COMMAND_MAX,
"crm_ticket -t '%s' -G '%s' --quiet",
tk->name, attr);
@@ -257,85 +356,167 @@
rv = errno;
log_error("popen error %d (%s) for \"%s\"",
rv, strerror(rv), cmd);
- return rv || -EINVAL;
+ return rv || EINVAL;
}
- if (fgets(line, sizeof(line) - 1, p) == NULL) {
+ if (fgets(line, BOOTH_ATTRVAL_LEN, p) == NULL) {
rv = ENODATA;
goto out;
}
- rv = EINVAL;
- if (!strncmp(line, "false", 5)) {
- v = 0;
- rv = 0;
- } else if (!strncmp(line, "true", 4)) {
- v = 1;
- rv = 0;
- } else if (sscanf(line, "%" PRIi64, &v) == 1) {
- rv = 0;
- }
-
- *data = v;
+ *vp = g_strdup(line);
out:
rv = pclose(p);
if (!rv) {
- log_debug("command \"%s\" value %" PRIi64, cmd, v);
+ log_debug("command \"%s\"", cmd);
} else if (WEXITSTATUS(rv) == 6) {
log_info("command \"%s\", ticket not found", cmd);
} else {
- log_error("command \"%s\" %s, value %" PRIi64, cmd, interpret_rv(rv), v);
+ log_error("command \"%s\" %s", cmd, interpret_rv(rv));
+ }
+ return rv;
+}
+
+static int save_attributes(struct ticket_config *tk, xmlDocPtr doc)
+{
+ int rv = 0, rc;
+ xmlNodePtr n;
+ xmlAttrPtr attr;
+ xmlChar *v;
+ struct attr_tab *atp;
+
+ n = xmlDocGetRootElement(doc);
+ if (n == NULL) {
+ tk_log_error("crm_ticket xml output empty");
+ return -EINVAL;
+ }
+ if (xmlStrcmp(n->name, (const xmlChar *)"ticket_state")) {
+ tk_log_error("crm_ticket xml root element not ticket_state");
+ return -EINVAL;
+ }
+ for (attr = n->properties; attr; attr = attr->next) {
+ v = xmlGetProp(n, attr->name);
+ for (atp = attr_handlers; atp->name; atp++) {
+ if (!strcmp(atp->name, attr->name)) {
+ rc = atp->handling_f(tk, attr->name, v);
+ break;
+ }
+ }
+ if (!atp->name) {
+ rc = save_attr(tk, attr->name, v);
+ }
+ if (rc) {
+ tk_log_error("error storing attribute %s", attr->name);
+ rv |= rc;
+ }
+ xmlFree(v);
}
return rv;
}
-static int pcmk_load_ticket(struct ticket_config *tk)
+#define CHUNK_SIZE 256
+
+static int parse_ticket_state(struct ticket_config *tk, FILE *p)
{
- int rv;
- int64_t v;
+ int rv = 0;
+ GString *input = NULL;
+ char line[CHUNK_SIZE];
+ xmlDocPtr doc = NULL;
+ xmlErrorPtr errptr;
+ int opts = XML_PARSE_COMPACT | XML_PARSE_NONET;
+
+ /* skip first two lines of output */
+ if (fgets(line, CHUNK_SIZE-1, p) == NULL || fgets(line, CHUNK_SIZE-1, p) == NULL) {
+ tk_log_error("crm_ticket xml output empty");
+ rv = ENODATA;
+ goto out;
+ }
+ input = g_string_sized_new(CHUNK_SIZE);
+ if (!input) {
+ log_error("out of memory");
+ rv = -1;
+ goto out;
+ }
+ while (fgets(line, CHUNK_SIZE-1, p) != NULL) {
+ if (!g_string_append(input, line)) {
+ log_error("out of memory");
+ rv = -1;
+ goto out;
+ }
+ }
+
+ doc = xmlReadDoc(input->str, NULL, NULL, opts);
+ if (doc == NULL) {
+ errptr = xmlGetLastError();
+ if (errptr) {
+ tk_log_error("crm_ticket xml parse failed (domain=%d, level=%d, code=%d): %s",
+ errptr->domain, errptr->level,
+ errptr->code, errptr->message);
+ } else {
+ tk_log_error("crm_ticket xml parse failed");
+ }
+ rv = -EINVAL;
+ goto out;
+ }
+ rv = save_attributes(tk, doc);
+out:
+ if (doc)
+ xmlFreeDoc(doc);
+ if (input)
+ g_string_free(input, TRUE);
+ return rv;
+}
+
+static int pcmk_load_ticket(struct ticket_config *tk)
+{
+ char cmd[COMMAND_MAX];
+ int rv = 0, pipe_rv;
+ FILE *p;
/* This here gets run during startup; testing that here means that
* normal operation won't be interrupted with that test. */
test_atomicity();
+ snprintf(cmd, COMMAND_MAX,
+ "crm_ticket -t '%s' -q",
+ tk->name);
- rv = crm_ticket_get(tk, "expires", &v);
- if (!rv) {
- secs2tv(unwall_ts(v), &tk->term_expires);
- }
-
- rv = crm_ticket_get(tk, "term", &v);
- if (!rv) {
- tk->current_term = v;
+ p = popen(cmd, "r");
+ if (p == NULL) {
+ pipe_rv = errno;
+ log_error("popen error %d (%s) for \"%s\"",
+ pipe_rv, strerror(pipe_rv), cmd);
+ return pipe_rv || -EINVAL;
}
- rv = crm_ticket_get(tk, "granted", &v);
- if (!rv) {
- tk->is_granted = v;
- }
+ rv = parse_ticket_state(tk, p);
- rv = crm_ticket_get(tk, "owner", &v);
- if (!rv) {
- /* No check, node could have been deconfigured. */
- if (!find_site_by_id(v, &tk->leader)) {
- /* Hmm, no site found for the ticket we have in the
- * CIB!?
- * Assume that the ticket belonged to us if it was
- * granted here!
- */
- log_warn("%s: no site matches; site got reconfigured?",
+ if (!tk->leader) {
+ /* Hmm, no site found for the ticket we have in the
+ * CIB!?
+ * Assume that the ticket belonged to us if it was
+ * granted here!
+ */
+ log_warn("%s: no site matches; site got reconfigured?",
+ tk->name);
+ if (tk->is_granted) {
+ log_warn("%s: granted here, assume it belonged to us",
tk->name);
- if (tk->is_granted) {
- log_warn("%s: granted here, assume it belonged to us",
- tk->name);
- tk->leader = local;
- }
+ tk->leader = local;
}
}
- return rv;
+ pipe_rv = pclose(p);
+ if (!pipe_rv) {
+ log_debug("command \"%s\"", cmd);
+ } else if (WEXITSTATUS(pipe_rv) == 6) {
+ log_info("command \"%s\", ticket not found", cmd);
+ } else {
+ log_error("command \"%s\" %s", cmd, interpret_rv(pipe_rv));
+ }
+ return rv | pipe_rv;
}
@@ -343,4 +524,7 @@
.grant_ticket = pcmk_grant_ticket,
.revoke_ticket = pcmk_revoke_ticket,
.load_ticket = pcmk_load_ticket,
+ .set_attr = pcmk_set_attr,
+ .get_attr = pcmk_get_attr,
+ .del_attr = pcmk_del_attr,
};
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/src/pacemaker.h new/booth/src/pacemaker.h
--- old/booth/src/pacemaker.h 2015-11-06 09:20:07.000000000 +0100
+++ new/booth/src/pacemaker.h 2015-11-23 19:13:11.000000000 +0100
@@ -27,6 +27,9 @@
int (*grant_ticket) (struct ticket_config *tk);
int (*revoke_ticket) (struct ticket_config *tk);
int (*load_ticket) (struct ticket_config *tk);
+ int (*set_attr) (struct ticket_config *tk, const char *a, const char *v);
+ int (*get_attr) (struct ticket_config *tk, const char *a, const char **vp);
+ int (*del_attr) (struct ticket_config *tk, const char *a);
};
struct ticket_handler pcmk_handler;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/src/raft.c new/booth/src/raft.c
--- old/booth/src/raft.c 2015-11-06 09:20:07.000000000 +0100
+++ new/booth/src/raft.c 2015-11-23 19:13:11.000000000 +0100
@@ -726,6 +726,8 @@
return booth_udp_send_auth(sender, &omsg, sendmsglen(&omsg));
}
+#define is_reason(r, tk) \
+ (reason == (r) || (reason == OR_AGAIN && (tk)->election_reason == (r)))
int new_election(struct ticket_config *tk,
struct booth_site *preference, int update_term, cmd_reason_t reason)
@@ -735,6 +737,13 @@
if (local->type != SITE)
return 0;
+ if ((is_reason(OR_TKT_LOST, tk) || is_reason(OR_STEPDOWN, tk)) &&
+ check_attr_prereq(tk, GRANT_AUTO)) {
+ tk_log_info("attribute prerequisite not met, "
+ "not starting elections");
+ return 0;
+ }
+
/* elections were already started, but not yet finished/timed out */
if (is_time_set(&tk->election_end) && !is_past(&tk->election_end))
return 1;
@@ -747,6 +756,9 @@
} else {
tk_log_debug("starting elections");
}
+ tk_log_debug("elections caused by %s %s",
+ state_to_string(reason),
+ reason == OR_AGAIN ? state_to_string(tk->election_reason) : "" );
}
/* §5.2 */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/src/ticket.c new/booth/src/ticket.c
--- old/booth/src/ticket.c 2015-11-06 09:20:07.000000000 +0100
+++ new/booth/src/ticket.c 2015-11-23 19:13:11.000000000 +0100
@@ -230,6 +230,41 @@
return rv;
}
+#define attr_found(geo_ap, ap) \
+ ((geo_ap) && !strcmp((geo_ap)->val, (ap)->attr_val))
+
+int check_attr_prereq(struct ticket_config *tk, grant_type_e grant_type)
+{
+ GList *el;
+ struct attr_prereq *ap;
+ struct geo_attr *geo_ap;
+
+ for (el = g_list_first(tk->attr_prereqs); el; el = g_list_next(el))
+ {
+ ap = (struct attr_prereq *)el->data;
+ if (ap->grant_type != grant_type)
+ continue;
+ geo_ap = (struct geo_attr *)g_hash_table_lookup(tk->attr, ap->attr_name);
+ switch(ap->op) {
+ case ATTR_OP_EQ:
+ if (!attr_found(geo_ap, ap))
+ goto fail;
+ break;
+ case ATTR_OP_NE:
+ if (attr_found(geo_ap, ap))
+ goto fail;
+ break;
+ default:
+ break;
+ }
+ }
+ return 0;
+
+fail:
+ tk_log_warn("'%s' attr-prereq failed", ap->attr_name);
+ return 1;
+}
+
/* do we need to run the external program?
* or we already done that and waiting for the outcome
* or program exited and we can collect the status
@@ -278,6 +313,9 @@
{
int rv;
+ if (reason == OR_ADMIN && check_attr_prereq(tk, GRANT_MANUAL))
+ return RLT_ATTR_PREREQ;
+
switch(do_ext_prog(tk, 0)) {
case 0:
/* everything fine */
@@ -887,10 +925,13 @@
static void ticket_lost(struct ticket_config *tk)
{
+ int reason = OR_TKT_LOST;
+
if (tk->leader != local) {
tk_log_warn("lost at %s", site_string(tk->leader));
} else {
tk_log_warn("lost majority (revoking locally)");
+ reason = tk->election_reason ? tk->election_reason : OR_REACQUIRE;
}
tk->lost_leader = tk->leader;
@@ -899,7 +940,7 @@
set_state(tk, ST_FOLLOWER);
if (local->type == SITE) {
ticket_write(tk);
- schedule_election(tk, OR_TKT_LOST);
+ schedule_election(tk, reason);
}
}
@@ -1180,8 +1221,7 @@
case ST_FOLLOWER:
/* If there is (or should be) some owner, check on it later on.
* If no one is interested - don't care. */
- if (is_owned(tk) &&
- (local->type == SITE)) {
+ if (is_owned(tk)) {
interval_add(&tk->term_expires, tk->acquire_after, &tv);
ticket_next_cron_at(tk, &tv);
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/src/ticket.h new/booth/src/ticket.h
--- old/booth/src/ticket.h 2015-11-06 09:20:07.000000000 +0100
+++ new/booth/src/ticket.h 2015-11-23 19:13:11.000000000 +0100
@@ -106,6 +106,8 @@
void add_random_delay(struct ticket_config *tk);
void schedule_election(struct ticket_config *tk, cmd_reason_t reason);
+int check_attr_prereq(struct ticket_config *tk, grant_type_e grant_type);
+
static inline void ticket_next_cron_at(struct ticket_config *tk, timetype *when)
{
copy_time(when, &tk->next_cron);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/src/transport.c new/booth/src/transport.c
--- old/booth/src/transport.c 2015-11-06 09:20:07.000000000 +0100
+++ new/booth/src/transport.c 2015-11-23 19:13:11.000000000 +0100
@@ -236,10 +236,15 @@
}
/* First try with exact addresses, then optionally with subnet matching. */
- if (ifa->ifa_prefixlen > address_bits_matched)
+ if (ifa->ifa_prefixlen > address_bits_matched) {
find_address(ipaddr,
ifa->ifa_family, ifa->ifa_prefixlen,
fuzzy_allowed, &me, &address_bits_matched);
+ if (me) {
+ log_debug("found myself at %s (%d bits matched)",
+ site_string(me), address_bits_matched);
+ }
+ }
}
h = NLMSG_NEXT(h, status);
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/test/live_test.sh new/booth/test/live_test.sh
--- old/booth/test/live_test.sh 2015-11-06 09:20:07.000000000 +0100
+++ new/booth/test/live_test.sh 2015-11-23 19:13:11.000000000 +0100
@@ -370,7 +370,26 @@
/^ticket.*'$tkt'/ {n=1}
' $cnf
}
+get_attr() {
+ awk '
+n && /^[[:space:]]*attr-prereq = auto .* eq / {print $4,$6; exit}
+n && (/^$/ || /^ticket.*/) {exit}
+/^ticket.*'$tkt'/ {n=1}
+' $cnf
+}
+set_site_attr() {
+ local site
+ site=`get_site $1`
+ set -- `get_attr`
+ geostore set -s $site $1 $2
+}
+del_site_attr() {
+ local site
+ site=`get_site $1`
+ set -- `get_attr`
+ geostore delete -s $site $1
+}
break_external_prog() {
run_site $1 crm configure "location $PREFNAME `get_rsc` rule -inf: defined \#uname"
}
@@ -507,7 +526,7 @@
# list on all of them (at least one should have booth
# running)
ticket_line=`forall_sites booth list | grep $tkt | sort -u | head -1`
- grantee=`echo "$ticket_line" | sed 's/.*leader: //;s/,.*//'`
+ grantee=`echo "$ticket_line" | sed 's/.*leader: //;s/,.*//;s/NONE/none/'`
echo $grantee
[ "$grantee" = "none" ] && return
! echo "$ticket_line" | grep -q "$tkt.*pending"
@@ -948,6 +967,8 @@
# ticket failover
setup_failover() {
grant_ticket 1
+ [ -n "`get_attr`" ] && set_site_attr 2
+ return 0
}
test_failover() {
stop_site_clean `get_site 1` || return 1
@@ -969,6 +990,8 @@
# split brain (leader alone)
setup_split_leader() {
grant_ticket_cib 1
+ [ -n "`get_attr`" ] && set_site_attr 2
+ return 0
}
test_split_leader() {
run_site 1 $iprules stop $port >/dev/null
@@ -1029,6 +1052,7 @@
# external test prog failed
setup_external_prog_failed() {
grant_ticket 1 || return 1
+ [ -n "`get_attr`" ] && set_site_attr 2
break_external_prog 1
show_pref 1 || return 1
}
@@ -1047,6 +1071,57 @@
[ -n "`get_rsc`" ]
}
+## TEST: attr_prereq_ok ##
+
+# failover with attribute prerequisite
+setup_attr_prereq_ok() {
+ grant_ticket 1 || return 1
+ set_site_attr 2
+ stop_site_clean `get_site 1`
+ booth_status `get_site 1` && return 1
+ return 0
+}
+test_attr_prereq_ok() {
+ wait_exp
+ wait_timeout
+}
+check_attr_prereq_ok() {
+ check_consistency `get_site 2`
+}
+recover_attr_prereq_ok() {
+ start_site `get_site 1`
+ del_site_attr 2
+}
+applicable_attr_prereq_ok() {
+ [ -n "`get_attr`" ]
+}
+
+## TEST: attr_prereq_fail ##
+
+# failover with failed attribute prerequisite
+setup_attr_prereq_fail() {
+ grant_ticket 1 || return 1
+ del_site_attr 2 >/dev/null 2>&1
+ stop_site_clean `get_site 1`
+ booth_status `get_site 1` && return 1
+ return 0
+}
+test_attr_prereq_fail() {
+ wait_exp
+ wait_exp
+ wait_exp
+}
+check_attr_prereq_fail() {
+ check_consistency &&
+ booth_where_granted | grep -qwi none
+}
+recover_attr_prereq_fail() {
+ start_site `get_site 1`
+}
+applicable_attr_prereq_fail() {
+ [ -n "`get_attr`" ]
+}
+
#
# environment modifications
#
@@ -1161,7 +1236,7 @@
simultaneous_start_even slow_start_granted
restart_granted reload_granted restart_granted_nocib restart_notgranted
failover split_leader split_follower split_edge
-external_prog_failed"}
+external_prog_failed attr_prereq_ok attr_prereq_fail"}
for t in $TESTS; do
runtest $t
1
0
Hello community,
here is the log from the commit of package machinery for openSUSE:Factory checked in at 2015-11-28 15:19:00
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/machinery (Old)
and /work/SRC/openSUSE:Factory/.machinery.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "machinery"
Changes:
--------
--- /work/SRC/openSUSE:Factory/machinery/machinery.changes 2015-11-22 11:02:28.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.machinery.new/machinery.changes 2015-11-28 15:19:03.000000000 +0100
@@ -1,0 +2,19 @@
+Tue Nov 24 13:17:18 CET 2015 - thardeck(a)suse.de
+
+- update to version 1.16.2
+ * Fix crash when the user does not have enough permissions to create the image
+ directory for the `build` command (gh#SUSE/machinery#1667)
+ * Fix wrong hint for docker containers while running `analyze` command
+ * Add a new hint when using the `--public` option for the `serve` command that it
+ makes all descriptions publicly available
+ * Fix Machinery failing to inspect changed config files in case of restrictive
+ permissions (gh#SUSE/machinery#1609)
+ * Remove hint for `show`, when `inspect` is run with `--show` option
+ * Fix repository inspection on hosts that have a LANGUAGE variable set
+ * Empty scopes now display a message in HTML & CLI views (gh#SUSE/machinery#1615)
+ * Fix SLES 11 SP4 os inspector output to be similar to SLES 11 SP3
+ * Fix Autoyast export on openSUSE Leap and Tumbleweed (gh#SUSE/machinery#1627)
+ * Allow building of openSUSE Leap and Tumbleweed on openSUSE Leap and Tumbleweed
+ * Allow building of SLES11 and SLES12 on openSUSE Leap
+
+-------------------------------------------------------------------
Old:
----
machinery-tool-1.16.1.gem
New:
----
machinery-tool-1.16.2.gem
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ machinery.spec ++++++
--- /var/tmp/diff_new_pack.nbXMQN/_old 2015-11-28 15:19:04.000000000 +0100
+++ /var/tmp/diff_new_pack.nbXMQN/_new 2015-11-28 15:19:04.000000000 +0100
@@ -17,7 +17,7 @@
Name: machinery
-Version: 1.16.1
+Version: 1.16.2
Release: 0
%define binary_name machinery
%define mod_name machinery-tool
@@ -68,7 +68,7 @@
BuildRequires: %{rubygem mimemagic <= 0.4}
BuildRequires: %{rubygem mimemagic >= 0.3.0}
BuildRequires: %{rubygem nokogiri <= 1.7}
-BuildRequires: %{rubygem nokogiri >= 1.6.0}
+BuildRequires: %{rubygem nokogiri >= 1.6.3}
BuildRequires: %{rubygem sinatra <= 1.5}
BuildRequires: %{rubygem sinatra >= 1.4.6}
BuildRequires: %{rubygem tilt <= 3}
@@ -93,7 +93,7 @@
Requires: %{rubygem mimemagic <= 0.4}
Requires: %{rubygem mimemagic >= 0.3.0}
Requires: %{rubygem nokogiri <= 1.7}
-Requires: %{rubygem nokogiri >= 1.6.0}
+Requires: %{rubygem nokogiri >= 1.6.3}
Requires: %{rubygem sinatra <= 1.5}
Requires: %{rubygem sinatra >= 1.4.6}
Requires: %{rubygem tilt <= 3}
@@ -122,7 +122,7 @@
BuildRequires: rubygem(mimemagic) <= 0.4
BuildRequires: rubygem(mimemagic) >= 0.3.0
BuildRequires: rubygem(nokogiri) <= 1.7
-BuildRequires: rubygem(nokogiri) >= 1.6.0
+BuildRequires: rubygem(nokogiri) >= 1.6.3
BuildRequires: rubygem(sinatra) <= 1.5
BuildRequires: rubygem(sinatra) >= 1.4.6
BuildRequires: rubygem(tilt) <= 3
@@ -174,7 +174,7 @@
gem "json", "~> 1.8.0"
%endif
gem "abstract_method", "~> 1.2.1"
-gem "nokogiri", "~> 1.6.0"
+gem "nokogiri", "~> 1.6.3"
gem "gli", "~> 2.11"
gem "json-schema", "~> 2.2.4"
gem "haml", "~> 4.0.5"
@@ -196,8 +196,6 @@
bundle install --standalone --local
-rm -rf vendor .bundle Gemfile Gemfile.lock
-
# Remove references to the build directory to prevent the following RPMLint error:
# E: file-contains-buildroot (Badness: 10000)
rm -rf bundle/ruby/%{rb_ver}/extensions/*/%{rb_ver}/nokogiri-*/mkmf.log
++++++ machinery-tool-1.16.1.gem -> machinery-tool-1.16.2.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/.git_revision new/.git_revision
--- old/.git_revision 2015-11-09 17:57:30.000000000 +0100
+++ new/.git_revision 2015-11-24 13:19:37.000000000 +0100
@@ -1 +1 @@
-e2a5941fcf2ffbbcbd765e23e860fc417592fdd1
\ No newline at end of file
+4afb989b21b401f983686603e6521c112630cac9
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/NEWS new/NEWS
--- old/NEWS 2015-11-09 17:57:30.000000000 +0100
+++ new/NEWS 2015-11-24 13:19:37.000000000 +0100
@@ -1,6 +1,25 @@
# Machinery Release Notes
+## Version 1.16.2 - Tue Nov 24 13:17:18 CET 2015 - thardeck(a)suse.de
+
+* Fix crash when the user does not have enough permissions to create the image
+ directory for the `build` command (gh#SUSE/machinery#1667)
+* Fix wrong hint for docker containers while running `analyze` command
+ (gh#SUSE/machinery#1632)
+* Add a new hint when using the `--public` option for the `serve` command that it
+ makes all descriptions publicly available
+* Fix Machinery failing to inspect changed config files in case of restrictive
+ permissions (gh#SUSE/machinery#1609)
+* Remove hint for `show`, when `inspect` is run with `--show` option
+ (gh#SUSE/machinery#1648)
+* Fix repository inspection on hosts that have a LANGUAGE variable set
+* Empty scopes now display a message in HTML & CLI views (gh#SUSE/machinery#1615)
+* Fix SLES 11 SP4 os inspector output to be similar to SLES 11 SP3
+* Fix Autoyast export on openSUSE Leap and Tumbleweed (gh#SUSE/machinery#1627)
+* Allow building of openSUSE Leap and Tumbleweed on openSUSE Leap and Tumbleweed
+* Allow building of SLES11 and SLES12 on openSUSE Leap
+
## Version 1.16.1 - Mon Nov 09 17:55:15 CET 2015 - thardeck(a)suse.de
* Fix type recognition in case of empty files for config- and changed-managed-files
Files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/html/partials/changed_managed_files.html.haml new/html/partials/changed_managed_files.html.haml
--- old/html/partials/changed_managed_files.html.haml 2015-11-09 17:57:30.000000000 +0100
+++ new/html/partials/changed_managed_files.html.haml 2015-11-24 13:19:37.000000000 +0100
@@ -1,4 +1,4 @@
-- if changed_managed_files && changed_managed_files.files.length > 0
+- if changed_managed_files
%div
%a.scope_anchor{ id: "changed_managed_files" }
.scope#changed_managed_files_container{ "data-scope" => "changed_managed_files" }
@@ -10,32 +10,35 @@
.row.scope_content.collapse.in
.col-xs-1
.col-xs-11
- %table.table.table-striped.table-hover.table-condensed.files-table.filterable
- %thead
- %tr
- %th Name
- %th Package Name
- %th.medium Package Version
- %th.medium Changes
- %th.small Mode
- %th.small User
- %th.small Group
- %tbody
- - changed_managed_files.files.each do |file|
+ - if count == 0
+ There are no changed managed files.
+ - if count > 0
+ %table.table.table-striped.table-hover.table-condensed.files-table.filterable
+ %thead
%tr
- %td
- - if file.on_disk?
- %a.file-download{ href: "#" }
- = file.name
- - else
- %span
- = file.name
- %td= file.package_name
- %td= file.package_version
- %td
- = file.changes.join(",")
- - if file.error_message
- %span{ title: file.error_message } (details)
- %td= file.mode
- %td= file.user
- %td= file.group
+ %th Name
+ %th Package Name
+ %th.medium Package Version
+ %th.medium Changes
+ %th.small Mode
+ %th.small User
+ %th.small Group
+ %tbody
+ - changed_managed_files.files.each do |file|
+ %tr
+ %td
+ - if file.on_disk?
+ %a.file-download{ href: "#" }
+ = file.name
+ - else
+ %span
+ = file.name
+ %td= file.package_name
+ %td= file.package_version
+ %td
+ = file.changes.join(",")
+ - if file.error_message
+ %span{ title: file.error_message } (details)
+ %td= file.mode
+ %td= file.user
+ %td= file.group
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/html/partials/config_files.html.haml new/html/partials/config_files.html.haml
--- old/html/partials/config_files.html.haml 2015-11-09 17:57:30.000000000 +0100
+++ new/html/partials/config_files.html.haml 2015-11-24 13:19:37.000000000 +0100
@@ -1,4 +1,4 @@
-- if config_files && config_files.files.length > 0
+- if config_files
%div
%a.scope_anchor{ id: "config_files" }
.scope#config_files_container{ "data-scope" => "config_files" }
@@ -8,50 +8,56 @@
:title => "Config Files",
:count => "#{count} #{Machinery.pluralize(count, "file")}"
.row.scope_content.collapse.in
- - config_files.files.each do |file|
- - if file.diff
- .diff{ style: "display: none", "data-config-file-diff" => file.diff.file }
- %span.diff-summary
- #{file.diff.additions} additions & #{file.diff.deletions} deletions
- %table.diff
- - file.diff.lines.each do |line|
- %tr{ class: line.type }
- %td.active.linenumber= line.original_line_number
- %td.linenumber= line.new_line_number
- %td
- = line.content
- .col-md-1
- .col-md-11
- %table.table.table-striped.table-hover.table-condensed.files-table.filterable
- %thead
- %tr
- %th Name
- %th.medium Package Name
- %th.medium Package Version
- %th.medium Changes
- %th.small Mode
- %th.small User
- %th.small Group
- %tbody
- - config_files.files.each do |file|
- %tr
- %td
- %span
- - if file.on_disk?
- %a.file-download{ href: "#" }
- = file.name
- - else
+ .col-xs-1
+ .col-xs-11
+ - if count == 0
+ There are no config files.
+ - if count > 0
+ - config_files.files.each do |file|
+ - if file.diff
+ .diff{ style: "display: none", "data-config-file-diff" => file.diff.file }
+ %span.diff-summary
+ #{file.diff.additions} additions & #{file.diff.deletions} deletions
+ %table.diff
+ - file.diff.lines.each do |line|
+ %tr{ class: line.type }
+ %td.active.linenumber= line.original_line_number
+ %td.linenumber= line.new_line_number
+ %td
+ = line.content
+ .col-md-1
+ .col-md-11
+ %table.table.table-striped.table-hover.table-condensed.files-table.filterable
+ %thead
+ %tr
+ %th Name
+ %th.medium Package Name
+ %th.medium Package Version
+ %th.medium Changes
+ %th.small Mode
+ %th.small User
+ %th.small Group
+ %tbody
+ - config_files.files.each do |file|
+ %tr
+ %td
%span
- = file.name
- - if file.diff
- %a.diff-toggle{ "data-config-file" => file.name, "data-toggle" => "popover" }
- Show diff
- %td= file.package_name
- %td= file.package_version
- %td
- = file.changes.join(",")
- - if file.error_message
- %span{ title: file.error_message } (details)
- %td= file.mode
- %td= file.user
- %td= file.group
+ - if file.on_disk?
+ %a.file-download{ href: "#" }
+ = file.name
+ - else
+ %span
+ = file.name
+ - if file.diff
+ %a.diff-toggle{ "data-config-file" => file.name,
+ "data-toggle" => "popover" }
+ Show diff
+ %td= file.package_name
+ %td= file.package_version
+ %td
+ = file.changes.join(",")
+ - if file.error_message
+ %span{ title: file.error_message } (details)
+ %td= file.mode
+ %td= file.user
+ %td= file.group
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/html/partials/packages.html.haml new/html/partials/packages.html.haml
--- old/html/partials/packages.html.haml 2015-11-09 17:57:30.000000000 +0100
+++ new/html/partials/packages.html.haml 2015-11-24 13:19:37.000000000 +0100
@@ -10,21 +10,24 @@
.row.scope_content.collapse.in
.col-xs-1
.col-xs-11
- %table.table.table-striped.table-hover.table-condensed.filterable
- %thead
- %tr
- %th Name
- %th.medium Version
- %th.medium Release
- %th.medium Arch
- %th.medium Vendor
- %th Checksum
- %tbody
- - packages.each do |package|
+ - if packages.length == 0
+ There are no packages.
+ - if packages.length > 0
+ %table.table.table-striped.table-hover.table-condensed.filterable
+ %thead
%tr
- %td= package.name
- %td= package.version
- %td= package.release
- %td= package.arch
- %td= package.vendor
- %td= package.checksum
+ %th Name
+ %th.medium Version
+ %th.medium Release
+ %th.medium Arch
+ %th.medium Vendor
+ %th Checksum
+ %tbody
+ - packages.each do |package|
+ %tr
+ %td= package.name
+ %td= package.version
+ %td= package.release
+ %td= package.arch
+ %td= package.vendor
+ %td= package.checksum
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/html/partials/patterns.html.haml new/html/partials/patterns.html.haml
--- old/html/partials/patterns.html.haml 2015-11-09 17:57:30.000000000 +0100
+++ new/html/partials/patterns.html.haml 2015-11-24 13:19:37.000000000 +0100
@@ -9,15 +9,18 @@
.row.scope_content.collapse.in
.col-xs-1
.col-xs-11
- %table.table.table-striped.table-hover.table-condensed.filterable
- %thead
- %tr
- %th Name
- %th.medium Version
- %th.medium Release
- %tbody
- - patterns.each do |pattern|
+ - if patterns.length == 0
+ There are no patterns.
+ - if patterns.length > 0
+ %table.table.table-striped.table-hover.table-condensed.filterable
+ %thead
%tr
- %td= pattern.name
- %td= pattern.version
- %td= pattern.release
+ %th Name
+ %th.medium Version
+ %th.medium Release
+ %tbody
+ - patterns.each do |pattern|
+ %tr
+ %td= pattern.name
+ %td= pattern.version
+ %td= pattern.release
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/html/partials/repositories.html.haml new/html/partials/repositories.html.haml
--- old/html/partials/repositories.html.haml 2015-11-09 17:57:30.000000000 +0100
+++ new/html/partials/repositories.html.haml 2015-11-24 13:19:37.000000000 +0100
@@ -10,26 +10,29 @@
.row.scope_content.collapse.in
.col-xs-1
.col-xs-11
- %table.table.table-striped.table-hover.table-condensed.filterable
- %thead
- %tr
- %th Name
- %th Alias
- %th.small Type
- %th URL
- %th.small Enabled
- %th.small Autorefresh
- %th.small GPG Check
- %th.small Priority
- %tbody
- - repositories.each do |repo|
+ - if count == 0
+ There are no repositories.
+ - if count > 0
+ %table.table.table-striped.table-hover.table-condensed.filterable
+ %thead
%tr
- %td= repo.name
- %td= repo.alias
- %td= repo.type
- %td
- %a{ href: repo.url }= repo.url
- %td= repo.enabled
- %td= repo.autorefresh
- %td= repo.gpgcheck
- %td= repo.priority
+ %th Name
+ %th Alias
+ %th.small Type
+ %th URL
+ %th.small Enabled
+ %th.small Autorefresh
+ %th.small GPG Check
+ %th.small Priority
+ %tbody
+ - repositories.each do |repo|
+ %tr
+ %td= repo.name
+ %td= repo.alias
+ %td= repo.type
+ %td
+ %a{ href: repo.url }= repo.url
+ %td= repo.enabled
+ %td= repo.autorefresh
+ %td= repo.gpgcheck
+ %td= repo.priority
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/html/partials/services.html.haml new/html/partials/services.html.haml
--- old/html/partials/services.html.haml 2015-11-09 17:57:30.000000000 +0100
+++ new/html/partials/services.html.haml 2015-11-24 13:19:37.000000000 +0100
@@ -10,14 +10,17 @@
.row.scope_content.collapse.in
.col-xs-1
.col-xs-11
- %table.table.table-striped.table-hover.table-condensed.filterable
- %thead
- %tr
- %th Name
- %th.medium State
- %tbody
- - services.services.each do |service|
+ - if count == 0
+ There are no services.
+ - if count > 0
+ %table.table.table-striped.table-hover.table-condensed.filterable
+ %thead
%tr
- %td= service.name
- %td{ class: "#{services.init_system}_#{service.state}" }
- = service.state
+ %th Name
+ %th.medium State
+ %tbody
+ - services.services.each do |service|
+ %tr
+ %td= service.name
+ %td{ class: "#{services.init_system}_#{service.state}" }
+ = service.state
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/html/partials/unmanaged_files.html.haml new/html/partials/unmanaged_files.html.haml
--- old/html/partials/unmanaged_files.html.haml 2015-11-09 17:57:30.000000000 +0100
+++ new/html/partials/unmanaged_files.html.haml 2015-11-24 13:19:37.000000000 +0100
@@ -1,4 +1,4 @@
-- if unmanaged_files && unmanaged_files.files.length > 0
+- if unmanaged_files
%div
%a.scope_anchor{ id: "unmanaged_files" }
.scope#unmanaged_files_container{ "data-scope" => "unmanaged_files" }
@@ -10,19 +10,22 @@
.row.scope_content.collapse.in
.col-xs-1
.col-xs-11
- %table.table.table-striped.table-hover.table-condensed.files-table.filterable
- %thead
- %tr
- %th Name
- %th.medium Type
- %tbody
- - unmanaged_files.files.each do |file|
+ - if count == 0
+ There are no unmanaged files.
+ - if count > 0
+ %table.table.table-striped.table-hover.table-condensed.files-table.filterable
+ %thead
%tr
- %td
- - if file.on_disk?
- %a.file-download{ href: "#" }
- = file.name
- - else
- %span
- = file.name
- %td= file.type
+ %th Name
+ %th.medium Type
+ %tbody
+ - unmanaged_files.files.each do |file|
+ %tr
+ %td
+ - if file.on_disk?
+ %a.file-download{ href: "#" }
+ = file.name
+ - else
+ %span
+ = file.name
+ %td= file.type
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/build_task.rb new/lib/build_task.rb
--- old/lib/build_task.rb 2015-11-09 17:57:30.000000000 +0100
+++ new/lib/build_task.rb 2015-11-24 13:19:37.000000000 +0100
@@ -28,7 +28,12 @@
config = KiwiConfig.new(system_description, options)
config.write(tmp_config_dir)
- FileUtils.mkdir_p(output_path)
+ begin
+ FileUtils.mkdir_p(output_path)
+ rescue Errno::EACCES
+ raise Machinery::Errors::BuildDirectoryCreateError.new(output_path, CurrentUser.new.username)
+ end
+
if tmp_image_dir.start_with?("/tmp/") && tmp_config_dir.start_with?("/tmp/")
tmp_script = write_kiwi_wrapper(tmp_config_dir, tmp_image_dir,
output_path, img_extension)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/cli.rb new/lib/cli.rb
--- old/lib/cli.rb 2015-11-09 17:57:30.000000000 +0100
+++ new/lib/cli.rb 2015-11-24 13:19:37.000000000 +0100
@@ -155,11 +155,11 @@
end
def self.check_container_name!(image, name)
- if image.include?("/") && name.include?("/")
+ if image == name && !SystemDescription.valid_name?(name)
raise Machinery::Errors::InvalidCommandLine.new(
"Error: System description name '#{name}' is invalid. By default Machinery" \
" uses the image name as description name if the parameter `--name` is not" \
- " provided.\nIf the image name consist a slash the `--name=NAME` parameter" \
+ " provided.\nIf the image name contains a slash the `--name=NAME` parameter" \
" is mandatory. Valid characters are 'a-zA-Z0-9_:.-'."
)
end
@@ -616,7 +616,7 @@
inspect_options
)
- Hint.print(:show_data, name: name)
+ Hint.print(:show_data, name: name) if options[:show] == false
if !options["extract-files"] || Inspector.all_scopes.count != scope_list.count
Hint.print(:do_complete_inspection, name: name, host: host)
@@ -920,6 +920,10 @@
if options[:public]
ip = "0.0.0.0"
+
+ Machinery::Ui.warn("The --public option makes ALL of your system descriptions publicly " \
+ "available. Take care if there are system descriptions that should not be read by " \
+ "others!\n\n")
else
ip = "127.0.0.1"
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/compare_task.rb new/lib/compare_task.rb
--- old/lib/compare_task.rb 2015-11-09 17:57:30.000000000 +0100
+++ new/lib/compare_task.rb 2015-11-24 13:19:37.000000000 +0100
@@ -70,9 +70,10 @@
identical = false if description1[scope] || description2[scope]
end
end
- output = "Compared descriptions are identical.\n" + output if identical && common_scopes
-
- if !identical_scopes.empty?
+ if identical && common_scopes
+ output = "\n" + output unless output.empty?
+ output = "Compared descriptions are identical." + output
+ elsif !identical_scopes.empty?
phrase = Machinery::pluralize(identical_scopes.count, "scope is", "scopes are")
output += "Following #{phrase} identical in both descriptions: " + identical_scopes.join(",")
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/current_user.rb new/lib/current_user.rb
--- old/lib/current_user.rb 2015-11-09 17:57:30.000000000 +0100
+++ new/lib/current_user.rb 2015-11-24 13:19:37.000000000 +0100
@@ -17,6 +17,10 @@
# Represents the user under which Machinery is running.
class CurrentUser
+ def username
+ ENV["USER"]
+ end
+
def is_root?
Process.euid == 0
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/exceptions.rb new/lib/exceptions.rb
--- old/lib/exceptions.rb 2015-11-09 17:57:30.000000000 +0100
+++ new/lib/exceptions.rb 2015-11-24 13:19:37.000000000 +0100
@@ -65,7 +65,14 @@
end.compact.first || "<HOSTNAME>"
formatted_scopes = Machinery::Ui.internal_scope_list_to_string(@scopes)
- cmd = "#{Hint.program_name} inspect --extract-files --scope=#{formatted_scopes.delete(" ")}"
+ if @description["environment"]["system_type"] == "docker"
+ inspect_cmd = "inspect-container"
+ else
+ inspect_cmd = "inspect"
+ end
+
+ cmd = "#{Hint.program_name} #{inspect_cmd} --extract-files " \
+ "--scope=#{formatted_scopes.delete(" ")}"
cmd += " --name='#{(a)description.name}'" if hostname != @description.name
cmd += " #{hostname}"
@@ -147,5 +154,16 @@
@message = message
end
end
+ class BuildDirectoryCreateError < MachineryError
+ def initialize(directory, user)
+ @directory = directory
+ @user = user
+ end
+
+ def to_s
+ "Could not create build directory '#{@directory}' because the user '#{@user}' does not " \
+ "have sufficient permissions."
+ end
+ end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/helper.rb new/lib/helper.rb
--- old/lib/helper.rb 2015-11-09 17:57:30.000000000 +0100
+++ new/lib/helper.rb 2015-11-24 13:19:37.000000000 +0100
@@ -55,10 +55,6 @@
with_env "LC_ALL" => "C", &block
end
-def with_utf8_locale(&block)
- with_env "LC_ALL" => "en_US.UTF-8", &block
-end
-
def with_env(env)
# ENV isn't a Hash, but a weird Hash-like object. Calling #to_hash on it
# will copy its items into a newly created Hash instance. This approach
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/kiwi_config.rb new/lib/kiwi_config.rb
--- old/lib/kiwi_config.rb 2015-11-09 17:57:30.000000000 +0100
+++ new/lib/kiwi_config.rb 2015-11-24 13:19:37.000000000 +0100
@@ -194,6 +194,12 @@
when OsSles11
boot = "vmxboot/suse-SLES11"
bootloader = "grub"
+ when OsOpenSuseTumbleweed
+ boot = "vmxboot/suse-tumbleweed"
+ bootloader = "grub2"
+ when OsOpenSuseLeap
+ boot = "vmxboot/suse-leap42.1"
+ bootloader = "grub2"
else
raise Machinery::Errors::ExportFailed.new(
"Export is not possible because the operating system " \
@@ -344,15 +350,11 @@
end
def enable_dhcp(output_location)
- case @system_description.os
- when OsSles11
- write_dhcp_network_config(output_location, "eth0")
- when OsSles12
- write_dhcp_network_config(output_location, "lan0")
- write_persistent_net_rules(output_location)
- when OsOpenSuse13_1
- write_dhcp_network_config(output_location, "lan0")
- write_persistent_net_rules(output_location)
+ if @system_description.os.is_a?(OsSles11)
+ write_dhcp_network_config(output_location, "eth0")
+ else
+ write_dhcp_network_config(output_location, "lan0")
+ write_persistent_net_rules(output_location)
end
puts "DHCP in built image will be enabled for the first device"
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/local_system.rb new/lib/local_system.rb
--- old/lib/local_system.rb 2015-11-09 17:57:30.000000000 +0100
+++ new/lib/local_system.rb 2015-11-24 13:19:37.000000000 +0100
@@ -84,7 +84,7 @@
message = <<EOF
You are running Machinery on a platform we do not explicitly support and test.
It still could work very well. If you run into issues or would like to provide us feedback, you are welcome to file an issue at https://github.com/SUSE/machinery/issues/new or write an email to machinery(a)lists.suse.com.
-Oficially supported operating systems are: '#{supported_oses}'
+Officially supported operating systems are: '#{supported_oses}'
To disable this message in the machinery configuration use 'machinery config perform-support-check=false'
EOF
@@ -132,7 +132,11 @@
else
cheetah_class = LoggedCheetah
end
- with_utf8_locale do
+
+ with_env(
+ "LANGUAGE" => "",
+ "LC_ALL" => locale
+ ) do
cheetah_class.run(*args)
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/remote_system.rb new/lib/remote_system.rb
--- old/lib/remote_system.rb 2015-11-09 17:57:30.000000000 +0100
+++ new/lib/remote_system.rb 2015-11-24 13:19:37.000000000 +0100
@@ -78,8 +78,8 @@
sudo = ["sudo", "-n"] if options[:privileged] && remote_user != "root"
cmds = [
- "ssh", "#{remote_user}@#{host}", "-o", "LogLevel=ERROR", sudo, "LC_ALL=#{locale}",
- *piped_args, options
+ "ssh", "#{remote_user}@#{host}", "-o", "LogLevel=ERROR", sudo, "LANGUAGE=",
+ "LC_ALL=#{locale}", *piped_args, options
].compact.flatten
cheetah_class.run(*cmds)
rescue Cheetah::ExecutionFailed => e
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/renderer.rb new/lib/renderer.rb
--- old/lib/renderer.rb 2015-11-09 17:57:30.000000000 +0100
+++ new/lib/renderer.rb 2015-11-24 13:19:37.000000000 +0100
@@ -253,8 +253,12 @@
private
def print_indented(s)
- s.split("\n").each do |line|
- @buffer += " " * @indent + line + "\n"
+ s.split("\n", -1).each do |line|
+ if line.empty?
+ @buffer += "\n"
+ else
+ @buffer += " " * @indent + line + "\n"
+ end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rpm_database.rb new/lib/rpm_database.rb
--- old/lib/rpm_database.rb 2015-11-09 17:57:30.000000000 +0100
+++ new/lib/rpm_database.rb 2015-11-24 13:19:37.000000000 +0100
@@ -35,6 +35,7 @@
def changed_files(&block)
return @changed_files if @changed_files
+ check_requirements
out = @system.run_script_with_progress("changed_files.sh", &block)
result = out.each_line.map do |line|
@@ -166,7 +167,8 @@
out = @system.run_command(
"stat", "--printf", "%a:%U:%G:%u:%g:%F:%n\\n",
*cur_files,
- stdout: :capture
+ stdout: :capture,
+ privileged: true
)
out.each_line do |l|
path, values = parse_stat_line(l)
@@ -197,4 +199,12 @@
ret.merge!(get_file_properties(cur_files)) unless cur_files.empty?
ret
end
+
+ private
+
+ def check_requirements
+ @system.check_requirement("rpm", "--version")
+ @system.check_requirement("stat", "--version")
+ @system.check_requirement("find", "--version")
+ end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/system_description.rb new/lib/system_description.rb
--- old/lib/system_description.rb 2015-11-09 17:57:30.000000000 +0100
+++ new/lib/system_description.rb 2015-11-24 13:19:37.000000000 +0100
@@ -72,18 +72,16 @@
description
end
- def validate_name(name)
- if ! /^[\w\.:-]*$/.match(name)
- raise Machinery::Errors::SystemDescriptionError.new(
- "System description name '#{name}' is invalid. " +
- "Only 'a-zA-Z0-9_:.-' are valid characters."
- )
- end
+ def valid_name?(name)
+ !!/^[\w:-][\w\.:-]*$/.match(name)
+ end
- if name.start_with?(".")
+ def validate_name(name)
+ unless valid_name?(name)
raise Machinery::Errors::SystemDescriptionError.new(
- "System description name '#{name}' is invalid. " +
- "A dot is not allowed as first character."
+ "System description name '#{name}' is invalid. " \
+ "Only 'a-zA-Z0-9_:.-' are valid characters and a dot " \
+ "is not allowed at the begginning."
)
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/version.rb new/lib/version.rb
--- old/lib/version.rb 2015-11-09 17:57:30.000000000 +0100
+++ new/lib/version.rb 2015-11-24 13:19:37.000000000 +0100
@@ -17,6 +17,6 @@
module Machinery
- VERSION = "1.16.1"
+ VERSION = "1.16.2"
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/machinery-helper/version.go new/machinery-helper/version.go
--- old/machinery-helper/version.go 2015-11-09 17:57:30.000000000 +0100
+++ new/machinery-helper/version.go 2015-11-24 13:19:37.000000000 +0100
@@ -2,4 +2,4 @@
package main
-const VERSION = "e2a5941fcf2ffbbcbd765e23e860fc417592fdd1"
+const VERSION = "4afb989b21b401f983686603e6521c112630cac9"
Files old/man/generated/machinery.1.gz and new/man/generated/machinery.1.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/man/generated/machinery.1.html new/man/generated/machinery.1.html
--- old/man/generated/machinery.1.html 2015-11-09 17:57:30.000000000 +0100
+++ new/man/generated/machinery.1.html 2015-11-24 13:19:37.000000000 +0100
@@ -905,7 +905,7 @@
<li><p>When inspecting as non-root the user has to have the following command
whitelist given in the sudoers file:</p>
-<p>machinery ALL=(ALL) NOPASSWD: /usr/bin/find,/usr/bin/cat,/bin/cat,/usr/bin/rsync,/bin/rpm -Va *,/bin/tar --create *</p></li>
+<p>machinery ALL=(ALL) NOPASSWD: /usr/bin/find,/usr/bin/cat,/bin/cat,/usr/bin/rsync,/bin/rpm -Va *,/bin/tar --create *,/usr/bin/stat</p></li>
<li><p>To add a remote <code>machinery</code> user run as root:</p>
<h1><code>useradd -m machinery -c "remote user for machinery"</code></h1>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata
--- old/metadata 2015-11-09 17:57:30.000000000 +0100
+++ new/metadata 2015-11-24 13:19:37.000000000 +0100
@@ -1,14 +1,14 @@
--- !ruby/object:Gem::Specification
name: machinery-tool
version: !ruby/object:Gem::Version
- version: 1.16.1
+ version: 1.16.2
platform: ruby
authors:
- SUSE
autorequire:
bindir: bin
cert_chain: []
-date: 2015-11-09 00:00:00.000000000 Z
+date: 2015-11-24 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: cheetah
@@ -58,14 +58,14 @@
requirements:
- - "~>"
- !ruby/object:Gem::Version
- version: 1.6.0
+ version: 1.6.3
type: :runtime
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - "~>"
- !ruby/object:Gem::Version
- version: 1.6.0
+ version: 1.6.3
- !ruby/object:Gem::Dependency
name: gli
requirement: !ruby/object:Gem::Requirement
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plugins/changed_managed_files/changed_managed_files_inspector.rb new/plugins/changed_managed_files/changed_managed_files_inspector.rb
--- old/plugins/changed_managed_files/changed_managed_files_inspector.rb 2015-11-09 17:57:30.000000000 +0100
+++ new/plugins/changed_managed_files/changed_managed_files_inspector.rb 2015-11-24 13:19:37.000000000 +0100
@@ -24,7 +24,6 @@
end
def inspect(filter, options = {})
- system.check_requirement("find", "--version")
system.check_retrieve_files_dependencies if options[:extract_changed_managed_files]
@system = system
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plugins/changed_managed_files/changed_managed_files_renderer.rb new/plugins/changed_managed_files/changed_managed_files_renderer.rb
--- old/plugins/changed_managed_files/changed_managed_files_renderer.rb 2015-11-09 17:57:30.000000000 +0100
+++ new/plugins/changed_managed_files/changed_managed_files_renderer.rb 2015-11-24 13:19:37.000000000 +0100
@@ -27,7 +27,10 @@
list do
file_status = description["changed_managed_files"].extracted
- if !file_status.nil?
+
+ if files.empty?
+ puts "There are no changed managed files."
+ elsif !file_status.nil?
puts "Files extracted: #{file_status ? "yes" : "no"}"
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plugins/config_files/config_files_inspector.rb new/plugins/config_files/config_files_inspector.rb
--- old/plugins/config_files/config_files_inspector.rb 2015-11-09 17:57:30.000000000 +0100
+++ new/plugins/config_files/config_files_inspector.rb 2015-11-24 13:19:37.000000000 +0100
@@ -17,13 +17,6 @@
class ConfigFilesInspector < Inspector
has_priority 80
- # checks if all required binaries are present
- def check_requirements(check_rsync)
- @system.check_requirement("rpm", "--version")
- @system.check_requirement("stat", "--version")
- @system.check_requirement("find", "--version")
- @system.check_retrieve_files_dependencies if check_rsync
- end
# returns a hash with entries for changed config files
def config_file_changes(pkg)
@@ -45,7 +38,7 @@
def inspect(filter, options = {})
do_extract = options[:extract_changed_config_files]
- check_requirements(do_extract)
+ system.check_retrieve_files_dependencies if do_extract
count = 0
files = @system.rpm_database.changed_files do |chunk|
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plugins/config_files/config_files_renderer.rb new/plugins/config_files/config_files_renderer.rb
--- old/plugins/config_files/config_files_renderer.rb 2015-11-09 17:57:30.000000000 +0100
+++ new/plugins/config_files/config_files_renderer.rb 2015-11-24 13:19:37.000000000 +0100
@@ -31,10 +31,14 @@
list do
file_status = description["config_files"].extracted
- if !file_status.nil?
+ files = description["config_files"].files
+
+ if files.empty?
+ puts "There are no config files."
+ elsif !file_status.nil?
puts "Files extracted: #{file_status ? "yes" : "no"}"
end
- files = description["config_files"].files
+
if files
files.each do |p|
item_content = "#{p.name} (#{p.package_name}-#{p.package_version}, " \
@@ -78,7 +82,7 @@
path = File.join(diffs_dir, name + ".diff")
if File.exists?(path)
- puts "Diff:\n#{File.read(path)}"
+ puts "Diff:\n#{File.read(path).chomp}"
else
Machinery::Ui.warn "Diff for #{name} was not found on disk."
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plugins/environment/environment_inspector.rb new/plugins/environment/environment_inspector.rb
--- old/plugins/environment/environment_inspector.rb 2015-11-09 17:57:30.000000000 +0100
+++ new/plugins/environment/environment_inspector.rb 2015-11-24 13:19:37.000000000 +0100
@@ -43,7 +43,7 @@
end
all_locales = output.split
- locale = ["en_US.utf8"].find { |l| all_locales.include?(l) }
+ locale = all_locales.find { |l| l.downcase.match(/en_us.utf.?8/) }
locale || "C"
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plugins/os/os_inspector.rb new/plugins/os/os_inspector.rb
--- old/plugins/os/os_inspector.rb 2015-11-09 17:57:30.000000000 +0100
+++ new/plugins/os/os_inspector.rb 2015-11-24 13:19:37.000000000 +0100
@@ -99,6 +99,13 @@
if result["pretty_name"] =~ /^openSUSE.*Leap/
result["pretty_name"] = "openSUSE Leap"
end
+
+ # converts SLES11 SP4 result to SP3 style
+ # the results are different because SP4 has an os-release
+ if result["pretty_name"] =~ /^SUSE Linux Enterprise Server 11 (SP\d)$/
+ result["pretty_name"] = "SUSE Linux Enterprise Server 11"
+ result["version"] = "11 #{$1}"
+ end
end
# return pretty_name as name as it contains the actual full length
# name instead of an abbreviation
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plugins/os/os_model.rb new/plugins/os/os_model.rb
--- old/plugins/os/os_model.rb 2015-11-09 17:57:30.000000000 +0100
+++ new/plugins/os/os_model.rb 2015-11-24 13:19:37.000000000 +0100
@@ -178,7 +178,7 @@
end
end
-class OsOpenSuseTumbleweed < Os
+class OsOpenSuseTumbleweed < OsSuse
def display_name
"#{name} (#{architecture})"
end
@@ -188,11 +188,11 @@
end
def self.buildable_systems
- [OsOpenSuse13_2]
+ [OsOpenSuse13_2, OsOpenSuseTumbleweed, OsOpenSuseLeap]
end
end
-class OsOpenSuseLeap < Os
+class OsOpenSuseLeap < OsSuse
def display_name
"#{name} (#{architecture})"
end
@@ -202,7 +202,7 @@
end
def self.buildable_systems
- [OsOpenSuse13_2, OsOpenSuseLeap]
+ [OsOpenSuse13_1, OsOpenSuse13_2, OsOpenSuseLeap, OsOpenSuseTumbleweed, OsSles12, OsSles11]
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plugins/packages/packages_renderer.rb new/plugins/packages/packages_renderer.rb
--- old/plugins/packages/packages_renderer.rb 2015-11-09 17:57:30.000000000 +0100
+++ new/plugins/packages/packages_renderer.rb 2015-11-24 13:19:37.000000000 +0100
@@ -23,6 +23,10 @@
def content(description)
return unless description.packages
+ if description.packages.empty?
+ puts "There are no packages."
+ end
+
list do
description.packages.each do |p|
item "#{p.name}-#{p.version}-#{p.release}.#{p.arch} (#{p.vendor})"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plugins/patterns/patterns_renderer.rb new/plugins/patterns/patterns_renderer.rb
--- old/plugins/patterns/patterns_renderer.rb 2015-11-09 17:57:30.000000000 +0100
+++ new/plugins/patterns/patterns_renderer.rb 2015-11-24 13:19:37.000000000 +0100
@@ -19,6 +19,10 @@
def content(description)
return unless description.patterns
+ if description.patterns.empty?
+ puts "There are no patterns."
+ end
+
list do
description.patterns.each do |p|
item "#{p.name}"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plugins/repositories/repositories_renderer.rb new/plugins/repositories/repositories_renderer.rb
--- old/plugins/repositories/repositories_renderer.rb 2015-11-09 17:57:30.000000000 +0100
+++ new/plugins/repositories/repositories_renderer.rb 2015-11-24 13:19:37.000000000 +0100
@@ -20,7 +20,7 @@
return unless description.repositories
if description.repositories.empty?
- puts "System has no repositories"
+ puts "There are no repositories."
end
list do
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plugins/services/services_renderer.rb new/plugins/services/services_renderer.rb
--- old/plugins/services/services_renderer.rb 2015-11-09 17:57:30.000000000 +0100
+++ new/plugins/services/services_renderer.rb 2015-11-24 13:19:37.000000000 +0100
@@ -19,6 +19,10 @@
def content(description)
return unless description["services"]
+ if description["services"].services.empty?
+ puts "There are no services."
+ end
+
list do
description["services"].services.each do |p|
item "#{p.name}: #{p.state}"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plugins/unmanaged_files/unmanaged_files_renderer.rb new/plugins/unmanaged_files/unmanaged_files_renderer.rb
--- old/plugins/unmanaged_files/unmanaged_files_renderer.rb 2015-11-09 17:57:30.000000000 +0100
+++ new/plugins/unmanaged_files/unmanaged_files_renderer.rb 2015-11-24 13:19:37.000000000 +0100
@@ -21,15 +21,18 @@
list do
file_status = description["unmanaged_files"].extracted
- if !file_status.nil?
+
+ if description["unmanaged_files"].files.empty?
+ puts "There are no unmanaged files."
+ elsif !file_status.nil?
puts "Files extracted: #{file_status ? "yes" : "no"}"
end
if description["unmanaged_files"].files
description["unmanaged_files"].files.each do |p|
- if p.user && p.group
+ if description["unmanaged_files"].extracted
item "#{p.name} (#{p.type})" do
- puts "User/Group: #{p.user}:#{p.group}"
+ puts "User/Group: #{p.user}:#{p.group}" if p.user || p.group
puts "Mode: #{p.mode}" if p.mode
puts "Size: #{number_to_human_size(p.size)}" if p.size
puts "Files: #{p.files}" if p.files
1
0
Hello community,
here is the log from the commit of package znc for openSUSE:Factory checked in at 2015-11-28 15:18:59
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/znc (Old)
and /work/SRC/openSUSE:Factory/.znc.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "znc"
Changes:
--------
--- /work/SRC/openSUSE:Factory/znc/znc.changes 2015-08-05 19:17:31.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.znc.new/znc.changes 2015-11-28 15:19:01.000000000 +0100
@@ -1,0 +2,42 @@
+Tue Nov 17 12:33:57 UTC 2015 - mpluskal(a)suse.com
+
+- Update to 1.6.2
+ * fixes
+ + Fixed a use-after-delete in webadmin. It was already
+ partially fixed in ZNC 1.4; since 1.4 it has been still
+ possible to trigger, but much harder.
+ + Fixed a startup failure when awaynick and simple_away were
+ both loaded, and simple_away had arguments.
+ + Fixed a build failure when using an ancient OpenSSL version.
+ + Fixed a build failure when using OpenSSL which was built
+ without SSLv3 support.
+ + Bindhost was sometimes used as ident.
+ + CAP :END wasn't parsed correctly, causing timeout during
+ login for some clients.
+ + Fixed channel keys if client joined several channels in
+ single command.
+ + Fixed memory leak when reading an invalid config.
+ * autovoice
+ + Check for autovoices when we are opped.
+ * controlpanel
+ + Fixed DelCTCPReply case-insensitivity.
+ * dcc
+ + Add missing return statement. It was harmless.
+ * modpython
+ + Fixed a memory leak.
+ * modules_online
+ + Wrong ident was used before.
+ * stickychan
+ + Fixed to unstick inaccessible channels to avoid infinite
+ join loops.
+ * internal changes
+ + Fixed the nick passed to CModule::OnChanMsg() so it has
+ channel permissions set.
+ + Fixed noisy -Winconsistent-missing-override compilation
+ warnings.
+ + Initialized some fields in constructors of modules before
+ OnLoad().
+- Make building more verbose
+- Partially fixes bsc#956254 - CVE-2014-9043
+
+-------------------------------------------------------------------
Old:
----
znc-1.6.1.tar.gz
znc-1.6.1.tar.gz.sig
New:
----
znc-1.6.2.tar.gz
znc-1.6.2.tar.gz.sig
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ znc.spec ++++++
--- /var/tmp/diff_new_pack.03k7bv/_old 2015-11-28 15:19:02.000000000 +0100
+++ /var/tmp/diff_new_pack.03k7bv/_new 2015-11-28 15:19:02.000000000 +0100
@@ -17,7 +17,7 @@
Name: znc
-Version: 1.6.1
+Version: 1.6.2
Release: 0
Summary: Advanced IRC Bouncer
License: Apache-2.0
@@ -36,16 +36,16 @@
BuildRequires: pkgconfig(systemd)
BuildRequires: pkgconfig(tcl)
BuildRequires: pkgconfig(zlib)
-%if 0%{?suse_version} == 1310
-BuildRequires: cyrus-sasl-devel
-%else
-BuildRequires: pkgconfig(libsasl2)
-%endif
Requires(pre): shadow
Provides: %{name}-extra = %{version}
Obsoletes: %{name}-extra < %{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%systemd_requires
+%if 0%{?suse_version} == 1310
+BuildRequires: cyrus-sasl-devel
+%else
+BuildRequires: pkgconfig(libsasl2)
+%endif
%description
ZNC is an IRC bounce with many advanced features like detaching, multiple
@@ -110,14 +110,15 @@
%build
export CFLAGS="%{optflags} -fstack-protector-all"
export CXXFLAGS="%{optflags} -fstack-protector-all"
-%configure --enable-cyrus \
+%configure \
+ --enable-cyrus \
--enable-perl \
--enable-tcl \
--with-tcl=%{_libdir} \
--enable-python \
--with-systemdsystemunitdir=%{_unitdir}
-make %{?_smp_mflags}
+make %{?_smp_mflags} V=1
%install
make DESTDIR=%{buildroot} install %{?_smp_mflags}
++++++ znc-1.6.1.tar.gz -> znc-1.6.2.tar.gz ++++++
++++ 28355 lines of diff (skipped)
1
0
Hello community,
here is the log from the commit of package vlc for openSUSE:Factory checked in at 2015-11-28 15:18:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/vlc (Old)
and /work/SRC/openSUSE:Factory/.vlc.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "vlc"
Changes:
--------
--- /work/SRC/openSUSE:Factory/vlc/vlc.changes 2015-09-08 17:40:53.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.vlc.new/vlc.changes 2015-11-28 15:18:59.000000000 +0100
@@ -1,0 +2,6 @@
+Sun Nov 22 21:14:44 UTC 2015 - jdelvare(a)suse.com
+
+- Don't pass --enable-dca unconditionally, it is handled later with
+ a condition.
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ vlc.spec ++++++
--- /var/tmp/diff_new_pack.YK8fHX/_old 2015-11-28 15:19:00.000000000 +0100
+++ /var/tmp/diff_new_pack.YK8fHX/_new 2015-11-28 15:19:00.000000000 +0100
@@ -347,7 +347,6 @@
%if ! 0%{?BUILD_ORIG}
--disable-avcodec \
%endif
- --enable-dca \
--enable-dvbpsi \
%if 0%{?suse_version} > 1110 || 0%{?BUILD_ORIG}
--enable-dvdnav \
1
0