From: Michal Marek <mmarek@suse.cz>
To: riku.voipio@linaro.org
Cc: linux-kbuild@vger.kernel.org, debian-kernel@lists.debian.org
Subject: Re: [PATCH 1/2] deb-pkg: move setting debarch for a separate function
Date: Wed, 15 Apr 2015 14:30:17 +0200 [thread overview]
Message-ID: <552E59D9.7060101@suse.cz> (raw)
In-Reply-To: <cf573e24baadc04da27c471dafee90344e0cb400.1428671643.git.riku.voipio@linaro.org>
On 2015-04-10 15:15, riku.voipio@linaro.org wrote:
> From: Riku Voipio <riku.voipio@linaro.org>
>
> create_package() function tries to resolve used architecture
> for everry package. Split the setting the architecture to a
> new function, set_debarch(), called once on startup.
>
> This allows using debarch from other parts of script as
> needed.
> ---
> scripts/package/builddeb | 14 ++++++++++----
> 1 file changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/scripts/package/builddeb b/scripts/package/builddeb
> index a9858a4..e397815 100755
> --- a/scripts/package/builddeb
> +++ b/scripts/package/builddeb
> @@ -27,8 +27,15 @@ create_package() {
> chown -R root:root "$pdir"
> chmod -R go-w "$pdir"
>
> + # Create the package
> + dpkg-gencontrol $forcearch -Vkernel:debarch="${debarch:-$(dpkg --print-architecture)}" -p$pname -P"$pdir"
> + dpkg --build "$pdir" ..
> +}
> +
> +set_debarch() {
> # Attempt to find the correct Debian architecture
> - local forcearch="" debarch=""
> + forcearch=""
> + debarch=""
> case "$UTS_MACHINE" in
> i386|ia64|alpha)
> debarch="$UTS_MACHINE" ;;
> @@ -73,10 +80,8 @@ create_package() {
> if [ -n "$debarch" ] ; then
> forcearch="-DArchitecture=$debarch"
> fi
> + export forcearch debarch
You do not need to export the variables. But it will improve the
readability of the script if you initialize the variables in the
toplevel scope.
Also, the fallback for empty $debarch is $(dpkg --print-architecture).
It makes sense to set it once in the new function.
Michal
next prev parent reply other threads:[~2015-04-15 12:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-10 13:15 [PATCH 1/2] deb-pkg: move setting debarch for a separate function riku.voipio
2015-04-10 13:15 ` [PATCH 2/2] deb-pkg: add source package riku.voipio
2015-04-22 15:50 ` maximilian attems
2015-04-23 9:01 ` Riku Voipio
2015-04-23 10:43 ` maximilian attems
2015-04-15 12:30 ` Michal Marek [this message]
2015-04-16 13:42 ` [PATCH] deb-pkg: v2: move setting debarch for a separate function riku.voipio
2015-04-22 14:45 ` Michal Marek
2015-04-22 15:52 ` maximilian attems
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=552E59D9.7060101@suse.cz \
--to=mmarek@suse.cz \
--cc=debian-kernel@lists.debian.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=riku.voipio@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.