SHA256
1
0
forked from pool/logrotate

Accepting request 434552 from Base:System

Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/434552
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/logrotate?expand=0&rev=50
This commit is contained in:
Dominique Leuenberger 2016-10-20 21:05:14 +00:00 committed by Git OBS Bridge
commit 1d79ba216b
9 changed files with 100 additions and 62 deletions

3
logrotate-3.10.0.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:15a5d4db53cec8f8e0561e88a0d8ee737a45dee1aba280c6e75f92950ca9306c
size 127492

View File

@ -1,13 +0,0 @@
Index: logrotate.c
===================================================================
--- logrotate.c.orig 2013-07-25 14:52:57.493518089 +0200
+++ logrotate.c 2013-07-25 14:52:57.499518158 +0200
@@ -1327,7 +1327,7 @@ int prerotateSingleLog(struct logInfo *l
message(MESS_FATAL, "could not allocate destFile memory\n");
}
if (!stat(destFile, &fst_buf)) {
- message(MESS_DEBUG,
+ message(MESS_ERROR,
"destination %s already exists, skipping rotation\n",
rotNames->firstRotated);
hasErrors = 1;

View File

@ -1,16 +1,3 @@
Index: Makefile
===================================================================
--- Makefile.orig
+++ Makefile
@@ -81,7 +81,7 @@ ifneq ($(STATEFILE),)
endif
BINDIR = $(BASEDIR)/sbin
-MANDIR ?= $(BASEDIR)/man
+MANDIR ?= $(BASEDIR)/share/man
#--------------------------------------------------------------------------
Index: examples/logrotate.cron Index: examples/logrotate.cron
=================================================================== ===================================================================
--- examples/logrotate.cron.orig --- examples/logrotate.cron.orig

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:022769e3288c80981559a8421703c88e8438b447235e36dd3c8e97cd94c52545
size 79061

View File

@ -2,9 +2,9 @@ Index: test/test
=================================================================== ===================================================================
--- test/test.orig --- test/test.orig
+++ test/test +++ test/test
@@ -1599,4 +1599,27 @@ test.log 0 @@ -1746,5 +1746,28 @@ EOF
test.log.1 0 zero rm -rf testdir adir
EOF rm -rf testdir bdir
+# check rotation with extension appended to the filename +# check rotation with extension appended to the filename
+cleanup 100 +cleanup 100
@ -30,6 +30,7 @@ Index: test/test
+ +
+ +
cleanup cleanup
Index: config.c Index: config.c
=================================================================== ===================================================================
--- config.c.orig --- config.c.orig
@ -42,7 +43,7 @@ Index: config.c
.compress_prog = NULL, .compress_prog = NULL,
.uncompress_prog = NULL, .uncompress_prog = NULL,
.compress_ext = NULL, .compress_ext = NULL,
@@ -1220,6 +1221,19 @@ static int readConfigFile(const char *co @@ -1224,6 +1225,19 @@ static int readConfigFile(const char *co
message(MESS_DEBUG, "extension is now %s\n", message(MESS_DEBUG, "extension is now %s\n",
newlog->extension); newlog->extension);
@ -66,7 +67,7 @@ Index: logrotate.8
=================================================================== ===================================================================
--- logrotate.8.orig --- logrotate.8.orig
+++ logrotate.8 +++ logrotate.8
@@ -283,6 +283,15 @@ configured to be run by cron daily. You @@ -284,6 +284,15 @@ configured to be run by cron daily. You
and run \fIlogrotate\fR hourly to be able to really rotate logs hourly. and run \fIlogrotate\fR hourly to be able to really rotate logs hourly.
.TP .TP
@ -86,7 +87,7 @@ Index: logrotate.c
=================================================================== ===================================================================
--- logrotate.c.orig --- logrotate.c.orig
+++ logrotate.c +++ logrotate.c
@@ -1216,6 +1216,24 @@ int prerotateSingleLog(struct logInfo *l @@ -1219,6 +1219,24 @@ int prerotateSingleLog(struct logInfo *l
rotNames->baseName = strdup(ourBaseName(log->files[logNum])); rotNames->baseName = strdup(ourBaseName(log->files[logNum]));

View File

@ -1,8 +1,8 @@
Index: config.c Index: config.c
=================================================================== ===================================================================
--- config.c.orig 2013-06-10 14:02:36.000000000 +0200 --- config.c.orig
+++ config.c 2013-07-25 15:42:42.465060702 +0200 +++ config.c
@@ -712,6 +712,7 @@ @@ -716,6 +716,7 @@ static int readConfigFile(const char *co
char **scriptDest = NULL; char **scriptDest = NULL;
struct logInfo *newlog = defConfig; struct logInfo *newlog = defConfig;
char *start, *chptr; char *start, *chptr;
@ -10,7 +10,7 @@ Index: config.c
char *dirName; char *dirName;
struct passwd *pw = NULL; struct passwd *pw = NULL;
int rc; int rc;
@@ -1245,6 +1246,20 @@ static int readConfigFile(const char *co @@ -1242,6 +1243,20 @@ static int readConfigFile(const char *co
message(MESS_DEBUG, "compress_prog is now %s\n", message(MESS_DEBUG, "compress_prog is now %s\n",
newlog->compress_prog); newlog->compress_prog);
@ -33,9 +33,9 @@ Index: config.c
Index: logrotate.c Index: logrotate.c
=================================================================== ===================================================================
--- logrotate.c.orig 2013-06-10 14:02:36.000000000 +0200 --- logrotate.c.orig
+++ logrotate.c 2013-07-25 15:30:36.687434418 +0200 +++ logrotate.c
@@ -85,6 +85,16 @@ unsigned int hashSize; @@ -104,6 +104,16 @@ unsigned int hashSize;
int numLogs = 0; int numLogs = 0;
int debug = 0; int debug = 0;
char *mailCommand = DEFAULT_MAIL_COMMAND; char *mailCommand = DEFAULT_MAIL_COMMAND;
@ -54,9 +54,9 @@ Index: logrotate.c
static gid_t save_egid; static gid_t save_egid;
Index: logrotate.h Index: logrotate.h
=================================================================== ===================================================================
--- logrotate.h.orig 2013-06-10 14:02:36.000000000 +0200 --- logrotate.h.orig
+++ logrotate.h 2013-07-25 15:30:36.687434418 +0200 +++ logrotate.h
@@ -66,6 +66,9 @@ TAILQ_HEAD(logInfoHead, logInfo) logs; @@ -79,6 +79,9 @@ TAILQ_HEAD(logInfoHead, logInfo) logs;
extern int numLogs; extern int numLogs;
extern int debug; extern int debug;
@ -68,9 +68,9 @@ Index: logrotate.h
int asprintf(char **string_ptr, const char *format, ...); int asprintf(char **string_ptr, const char *format, ...);
Index: test/test Index: test/test
=================================================================== ===================================================================
--- test/test.orig 2013-07-25 15:30:36.687434418 +0200 --- test/test.orig
+++ test/test 2013-07-25 16:16:11.992044805 +0200 +++ test/test
@@ -536,19 +536,6 @@ checkoutput <<EOF @@ -577,32 +577,6 @@ checkoutput <<EOF
test.log 0 zero test.log 0 zero
EOF EOF
@ -78,7 +78,7 @@ Index: test/test
- -
-# ------------------------------- Test 18 ------------------------------------ -# ------------------------------- Test 18 ------------------------------------
-preptest test.log 18 1 -preptest test.log 18 1
-$RLR test-config.18 --force -$RLR test-config.18 -l syslog --force
- -
-checkoutput <<EOF -checkoutput <<EOF
-test.log 0 -test.log 0
@ -86,6 +86,19 @@ Index: test/test
-EOF -EOF
- -
-(echo "gzip -f -9") | diff -u - compress-args -(echo "gzip -f -9") | diff -u - compress-args
-egrep -q '^LOGROTATE_COMPRESSED_FILENAME=.+/test/test.log.1$' compress-env
-if [ $? != 0 ]; then
- echo "LOGROTATE_COMPRESSED_FILENAME environment variable not found."
- cat compress-env++ exit 3
-fi
-
-if [ $SYSLOG_TESTS = 1 ]; then
- journalctl -n 50 2>/dev/null|grep $PWD/test.log.1 2>/dev/null >/dev/null
- if [ $? != 0 ]; then
- echo "syslog message not found"
- exit 1
- fi
-fi
- -
cleanup 19 cleanup 19

View File

@ -0,0 +1,29 @@
From 61f22b1eb2bd441bce998240701b0acd03265a47 Mon Sep 17 00:00:00 2001
From: Dominique Leuenberger <dimstar@opensuse.org>
Date: Mon, 3 Oct 2016 16:43:00 +0200
Subject: [PATCH] Fix test suite in combination with bash 4.4
Until bash 4.4, variables were silently stripped of NUL bytes; with Bash 4.4
this results now for every single 0-byte that is being stripped in a warning:
./test: line 170: warning: command substitution: ignored null byte in input
We now simply strip the NUL bytes before we have bash assign the values to
a variable. The result is the same.
---
test/test | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: logrotate-3.10.0/test/test
===================================================================
--- logrotate-3.10.0.orig/test/test
+++ logrotate-3.10.0/test/test
@@ -183,7 +183,7 @@ checkoutput() {
if [ -n "$co_compressed" ] && [ "$co_compressed" != 0 ]; then
contents=`gunzip -c $file`
else
- contents=`cat $file`
+ contents=`cat $file | tr -d '\000'`
fi
if [ "$contents" != "$expected" ]; then
echo "file $file does not contain expected results (compressed $co_compressed, args $*)" >&2

View File

@ -1,3 +1,22 @@
-------------------------------------------------------------------
Wed Oct 5 11:38:13 UTC 2016 - tchvatal@suse.com
- Version update to 3.10.0:
* Update url to point to github
- Remove upstreamed patch:
* logrotate-3.7.8-mess_err.patch
- Rebase patches:
* logrotate-3.7.8-suse.patch
* logrotate-addextension.patch
* logrotate-autoext.patch
* logrotate-fix-test62_with_bash-4.4.patch
-------------------------------------------------------------------
Mon Oct 3 14:46:34 UTC 2016 - dimstar@opensuse.org
- Add logrotate-fix-test62_with_bash-4.4.patch: Fix the test suite
when running with bash 4.4 (gh#logrotate/logrotate#66).
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Jun 22 12:53:44 UTC 2015 - kstreitova@suse.com Mon Jun 22 12:53:44 UTC 2015 - kstreitova@suse.com

View File

@ -1,7 +1,7 @@
# #
# spec file for package logrotate # spec file for package logrotate
# #
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -17,13 +17,13 @@
Name: logrotate Name: logrotate
Version: 3.9.1 Version: 3.10.0
Release: 0 Release: 0
Summary: Rotate, compress, remove, and mail system log files Summary: Rotate, compress, remove, and mail system log files
License: GPL-2.0+ License: GPL-2.0+
Group: System/Base Group: System/Base
Url: https://fedorahosted.org/releases/l/o/logrotate Url: https://github.com/logrotate/logrotate
Source: https://fedorahosted.org/releases/l/o/%{name}/%{name}-%{version}.tar.gz Source0: https://github.com/logrotate/logrotate/releases/download/%{version}/logrotate-%{version}.tar.xz
Source100: %{name}-rpmlintrc Source100: %{name}-rpmlintrc
Source101: %{name}.service Source101: %{name}.service
Source102: %{name}.timer Source102: %{name}.timer
@ -31,11 +31,13 @@ Patch0: logrotate-3.7.8-suse.patch
Patch1: logrotate-conf.patch Patch1: logrotate-conf.patch
Patch2: logrotate-autoext.patch Patch2: logrotate-autoext.patch
Patch3: logrotate-addextension.patch Patch3: logrotate-addextension.patch
Patch4: logrotate-3.7.8-mess_err.patch
Patch5: logrotate-manpage_config_clarification.patch Patch5: logrotate-manpage_config_clarification.patch
# PATCH-FIX-UPSTREAM logrotate-fix-test62_with_bash-4.4.patch gh#logrotate/logrotate#66 dimstar@opensuse.org -- Fix test suite in combination with bash 4.4
Patch6: logrotate-fix-test62_with_bash-4.4.patch
BuildRequires: acl BuildRequires: acl
BuildRequires: libacl-devel BuildRequires: libacl-devel
BuildRequires: libselinux-devel BuildRequires: libselinux-devel
BuildRequires: pkgconfig
BuildRequires: popt-devel BuildRequires: popt-devel
BuildRequires: pkgconfig(systemd) >= 197 BuildRequires: pkgconfig(systemd) >= 197
Requires: xz Requires: xz
@ -56,25 +58,24 @@ daily cron job.
%patch1 %patch1
%patch2 %patch2
%patch3 %patch3
%patch4
%patch5 -p1 %patch5 -p1
%patch6 -p1
%build %build
make %{?_smp_mflags} CC="gcc" RPM_OPT_FLAGS="%{optflags}" \ %configure
WITH_SELINUX=yes \ make %{?_smp_mflags}
WITH_ACL=yes
%check %check
make %{?_smp_mflags} test make %{?_smp_mflags} check
%install %install
make PREFIX=%{buildroot} install %make_install
mkdir -p %{buildroot}%{_sysconfdir}/{logrotate.d,cron.daily} mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d
mkdir -p %{buildroot}%{_prefix}/sbin
install -m 644 examples/logrotate-default %{buildroot}%{_sysconfdir}/logrotate.conf install -m 644 examples/logrotate-default %{buildroot}%{_sysconfdir}/logrotate.conf
install -m 644 examples/logrotate.wtmp %{buildroot}%{_sysconfdir}/logrotate.d/wtmp install -m 644 examples/logrotate.wtmp %{buildroot}%{_sysconfdir}/logrotate.d/wtmp
install -D -m 0644 %{SOURCE101} %{buildroot}%{_unitdir}/%{name}.service install -D -m 0644 %{SOURCE101} %{buildroot}%{_unitdir}/%{name}.service
install -D -m 0644 %{SOURCE102} %{buildroot}%{_unitdir}/%{name}.timer install -D -m 0644 %{SOURCE102} %{buildroot}%{_unitdir}/%{name}.timer
ln -s service %{buildroot}%{_sbindir}/rc%{name}
%pre %pre
#only the timer can be enabled/disabled/masked ! #only the timer can be enabled/disabled/masked !
@ -99,6 +100,7 @@ fi
%defattr(-,root,root) %defattr(-,root,root)
%doc CHANGES COPYING %doc CHANGES COPYING
%{_sbindir}/logrotate %{_sbindir}/logrotate
%{_sbindir}/rc%{name}
%{_mandir}/man8/logrotate.8* %{_mandir}/man8/logrotate.8*
%{_mandir}/man5/logrotate.conf.5* %{_mandir}/man5/logrotate.conf.5*
%config %{_sysconfdir}/logrotate.conf %config %{_sysconfdir}/logrotate.conf