From: Stefano Stabellini Subject: Re: [PATCH 4/8] raisin: Use PKGTYPE rather than DISTRO to determine how to build a package Date: Fri, 17 Apr 2015 11:10:23 +0100 Message-ID: References: <1429201182-1044-1-git-send-email-george.dunlap@eu.citrix.com> <1429201182-1044-4-git-send-email-george.dunlap@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1429201182-1044-4-git-send-email-george.dunlap@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: George Dunlap Cc: Stefano Stabellini , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Thu, 16 Apr 2015, George Dunlap wrote: > Signed-off-by: George Dunlap > --- > CC: Stefano Stabellini > --- > lib/common-functions.sh | 18 +++++++++--------- > 1 file changed, 9 insertions(+), 9 deletions(-) > > diff --git a/lib/common-functions.sh b/lib/common-functions.sh > index 373d6fb..e66c6f4 100644 > --- a/lib/common-functions.sh > +++ b/lib/common-functions.sh > @@ -239,16 +239,16 @@ function for_each_component () { > done > } > > +function _build_package_deb() { > + fakeroot bash ./scripts/mkdeb "$1" > +} > + > +function _build_package_rpm() { > + ./scripts/mkrpm "$1" > +} > + > function build_package() { > - if [[ $DISTRO = "Debian" ]] > - then > - fakeroot bash ./scripts/mkdeb "$1" > - elif [[ $DISTRO = "Fedora" ]] > - then > - ./scripts/mkrpm "$1" > - else > - echo "Don't know how to create packages for $DISTRO" > - fi > + _build_package_${PKGTYPE} "$1" Just use "$PKGTYPE" instead of ${} Also please document PKGTYPE among the exported global variables in the README. > } > > function install_package() { > -- > 1.9.1 >