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
June 2017
- 1 participants
- 2052 discussions
Hello community,
here is the log from the commit of package cairo for openSUSE:Factory checked in at 2017-06-28 10:32:16
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/cairo (Old)
and /work/SRC/openSUSE:Factory/.cairo.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "cairo"
Wed Jun 28 10:32:16 2017 rev:78 rq:505122 version:1.15.6
Changes:
--------
--- /work/SRC/openSUSE:Factory/cairo/cairo.changes 2017-06-19 13:23:07.362701320 +0200
+++ /work/SRC/openSUSE:Factory/.cairo.new/cairo.changes 2017-06-28 10:32:20.876808694 +0200
@@ -1,0 +2,7 @@
+Tue Jun 20 11:20:29 UTC 2017 - alarrosa(a)suse.com
+
+- Add 0001-image-prevent-invalid-ptr-access-for-4GB-images.patch to
+ fix a segfault when using >4GB images since int values were used
+ for pointer operations (bsc#1007255, fdo#98165, CVE-2016-9082).
+
+-------------------------------------------------------------------
New:
----
0001-image-prevent-invalid-ptr-access-for-4GB-images.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ cairo.spec ++++++
--- /var/tmp/diff_new_pack.Vqu9Ir/_old 2017-06-28 10:32:22.156627628 +0200
+++ /var/tmp/diff_new_pack.Vqu9Ir/_new 2017-06-28 10:32:22.156627628 +0200
@@ -33,6 +33,8 @@
Patch1: cairo-get_bitmap_surface-bsc1036789-CVE-2017-7475.diff
# PATCH-FIX-UPSTREAM cairo-fix-off-by-one-check.patch fdo#101427 zaitor(a)opensuse.org -- Fix off by one check in cairo-image-info.c
Patch2: cairo-fix-off-by-one-check.patch
+# PATCH-FIX-UPSTREAM 0001-image-prevent-invalid-ptr-access-for-4GB-images.patch bsc#1007255 fdo#98165 CVE-2016-9082 alarrosa(a)suse.com -- Fix segfault when using >4GB images
+Patch3: 0001-image-prevent-invalid-ptr-access-for-4GB-images.patch
BuildRequires: gtk-doc
BuildRequires: pkg-config
BuildRequires: pkgconfig(fontconfig)
@@ -141,6 +143,7 @@
%patch0 -p1
%patch1 -p1
%patch2 -p1
+%patch3 -p1
%build
%configure \
++++++ 0001-image-prevent-invalid-ptr-access-for-4GB-images.patch ++++++
>From c812d1c1935cccf096a60ad904e640fdc83bd41c Mon Sep 17 00:00:00 2001
From: Adrian Johnson <ajohnson(a)redneon.com>
Date: Thu, 20 Oct 2016 21:12:30 +1030
Subject: [PATCH] image: prevent invalid ptr access for > 4GB images
Image data is often accessed using:
image->data + y * image->stride
On 64-bit achitectures if the image data is > 4GB, this computation
will overflow since both y and stride are 32-bit types.
https://bugs.freedesktop.org/show_bug.cgi?id=98165
---
boilerplate/cairo-boilerplate.c | 4 +++-
src/cairo-image-compositor.c | 4 ++--
src/cairo-image-surface-private.h | 2 +-
src/cairo-mesh-pattern-rasterizer.c | 2 +-
src/cairo-png.c | 2 +-
src/cairo-script-surface.c | 3 ++-
6 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/boilerplate/cairo-boilerplate.c b/boilerplate/cairo-boilerplate.c
index 7fdbf79..4804dea 100644
--- a/boilerplate/cairo-boilerplate.c
+++ b/boilerplate/cairo-boilerplate.c
@@ -42,6 +42,7 @@
#undef CAIRO_VERSION_H
#include "../cairo-version.h"
+#include <stddef.h>
#include <stdlib.h>
#include <ctype.h>
#include <assert.h>
@@ -976,7 +977,8 @@ cairo_surface_t *
cairo_boilerplate_image_surface_create_from_ppm_stream (FILE *file)
{
char format;
- int width, height, stride;
+ int width, height;
+ ptrdiff_t stride;
int x, y;
unsigned char *data;
cairo_surface_t *image = NULL;
diff --git a/src/cairo-image-compositor.c b/src/cairo-image-compositor.c
index 48072f8..3ca0006 100644
--- a/src/cairo-image-compositor.c
+++ b/src/cairo-image-compositor.c
@@ -1575,7 +1575,7 @@ typedef struct _cairo_image_span_renderer {
pixman_image_t *src, *mask;
union {
struct fill {
- int stride;
+ ptrdiff_t stride;
uint8_t *data;
uint32_t pixel;
} fill;
@@ -1594,7 +1594,7 @@ typedef struct _cairo_image_span_renderer {
struct finish {
cairo_rectangle_int_t extents;
int src_x, src_y;
- int stride;
+ ptrdiff_t stride;
uint8_t *data;
} mask;
} u;
diff --git a/src/cairo-image-surface-private.h b/src/cairo-image-surface-private.h
index 8ca694c..7e78d61 100644
--- a/src/cairo-image-surface-private.h
+++ b/src/cairo-image-surface-private.h
@@ -71,7 +71,7 @@ struct _cairo_image_surface {
int width;
int height;
- int stride;
+ ptrdiff_t stride;
int depth;
unsigned owns_data : 1;
diff --git a/src/cairo-mesh-pattern-rasterizer.c b/src/cairo-mesh-pattern-rasterizer.c
index 1b63ca8..e7f0db6 100644
--- a/src/cairo-mesh-pattern-rasterizer.c
+++ b/src/cairo-mesh-pattern-rasterizer.c
@@ -470,7 +470,7 @@ draw_pixel (unsigned char *data, int width, int height, int stride,
tg += tg >> 16;
tb += tb >> 16;
- *((uint32_t*) (data + y*stride + 4*x)) = ((ta << 16) & 0xff000000) |
+ *((uint32_t*) (data + y*(ptrdiff_t)stride + 4*x)) = ((ta << 16) & 0xff000000) |
((tr >> 8) & 0xff0000) | ((tg >> 16) & 0xff00) | (tb >> 24);
}
}
diff --git a/src/cairo-png.c b/src/cairo-png.c
index 562b743..aa8c227 100644
--- a/src/cairo-png.c
+++ b/src/cairo-png.c
@@ -673,7 +673,7 @@ read_png (struct png_read_closure_t *png_closure)
}
for (i = 0; i < png_height; i++)
- row_pointers[i] = &data[i * stride];
+ row_pointers[i] = &data[i * (ptrdiff_t)stride];
png_read_image (png, row_pointers);
png_read_end (png, info);
diff --git a/src/cairo-script-surface.c b/src/cairo-script-surface.c
index ea0117d..91e4baa 100644
--- a/src/cairo-script-surface.c
+++ b/src/cairo-script-surface.c
@@ -1202,7 +1202,8 @@ static cairo_status_t
_write_image_surface (cairo_output_stream_t *output,
const cairo_image_surface_t *image)
{
- int stride, row, width;
+ int row, width;
+ ptrdiff_t stride;
uint8_t row_stack[CAIRO_STACK_BUFFER_SIZE];
uint8_t *rowdata;
uint8_t *data;
--
2.1.4
1
0
Hello community,
here is the log from the commit of package fail2ban for openSUSE:Factory checked in at 2017-06-27 10:21:50
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/fail2ban (Old)
and /work/SRC/openSUSE:Factory/.fail2ban.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "fail2ban"
Tue Jun 27 10:21:50 2017 rev:49 rq:506342 version:0.9.7
Changes:
--------
--- /work/SRC/openSUSE:Factory/fail2ban/fail2ban.changes 2017-05-17 10:55:01.245200934 +0200
+++ /work/SRC/openSUSE:Factory/.fail2ban.new/fail2ban.changes 2017-06-27 10:21:55.957595728 +0200
@@ -1,0 +2,6 @@
+Mon Jun 26 07:23:57 UTC 2017 - jweberhofer(a)weberhofer.at
+
+- added 1783.patch from upstream: "Updated roundcube authentication filter"
+- use tmpfiles_create macro
+
+-------------------------------------------------------------------
New:
----
1783.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ fail2ban.spec ++++++
--- /var/tmp/diff_new_pack.qlrW4E/_old 2017-06-27 10:21:57.377395060 +0200
+++ /var/tmp/diff_new_pack.qlrW4E/_new 2017-06-27 10:21:57.377395060 +0200
@@ -16,6 +16,7 @@
#
+%{!?tmpfiles_create:%global tmpfiles_create systemd-tmpfiles --create}
Name: fail2ban
Version: 0.9.7
Release: 0
@@ -39,6 +40,8 @@
Patch101: %{name}-opensuse-service.patch
# PATCH-UPSTREAM 607568f.patch bnc#1036928 jweberhofer(a)weberhofer.at -- Postfix RBL: 554 & SMTP
Patch102: 607568f.patch
+# PATCH-UPSTREAM 1783.patch jweberhofer(a)weberhofer.at -- Updated roundcube authentication filter
+Patch103: 1783.patch
# PATCH-FIX-OPENSUSE fail2ban-disable-iptables-w-option.patch jweberhofer(a)weberhofer.at -- disable iptables "-w" option for older releases
Patch200: %{name}-disable-iptables-w-option.patch
BuildRequires: fdupes
@@ -119,9 +122,13 @@
# Use openSUSE paths
sed -i -e 's/^before = paths-.*/before = paths-opensuse.conf/' config/jail.conf
+# Remove shebang
+sed -i -e '/^#!\/usr\/bin\/python$/d' fail2ban/client/fail2banregex.py
+
%patch100
%patch101
%patch102 -p1
+%patch103 -p1
%if 0%{?suse_version} < 1310
%patch200 -p1
%endif
@@ -224,7 +231,7 @@
%post
%fillup_only
%if 0%{?suse_version} >= 1230
-systemd-tmpfiles --create %{_tmpfilesdir}/%{name}.conf
+%tmpfiles_create %{_tmpfilesdir}/%{name}.conf
# The next line is not workin in Leap 42.1, so keep the old way
#%%tmpfiles_create %%{_tmpfilesdir}/%%{name}.conf
%service_add_post %{name}.service
++++++ 1783.patch ++++++
diff -ur fail2ban-0.9.7-orig/config/filter.d/roundcube-auth.conf fail2ban-0.9.7/config/filter.d/roundcube-auth.conf
--- fail2ban-0.9.7-orig/config/filter.d/roundcube-auth.conf 2017-05-11 03:38:57.000000000 +0200
+++ fail2ban-0.9.7/config/filter.d/roundcube-auth.conf 2017-06-26 16:57:15.171337942 +0200
@@ -7,16 +7,30 @@
# The logpath in your jail can be updated to userlogins if you wish
#
+
+[Definition]
+# Fail2Ban configuration file for roundcube web server authentication failures
+#
+# When you enable systemd-logging, this filter needs "$config['log_driver']" set
+# to "syslog" in the roundcube configuration
+#
+
[INCLUDES]
before = common.conf
[Definition]
-failregex = ^\s*(\[\])?(%(__hostname)s\s*(roundcube:)?\s*(<[\w]+>)? IMAP Error)?: (FAILED login|Login failed) for .*? from <HOST>(\. .* in .*?/rcube_imap\.php on line \d+ \(\S+ \S+\))?$
- ^\[\]:\s*(<[\w]+>)? Failed login for [\w\-\.\+]+((a)[\w\-\.\+]+\.[a-zA-Z]{2,6})? from <HOST> in session \w+( \(error: \d\))?$
+prefregex = ^\s*(\[\])?(%(__hostname)s\s*(?:roundcube(?:\[(\d*)\])?:)?\s*(<[\w]+>)? IMAP Error)?:
+
+failregex = %(prefregex)s (?:FAILED login|Login failed) for (?P<user>.*) from <HOST>(\. (?:(?! from ).)*(?: user=(?P=user))? in \S+\.php on line \d+ \(\S+ \S+\))?$
+ %(prefregex)s (?:<[\w]+> )?Failed login for (?P<user>.*) from <HOST> in session \w+( \(error: \d\))?$
+
+ignoreregex =
+
+[Init]
+journalmatch = SYSLOG_IDENTIFIER=roundcube
-ignoreregex =
# DEV Notes:
#
# Source: https://github.com/roundcube/roundcubemail/blob/master/program/lib/Roundcub…
diff -ur fail2ban-0.9.7-orig/config/jail.conf fail2ban-0.9.7/config/jail.conf
--- fail2ban-0.9.7-orig/config/jail.conf 2017-05-11 03:38:57.000000000 +0200
+++ fail2ban-0.9.7/config/jail.conf 2017-06-26 10:37:10.200062390 +0200
@@ -379,7 +379,8 @@
port = http,https
logpath = %(roundcube_errors_log)s
-
+# Use following line in your jail.local if roundcube logs to journal.
+#backend = %(syslog_backend)s
[openwebmail]
1
0
Hello community,
here is the log from the commit of package forkstat for openSUSE:Factory checked in at 2017-06-27 10:21:47
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/forkstat (Old)
and /work/SRC/openSUSE:Factory/.forkstat.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "forkstat"
Tue Jun 27 10:21:47 2017 rev:4 rq:506335 version:0.02.00
Changes:
--------
--- /work/SRC/openSUSE:Factory/forkstat/forkstat.changes 2017-06-26 15:53:32.992775741 +0200
+++ /work/SRC/openSUSE:Factory/.forkstat.new/forkstat.changes 2017-06-27 10:21:54.329825789 +0200
@@ -1,0 +2,24 @@
+Sun Jun 25 19:12:00 UTC 2017 - mardnh(a)gmx.de
+
+- update to version 0.02.00
+ * Makefile: update version and change codename
+ * Minor tweaks to the manual, cosmetic changes
+ * Move arrays to end of stacks to help avoid any stack smashing
+ * Minor source clean-up
+ * Avoid TOCTOU race on stat + open
+ * Use alternative ptrace pid info
+ * Add -x extra UID and TTY information option
+ * Add uid/sid event tracing
+ * Display name of events on -e option when invalid event used
+ * Add ptrace event spying
+ * Fix realtime flag opts mask
+ * Fix -r help option
+ * Add extra spacing in heading as it is offset by one after PID
+ * Remove old set_priority code now that -r replaces it
+ * Manpage: fix pdf warning:
+ * Makefile: add pdf man page rule and add .PHONEYs
+ * Add Philipp Gesang to the man page for kudos for contributions.
+ * Add -r real time scheduling option
+ * Put help options into one large printf statement
+
+-------------------------------------------------------------------
Old:
----
forkstat-0.01.19.tar.gz
New:
----
forkstat-0.02.00.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ forkstat.spec ++++++
--- /var/tmp/diff_new_pack.Sc9sQb/_old 2017-06-27 10:21:54.889746653 +0200
+++ /var/tmp/diff_new_pack.Sc9sQb/_new 2017-06-27 10:21:54.889746653 +0200
@@ -18,7 +18,7 @@
Name: forkstat
-Version: 0.01.19
+Version: 0.02.00
Release: 0
Summary: Process fork/exec/exit monitoring tool
License: GPL-2.0+
++++++ forkstat-0.01.19.tar.gz -> forkstat-0.02.00.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/forkstat-0.01.19/Makefile new/forkstat-0.02.00/Makefile
--- old/forkstat-0.01.19/Makefile 2017-06-21 18:59:39.000000000 +0200
+++ new/forkstat-0.02.00/Makefile 2017-06-24 21:43:28.000000000 +0200
@@ -16,9 +16,9 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
-VERSION=0.01.19
+VERSION=0.02.00
#
-# Version "Frantic Forking Finder"
+# Version "Perspicacious Process Peeker"
#
CFLAGS += -Wall -Wextra -DVERSION='"$(VERSION)"' -O2
@@ -43,6 +43,7 @@
forkstat.8.gz: forkstat.8
gzip -c $< > $@
+.PHONEY: dist
dist:
rm -rf forkstat-$(VERSION)
mkdir forkstat-$(VERSION)
@@ -51,10 +52,17 @@
tar -zcf forkstat-$(VERSION).tar.gz forkstat-$(VERSION)
rm -rf forkstat-$(VERSION)
+.PHONEY: pdf
+pdf:
+ man -t ./forkstat.8 | ps2pdf - > forkstat.pdf
+
+.PHONEY: clean
clean:
rm -f forkstat forkstat.o forkstat.8.gz
rm -f forkstat-$(VERSION).tar.gz
+ rm -f forkstat.pdf
+.PHONEY: install
install: forkstat forkstat.8.gz
mkdir -p ${DESTDIR}${BINDIR}
cp forkstat ${DESTDIR}${BINDIR}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/forkstat-0.01.19/forkstat.8 new/forkstat-0.02.00/forkstat.8
--- old/forkstat-0.01.19/forkstat.8 2017-06-21 18:59:39.000000000 +0200
+++ new/forkstat-0.02.00/forkstat.8 2017-06-24 21:43:28.000000000 +0200
@@ -2,7 +2,7 @@
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
-.TH FORKSTAT 8 "21 June, 2017"
+.TH FORKSTAT 8 "24 June, 2017"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
@@ -26,9 +26,11 @@
.RI [ \-e ]
.RI [ \-h ]
.RI [ \-l ]
+.RI [ \-r ]
.RI [ \-s ]
.RI [ \-S ]
.RI [ \-q ]
+.RI [ \-x ]
.br
.SH DESCRIPTION
@@ -43,12 +45,12 @@
Forkstat will display several columns of process related information:
.TS
-l lw(5i).
+l l.
\fBTitle Description\fR
Time When the fork/exec/exit event occurred.
Event Type of event.
PID Process or thread ID.
-Info Parent or child if a fork, or exit value.
+Info Parent or child if a fork, or process exit(2) value.
Duration T{
On exit, the duration the command ran for in seconds.
Process The process name. The name will be in [ ] brackets if it is a kernel thread.
@@ -67,7 +69,7 @@
specify events to trace as a comma seperated list. By default the fork, exec and exit
events are traced. Available events are:
.TS
-l lw(5i).
+l lw(4i).
\fBEvent Description\fR
fork forks
exec execs
@@ -75,12 +77,22 @@
core core dumps
comm process name changes in comm field
clone clone (normally on thread creation)
+ptrce ptrace attach or detach
+uid uid/gid events
+sid sid events
all all the events above
.TE
.TP
.B \-h
show brief help summary.
.TP
+.B \-l
+set stdout to line-buffered mode.
+.TP
+.B \-r
+run with real time FIFO scheduling with maximum priority to keep up with high volumes
+of process events.
+.TP
.B \-s
show short process name information.
.TP
@@ -90,8 +102,8 @@
.B \-q
run quietly and enable the \-S option.
.TP
-.B \-l
-set stdout to line-buffered mode.
+.B \-x
+show extra process related information: user ID and TTY of the process.
.SH EXAMPLES
.LP
Show process activity with short process names and directory base path stripped off:
@@ -121,7 +133,8 @@
.SH SEE ALSO
.BR vmstat (8)
.SH AUTHOR
-forkstat was written by Colin King <colin.king(a)canonical.com>
+forkstat was written by Colin King <colin.king(a)canonical.com>. Thanks also
+for contributions from Philipp Gesang.
.PP
This manual page was written by Colin King <colin.king(a)canonical.com>,
for the Ubuntu project (but may be used by others).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/forkstat-0.01.19/forkstat.c new/forkstat-0.02.00/forkstat.c
--- old/forkstat-0.01.19/forkstat.c 2017-06-21 18:59:39.000000000 +0200
+++ new/forkstat-0.02.00/forkstat.c 2017-06-24 21:43:28.000000000 +0200
@@ -39,6 +39,7 @@
#include <time.h>
#include <getopt.h>
#include <sched.h>
+#include <pwd.h>
#include <sys/ioctl.h>
#include <sys/time.h>
@@ -52,24 +53,32 @@
#include <linux/cn_proc.h>
#define APP_NAME "forkstat"
-#define MAX_PIDS (32769) /* Hash Max PIDs */
+#define MAX_PIDS (32769) /* Hash Max PIDs */
-#define NULL_PID (-1)
-
-#define OPT_CMD_LONG (0x00000001)
-#define OPT_CMD_SHORT (0x00000002)
-#define OPT_CMD_DIRNAME_STRIP (0x00000004)
-#define OPT_STATS (0x00000008)
-#define OPT_QUIET (0x00000010)
-
-#define OPT_EV_FORK (0x00000100)
-#define OPT_EV_EXEC (0x00000200)
-#define OPT_EV_EXIT (0x00000400)
-#define OPT_EV_CORE (0x00000800)
-#define OPT_EV_COMM (0x00001000)
-#define OPT_EV_CLNE (0x00002000)
-#define OPT_EV_MASK (0x00003f00)
-#define OPT_EV_ALL (OPT_EV_MASK)
+#define NULL_PID (pid_t)(-1)
+#define NULL_UID (uid_t)(-1)
+#define NULL_GID (gid_t)(-1)
+#define NULL_TTY (dev_t)(-1)
+
+#define OPT_CMD_LONG (0x00000001) /* Long command line info */
+#define OPT_CMD_SHORT (0x00000002) /* Short command line info */
+#define OPT_CMD_DIRNAME_STRIP (0x00000004) /* Strip dirpath from command */
+#define OPT_STATS (0x00000008) /* Show stats at end of run */
+#define OPT_QUIET (0x00000010) /* Run quietly */
+#define OPT_REALTIME (0x00000020) /* Run with Real Time scheduling */
+#define OPT_EXTRA (0x00000040) /* Show extra stats */
+
+#define OPT_EV_FORK (0x00000100) /* Fork event */
+#define OPT_EV_EXEC (0x00000200) /* Exec event */
+#define OPT_EV_EXIT (0x00000400) /* Exit event */
+#define OPT_EV_CORE (0x00000800) /* Coredump event */
+#define OPT_EV_COMM (0x00001000) /* Comm proc info event */
+#define OPT_EV_CLNE (0x00002000) /* Clone event */
+#define OPT_EV_PTRC (0x00004000) /* Ptrace event */
+#define OPT_EV_UID (0x00008000) /* UID event */
+#define OPT_EV_SID (0x00010000) /* SID event */
+#define OPT_EV_MASK (0x0001ff00) /* Event mask */
+#define OPT_EV_ALL (OPT_EV_MASK) /* All events */
#define GOT_TGID (0x01)
#define GOT_PPID (0x02)
@@ -79,11 +88,13 @@
#define LINUX_VERSION_CODE KERNEL_VERSION(2,0,0)
#endif
-
/* /proc info cache */
typedef struct proc_info {
struct proc_info *next; /* next proc info in hashed linked list */
pid_t pid; /* Process ID */
+ uid_t uid; /* User ID */
+ gid_t gid; /* GUID */
+ dev_t tty; /* TTY dev */
char *cmdline; /* /proc/pid/cmdline text */
bool kernel_thread; /* true if a kernel thread */
struct timeval start; /* time when process started */
@@ -96,13 +107,16 @@
} kernel_task_info;
typedef enum {
- STAT_FORK = 0,
- STAT_EXEC,
- STAT_EXIT,
- STAT_CORE,
- STAT_COMM,
- STAT_CLNE,
- STAT_LAST
+ STAT_FORK = 0, /* Fork */
+ STAT_EXEC, /* Exec */
+ STAT_EXIT, /* Exit */
+ STAT_CORE, /* Core dump */
+ STAT_COMM, /* Proc comm field change */
+ STAT_CLNE, /* Clone */
+ STAT_PTRC, /* Ptrace */
+ STAT_UID, /* UID change */
+ STAT_SID, /* SID change */
+ STAT_LAST /* Always last sentinal */
} event_t;
typedef struct proc_stats {
@@ -127,6 +141,9 @@
{ "core", "Coredump", OPT_EV_CORE, STAT_CORE },
{ "comm", "Comm", OPT_EV_COMM, STAT_COMM },
{ "clone","Clone", OPT_EV_CLNE, STAT_CLNE },
+ { "ptrce","Ptrace", OPT_EV_PTRC, STAT_PTRC },
+ { "uid", "Uid", OPT_EV_UID, STAT_UID },
+ { "sid", "Sid", OPT_EV_SID, STAT_SID },
{ "all", "", OPT_EV_ALL, 0 },
{ NULL, NULL, 0, 0 }
};
@@ -144,6 +161,7 @@
/* Default void no process info struct */
static proc_info_t no_info = {
.pid = NULL_PID,
+ .uid = NULL_UID,
.cmdline = "<unknown>",
.kernel_thread = false,
.start = { 0, 0 },
@@ -206,6 +224,102 @@
static proc_info_t *proc_info_get(pid_t pid);
/*
+ * get_username()
+ * get username from a given user id
+ */
+static char *get_username(const uid_t uid)
+{
+ struct passwd *pwd;
+ static char buf[12];
+
+ pwd = getpwuid(uid);
+ if (pwd)
+ return pwd->pw_name;
+
+ snprintf(buf, sizeof(buf), "%d", uid);
+ return buf;
+}
+
+/*
+ * get_tty()
+ * get a TTY name with device ID dev
+ */
+static char *get_tty(const dev_t dev)
+{
+ DIR *dir;
+ struct dirent *dirent;
+ static char tty[16];
+
+ strncpy(tty, "?", sizeof(tty));
+
+ dir = opendir("/dev/pts");
+ if (!dir)
+ goto err;
+
+ while ((dirent = readdir(dir))) {
+ struct stat buf;
+ char path[PATH_MAX];
+
+ if (dirent->d_name[0] == '.')
+ continue;
+
+ snprintf(path, sizeof(path), "/dev/pts/%s", dirent->d_name);
+ if (stat(path, &buf) < 0)
+ continue;
+
+ if (buf.st_rdev == dev) {
+ snprintf(tty, sizeof(tty), "pts/%s", dirent->d_name);
+ break;
+ }
+ }
+
+ (void)closedir(dir);
+err:
+ return tty;
+}
+
+/*
+ * get_extra()
+ * quick and dirty way to get UID and GID from a PID,
+ * note that this does not cater of changes
+ * because of use of an effective ID.
+ */
+static void get_extra(const pid_t pid, proc_info_t *info)
+{
+ ssize_t ret;
+ long dev;
+ int fd;
+ char path[PATH_MAX];
+ char buffer[4096];
+ struct stat buf;
+
+ info->uid = NULL_UID;
+ info->gid = NULL_GID;
+ info->tty = NULL_TTY;
+
+ if (!(opt_flags & OPT_EXTRA))
+ return;
+
+ snprintf(path, sizeof(path), "/proc/%u/stat", pid);
+ fd = open(path, O_RDONLY);
+ if (fd < 0)
+ return;
+
+ if (fstat(fd, &buf) == 0) {
+ info->uid = buf.st_uid;
+ info->gid = buf.st_gid;
+ }
+
+ ret = read(fd, buffer, sizeof(buffer));
+ (void)close(fd);
+ if (ret < 0)
+ return;
+
+ if (sscanf(buffer, "%*d %*s %*s %*d %*d %*d %ld", &dev) == 1)
+ info->tty = (dev_t)dev;
+}
+
+/*
* pid_max_digits()
* determine (or guess) maximum digits of pids
*/
@@ -249,14 +363,15 @@
static pid_t get_parent_pid(const pid_t pid, bool *is_thread)
{
FILE *fp;
- char path[PATH_MAX];
- char buffer[4096];
pid_t tgid = 0, ppid = 0;
unsigned int got = 0;
+ char path[PATH_MAX];
+ char buffer[4096];
*is_thread = false;
snprintf(path, sizeof(path), "/proc/%u/status", pid);
- if ((fp = fopen(path, "r")) == NULL)
+ fp = fopen(path, "r");
+ if (!fp)
return 0;
while (((got & GOT_ALL) != GOT_ALL) &&
@@ -300,10 +415,10 @@
*/
static bool sane_proc_pid_info(void)
{
- FILE *fp;
static const char pattern[] = "container=";
- const char *ptr = pattern;
+ FILE *fp;
bool ret = true;
+ const char *ptr = pattern;
fp = fopen("/proc/1/environ", "r");
if (!fp)
@@ -344,7 +459,7 @@
} else {
/* In side a container, make a guess at kernel threads */
int i;
- pid_t pgid = getpgid(id);
+ const pid_t pgid = getpgid(id);
/* This fails for kernel threads inside a container */
if (pgid >= 0)
@@ -397,7 +512,7 @@
static int tty_height(void)
{
#ifdef TIOCGWINSZ
- int fd = 0;
+ const int fd = 0;
struct winsize ws;
/* if tty and we can get a sane width, return it */
@@ -423,8 +538,9 @@
pid_size = pid_max_digits();
- printf("Time Event %*.*s Info Duration Process\n",
- pid_size, pid_size, "PID");
+ printf("Time Event %*.*s %sInfo Duration Process\n",
+ pid_size, pid_size, "PID",
+ (opt_flags & OPT_EXTRA) ? " UID TTY " : "");
}
/*
@@ -433,7 +549,7 @@
*/
static void row_increment(void)
{
- int tty_rows = tty_height();
+ const int tty_rows = tty_height();
row++;
if ((tty_rows > 2) && (row >= tty_rows)) {
@@ -504,11 +620,11 @@
stats = stats->next;
}
stats = calloc(1, sizeof(*stats));
- if (stats == NULL)
+ if (!stats)
return; /* silently ignore */
stats->name = strdup(name);
- if (stats->name == NULL) {
+ if (!stats->name) {
free(stats);
return;
}
@@ -560,7 +676,7 @@
printf(" Total Process\n");
sorted = calloc(n, sizeof(proc_stats_t *));
- if (sorted == NULL) {
+ if (!sorted) {
fprintf(stderr, "Cannot sort statistics, out of memory.\n");
return;
}
@@ -609,9 +725,9 @@
*/
static char *proc_comm(const pid_t pid)
{
- char buffer[4096];
int fd;
ssize_t ret;
+ char buffer[4096];
snprintf(buffer, sizeof(buffer), "/proc/%d/comm", pid);
if ((fd = open(buffer, O_RDONLY)) < 0) {
@@ -632,17 +748,17 @@
*/
static char *proc_cmdline(const pid_t pid)
{
- char buffer[4096];
char *ptr;
int fd;
ssize_t ret;
+ char buffer[4096];
snprintf(buffer, sizeof(buffer), "/proc/%d/cmdline", pid);
if ((fd = open(buffer, O_RDONLY)) < 0) {
return proc_comm(pid);
}
- memset(buffer, 0, sizeof(buffer));
+ (void)memset(buffer, 0, sizeof(buffer));
if ((ret = read(fd, buffer, sizeof(buffer) - 1)) <= 0) {
(void)close(fd);
return proc_comm(pid);
@@ -686,11 +802,11 @@
*/
static proc_info_t *proc_info_get(const pid_t pid)
{
- size_t i = proc_info_hash(pid);
+ const size_t i = proc_info_hash(pid);
proc_info_t *info = proc_info[i];
while (info) {
- if (proc_info[i]->pid == pid)
+ if (info->pid == pid)
return info;
info = info->next;
}
@@ -703,12 +819,14 @@
*/
static void proc_info_free(const pid_t pid)
{
- size_t i = proc_info_hash(pid);
+ const size_t i = proc_info_hash(pid);
proc_info_t *info = proc_info[i];
while (info) {
if (info->pid == pid) {
info->pid = NULL_PID;
+ info->uid = NULL_UID;
+ info->gid = NULL_GID;
free(info->cmdline);
info->cmdline = NULL;
return;
@@ -748,7 +866,8 @@
if (info == &no_info)
return &no_info;
- if ((newcmd = proc_cmdline(pid)) == NULL)
+ newcmd = proc_cmdline(pid);
+ if (!newcmd)
return &no_info;
free(info->cmdline);
@@ -763,7 +882,7 @@
*/
static proc_info_t *proc_info_add(const pid_t pid, struct timeval *tv)
{
- size_t i = proc_info_hash(pid);
+ const size_t i = proc_info_hash(pid);
proc_info_t *info;
char *cmdline;
@@ -779,8 +898,9 @@
info = info->next;
}
- if (info == NULL) {
- if ((info = calloc(1, sizeof(proc_info_t))) == NULL) {
+ if (!info) {
+ info = calloc(1, sizeof(proc_info_t));
+ if (!info) {
fprintf(stderr, "Cannot allocate all proc info\n");
free(cmdline);
return NULL;
@@ -790,6 +910,7 @@
}
info->cmdline = cmdline;
info->pid = pid;
+ get_extra(pid, info);
info->kernel_thread = pid_a_kernel_thread(cmdline, pid);
if (tv)
@@ -814,7 +935,8 @@
snprintf(path, sizeof(path), "/proc/%i/task", pid);
- if ((dir = opendir(path)) == NULL)
+ dir = opendir(path);
+ if (!dir)
return;
while ((dirent = readdir(dir))) {
@@ -840,7 +962,8 @@
DIR *dir;
struct dirent *dirent;
- if ((dir = opendir("/proc")) == NULL)
+ dir = opendir("/proc");
+ if (!dir)
return -1;
while ((dirent = readdir(dir))) {
@@ -860,6 +983,24 @@
return 0;
}
+static char *extra_info(const uid_t uid)
+{
+ static char buf[20];
+
+ *buf = '\0';
+ if (opt_flags & OPT_EXTRA) {
+ const proc_info_t *info = proc_info_get(uid);
+
+ if (info && info->uid != NULL_UID)
+ snprintf(buf, sizeof(buf), "%6d %-6.6s ", info->uid, get_tty(info->tty));
+ else
+ snprintf(buf, sizeof(buf), "%14s", "");
+ }
+
+ return buf;
+}
+
+
/*
* handle_sig()
* catch signal and flag a stop
@@ -887,7 +1028,7 @@
return -1;
}
- memset(&addr, 0, sizeof(addr));
+ (void)memset(&addr, 0, sizeof(addr));
addr.nl_pid = getpid();
addr.nl_family = AF_NETLINK;
addr.nl_groups = CN_IDX_PROC;
@@ -908,19 +1049,19 @@
*/
static int netlink_listen(const int sock)
{
- struct iovec iov[3];
+ enum proc_cn_mcast_op op;
struct nlmsghdr nlmsghdr;
struct cn_msg cn_msg;
- enum proc_cn_mcast_op op;
+ struct iovec iov[3];
- memset(&nlmsghdr, 0, sizeof(nlmsghdr));
+ (void)memset(&nlmsghdr, 0, sizeof(nlmsghdr));
nlmsghdr.nlmsg_len = NLMSG_LENGTH(sizeof(cn_msg) + sizeof(op));
nlmsghdr.nlmsg_pid = getpid();
nlmsghdr.nlmsg_type = NLMSG_DONE;
iov[0].iov_base = &nlmsghdr;
iov[0].iov_len = sizeof(nlmsghdr);
- memset(&cn_msg, 0, sizeof(cn_msg));
+ (void)memset(&cn_msg, 0, sizeof(cn_msg));
cn_msg.id.idx = CN_IDX_PROC;
cn_msg.id.val = CN_VAL_PROC;
cn_msg.len = sizeof(enum proc_cn_mcast_op);
@@ -935,34 +1076,6 @@
}
/*
- * set_prioity
- * set high priority to try and get netlink activty
- * before short lived processes die
- */
-static void set_priority(void)
-{
- int max;
- struct sched_param param;
- int sched;
-
-#if defined(SCHED_DEADLINE)
- sched = SCHED_DEADLINE;
-#elif defined(SCHED_SCHED_FIFO)
- sched = SCHED_FIFO;
-#elif defined(SCHED_RR)
- sched = SCHED_FIFO;
-#else
- sched = SCHED_OTHER; /* Oh well */
-#endif
- if ((max = sched_get_priority_max(sched)) < 0)
- return;
-
- memset(¶m, 0, sizeof(param));
- param.sched_priority = max;
- (void)sched_setscheduler(getpid(), sched, ¶m);
-}
-
-/*
* monitor()
* monitor system activity
*/
@@ -972,7 +1085,6 @@
const int pid_size = pid_max_digits();
print_heading();
- set_priority();
while (!stop_recv) {
ssize_t len;
@@ -982,7 +1094,8 @@
return 0;
}
if (len == -1) {
- int err = errno;
+ const int err = errno;
+
switch (err) {
case EINTR:
return 0;
@@ -1020,7 +1133,7 @@
struct tm tm;
char when[10];
time_t now;
- pid_t ppid;
+ pid_t pid, ppid;
bool is_thread;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14)
@@ -1059,32 +1172,35 @@
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14)
case PROC_EVENT_FORK:
ppid = get_parent_pid(proc_ev->event_data.fork.child_pid, &is_thread);
+ pid = proc_ev->event_data.fork.child_pid;
proc_stats_account(proc_ev->event_data.fork.parent_pid,
is_thread ? STAT_CLNE : STAT_FORK);
if (gettimeofday(&tv, NULL) < 0) {
- memset(&tv, 0, sizeof tv);
+ (void)memset(&tv, 0, sizeof tv);
}
info1 = proc_info_get(ppid);
- info2 = proc_info_add(proc_ev->event_data.fork.child_pid, &tv);
+ info2 = proc_info_add(pid, &tv);
if (!(opt_flags & OPT_QUIET) &&
(((opt_flags & OPT_EV_FORK) && !is_thread) ||
((opt_flags & OPT_EV_CLNE) && is_thread))) {
if (info1 != NULL && info2 != NULL) {
char *type = is_thread ? "clone" : "fork";
row_increment();
- printf("%s %-5.5s %*d parent %8s %s%s%s\n",
+ printf("%s %-5.5s %*d %sparent %8s %s%s%s\n",
when,
type,
pid_size, ppid,
+ extra_info(ppid),
"",
info1->kernel_thread ? "[" : "",
info1->cmdline,
info1->kernel_thread ? "]" : "");
row_increment();
- printf("%s %-5.5s %*d %-6.6s %8s %s%s%s\n",
+ printf("%s %-5.5s %*d %s%6.6s %8s %s%s%s\n",
when,
type,
- pid_size, proc_ev->event_data.fork.child_pid,
+ pid_size, pid,
+ extra_info(pid),
is_thread ? "thread" : "child",
"",
info1->kernel_thread ? "[" : "",
@@ -1095,12 +1211,14 @@
break;
case PROC_EVENT_EXEC:
proc_stats_account(proc_ev->event_data.exec.process_pid, STAT_EXEC);
- info1 = proc_info_update(proc_ev->event_data.exec.process_pid);
+ pid = proc_ev->event_data.exec.process_pid;
+ info1 = proc_info_update(pid);
if (!(opt_flags & OPT_QUIET) && (opt_flags & OPT_EV_EXEC)) {
row_increment();
- printf("%s exec %*d %8s %s%s%s\n",
+ printf("%s exec %*d %s %8s %s%s%s\n",
when,
- pid_size, proc_ev->event_data.exec.process_pid,
+ pid_size, pid,
+ extra_info(pid),
"",
info1->kernel_thread ? "[" : "",
info1->cmdline,
@@ -1110,12 +1228,13 @@
case PROC_EVENT_EXIT:
proc_stats_account(proc_ev->event_data.exit.process_pid, STAT_EXIT);
if (!(opt_flags & OPT_QUIET) && (opt_flags & OPT_EV_EXIT)) {
- info1 = proc_info_get(proc_ev->event_data.exit.process_pid);
+ pid = proc_ev->event_data.exit.process_pid;
+ info1 = proc_info_get(pid);
if (info1->start.tv_sec) {
double d1, d2;
if (gettimeofday(&tv, NULL) < 0) {
- memset(&tv, 0, sizeof tv);
+ (void)memset(&tv, 0, sizeof tv);
}
d1 = timeval_to_double(&info1->start);
d2 = timeval_to_double(&tv);
@@ -1124,9 +1243,10 @@
snprintf(duration, sizeof(duration), "unknown");
}
row_increment();
- printf("%s exit %*d %5d %8s %s%s%s\n",
+ printf("%s exit %*d %s%6d %8s %s%s%s\n",
when,
- pid_size, proc_ev->event_data.exit.process_pid,
+ pid_size, pid,
+ extra_info(pid),
proc_ev->event_data.exit.exit_code,
duration,
info1->kernel_thread ? "[" : "",
@@ -1135,16 +1255,64 @@
}
proc_info_free(proc_ev->event_data.exit.process_pid);
break;
+ case PROC_EVENT_UID:
+ proc_stats_account(proc_ev->event_data.exec.process_pid, STAT_UID);
+ info1 = proc_info_update(proc_ev->event_data.exec.process_pid);
+ if (!(opt_flags & OPT_QUIET) && (opt_flags & OPT_EV_UID)) {
+ row_increment();
+ pid = proc_ev->event_data.exec.process_pid;
+ if (proc_ev->what == PROC_EVENT_UID) {
+ printf("%s uid %*d %s%6s %8s %s%s%s\n",
+ when,
+ pid_size, pid,
+ extra_info(pid),
+ get_username(proc_ev->event_data.id.e.euid),
+ "",
+ info1->kernel_thread ? "[" : "",
+ info1->cmdline,
+ info1->kernel_thread ? "]" : "");
+ } else {
+ printf("%s gid %*d %6s %s%8s %s%s%s\n",
+ when,
+ pid_size, pid,
+ extra_info(pid),
+ get_username(proc_ev->event_data.id.e.euid),
+ "",
+ info1->kernel_thread ? "[" : "",
+ info1->cmdline,
+ info1->kernel_thread ? "]" : "");
+ }
+ }
+ break;
+ case PROC_EVENT_SID:
+ proc_stats_account(proc_ev->event_data.exec.process_pid, STAT_SID);
+ info1 = proc_info_update(proc_ev->event_data.exec.process_pid);
+ if (!(opt_flags & OPT_QUIET) && (opt_flags & OPT_EV_UID)) {
+ row_increment();
+ pid = proc_ev->event_data.exec.process_pid;
+ printf("%s sid %*d %s%6d %8s %s%s%s\n",
+ when,
+ pid_size, pid,
+ extra_info(pid),
+ proc_ev->event_data.sid.process_pid,
+ "",
+ info1->kernel_thread ? "[" : "",
+ info1->cmdline,
+ info1->kernel_thread ? "]" : "");
+ }
+ break;
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)
case PROC_EVENT_COREDUMP:
proc_stats_account(proc_ev->event_data.coredump.process_pid, STAT_CORE);
if (!(opt_flags & OPT_QUIET) && (opt_flags & OPT_EV_CORE)) {
- info1 = proc_info_get(proc_ev->event_data.coredump.process_pid);
+ pid = proc_ev->event_data.coredump.process_pid;
+ info1 = proc_info_get(pid);
row_increment();
- printf("%s core %*d %8s %s%s%s\n",
+ printf("%s core %*d %s %8s %s%s%s\n",
when,
- pid_size, proc_ev->event_data.exit.process_pid,
+ pid_size, pid,
+ extra_info(pid),
"",
info1->kernel_thread ? "[" : "",
info1->cmdline,
@@ -1152,19 +1320,47 @@
}
break;
#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0)
+ case PROC_EVENT_PTRACE:
+ proc_stats_account(proc_ev->event_data.comm.process_pid, STAT_PTRC);
+ if (!(opt_flags & OPT_QUIET) && (opt_flags & OPT_EV_PTRC)) {
+ const bool attach = (proc_ev->event_data.ptrace.tracer_pid != 0);
+
+#if 0
+ pid = attach ? proc_ev->event_data.ptrace.tracer_pid :
+ proc_ev->event_data.ptrace.process_pid;
+#else
+ pid = proc_ev->event_data.ptrace.process_pid;
+#endif
+ info1 = proc_info_get(pid);
+ row_increment();
+ printf("%s ptrce %*d %s%6s %8s %s%s%s\n",
+ when,
+ pid_size, pid,
+ extra_info(pid),
+ attach ? "attach" : "detach",
+ "",
+ info1->kernel_thread ? "[" : "",
+ attach ? info1->cmdline : "",
+ info1->kernel_thread ? "]" : "");
+ }
+ break;
+#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)
case PROC_EVENT_COMM:
proc_stats_account(proc_ev->event_data.comm.process_pid, STAT_COMM);
if (!(opt_flags & OPT_QUIET) && (opt_flags & OPT_EV_COMM)) {
- info1 = proc_info_get(proc_ev->event_data.comm.process_pid);
- comm = proc_comm(proc_ev->event_data.comm.process_pid);
- if (comm == NULL)
+ pid = proc_ev->event_data.comm.process_pid;
+ info1 = proc_info_get(pid);
+ comm = proc_comm(pid);
+ if (!comm)
break;
row_increment();
- printf("%s comm %*d %8s %s%s%s -> %s\n",
+ printf("%s comm %*d %s %8s %s%s%s -> %s\n",
when,
- pid_size, proc_ev->event_data.exit.process_pid,
+ pid_size, pid,
+ extra_info(pid),
"",
info1->kernel_thread ? "[" : "",
info1->cmdline,
@@ -1190,14 +1386,15 @@
{
printf("%s, version %s\n\n", APP_NAME, VERSION);
printf("usage: %s [-d|-D|-e|-h|-l|-s|-S|-q]\n", argv[0]);
- printf("-d\tstrip off directory path from process name.\n");
- printf("-D\tspecify run duration in seconds.\n");
- printf("-e\tselect which events to monitor.\n");
- printf("-h\tshow this help.\n");
- printf("-l\tforce stdout line buffering.\n");
- printf("-s\tshow short process name.\n");
- printf("-S\tshow event statistics at end of the run.\n");
- printf("-q\trun quietly and enable -S option.\n");
+ printf("-d\tstrip off directory path from process name.\n"
+ "-D\tspecify run duration in seconds.\n"
+ "-e\tselect which events to monitor.\n"
+ "-h\tshow this help.\n"
+ "-l\tforce stdout line buffering.\n"
+ "-r\trun with real time FIFO scheduler.\n"
+ "-s\tshow short process name.\n"
+ "-S\tshow event statistics at end of the run.\n"
+ "-q\trun quietly and enable -S option.\n");
}
/*
@@ -1219,7 +1416,10 @@
}
}
if (!found) {
- fprintf(stderr, "Unknown event '%s'.\n", token);
+ fprintf(stderr, "Unknown event '%s'. Allowed events:", token);
+ for (i = 0; ev_map[i].event; i++)
+ printf(" %s", ev_map[i].event);
+ printf("\n");
return -1;
}
}
@@ -1233,7 +1433,7 @@
struct sigaction new_action;
for (;;) {
- int c = getopt(argc, argv, "dD:e:hlsSq");
+ const int c = getopt(argc, argv, "dD:e:hlrsSqx");
if (c == -1)
break;
switch (c) {
@@ -1254,6 +1454,9 @@
case 'h':
show_help(argv);
exit(EXIT_SUCCESS);
+ case 'r':
+ opt_flags |= OPT_REALTIME;
+ break;
case 's':
opt_flags &= ~OPT_CMD_LONG;
opt_flags |= OPT_CMD_SHORT;
@@ -1270,6 +1473,9 @@
exit(EXIT_FAILURE);
}
break;
+ case 'x':
+ opt_flags |= OPT_EXTRA;
+ break;
default:
show_help(argv);
exit(EXIT_FAILURE);
@@ -1277,14 +1483,14 @@
}
if ((opt_flags & OPT_EV_MASK) == 0)
- opt_flags |= (OPT_EV_FORK | OPT_EV_EXEC | OPT_EV_EXIT | OPT_EV_CLNE);
+ opt_flags |= (OPT_EV_FORK | OPT_EV_EXEC | OPT_EV_EXIT | OPT_EV_CLNE | OPT_EV_PTRC);
if (geteuid() != 0) {
fprintf(stderr, "Need to run with root access.\n");
goto abort_sock;
}
- memset(&new_action, 0, sizeof(new_action));
+ (void)memset(&new_action, 0, sizeof(new_action));
for (i = 0; signals[i] != -1; i++) {
new_action.sa_handler = handle_sig;
sigemptyset(&new_action.sa_mask);
@@ -1304,6 +1510,27 @@
goto abort_sock;
}
+ if (opt_flags & OPT_REALTIME) {
+ struct sched_param param;
+ int max_prio;
+ const int policy = SCHED_FIFO;
+
+ max_prio = sched_get_priority_max(policy);
+ if (max_prio < 0) {
+ fprintf(stderr, "sched_get_priority_max failed: errno=%d (%s)\n",
+ errno, strerror(errno));
+ goto abort_sock;
+ }
+
+ (void)memset(¶m, 0, sizeof(param));
+ param.sched_priority = max_prio;
+ if (sched_setscheduler(getpid(), policy, ¶m) < 0) {
+ fprintf(stderr, "sched_setscheduler failed: errno=%d (%s)\n",
+ errno, strerror(errno));
+ goto abort_sock;
+ }
+ }
+
sock = netlink_connect();
if (sock == -EPROTONOSUPPORT) {
fprintf(stderr, "Cannot show process activity with this kernel, netlink required.\n");
1
0
Hello community,
here is the log from the commit of package terminus-bitmap-fonts for openSUSE:Factory checked in at 2017-06-27 10:21:44
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/terminus-bitmap-fonts (Old)
and /work/SRC/openSUSE:Factory/.terminus-bitmap-fonts.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "terminus-bitmap-fonts"
Tue Jun 27 10:21:44 2017 rev:12 rq:506320 version:4.46
Changes:
--------
--- /work/SRC/openSUSE:Factory/terminus-bitmap-fonts/terminus-bitmap-fonts.changes 2017-04-14 13:40:52.396661034 +0200
+++ /work/SRC/openSUSE:Factory/.terminus-bitmap-fonts.new/terminus-bitmap-fonts.changes 2017-06-27 10:21:52.718053589 +0200
@@ -1,0 +2,18 @@
+Mon Jun 26 18:13:58 UTC 2017 - aloisio(a)gmx.com
+
+- Update to version 4.46
+ * The X11 8-bit code pages are not installed by default.
+ * Added IBM-437 8-bit code page for X11.
+ * The CRT VGA weight for Linux console is not installed by default.
+ * Removed the Linux console mapping files.
+ * These should be provided by the console packages.
+ * Removed the BSD console installation.
+ * The recent BSD-s have a new console subsystem.
+ * Added 50 new characters. Mostly math, but also Buglarian yat and yus.
+ * Rewritten the font conversion tools in python/javascript.
+ * The full unicode range (17x64K) is now supported.
+ * The Windows installer can be built from sources.
+ * Small fixes and improvements (7 characters in various sizes).
+ * Renamed install-ref to install-psf-ref (uninstall too).
+
+-------------------------------------------------------------------
Old:
----
terminus-font-4.40.tar.gz
New:
----
terminus-font-4.46.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ terminus-bitmap-fonts.spec ++++++
--- /var/tmp/diff_new_pack.ovn76E/_old 2017-06-27 10:21:53.321968235 +0200
+++ /var/tmp/diff_new_pack.ovn76E/_new 2017-06-27 10:21:53.321968235 +0200
@@ -19,7 +19,7 @@
%define fontname terminus-font
Name: terminus-bitmap-fonts
-Version: 4.40
+Version: 4.46
Release: 0
Summary: Readable Fixed Width Fonts for X11 and the Linux Console
License: OFL-1.1
@@ -36,6 +36,7 @@
%endif
BuildRequires: dos2unix
BuildRequires: fontpackages-devel
+BuildRequires: python3-devel
%reconfigure_fonts_prereq
Provides: terminus-font
Provides: locale(ru;bg)
++++++ terminus-font-4.40.tar.gz -> terminus-font-4.46.tar.gz ++++++
++++ 180417 lines of diff (skipped)
1
0
Hello community,
here is the log from the commit of package lua-lmod for openSUSE:Factory checked in at 2017-06-27 10:21:41
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/lua-lmod (Old)
and /work/SRC/openSUSE:Factory/.lua-lmod.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "lua-lmod"
Tue Jun 27 10:21:41 2017 rev:4 rq:506289 version:6.5.11
Changes:
--------
--- /work/SRC/openSUSE:Factory/lua-lmod/lua-lmod.changes 2017-06-12 15:34:28.279101016 +0200
+++ /work/SRC/openSUSE:Factory/.lua-lmod.new/lua-lmod.changes 2017-06-27 10:21:51.786185295 +0200
@@ -1,0 +2,5 @@
+Mon Jun 26 08:55:33 UTC 2017 - dmueller(a)suse.com
+
+- correct buildrequires for building on Leap 42.3 and on SLE15+
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ lua-lmod.spec ++++++
--- /var/tmp/diff_new_pack.TRi9XT/_old 2017-06-27 10:21:52.518081852 +0200
+++ /var/tmp/diff_new_pack.TRi9XT/_new 2017-06-27 10:21:52.522081287 +0200
@@ -52,15 +52,15 @@
BuildRequires: python-Sphinx
BuildRequires: rsync
BuildRequires: tcl
-%if 0%{?sle_version} == 0 || 0%{?sle_version} > 121000
-BuildRequires: python-Sphinx-latex
-%endif
BuildRequires: texlive
BuildRequires: texlive-babel
BuildRequires: texlive-babel-english
+BuildRequires: texlive-capt-of
+BuildRequires: texlive-caption
BuildRequires: texlive-cmap
BuildRequires: texlive-courier
BuildRequires: texlive-dvips
+BuildRequires: texlive-eqparbox
BuildRequires: texlive-fancybox
BuildRequires: texlive-fancyhdr
BuildRequires: texlive-fancyvrb
@@ -68,6 +68,7 @@
BuildRequires: texlive-helvetic
BuildRequires: texlive-mdwtools
BuildRequires: texlive-multirow
+BuildRequires: texlive-needspace
BuildRequires: texlive-parskip
BuildRequires: texlive-psnfss
BuildRequires: texlive-threeparttable
@@ -75,12 +76,14 @@
BuildRequires: texlive-titlesec
BuildRequires: texlive-upquote
BuildRequires: texlive-wrapfig
-
Requires: lua >= %{lua_version}
Requires: lua-luafilesystem
Requires: lua-luaposix
Requires: lua-luaterm
Requires: tcl
+%if 0%{?is_opensuse} || 0%{?sle_version} >= 150000
+BuildRequires: python-Sphinx-latex
+%endif
%description
Lmod is an Environment Module System based on Lua, Reads TCL Modules,
1
0
Hello community,
here is the log from the commit of package python-botocore for openSUSE:Factory checked in at 2017-06-27 10:21:36
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-botocore (Old)
and /work/SRC/openSUSE:Factory/.python-botocore.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-botocore"
Tue Jun 27 10:21:36 2017 rev:17 rq:506281 version:1.5.67
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-botocore/python-botocore.changes 2017-06-15 11:26:08.160168964 +0200
+++ /work/SRC/openSUSE:Factory/.python-botocore.new/python-botocore.changes 2017-06-27 10:21:49.954444184 +0200
@@ -6 +6 @@
- https://github.com/boto/botocore/blob/develop/CHANGELOG.rst
+ https://github.com/boto/botocore/blob/1.5.67/CHANGELOG.rst
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
1
0
27 Jun '17
Hello community,
here is the log from the commit of package epson-inkjet-printer-escpr for openSUSE:Factory checked in at 2017-06-27 10:21:33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/epson-inkjet-printer-escpr (Old)
and /work/SRC/openSUSE:Factory/.epson-inkjet-printer-escpr.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "epson-inkjet-printer-escpr"
Tue Jun 27 10:21:33 2017 rev:21 rq:506265 version:1.6.13
Changes:
--------
--- /work/SRC/openSUSE:Factory/epson-inkjet-printer-escpr/epson-inkjet-printer-escpr.changes 2017-04-30 21:23:48.537452026 +0200
+++ /work/SRC/openSUSE:Factory/.epson-inkjet-printer-escpr.new/epson-inkjet-printer-escpr.changes 2017-06-27 10:21:47.734757905 +0200
@@ -1,0 +2,11 @@
+Sun Jun 18 16:31:54 UTC 2017 - bwiedemann(a)suse.com
+
+- call gzip -n to make build fully reproducible
+
+-------------------------------------------------------------------
+Mon Jun 12 22:31:03 UTC 2017 - nico.kruber(a)gmail.com
+
+- add bug_x86_64.patch which should fix the segfault that some
+ users are experiencing
+
+-------------------------------------------------------------------
New:
----
bug_x86_64.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ epson-inkjet-printer-escpr.spec ++++++
--- /var/tmp/diff_new_pack.kiGIpn/_old 2017-06-27 10:21:48.614633548 +0200
+++ /var/tmp/diff_new_pack.kiGIpn/_new 2017-06-27 10:21:48.618632982 +0200
@@ -51,6 +51,9 @@
License: GPL-2.0
Group: Hardware/Printing
Source0: epson-inkjet-printer-escpr-%{version}-1lsb3.2.tar.gz
+# PATCH-FIX-UPSTREAM bug_x86_64.patch -- fix a segfault on x64_64 (probably manifested with GCC7 use)
+# https://aur.archlinux.org/cgit/aur.git/plain/bug_x86_64.patch?h=epson-inkje…
+Patch0: bug_x86_64.patch
# This software is a filter program used with CUPS:
Requires: cups
# Install into this non-root directory (required when norootforbuild is used):
@@ -75,6 +78,7 @@
%prep
# Be quiet when unpacking:
%setup -q
+%patch0 -p1
%build
# Set our preferred architecture-specific flags for the compiler and linker:
@@ -119,7 +123,7 @@
for p in *.ppd
do echo -n "$p: "
grep -E -v '^\*UIConstraints:|^\*NonUIConstraints:|^\*cupsFilter:' $p | cupstestppd - || true
- gzip $p
+ gzip -n9 $p
done
# Switch back to the usual build log messages:
set -x
++++++ bug_x86_64.patch ++++++
diff -Naur epson-inkjet-printer-escpr-1.6.9/src/filter.c epson-inkjet-printer-escpr-1.6.9-fixed/src/filter.c
--- epson-inkjet-printer-escpr-1.6.9/src/filter.c 2016-09-21 03:55:30.000000000 +0200
+++ epson-inkjet-printer-escpr-1.6.9-fixed/src/filter.c 2016-10-07 22:07:23.965463021 +0200
@@ -34,6 +34,8 @@
#include "epson-protocol.h"
#include "epson-escpr-api.h"
#include "epson-escpr-mem.h"
+#include "epson-escpr-services.h"
+#include "epson-escpage.h"
#include "err.h"
#include "mem.h"
@@ -42,6 +44,11 @@
#include "libprtX.h"
#include "optBase.h"
#include "linux_cmn.h"
+#include "xfifo.h"
+
+extern EPS_ERR_CODE SetupJobAttrib (const EPS_JOB_ATTRIB*);
+extern EPS_ERR_CODE SendStartJob ();
+extern EPS_ERR_CODE PrintBand (const EPS_UINT8*, EPS_UINT32, EPS_UINT32*);
#define WIDTH_BYTES(bits) (((bits) + 31) / 32 * 4)
@@ -380,10 +387,10 @@
}else{
debug_msg("pageStartJob() success");
}
-
+
printJob.jobStatus = EPS_STATUS_ESTABLISHED;
- int printHeight = 0;
-///////////////////////////////////////////////////////////////////////////////////////////////////////////
+ EPS_UINT32 printHeight = 0;
+///////////////////////////////////////////////////////////////////////////////////////////////////////////
print_area_x = printJob.printableAreaWidth;
print_area_y = printJob.printableAreaHeight;
@@ -535,7 +542,7 @@
memcpy(rever_buf + k*3, startpage + pos + (bandBmp.widthBytes - 6) - k*3, 3);
}
}
- PrintBand (rever_buf, bandBmp.widthBytes, &printHeight);
+ PrintBand ((const EPS_UINT8 *)rever_buf, bandBmp.widthBytes, &printHeight);
pos -= bandBmp.widthBytes;
}
@@ -642,17 +649,17 @@
}
}
}
-
+
band_line_count ++;
-
+
if (band_line_count >= band_line)
{
printHeight = band_line_count;
PrintBand (bandBmp.bits, bandBmp.widthBytes, &printHeight);
#if (HAVE_PPM)
fp = fopen(ppmfilename, "a+");
- int i=0;
- for(i=0; i<bytes_per_line/byte_par_pixel*3; i++){
+ int i=0;
+ for(i=0; i<bytes_per_line/byte_par_pixel*3; i++){
fprintf(fp, "%u ", (unsigned char)bandBmp.Bits[i]);
}
fprintf(fp, "\n");
@@ -831,7 +838,7 @@
/* Get number of pages */
char page_num;
- read (STDIN_FILENO, &page_num, 1);
+ (void)read (STDIN_FILENO, &page_num, 1);
/* Others */
jobAttr.apfAutoCorrect = EPS_APF_ACT_STANDARD;
@@ -881,7 +888,7 @@
// fwrite (pBuf, cbBuf, 1, outfp);
- XFIFOWrite(context, pBuf, cbBuf);
+ XFIFOWrite(context, (char *)pBuf, cbBuf);
return 1;
}
diff -Naur epson-inkjet-printer-escpr-1.6.9/src/mem.c epson-inkjet-printer-escpr-1.6.9-fixed/src/mem.c
--- epson-inkjet-printer-escpr-1.6.9/src/mem.c 2016-09-21 03:55:30.000000000 +0200
+++ epson-inkjet-printer-escpr-1.6.9-fixed/src/mem.c 2016-10-07 22:07:59.519366574 +0200
@@ -24,6 +24,7 @@
#include <stdlib.h>
#include "mem.h"
+#include "err.h"
void *
mem_malloc (unsigned int size, bool_t crit)
1
0
Hello community,
here is the log from the commit of package gri for openSUSE:Factory checked in at 2017-06-27 10:21:31
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/gri (Old)
and /work/SRC/openSUSE:Factory/.gri.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "gri"
Tue Jun 27 10:21:31 2017 rev:14 rq:506249 version:2.12.23
Changes:
--------
--- /work/SRC/openSUSE:Factory/gri/gri.changes 2016-03-17 16:47:25.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.gri.new/gri.changes 2017-06-27 10:21:45.935012272 +0200
@@ -0,0 +1,9 @@
+
+-------------------------------------------------------------------
+Mon Jun 26 09:44:40 UTC 2017 - badshah400(a)gmail.com
+
+- Add gri-invalid-char-to-pointer.patch: Fix a char to char*
+ conversion by replacing '\0' with NULL.
+- Cleanup spec file by removing conditionals for outdated openSUSE
+ versions, running spec-cleaner.
+
New:
----
gri-invalid-char-to-pointer.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ gri.spec ++++++
--- /var/tmp/diff_new_pack.yf2bVT/_old 2017-06-27 10:21:46.918873218 +0200
+++ /var/tmp/diff_new_pack.yf2bVT/_new 2017-06-27 10:21:46.918873218 +0200
@@ -1,7 +1,7 @@
#
# spec file for package gri
#
-# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 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
@@ -28,19 +28,17 @@
Patch1: gri-texinfo-5.0.patch
# PATCH-FIX-UPSTREAM https://github.com/dankelley/gri/pull/10
Patch2: reproducible.patch
+# PATCH-FIX-UPSTREAM gri-invalid-char-to-pointer.patch badshah400(a)gmail.com -- Fix a char to char* conversion by replacing '\0' with NULL
+Patch3: gri-invalid-char-to-pointer.patch
BuildRequires: ImageMagick
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: readline-devel
BuildRequires: texinfo
-%if %suse_version <= 1220
-BuildRequires: texlive
-%else
BuildRequires: texlive-dvips
-%endif
BuildRequires: perl(Time::CTime)
-BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires(post): /sbin/install-info
+BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
Gri is a language for scientific graphics programming. It is a
@@ -63,24 +61,19 @@
%patch0
%patch1 -p1
%patch2 -p1
+%patch3 -p1
%build
%configure
-%__make
+# Parallel make does not work
+make
%install
-%if 0%{sles_version}
-%makeinstall DESTDIR=%{buildroot}
-%else
%make_install DESTDIR=%{buildroot}
-%endif
# drop timestamp from texinfo
sed -i "s/<!-- [A-Z].. [A-Z].. .. ..:..:.. .... -->//" %{buildroot}%{_datadir}/%{name}/doc/html/index.html
%fdupes %{buildroot}%{_datadir}/%{name}/
-%clean
-%{?buildroot:rm -rf %{buildroot}}
-
%post
/sbin/install-info %{_infodir}/gri.info %{_infodir}/dir
++++++ gri-invalid-char-to-pointer.patch ++++++
Index: gri-2.12.23/src/query.cc
===================================================================
--- gri-2.12.23.orig/src/query.cc
+++ gri-2.12.23/src/query.cc
@@ -56,7 +56,7 @@ queryCmd()
if (!find_hint_and_def(hint, def)) {
return false;
}
- def_word[0] = '\0';
+ def_word[0] = NULL;
chop_into_words(def, def_word, &def_words, NCHAR);
// Strip off double-quotes form list of defaults
for (unsigned int i = 0; i < def_words; i++) {
1
0
Hello community,
here is the log from the commit of package obs-service-tar_scm for openSUSE:Factory checked in at 2017-06-27 10:21:29
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/obs-service-tar_scm (Old)
and /work/SRC/openSUSE:Factory/.obs-service-tar_scm.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "obs-service-tar_scm"
Tue Jun 27 10:21:29 2017 rev:43 rq:506248 version:0.7.0.1497870887.fa1750b
Changes:
--------
--- /work/SRC/openSUSE:Factory/obs-service-tar_scm/obs-service-tar_scm.changes 2017-06-16 10:54:17.731619562 +0200
+++ /work/SRC/openSUSE:Factory/.obs-service-tar_scm.new/obs-service-tar_scm.changes 2017-06-27 10:21:44.423225941 +0200
@@ -1,0 +2,6 @@
+Mon Jun 19 11:16:11 UTC 2017 - adrian(a)suse.de
+
+- Update to version 0.7.0.1497261741.b1aa4cb:
+ * Move spec file to git
+
+-------------------------------------------------------------------
@@ -6,6 +11,0 @@
- * [lint] improve inline doc in TarSCM/tasks.py
- * [lint] refactor attribute dataMap in TarSCM.tasks
- * [lint] refactor invalid variable names in TarSCM.tasks
- * [lint] remove variable helpers from TarSCM.tasks
- * [lint] rename variable changes -> detected_changes in TarSCM.tasks
- * [lint] fixed 'line-to-long' error in TarSCM.tasks
Old:
----
obs-service-tar_scm-0.7.0.1496831936.d960322.tar.gz
New:
----
obs-service-tar_scm-0.7.0.1497870887.fa1750b.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ obs-service-tar_scm.spec ++++++
--- /var/tmp/diff_new_pack.VX43Sb/_old 2017-06-27 10:21:45.323098757 +0200
+++ /var/tmp/diff_new_pack.VX43Sb/_new 2017-06-27 10:21:45.327098192 +0200
@@ -19,8 +19,8 @@
%bcond_without obs_scm_testsuite
Name: obs-service-tar_scm
-%define version_unconverted 0.7.0.1496831936.d960322
-Version: 0.7.0.1496831936.d960322
+%define version_unconverted 0.7.0.1497870887.fa1750b
+Version: 0.7.0.1497870887.fa1750b
Release: 0
Summary: An OBS source service: create tar ball from svn/git/hg
License: GPL-2.0+
++++++ _service ++++++
--- /var/tmp/diff_new_pack.VX43Sb/_old 2017-06-27 10:21:45.359093670 +0200
+++ /var/tmp/diff_new_pack.VX43Sb/_new 2017-06-27 10:21:45.363093104 +0200
@@ -6,6 +6,7 @@
<param name="version">git-master</param>
<param name="versionformat">0.7.0.%ct.%h</param>
<param name="changesgenerate">enable</param>
+ <param name="extract">dist/obs-service-tar_scm.spec</param>
</service>
<service name="recompress" mode="disabled">
<param name="file">*.tar</param>
++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.VX43Sb/_old 2017-06-27 10:21:45.383090278 +0200
+++ /var/tmp/diff_new_pack.VX43Sb/_new 2017-06-27 10:21:45.383090278 +0200
@@ -5,4 +5,4 @@
<param name="url">git://github.com/M0ses/obs-service-tar_scm.git</param>
<param name="changesrevision">b742dfc0e12755cf306a95439494b5bdde7c0c61</param></service><service name="tar_scm">
<param name="url">git://github.com/openSUSE/obs-service-tar_scm.git</param>
- <param name="changesrevision">03230fdf240addb3dd1ba3201beef50722cc87ac</param></service></servicedata>
\ No newline at end of file
+ <param name="changesrevision">fa1750b7f620aee1f85304514daf712f18bb035b</param></service></servicedata>
\ No newline at end of file
++++++ obs-service-tar_scm-0.7.0.1496831936.d960322.tar.gz -> obs-service-tar_scm-0.7.0.1497870887.fa1750b.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-service-tar_scm-0.7.0.1496831936.d960322/TarSCM/__init__.py new/obs-service-tar_scm-0.7.0.1497870887.fa1750b/TarSCM/__init__.py
--- old/obs-service-tar_scm-0.7.0.1496831936.d960322/TarSCM/__init__.py 2017-06-07 12:38:56.000000000 +0200
+++ new/obs-service-tar_scm-0.7.0.1497870887.fa1750b/TarSCM/__init__.py 2017-06-19 13:14:47.000000000 +0200
@@ -1,3 +1,5 @@
+from __future__ import print_function
+
import sys
import os
@@ -31,8 +33,8 @@
try:
task_list.process_list()
- except OptionsError as e:
- print(e)
+ except OptionsError as exc:
+ print(exc)
sys.exit(1)
task_list.finalize(_cli)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-service-tar_scm-0.7.0.1496831936.d960322/TarSCM/tasks.py new/obs-service-tar_scm-0.7.0.1497870887.fa1750b/TarSCM/tasks.py
--- old/obs-service-tar_scm-0.7.0.1496831936.d960322/TarSCM/tasks.py 2017-06-07 12:38:56.000000000 +0200
+++ new/obs-service-tar_scm-0.7.0.1497870887.fa1750b/TarSCM/tasks.py 2017-06-19 13:14:47.000000000 +0200
@@ -104,7 +104,7 @@
process tasks from the task_list
'''
for task in self.task_list:
- self._process_single_task(task)
+ self.process_single_task(task)
def finalize(self, args):
'''
@@ -119,7 +119,7 @@
outfile.write(yaml.dump(self.data_map,
default_flow_style=False))
- def _process_single_task(self, args):
+ def process_single_task(self, args):
'''
do the work for a single task
'''
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-service-tar_scm-0.7.0.1496831936.d960322/dist/obs-service-tar_scm.spec new/obs-service-tar_scm-0.7.0.1497870887.fa1750b/dist/obs-service-tar_scm.spec
--- old/obs-service-tar_scm-0.7.0.1496831936.d960322/dist/obs-service-tar_scm.spec 1970-01-01 01:00:00.000000000 +0100
+++ new/obs-service-tar_scm-0.7.0.1497870887.fa1750b/dist/obs-service-tar_scm.spec 2017-06-19 13:14:47.000000000 +0200
@@ -0,0 +1,184 @@
+#
+# spec file for package obs-service-tar_scm
+#
+# Copyright (c) 2017 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
+# upon. The license for this file, and modifications and additions to the
+# file, is the same license as for the pristine package itself (unless the
+# license for the pristine package is not an Open Source License, in which
+# case the license is the MIT License). An "Open Source License" is a
+# license that conforms to the Open Source Definition (Version 1.9)
+# published by the Open Source Initiative.
+
+# Please submit bugfixes or comments via http://bugs.opensuse.org/
+#
+
+
+%bcond_without obs_scm_testsuite
+
+Name: obs-service-tar_scm
+%define version_unconverted 0.7.0.1496831936.d960322
+Version: 0.7.0.1496831936.d960322
+Release: 0
+Summary: An OBS source service: create tar ball from svn/git/hg
+License: GPL-2.0+
+Group: Development/Tools/Building
+Url: https://github.com/openSUSE/obs-service-tar_scm
+Source: %{name}-%{version}.tar.gz
+# Fix build on Ubuntu by disabling mercurial tests, not applied in rpm
+# based distributions
+#Patch0: 0001-Debianization-disable-running-mercurial-tests.patch
+%if %{with obs_scm_testsuite}
+BuildRequires: bzr
+BuildRequires: git-core
+BuildRequires: mercurial
+%if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
+BuildRequires: PyYAML
+%else
+BuildRequires: python-PyYAML
+%endif
+BuildRequires: python-dateutil
+BuildRequires: python-lxml
+BuildRequires: python-mock
+BuildRequires: subversion
+%endif
+BuildRequires: python >= 2.6
+BuildRequires: python-unittest2
+Requires: bzr
+Requires: git-core
+Requires: mercurial
+Requires: obs-service-obs_scm-common = %version-%release
+Requires: subversion
+BuildRoot: %{_tmppath}/%{name}-%{version}-build
+BuildArch: noarch
+
+%description
+This is a source service for openSUSE Build Service.
+
+It supports downloading from svn, git, hg and bzr repositories.
+
+%package -n obs-service-obs_scm-common
+Summary: Common parts of SCM handling services
+Group: Development/Tools/Building
+Requires: python-dateutil
+%if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
+Requires: PyYAML
+%else
+Requires: python-PyYAML
+%if 0%{?suse_version} < 1315
+Requires: python-argparse
+%endif
+%endif
+
+%if 0%{?fedora_version} >= 25
+Requires: python2
+%endif
+
+%description -n obs-service-obs_scm-common
+
+%package -n obs-service-tar
+Summary: Creates a tar archive from local directory
+Group: Development/Tools/Building
+Requires: obs-service-obs_scm-common = %version-%release
+Provides: obs-service-tar_scm:/usr/lib/obs/service/tar.service
+
+%description -n obs-service-tar
+Creates a tar archive from local directory
+
+%package -n obs-service-obs_scm
+Summary: Creates a OBS cpio from a remote SCM resource
+Group: Development/Tools/Building
+Provides: obs-service-tar_scm:/usr/lib/obs/service/obs_scm.service
+Requires: bzr
+Requires: git-core
+Requires: mercurial
+Requires: obs-service-obs_scm-common = %version-%release
+Requires: subversion
+
+%description -n obs-service-obs_scm
+Creates a OBS cpio from a remote SCM resource.
+
+This can be used to work directly in local git checkout and can be packaged
+into a tar ball during build time.
+
+%package -n obs-service-appimage
+Summary: Handles source downloads defined in appimage.yml files
+Group: Development/Tools/Building
+Requires: bzr
+Requires: git-core
+Requires: mercurial
+Requires: obs-service-obs_scm-common = %version-%release
+Requires: subversion
+
+%description -n obs-service-appimage
+Experimental appimage support: This parses appimage.yml files for SCM
+resources and packages them.
+
+%package -n obs-service-snapcraft
+Summary: Handles source downloads defined in snapcraft.yaml files
+Group: Development/Tools/Building
+Provides: obs-service-tar_scm:/usr/lib/obs/service/snapcraft.service
+Requires: bzr
+Requires: git-core
+Requires: mercurial
+Requires: obs-service-obs_scm-common = %version-%release
+Requires: subversion
+
+%description -n obs-service-snapcraft
+Experimental snapcraft support: This parses snapcraft.yaml files for SCM
+resources and packages them.
+
+
+%prep
+%setup -q -n obs-service-tar_scm-%version
+
+%build
+
+%install
+make install DESTDIR="%{buildroot}" PREFIX="%{_prefix}" SYSCFG="%{_sysconfdir}"
+
+%if %{with obs_scm_testsuite}
+%if 0%{?suse_version} >= 1220
+%check
+# No need to run PEP8 tests here; that would require a potentially
+# brittle BuildRequires: python-pep8, and any style issues are already
+# caught by Travis CI.
+make test
+%endif
+%endif
+
+%files
+%defattr(-,root,root)
+%{_prefix}/lib/obs/service/tar_scm.service
+
+%files -n obs-service-obs_scm-common
+%defattr(-,root,root)
+%dir %{_prefix}/lib/obs
+%dir %{_prefix}/lib/obs/service
+%{_prefix}/lib/obs/service/TarSCM
+%{_prefix}/lib/obs/service/tar_scm
+%dir %{_sysconfdir}/obs
+%dir %{_sysconfdir}/obs/services
+%config(noreplace) %{_sysconfdir}/obs/services/*
+
+%files -n obs-service-tar
+%defattr(-,root,root)
+%{_prefix}/lib/obs/service/tar
+%{_prefix}/lib/obs/service/tar.service
+
+%files -n obs-service-obs_scm
+%defattr(-,root,root)
+%{_prefix}/lib/obs/service/obs_scm
+%{_prefix}/lib/obs/service/obs_scm.service
+
+%files -n obs-service-appimage
+%defattr(-,root,root)
+%{_prefix}/lib/obs/service/appimage*
+
+%files -n obs-service-snapcraft
+%defattr(-,root,root)
+%{_prefix}/lib/obs/service/snapcraft*
+
+%changelog
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-service-tar_scm-0.7.0.1496831936.d960322/tar_scm.py new/obs-service-tar_scm-0.7.0.1497870887.fa1750b/tar_scm.py
--- old/obs-service-tar_scm-0.7.0.1496831936.d960322/tar_scm.py 2017-06-07 12:38:56.000000000 +0200
+++ new/obs-service-tar_scm-0.7.0.1497870887.fa1750b/tar_scm.py 2017-06-19 13:14:47.000000000 +0200
@@ -17,9 +17,10 @@
sys.path.append(os.path.dirname(os.path.abspath(__file__))) # noqa
-import TarSCM
-import TarSCM.tasks
-from TarSCM.exceptions import OptionsError
+# These two modules have to be imported after sys.path.append because
+# the additional path is where the modules are found
+import TarSCM # pylint: disable=wrong-import-position
+import TarSCM.tasks # pylint: disable=wrong-import-position
def main():
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-service-tar_scm-0.7.0.1496831936.d960322/tests/commontests.py new/obs-service-tar_scm-0.7.0.1497870887.fa1750b/tests/commontests.py
--- old/obs-service-tar_scm-0.7.0.1496831936.d960322/tests/commontests.py 2017-06-07 12:38:56.000000000 +0200
+++ new/obs-service-tar_scm-0.7.0.1497870887.fa1750b/tests/commontests.py 2017-06-19 13:14:47.000000000 +0200
@@ -4,9 +4,9 @@
from pprint import pprint, pformat
-from testassertions import TestAssertions
-from testenv import TestEnvironment
-from utils import mkfreshdir
+from tests.testassertions import TestAssertions
+from tests.testenv import TestEnvironment
+from tests.utils import mkfreshdir
class CommonTests(TestEnvironment, TestAssertions):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-service-tar_scm-0.7.0.1496831936.d960322/tests/fixtures/TasksTestCases/test_generate_task_list_multi_tasks/snapcraft.yaml new/obs-service-tar_scm-0.7.0.1497870887.fa1750b/tests/fixtures/TasksTestCases/test_generate_task_list_multi_tasks/snapcraft.yaml
--- old/obs-service-tar_scm-0.7.0.1496831936.d960322/tests/fixtures/TasksTestCases/test_generate_task_list_multi_tasks/snapcraft.yaml 2017-06-07 12:38:56.000000000 +0200
+++ new/obs-service-tar_scm-0.7.0.1497870887.fa1750b/tests/fixtures/TasksTestCases/test_generate_task_list_multi_tasks/snapcraft.yaml 1970-01-01 01:00:00.000000000 +0100
@@ -1,23 +0,0 @@
-name: pipelinetest
-version: 1.0
-summary: Libpipeline example
-description: |
- This is an example package of an autotools project built with snapcraft
- using a remote source.
-
-apps:
- pipelinetest:
- command: ./bin/test
-
-parts:
- kanku:
- plugin: make
- source: git@github.com:M0ses/kanku
- source-type: git
- after:
- - libpipeline
- libpipeline:
- plugin: autotools
- source: lp:~mterry/libpipeline/printf
- source-type: bzr
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-service-tar_scm-0.7.0.1496831936.d960322/tests/fixtures/TasksTestCases/test_generate_task_list_single_task/snapcraft.yaml new/obs-service-tar_scm-0.7.0.1497870887.fa1750b/tests/fixtures/TasksTestCases/test_generate_task_list_single_task/snapcraft.yaml
--- old/obs-service-tar_scm-0.7.0.1496831936.d960322/tests/fixtures/TasksTestCases/test_generate_task_list_single_task/snapcraft.yaml 2017-06-07 12:38:56.000000000 +0200
+++ new/obs-service-tar_scm-0.7.0.1497870887.fa1750b/tests/fixtures/TasksTestCases/test_generate_task_list_single_task/snapcraft.yaml 1970-01-01 01:00:00.000000000 +0100
@@ -1,28 +0,0 @@
-name: pipelinetest
-version: 1.0
-summary: Libpipeline example
-description: |
- This is an example package of an autotools project built with snapcraft
- using a remote source.
-
-apps:
- pipelinetest:
- command: ./bin/test
-
-parts:
- pipelinetest:
- plugin: make
- source: .
- after:
- - libpipeline
- unkown-source-type:
- plugin: make
- source: .
- source-type: not-known
- after:
- - libpipeline
- libpipeline:
- plugin: autotools
- source: lp:~mterry/libpipeline/printf
- source-type: bzr
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-service-tar_scm-0.7.0.1496831936.d960322/tests/fixtures/TasksTestCases/test_generate_task_list_single_task_appimage/appimage.yml new/obs-service-tar_scm-0.7.0.1497870887.fa1750b/tests/fixtures/TasksTestCases/test_generate_task_list_single_task_appimage/appimage.yml
--- old/obs-service-tar_scm-0.7.0.1496831936.d960322/tests/fixtures/TasksTestCases/test_generate_task_list_single_task_appimage/appimage.yml 2017-06-07 12:38:56.000000000 +0200
+++ new/obs-service-tar_scm-0.7.0.1497870887.fa1750b/tests/fixtures/TasksTestCases/test_generate_task_list_single_task_appimage/appimage.yml 1970-01-01 01:00:00.000000000 +0100
@@ -1,9 +0,0 @@
-app: QtQuickApp
-
-build:
- packages:
- - linuxdeployqt
- - pkgconfig(Qt5Quick)
- git:
- - https://github.com/probonopd/QtQuickApp.git
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-service-tar_scm-0.7.0.1496831936.d960322/tests/fixtures/TasksTestCases/test_generate_tl_multi_tasks/snapcraft.yaml new/obs-service-tar_scm-0.7.0.1497870887.fa1750b/tests/fixtures/TasksTestCases/test_generate_tl_multi_tasks/snapcraft.yaml
--- old/obs-service-tar_scm-0.7.0.1496831936.d960322/tests/fixtures/TasksTestCases/test_generate_tl_multi_tasks/snapcraft.yaml 1970-01-01 01:00:00.000000000 +0100
+++ new/obs-service-tar_scm-0.7.0.1497870887.fa1750b/tests/fixtures/TasksTestCases/test_generate_tl_multi_tasks/snapcraft.yaml 2017-06-19 13:14:47.000000000 +0200
@@ -0,0 +1,23 @@
+name: pipelinetest
+version: 1.0
+summary: Libpipeline example
+description: |
+ This is an example package of an autotools project built with snapcraft
+ using a remote source.
+
+apps:
+ pipelinetest:
+ command: ./bin/test
+
+parts:
+ kanku:
+ plugin: make
+ source: git@github.com:M0ses/kanku
+ source-type: git
+ after:
+ - libpipeline
+ libpipeline:
+ plugin: autotools
+ source: lp:~mterry/libpipeline/printf
+ source-type: bzr
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-service-tar_scm-0.7.0.1496831936.d960322/tests/fixtures/TasksTestCases/test_generate_tl_single_task/snapcraft.yaml new/obs-service-tar_scm-0.7.0.1497870887.fa1750b/tests/fixtures/TasksTestCases/test_generate_tl_single_task/snapcraft.yaml
--- old/obs-service-tar_scm-0.7.0.1496831936.d960322/tests/fixtures/TasksTestCases/test_generate_tl_single_task/snapcraft.yaml 1970-01-01 01:00:00.000000000 +0100
+++ new/obs-service-tar_scm-0.7.0.1497870887.fa1750b/tests/fixtures/TasksTestCases/test_generate_tl_single_task/snapcraft.yaml 2017-06-19 13:14:47.000000000 +0200
@@ -0,0 +1,28 @@
+name: pipelinetest
+version: 1.0
+summary: Libpipeline example
+description: |
+ This is an example package of an autotools project built with snapcraft
+ using a remote source.
+
+apps:
+ pipelinetest:
+ command: ./bin/test
+
+parts:
+ pipelinetest:
+ plugin: make
+ source: .
+ after:
+ - libpipeline
+ unkown-source-type:
+ plugin: make
+ source: .
+ source-type: not-known
+ after:
+ - libpipeline
+ libpipeline:
+ plugin: autotools
+ source: lp:~mterry/libpipeline/printf
+ source-type: bzr
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-service-tar_scm-0.7.0.1496831936.d960322/tests/fixtures/TasksTestCases/test_generate_tl_st_appimage/appimage.yml new/obs-service-tar_scm-0.7.0.1497870887.fa1750b/tests/fixtures/TasksTestCases/test_generate_tl_st_appimage/appimage.yml
--- old/obs-service-tar_scm-0.7.0.1496831936.d960322/tests/fixtures/TasksTestCases/test_generate_tl_st_appimage/appimage.yml 1970-01-01 01:00:00.000000000 +0100
+++ new/obs-service-tar_scm-0.7.0.1497870887.fa1750b/tests/fixtures/TasksTestCases/test_generate_tl_st_appimage/appimage.yml 2017-06-19 13:14:47.000000000 +0200
@@ -0,0 +1,9 @@
+app: QtQuickApp
+
+build:
+ packages:
+ - linuxdeployqt
+ - pkgconfig(Qt5Quick)
+ git:
+ - https://github.com/probonopd/QtQuickApp.git
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-service-tar_scm-0.7.0.1496831936.d960322/tests/fixtures/TasksTestCases/test_tasks_finalize new/obs-service-tar_scm-0.7.0.1497870887.fa1750b/tests/fixtures/TasksTestCases/test_tasks_finalize
--- old/obs-service-tar_scm-0.7.0.1496831936.d960322/tests/fixtures/TasksTestCases/test_tasks_finalize 2017-06-27 10:21:45.503073320 +0200
+++ new/obs-service-tar_scm-0.7.0.1497870887.fa1750b/tests/fixtures/TasksTestCases/test_tasks_finalize 2017-06-27 10:21:45.559065407 +0200
@@ -1 +1 @@
-symbolic link to test_generate_task_list_multi_tasks/
+symbolic link to test_generate_tl_multi_tasks/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-service-tar_scm-0.7.0.1496831936.d960322/tests/scmlogs.py new/obs-service-tar_scm-0.7.0.1497870887.fa1750b/tests/scmlogs.py
--- old/obs-service-tar_scm-0.7.0.1496831936.d960322/tests/scmlogs.py 2017-06-07 12:38:56.000000000 +0200
+++ new/obs-service-tar_scm-0.7.0.1497870887.fa1750b/tests/scmlogs.py 2017-06-19 13:14:47.000000000 +0200
@@ -1,5 +1,5 @@
#!/usr/bin/env python2
-
+from __future__ import print_function
import glob
import os
@@ -39,9 +39,11 @@
os.environ['PATH'] = new_path
def __init__(self, scm, test_dir):
- self.scm = scm
- self.test_dir = test_dir
- self.counter = 0
+ self.scm = scm
+ self.test_dir = test_dir
+ self.counter = 0
+ self.current_log_path = None
+
self.unlink_existing_logs()
def get_log_file_template(self):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-service-tar_scm-0.7.0.1496831936.d960322/tests/tasks.py new/obs-service-tar_scm-0.7.0.1497870887.fa1750b/tests/tasks.py
--- old/obs-service-tar_scm-0.7.0.1496831936.d960322/tests/tasks.py 2017-06-07 12:38:56.000000000 +0200
+++ new/obs-service-tar_scm-0.7.0.1497870887.fa1750b/tests/tasks.py 2017-06-19 13:14:47.000000000 +0200
@@ -1,9 +1,8 @@
+from __future__ import print_function
+
import sys
import os
-import argparse
import inspect
-import re
-import copy
import shutil
from mock import MagicMock
@@ -23,6 +22,7 @@
self.tmp_dir = os.path.join(self.tests_dir, 'tmp')
self.outdir = os.path.join(self.tmp_dir,
self.__class__.__name__, 'out')
+ self.cur_dir = None
self._prepare_cli()
def tearDown(self):
@@ -42,19 +42,19 @@
fn_name = inspect.stack()[1][3]
try:
os.chdir(os.path.join(self.basedir, 'fixtures', cl_name, fn_name))
- except(OSError) as e:
+ except OSError:
print("current working directory: %s" % os.getcwd())
- raise(e)
+ raise
def _restore_cwd(self):
try:
os.chdir(self.basedir)
- except(OSError) as e:
+ except OSError:
print("failed to restore : current working directory: %s" %
os.getcwd())
- raise(e)
+ raise
- def test_generate_task_list_single_task(self):
+ def test_generate_tl_single_task(self):
expected = {
'scm': 'bzr', 'clone_prefix': '_obs_', 'snapcraft': True,
'revision': None, 'url': 'lp:~mterry/libpipeline/printf',
@@ -64,11 +64,12 @@
tasks = TarSCM.tasks()
tasks.generate_list(self.cli)
self._restore_cwd()
- for k in expected.keys():
+ for k in expected:
self.assertEqual(tasks.task_list[0].__dict__[k], expected[k])
self.assertEqual(len(tasks.task_list), 1)
- def test_generate_task_list_single_task_appimage(self):
+ def test_generate_tl_st_appimage(self):
+ '''Test generates task list with single task from appimage.yml'''
self.cli.snapcraft = False
self.cli.appimage = True
expected = {
@@ -83,7 +84,7 @@
tasks = TarSCM.tasks()
tasks.generate_list(self.cli)
self._restore_cwd()
- for k in expected.keys():
+ for k in expected:
self.assertEqual(tasks.task_list[0].__dict__[k], expected[k])
self.assertEqual(len(tasks.task_list), 1)
@@ -94,7 +95,7 @@
tasks = TarSCM.tasks()
tasks.generate_list(self.cli)
- def test_generate_task_list_multi_tasks(self):
+ def test_generate_tl_multi_tasks(self):
expected = {
'libpipeline': {
'changesgenerate': False,
@@ -124,9 +125,9 @@
tasks.generate_list(self.cli)
# test values in the objects instead of objects
for got in tasks.task_list:
- gf = got.__dict__['filename']
- for k in expected[gf].keys():
- self.assertEqual(got.__dict__[k], expected[gf][k])
+ got_f = got.__dict__['filename']
+ for key in expected[got_f].keys():
+ self.assertEqual(got.__dict__[key], expected[got_f][key])
self._restore_cwd()
def test_tasks_finalize(self):
@@ -158,18 +159,17 @@
os.makedirs(self.cli.outdir)
tasks.generate_list(self.cli)
tasks.finalize(self.cli)
- i = 0
self._restore_cwd()
- sf = open(os.path.join(self.cli.outdir,
+ scf = open(os.path.join(self.cli.outdir,
'_service:snapcraft:snapcraft.yaml'), 'r')
- got = sf.read()
- sf.close()
+ got = scf.read()
+ scf.close()
self.assertEqual(got, expected)
def test_cleanup(self):
tasks = TarSCM.tasks()
- cn = self.__class__.__name__
- cn_dir = os.path.join(self.tmp_dir, cn)
+ cln = self.__class__.__name__
+ cn_dir = os.path.join(self.tmp_dir, cln)
if not os.path.exists(self.tmp_dir):
os.mkdir(self.tmp_dir)
if not os.path.exists(cn_dir):
@@ -183,31 +183,37 @@
def test_get_version(self):
class FakeSCM():
+ # pylint: disable=unused-argument,no-self-use,no-init,
+ # pylint: disable=too-few-public-methods
def detect_version(self, args):
return '0.0.1'
scm = FakeSCM()
tasks = TarSCM.tasks()
- v = tasks.get_version(scm, self.cli)
- self.assertEqual(v, '0.0.1')
+ ver = tasks.get_version(scm, self.cli)
+ self.assertEqual(ver, '0.0.1')
self.cli.versionprefix = "r"
- v = tasks.get_version(scm, self.cli)
- self.assertEqual(v, 'r.0.0.1')
+ ver = tasks.get_version(scm, self.cli)
+ self.assertEqual(ver, 'r.0.0.1')
- def test_get_version_with_versionrewrite(self):
+ def test_get_version_with_versionrw(self):
+ '''Test for get_version with versionrewrite'''
class FakeSCM():
+ # pylint: disable=unused-argument,no-self-use,no-init,
+ # pylint: disable=too-few-public-methods
def detect_version(self, args):
return 'v0.0.1'
- self.cli.versionrewrite_pattern = 'v(\d[\d\.]*)'
+
+ self.cli.versionrewrite_pattern = r'v(\d[\d\.]*)'
self.cli.versionrewrite_replacement = '\\1-stable'
scm = FakeSCM()
tasks = TarSCM.tasks()
- v = tasks.get_version(scm, self.cli)
- self.assertEqual(v, '0.0.1-stable')
+ ver = tasks.get_version(scm, self.cli)
+ self.assertEqual(ver, '0.0.1-stable')
def test_process_list(self):
tasks = TarSCM.tasks()
self.cli.snapcraft = False
- tasks._process_single_task = MagicMock(name='_process_single_task')
+ tasks.process_single_task = MagicMock(name='process_single_task')
tasks.generate_list(self.cli)
tasks.process_list()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-service-tar_scm-0.7.0.1496831936.d960322/tests/test.py new/obs-service-tar_scm-0.7.0.1497870887.fa1750b/tests/test.py
--- old/obs-service-tar_scm-0.7.0.1496831936.d960322/tests/test.py 2017-06-07 12:38:56.000000000 +0200
+++ new/obs-service-tar_scm-0.7.0.1497870887.fa1750b/tests/test.py 2017-06-19 13:14:47.000000000 +0200
@@ -1,32 +1,42 @@
#!/usr/bin/env python2
-#
-# This CLI tool is responsible for running the tests.
-# See TESTING.md for more information.
+'''
+This CLI tool is responsible for running the tests.
+See TESTING.md for more information.
+'''
+from __future__ import print_function
import os
import re
import shutil
import sys
-from gittests import GitTests
-from svntests import SvnTests
-from hgtests import HgTests
-from bzrtests import BzrTests
-from testenv import TestEnvironment
-from unittestcases import UnitTestCases
-from tasks import TasksTestCases
-from scm import SCMBaseTestCases
+
+from tests.gittests import GitTests
+from tests.svntests import SvnTests
+from tests.hgtests import HgTests
+from tests.bzrtests import BzrTests
+from tests.testenv import TestEnvironment
+from tests.unittestcases import UnitTestCases
+from tests.tasks import TasksTestCases
+from tests.scm import SCMBaseTestCases
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
-if __name__ == '__main__':
- suite = unittest.TestSuite()
- testclasses = [
+
+def str_to_class(string):
+ '''Convert string into class'''
+ return getattr(sys.modules[__name__], string)
+
+
+def prepare_testclasses():
+ tclasses = [
# If you are only interested in a particular VCS, you can
- # temporarily comment out any of these:
+ # temporarily comment out any of these or use the env variable
+ # TAR_SCM_TC=<comma_separated_list> test.py
+ # TAR_SCM_TC=UnitTestCases,TasksTestCases,SCMBaseTestCases,GitTests,SvnTests,HgTests
UnitTestCases,
TasksTestCases,
SCMBaseTestCases,
@@ -36,45 +46,56 @@
BzrTests
]
+ if os.getenv('TAR_SCM_TC'):
+ tclasses = []
+ for classname in os.environ['TAR_SCM_TC'].split(','):
+ tclasses.append(str_to_class(classname))
+
+ return tclasses
+
+
+def prepare_testsuite(tclasses):
+ testsuite = unittest.TestSuite()
+
if len(sys.argv) == 1:
- for testclass in testclasses:
+ for testclass in tclasses:
all_tests = unittest.TestLoader().loadTestsFromTestCase(testclass)
- suite.addTests(all_tests)
+ testsuite.addTests(all_tests)
else:
# By default this uses the CLI args as string or regexp
# matches for names of git tests, but you can tweak this to run
# specific tests, e.g.:
- #
- # suite.addTest(HgTests('test_version_versionformat'))
- # suite.addTest(HgTests('test_versionformat_dateYYYYMMDD'))
- test_class = GitTests
- # test_class = TasksTestCases
- # test_class = UnitTestCases
- to_run = {}
- for arg in sys.argv[1:]:
- m = re.match('^/(.+)/$', arg)
- if m:
- # regexp mode
- regexp = m.group(1)
- matcher = lambda t: re.search(regexp, t)
- else:
- matcher = lambda t: t == arg
- for t in dir(test_class):
- if not t.startswith('test_'):
- continue
- if matcher(t):
- to_run[t] = True
-
- for t in to_run.keys():
- suite.addTest(test_class(t))
+ # PYTHONPATH=.:tests tests/test.py test_versionformat
+ for test_class in tclasses:
+ to_run = {}
+ for arg in sys.argv[1:]:
+ rmatch = re.match('^/(.+)/$', arg)
+ if rmatch:
+ # regexp mode
+ regexp = rmatch.group(1)
+ matcher = lambda t, r=regexp: re.search(r, t)
+ else:
+ matcher = lambda t, a=arg: t == a
+ for tdir in dir(test_class):
+ if not tdir.startswith('test_'):
+ continue
+ if matcher(tdir):
+ to_run[tdir] = True
+
+ for trun in to_run:
+ testsuite.addTest(test_class(trun))
+ return testsuite
+
+
+def main():
+ test_classes = prepare_testclasses()
+ suite = prepare_testsuite(test_classes)
runner_args = {
- # 'verbosity' : 2,
+ # 'verbosity': 2,
+ # 'failfast': True,
+ 'buffer': True
}
- major, minor, micro, releaselevel, serial = sys.version_info
- # New in 2.7 but available in earlier versions via unittest2
- runner_args['buffer'] = True
- # runner_args['failfast'] = True
runner = unittest.TextTestRunner(**runner_args)
result = runner.run(suite)
@@ -88,3 +109,6 @@
print("Left temporary files in %s" % TestEnvironment.tmp_dir)
print("You should remove these prior to the next test run.")
sys.exit(1)
+
+if __name__ == '__main__':
+ main()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-service-tar_scm-0.7.0.1496831936.d960322/tests/utils.py new/obs-service-tar_scm-0.7.0.1497870887.fa1750b/tests/utils.py
--- old/obs-service-tar_scm-0.7.0.1496831936.d960322/tests/utils.py 2017-06-07 12:38:56.000000000 +0200
+++ new/obs-service-tar_scm-0.7.0.1497870887.fa1750b/tests/utils.py 2017-06-19 13:14:47.000000000 +0200
@@ -1,6 +1,7 @@
#!/usr/bin/env python2
#
# Simple utility functions to help executing processes.
+from __future__ import print_function
import os
import re
@@ -21,11 +22,11 @@
def run_cmd(cmd):
- p = subprocess.Popen(cmd, shell=True,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
- (stdout, stderr) = p.communicate()
- return (stdout, stderr, p.returncode)
+ proc = subprocess.Popen(cmd, shell=True,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ (stdout, stderr) = proc.communicate()
+ return (stdout, stderr, proc.returncode)
def quietrun(cmd):
1
0
Hello community,
here is the log from the commit of package postfixadmin for openSUSE:Factory checked in at 2017-06-27 10:21:26
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/postfixadmin (Old)
and /work/SRC/openSUSE:Factory/.postfixadmin.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "postfixadmin"
Tue Jun 27 10:21:26 2017 rev:27 rq:506135 version:3.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/postfixadmin/postfixadmin.changes 2017-02-12 00:49:57.653187522 +0100
+++ /work/SRC/openSUSE:Factory/.postfixadmin.new/postfixadmin.changes 2017-06-27 10:21:41.355659496 +0200
@@ -1,0 +2,10 @@
+Sun Jun 25 18:36:32 UTC 2017 - suse-beta(a)cboltz.de
+
+- update to PostfixAdmin 3.1:
+ - several broadcast improvements
+ - better static DB connection cache to avoid hundreds of mysqli
+ connections when doing lots of escape_string() calls
+ - add favicon to fix session handling in chrome (#44)
+ - various small fixes and improvements, see CHANGELOG.TXT
+
+-------------------------------------------------------------------
Old:
----
postfixadmin-3.0.2.tar.gz
New:
----
postfixadmin-3.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ postfixadmin.spec ++++++
--- /var/tmp/diff_new_pack.NJotlk/_old 2017-06-27 10:21:43.315382519 +0200
+++ /var/tmp/diff_new_pack.NJotlk/_new 2017-06-27 10:21:43.319381953 +0200
@@ -17,7 +17,7 @@
Name: postfixadmin
-Version: 3.0.2
+Version: 3.1
Release: 0
Url: http://postfixadmin.sourceforge.net/
Source0: http://sourceforge.net/projects/postfixadmin/files/postfixadmin/%{name}-%{v…
@@ -127,7 +127,7 @@
#ln -s ../../../..%{_sysconfdir}/%{name}/config.inc.php \
# %{buildroot}%{_datadir}/%{name}/config.inc.php
-install -m 0644 *.php *.js %{buildroot}%{serverroot}/%{name}/
+install -m 0644 *.php *.js favicon.ico %{buildroot}%{serverroot}/%{name}/
mv VIRTUAL_VACATION/vacation.pl %{buildroot}%{_prefix}/lib/%{name}/
# compatibility symlink to match documentation
@@ -165,11 +165,6 @@
#EOF
#fi
-#%preun
-#if [ $1 = 0 ]; then
-# /usr/sbin/userdel vacation 2>/dev/null || :
-#fi
-
%files
%defattr(-,root,root)
#%config %dir %{_sysconfdir}/%{name}
++++++ postfixadmin-3.0.2.tar.gz -> postfixadmin-3.1.tar.gz ++++++
++++ 3813 lines of diff (skipped)
1
0