Accepting request 244920 from home:Mitsutoshi:branches:utilities

- updated Source to 1.13:
  + Ignore check-mk-agent-logwatch's FHS violating
    /etc/check_mk/logwatch.state. Closes: deb#753903
  + Only allow [-a-z_] in etckeeper commands to avoid any possible
    directory traversal etc issues.
  + update-ignore, uninit: Fix parsing of ignore files containing '\'
- added etckeeper-avoid-packagelist.patch:
  Because it is slow that some package manager make the packagelist
  (eg, rpm -qa), high-level package manager might time out
  (eg. zypper in/remove).
  So I added this patch.
  If you think that the packagelist is unnecessary,
  set AVOID_PACKAGELIST=1 in etckeeper.conf.
  Or if you want to avoid it temporarily,
  you can use environment variable ETCKEEPER_AVOID_PACKAGELIST=1 .
  (eg, ETCKEEPER_AVOID_PACKAGELIST=1 zypper update).
  This patch was sent to upstream, but Joey does not accept it yet.
  Please see also gh#joeyh/etckeeper#17 .
- rename subpackage from pkgmanager-collabo
  to zypp-plugin or yum-plugin.
  please see also:
  http://lists.opensuse.org/archive/opensuse-factory/2014-07/msg00060.html
- added "Provides:" for renaming:
  pkgmanager-collabo => (zypp|yum)-plugin.
  Please see also:
  https://en.opensuse.org/openSUSE:Package_dependencies#Renaming_a_packageage
- added "Provides:" for split packages: etekeeper-cron and plugins.
  Please see also:
  https://en.opensuse.org/openSUSE:Package_dependencies#Splitting_off_a_sub-pack
- added "Reccomends: git".
  please see also:
  http://lists.opensuse.org/archive/opensuse-factory/2014-07/msg00060.html
- added bzr support files.
  Their files need "Buildrequires: python-devel bzr",
  but did not write them, so they were not installed untill now.
- added Python Compatibility with older distributions codes.
  Please see also:
  https://en.opensuse.org/openSUSE:Packaging_Python#Compatibility_with_older_distributions
- added version-release number to Recommendes and Requires.
  It is desirable that etckeeper packages are same version.
- removed lib/zypp directories:
  They should belong libzypp.
  + remove them.
  + added "BuildRequire: zypp-plugin-python".

OBS-URL: https://build.opensuse.org/request/show/244920
OBS-URL: https://build.opensuse.org/package/show/utilities/etckeeper?expand=0&rev=8
This commit is contained in:
OBS User mrdocs 2014-08-16 19:25:19 +00:00 committed by Git OBS Bridge
parent 8cfed70b53
commit d7674fab76
6 changed files with 202 additions and 94 deletions

View File

