[packages/util-vserver] - emulate '--initdb' on rpm5 - add '--convertdb' vrpm option to convert rpm db from rpm4 (db4.7) to
baggins
baggins at pld-linux.org
Fri Oct 12 20:21:18 CEST 2012
commit 696acb349e8ad798ddebf643c07bbe1ebc68155a
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Fri Oct 12 20:18:29 2012 +0200
- emulate '--initdb' on rpm5
- add '--convertdb' vrpm option to convert rpm db from rpm4 (db4.7) to rpm5 (db5.3)
use it as normal rpm option: 'vrpm <vserver> -- --convertdb'
- don't package redhat files in main package
- rel 2
util-vserver-rpm5.patch | 27 +++++++++++++++++++++++++++
util-vserver.spec | 8 +++-----
2 files changed, 30 insertions(+), 5 deletions(-)
---
diff --git a/util-vserver.spec b/util-vserver.spec
index 7948b64..fb8d40a 100644
--- a/util-vserver.spec
+++ b/util-vserver.spec
@@ -19,7 +19,7 @@
%endif
%define snap pre3034
-%define rel 1
+%define rel 2
Summary: Linux virtual server utilities
Summary(pl.UTF-8): Narzędzia dla linuksowych serwerów wirtualnych
Name: util-vserver
@@ -76,6 +76,7 @@ Patch22: %{name}-pivot-root-ugly-hack.patch
Patch24: vunify-more-exclude.patch
Patch25: stat.patch
Patch26: %{name}-am.patch
+Patch27: %{name}-rpm5.patch
URL: http://savannah.nongnu.org/projects/util-vserver/
BuildRequires: autoconf
BuildRequires: automake >= 1.9
@@ -438,6 +439,7 @@ Szablony do tworzenia VServerów dla dystrybucji Titanium Linux.
%patch24 -p1
%patch25 -p1
%patch26 -p1
+%patch27 -p1
install %{SOURCE9} package-management.txt
@@ -781,10 +783,6 @@ exit 0
%dir %{_libdir}/%{name}/distributions/template
%attr(755,root,root) %{_libdir}/%{name}/distributions/template/initpost
%attr(755,root,root) %{_libdir}/%{name}/distributions/template/initpre
-%dir %{_libdir}/%{name}/distributions/redhat
-%attr(755,root,root) %{_libdir}/%{name}/distributions/redhat/initpost
-%attr(755,root,root) %{_libdir}/%{name}/distributions/redhat/initpre
-%attr(755,root,root) %{_libdir}/%{name}/distributions/redhat/rc.sysinit
%{_libdir}/%{name}/FEATURES.txt
%{_libdir}/%{name}/util-vserver-vars
%attr(755,root,root) %{_libdir}/%{name}/bash-wrapper
diff --git a/util-vserver-rpm5.patch b/util-vserver-rpm5.patch
new file mode 100644
index 0000000..f3106be
--- /dev/null
+++ b/util-vserver-rpm5.patch
@@ -0,0 +1,27 @@
+--- util-vserver-0.30.216-pre3034/scripts/vrpm.orig 2012-04-24 11:48:10.000000000 +0200
++++ util-vserver-0.30.216-pre3034/scripts/vrpm 2012-10-12 18:44:57.137928223 +0200
+@@ -46,6 +46,9 @@
+ exit 0
+ }
+
++rpmversion=$(awk '/^%_rpmversion/ { split($2,ver,/\./); print ver[1] }' /usr/lib/rpm/macros 2>/dev/null)
++[ -z "$rpmversion" ] && rpmversion=5
++
+ tmp=$(getopt -o +q --long help,version,debug,quiet,$VS_ALLVSERVERS_ARGS -n "$0" -- "$@") || exit 1
+ eval set -- "$tmp"
+
+@@ -70,4 +73,14 @@
+ export VSOMETHING_TITLE VSOMETHING_WORKER VSOMETHING_PKGMGMT
+
+ test ${#vsomething_opts[@]} -eq 0 || vsomething_opts=( "${vsomething_opts[@]}" -- )
++if [ "$rpmversion" -ge 5 ]; then
++ declare -a rpm_opts
++ [ ${#vsomething_opts[@]} -eq 0 ] && rpm_opts=( "$1" "--" )
++ if [[ "$@" = *--initdb* ]]; then
++ exec $_VSOMETHING "${send_through[@]}" rpm "${vsomething_opts[@]}" "${rpm_opts[@]}" -qa
++ fi
++ if [[ "$@" = *--convertdb* ]]; then
++ exec $_VSOMETHING "${send_through[@]}" /usr/lib/rpm/bin/dbconvert "${vsomething_opts[@]}" "${rpm_opts[@]}" --rebuilddb
++ fi
++fi
+ exec $_VSOMETHING "${send_through[@]}" rpm "${vsomething_opts[@]}" "$@"
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/util-vserver.git/commitdiff/696acb349e8ad798ddebf643c07bbe1ebc68155a
More information about the pld-cvs-commit
mailing list