From: Panu Matilainen Date: Mon, 25 Jun 2012 07:34:22 +0000 (+0300) Subject: Add support for quilt (ticket #54) and bzr to %autosetup/patch X-Git-Tag: tznext/4.11.0.1.tizen20130304~446 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5322c3bd4bb99e9f1221eeddaf8de4da0f729e99;p=tools%2Flibrpm-tizen.git Add support for quilt (ticket #54) and bzr to %autosetup/patch - These are both "appears to have roughly the intended effect" level tested, but I'm not really familiar with either bzr or quilt so any further refinements need to come from people actually familiar with these tools. --- diff --git a/configure.ac b/configure.ac index 55ba214..cd11d26 100644 --- a/configure.ac +++ b/configure.ac @@ -144,6 +144,8 @@ AC_PATH_PROG(__STRIP, strip, /usr/bin/strip, $MYPATH) AC_PATH_PROG(__GIT, git, /usr/bin/git, $MYPATH) AC_PATH_PROG(__HG, hg, /usr/bin/hg, $MYPATH) +AC_PATH_PROG(__BZR, bzr, /usr/bin/bzr, $MYPATH) +AC_PATH_PROG(__QUILT, quilt, /usr/bin/quilt, $MYPATH) AC_PATH_PROG(__FAKECHROOT, fakechroot, no, $MYPATH) AM_CONDITIONAL(HAVE_FAKECHROOT, [test "$__FAKECHROOT" != "no"]) diff --git a/macros.in b/macros.in index 31bb70c..4c77bbb 100644 --- a/macros.in +++ b/macros.in @@ -70,6 +70,8 @@ %__unzip @__UNZIP@ %__git @__GIT@ %__hg @__HG@ +%__bzr @__BZR@ +%__quilt @__QUILT@ #============================================================================== # ---- Build system path macros. @@ -1033,6 +1035,7 @@ done \ %__scm_author rpm-build # Plain patch (-m is unused) +%__scm_setup_patch(q) %{nil} %__scm_apply_patch(qp:m:)\ %{__patch} %{-p:-p%{-p*}} %{-q:-s} @@ -1056,6 +1059,23 @@ done \ %{__git} apply %{-p:-p%{-p*}} -\ %{__git} commit %{-q} -a -m %{-m*} --author "%{__scm_author}" +# Quilt +%__scm_setup_quilt(q) %{nil} +%__scm_apply_quilt(qp:m:)\ +%{__quilt} import %{-p:-p%{-p*}} %{1} && %{__quilt} push + +# Bzr +%__scm_setup_bzr(q)\ +%{__bzr} whoami "%{__scm_author}"\ +%{__bzr} init %{-q}\ +%{__bzr} add .\ +%{__bzr} commit %{-q} -m "%{name}-%{version} base" + +# bzr doesn't seem to have its own command to apply patches? +%__scm_apply_bzr(qp:m:)\ +%{__patch} %{-p:-p%{-p*}} %{-q:-s}\ +%{__bzr} commit %{-q} -m %{-m*} + # Single patch application %apply_patch(qp:m:)\ %{uncompress:%{1}} | %{expand:%__scm_apply_%{__scm} %{-q} %{-p:-p%{-p*}} %{-m:-m%{-m*}}}