@ -0,0 +1,90 @@
From: Mitsutoshi NAKANO <bkbin005@rinku.zaq.ne.jp>
Date: 2014-07-20 04:15:00 +0900
Subject: add: AVOID_PACKAGELIST & ETCKEEPER_AVOID_PACKAGELIST
References: gh#joeyh/etckeeper#17
Upstream: sent (but not accept yet)
Because it is slow that some package manager make the packagelist
(eg, rpm -qa), high-level package manager might time out
(eg. zypper in/remove).
If you think that the packagelist is unnecessary, set AVOID_PACKAGELIST=1
in etckeeper.conf.
Or if you want to avoid it temporarily,
you can use environment variable ETCKEEPER_AVOID_PACKAGELIST=1 .
(eg, ETCKEEPER_AVOID_PACKAGELIST=1 zypper update).
diff --git a/etckeeper b/etckeeper
index 554ada9..463a8e1 100755
--- a/etckeeper
+++ b/etckeeper
@@ -116,6 +116,13 @@ if [ -z "$VCS" ]; then
fi
export VCS
+#If environment variable ETCKEEPER_AVOID_PACKAGELIST is not null,
+# AVOID_PACKAGELIST in etckeeper.conf is overridden here.
+if [ -n "$ETCKEEPER_AVOID_PACKAGELIST" ]; then
+ AVOID_PACKAGELIST="$ETCKEEPER_AVOID_PACKAGELIST"
+fi
+export AVOID_PACKAGELIST
+
lsscripts() {
perl -e '
$dir=shift;
diff --git a/etckeeper.8 b/etckeeper.8
index 62ae976..5ecb183 100644
--- a/etckeeper.8
+++ b/etckeeper.8
@@ -65,7 +65,19 @@ prompting.)
/etc/etckeeper also contains directories containing the programs that are
run for each of the above commands.
.SH ENVIRONMENT VARIABLES
-ETCKEEPER_CONF_DIR path to configuration directory instead of default /etc/etckeeper.
+ETCKEEPER_CONF_DIR path to configuration directory instead of default
+/etc/etckeeper.
+.PP
+ETCKEEPER_AVOID_PACKAGELIST:
+Because it is slow that some package manager make the packagelist
+(eg, rpm -qa), high-level package manager might time out.
+If you think that the packagelist is unnecessary,
+set AVOID_PACKAGELIST=1. in etckeeper.conf
+Or if you want to avoid it temporarily,
+you can use environment variable ETCKEEPER_AVOID_PACKAGELIST=1 .
+(eg, ETCKEEPER_AVOID_PACKAGELIST=1 zypper update)
+AVOID_PACKAGELIST=1
+
.SH SEE ALSO
/usr/share/doc/etckeeper/README.md.gz
.SH AUTHOR
diff --git a/etckeeper.conf b/etckeeper.conf
index f988c10..43a1672 100644
--- a/etckeeper.conf
+++ b/etckeeper.conf
@@ -41,3 +41,12 @@ LOWLEVEL_PACKAGE_MANAGER=dpkg
# (eg, "origin" for git). Space-separated lists of multiple remotes
# also work (eg, "origin gitlab github" for git).
PUSH_REMOTE=""
+
+# Because it is slow that some package manager make the packagelist
+# (eg, rpm -qa), high-level package manager might time out.
+# If you think that the packagelist is unnecessary,
+# set AVOID_PACKAGELIST=1.
+# Or if you want to avoid it temporarily,
+# you can use environment variable ETCKEEPER_AVOID_PACKAGELIST=1 .
+# (eg, ETCKEEPER_AVOID_PACKAGELIST=1 zypper update)
+#AVOID_PACKAGELIST=1
diff --git a/pre-install.d/10packagelist b/pre-install.d/10packagelist
index e5fefa8..4bc8aa4 100755
--- a/pre-install.d/10packagelist
+++ b/pre-install.d/10packagelist
@@ -1,4 +1,9 @@
#!/bin/sh
+
+if [ "$AVOID_PACKAGELIST" = "1" ]; then
+ exit 0
+fi
+
# This list will be later used when committing.
mkdir -p /var/cache/etckeeper/
etckeeper list-installed > /var/cache/etckeeper/packagelist.pre-install

View File

@ -1,46 +0,0 @@
From: Mitsutoshi NAKANO <bkbin005@rinku.zaq.ne.jp>
Date: 2014-06-18 20:14:28 +0900
Subject: zypper-etckeeper.py: change permission and locale .
References: bnc#884154
http://lists.opensuse.org/archive/opensuse-factory/2014-06/msg00090.html
Upstream: merged
This patch fixed bnc#884154 .
I changed zypper-etckeeper.py 's permission from 644 to 755.
I changed zypper-etckeeper.py's LANG to C.
---
diff --git a/Makefile b/Makefile
index 13ce4fe..cf034a2 100644
--- a/Makefile
+++ b/Makefile
@@ -45,7 +45,7 @@ ifeq ($(HIGHLEVEL_PACKAGE_MANAGER),yum)
endif
ifeq ($(HIGHLEVEL_PACKAGE_MANAGER),zypper)
mkdir -p $(DESTDIR)$(prefix)/lib/zypp/plugins/commit
- $(INSTALL_DATA) zypper-etckeeper.py $(DESTDIR)$(prefix)/lib/zypp/plugins/commit/zypper-etckeeper.py
+ $(INSTALL) zypper-etckeeper.py $(DESTDIR)$(prefix)/lib/zypp/plugins/commit/zypper-etckeeper.py
endif
-./etckeeper-bzr/__init__.py install --root=$(DESTDIR) ${PYTHON_INSTALL_OPTS} || echo "** bzr support not installed"
echo "** installation successful"
diff --git a/zypper-etckeeper.py b/zypper-etckeeper.py
index b21f23d..daa2ff2 100755
--- a/zypper-etckeeper.py
+++ b/zypper-etckeeper.py
@@ -3,7 +3,7 @@
import errno
import subprocess
import zypp_plugin
-
+import os
def _call_etckeeper(install_arg):
# zypper interprets the plugin's stdout as described in
@@ -34,5 +34,6 @@ class EtckeeperPlugin(zypp_plugin.Plugin):
self.ack()
+os.environ["LANG"] = "C"
plugin = EtckeeperPlugin()
plugin.main()

View File

@ -1,9 +1,57 @@
-------------------------------------------------------------------
Fri Aug 15 22:15:20 UTC 2014 - bkbin005@rinku.zaq.ne.jp
- updated Source to 1.13:
+ Ignore check-mk-agent-logwatch's FHS violating
/etc/check_mk/logwatch.state. Closes: deb#753903
+ Only allow [-a-z_] in etckeeper commands to avoid any possible
directory traversal etc issues.
+ update-ignore, uninit: Fix parsing of ignore files containing '\'
- added etckeeper-avoid-packagelist.patch:
Because it is slow that some package manager make the packagelist
(eg, rpm -qa), high-level package manager might time out
(eg. zypper in/remove).
So I added this patch.
If you think that the packagelist is unnecessary,
set AVOID_PACKAGELIST=1 in etckeeper.conf.
Or if you want to avoid it temporarily,
you can use environment variable ETCKEEPER_AVOID_PACKAGELIST=1 .
(eg, ETCKEEPER_AVOID_PACKAGELIST=1 zypper update).
This patch was sent to upstream, but Joey does not accept it yet.
Please see also gh#joeyh/etckeeper#17 .
- rename subpackage from pkgmanager-collabo
to zypp-plugin or yum-plugin.
please see also:
http://lists.opensuse.org/archive/opensuse-factory/2014-07/msg00060.html
- added "Provides:" for renaming:
pkgmanager-collabo => (zypp|yum)-plugin.
Please see also:
https://en.opensuse.org/openSUSE:Package_dependencies#Renaming_a_packageage
- added "Provides:" for split packages: etekeeper-cron and plugins.
Please see also:
https://en.opensuse.org/openSUSE:Package_dependencies#Splitting_off_a_sub-pack
- added "Reccomends: git".
please see also:
http://lists.opensuse.org/archive/opensuse-factory/2014-07/msg00060.html
- added bzr support files.
Their files need "Buildrequires: python-devel bzr",
but did not write them, so they were not installed untill now.
- added Python Compatibility with older distributions codes.
Please see also:
https://en.opensuse.org/openSUSE:Packaging_Python#Compatibility_with_older_distributions
- added version-release number to Recommendes and Requires.
It is desirable that etckeeper packages are same version.
- removed lib/zypp directories:
They should belong libzypp.
+ remove them.
+ added "BuildRequire: zypp-plugin-python".
-------------------------------------------------------------------
Mon Jul 7 21:21:34 UTC 2014 - bkbin005@rinku.zaq.ne.jp
- modified etckeeper.spec style
by "osc service run format_spec_file".
- removed lint code 'rm -rf "{buildroot}{_prefix}/lib"/python*'.
- removed lint code 'rm -rf "%{buildroot}%{_prefix}/lib"/python*'.
This line does not work.
- removed "Requires: git".
users can select VCS.

View File

@ -19,32 +19,39 @@
#
# see https://en.opensuse.org/openSUSE:Packaging_Python#Compatibility_with_older_distributions
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
Name: etckeeper
Version: 1.12
Version: 1.13
Release: 0
Summary: Store /etc under Version Control
License: GPL-2.0+
Group: System/Management
Source: http://ftp.debian.org/debian/pool/main/e/etckeeper/etckeeper_%{version}.tar.gz
Source: http://ftp.debian.org/debian/pool/main/e/etckeeper/%{name}_%{version}.tar.gz
Source99: etckeeper.rpmlintrc
# PATCH-FIX-UPSTREAM etckeeper-zypp.patch bnc#884154 bkbin005@rinku.zaq.ne.jp -- fix for ZYpp
Patch0: etckeeper-zypp.patch
# PATCH-FIX-UPSTREAM etckeeper-avoid-packagelist.patch gh#joeyh/etckeeper#17 bkbin005@rinku.zaq.ne.jp -- add AVOID_PACKAGELIST
Patch0: etckeeper-avoid-packagelist.patch
Url: http://joeyh.name/code/etckeeper/
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
BuildRequires: make
# delete 2014-07-05 bkbin005@rinku.zaq.ne.jp
# Users should be able to select VCS.
#Requires: git
%define LPM rpm
BuildRequires: make
# added for bzr 2014-07-10 bkbin005@rinku.zaq.ne.jp
BuildRequires: bzr
BuildRequires: python-devel
%if 0%{?suse_version}
Recommends: etckeeper-cron
Recommends: etckeeper-pkgmanager-collabo
# modified 2014-07-09 bkbin005@rinku.zaq.ne.jp
# Users should be able to select VCS.
Recommends: git
Recommends: %{name}-cron = %{version}-%{release}
Recommends: %{name}-zypp-plugin = %{version}-%{release}
BuildRequires: libzypp
%define HPM zypper
%else
BuildRequires: yum
Requires: %{name}-cron = %{version}-%{release}
Requires: %{name}-yum-plugin = %{version}-%{release}
%define HPM yum
%endif
@ -58,31 +65,47 @@ quite modular and configurable, while also being simple to use if you
understand the basics of working with version control.
%package -n etckeeper-cron
%package cron
Summary: The etckeeper cron function
Group: System/Management
Requires: cron
Requires: etckeeper
%description -n etckeeper-cron
The etckeeper-cron furnishes etckeeper collaboration function
with cron.
%package -n etckeeper-pkgmanager-collabo
Summary: The etckeeper collaboration function with package-manager
Group: System/Management
Requires: etckeeper
Requires: etckeeper = %{version}-%{release}
Provides: etckeeper:%{_sysconfdir}/cron.daily/etckeeper
%if 0%{?suse_version}
Requires: zypp-plugin-python
Requires: cron
%else
Requires: crontabs
%endif
%description -n etckeeper-pkgmanager-collabo
The etckeeper-cron furnishes etckeeper collaboration function
with package-manager.
%description cron
The etckeeper-cron calls etckeeper from cron.
%if 0%{?suse_version}
%package zypp-plugin
Summary: The etckeeper integration function with ZYpp
Group: System/Management
Requires: etckeeper = %{version}-%{release}
Requires: zypp-plugin-python
BuildRequires: zypp-plugin-python
Obsoletes: etckeeper-pkgmanager-collabo < %{version}-%{release}
Provides: etckeeper-pkgmanager-collabo = %{version}-%{release}
Provides: etckeeper:%{_prefix}/lib/zypp/plugins/commit/zypper-etckeeper.py
%description zypp-plugin
The etckeeper-zypp-plugin calls etckeeper from ZYpp.
%else
%package yum-plugin
Summary: The etckeeper integration function with YUM
Group: System/Management
Requires: etckeeper = %{version}-%{release}
Obsoletes: etckeeper-pkgmanager-collabo
Provides: etckeeper-pkgmanager-collabo = %{version}-%{release}
Provides: etckeeper:%{_sysconfdir}/yum/pluginconf.d/etckeeper.conf
%description yum-plugin
The etckeeper-zypp-plugin calls etckeeper from YUM.
%endif
%prep
%setup -q -n "%{name}"
%patch0 -p1
@ -97,17 +120,10 @@ s|^(\s*)(VCS)=.+|$1$2=git|;
make %{?_smp_mflags}
%install
make \
DESTDIR="%{buildroot}" \
PYTHON_INSTALL_OPTS="--prefix=%{_prefix} --root=%{buildroot}" \
PYTHON_INSTALL_OPTS="--prefix=%{_prefix} --install-purelib=%{python_sitearch}" \
install
# delete 2014-07-06 bkbin005@rinku.zaq.ne.jp - does not seems to work it.
# so, delete it.
## who cares about bzr...
#rm -rf "{buildroot}{_prefix}/lib"/python*
install -D debian/cron.daily "%{buildroot}/etc/cron.daily/%{name}"
%clean
@ -123,20 +139,20 @@ install -D debian/cron.daily "%{buildroot}/etc/cron.daily/%{name}"
%config %{_sysconfdir}/etckeeper/*.d/*
%doc %{_mandir}/man8/etckeeper.8*
%config %{_sysconfdir}/bash_completion.d/etckeeper
%{python_sitearch}/bzrlib/plugins/%{name}/
%{python_sitearch}/bzr_%{name}-*.egg-info
%files -n etckeeper-cron
%files cron
%defattr(-,root,root)
%config(noreplace) %{_sysconfdir}/cron.daily/etckeeper
%files -n etckeeper-pkgmanager-collabo
%defattr(-,root,root)
%if 0%{?suse_version}
%dir %{_prefix}/lib/zypp
%dir %{_prefix}/lib/zypp/plugins
%dir %{_prefix}/lib/zypp/plugins/commit
%files zypp-plugin
%defattr(-,root,root)
%{_prefix}/lib/zypp/plugins/commit/zypper-etckeeper.py
%else
%files yum-plugin
%defattr(-,root,root)
%config(noreplace) %{_sysconfdir}/yum/pluginconf.d/etckeeper.conf
%{_prefix}/lib/yum-plugins/etckeeper.*
%endif

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:86b77c9e375cdd09ed96c3c120e10c18d8d9ec4fa114622050b34552c36d5e31
size 49013

3
etckeeper_1.13.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8d0870a4f3751aa6ccf70bbece29843ce41c6f4432e3bc0929cae4a40fcf162b
size 48518