public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "Maxim Yu. Osipov" <mosipov@ilbers.de>
To: isar-users@googlegroups.com
Subject: Re: [PATCH] classes/isar-image: Collapse multiple sudo's
Date: Mon, 7 Jan 2019 18:19:42 +0300	[thread overview]
Message-ID: <aeb8186c-1451-6f2f-c43b-2780692a4458@ilbers.de> (raw)
In-Reply-To: <20181219111638.22173-1-mosipov@ilbers.de>

On 12/19/18 2:16 PM, Maxim Yu. Osipov wrote:
> Suggested-by: Jan Kiszka <jan.kiszka@siemens.com>
> Signed-off-by: Maxim Yu. Osipov <mosipov@ilbers.de>

Applied to the 'next'.

> ---
>   meta/classes/isar-image.bbclass | 40 +++++++++++++++++++++-------------------
>   1 file changed, 21 insertions(+), 19 deletions(-)
> 
> diff --git a/meta/classes/isar-image.bbclass b/meta/classes/isar-image.bbclass
> index 4992800..754e896 100644
> --- a/meta/classes/isar-image.bbclass
> +++ b/meta/classes/isar-image.bbclass
> @@ -53,26 +53,28 @@ isar_image_conf_rootfs() {
>   
>   isar_image_cleanup() {
>       # Cleanup
> -    sudo rm "${IMAGE_ROOTFS}/etc/apt/sources.list.d/isar-apt.list"
> -    test ! -e "${IMAGE_ROOTFS}/usr/share/doc/qemu-user-static" && \
> -         sudo find "${IMAGE_ROOTFS}/usr/bin" \
> -              -maxdepth 1 -name 'qemu-*-static' -type f -delete
> -    sudo umount -l ${IMAGE_ROOTFS}/isar-apt
> -    sudo rmdir ${IMAGE_ROOTFS}/isar-apt
> -    sudo umount -l ${IMAGE_ROOTFS}/dev
> -    sudo umount -l ${IMAGE_ROOTFS}/proc
> -    sudo umount -l ${IMAGE_ROOTFS}/sys
> -    sudo rm -f "${IMAGE_ROOTFS}/etc/apt/apt.conf.d/55isar-fallback.conf"
> -    if [ "${ISAR_USE_CACHED_BASE_REPO}" = "1" ]; then
> -        sudo umount -l ${IMAGE_ROOTFS}/base-apt
> -        sudo rmdir ${IMAGE_ROOTFS}/base-apt
> -        # Replace the local apt we bootstrapped with the
> -        # APT sources initially defined in DISTRO_APT_SOURCES
> -        sudo rm -f "${IMAGE_ROOTFS}/etc/apt/sources.list.d/base-apt.list"
> -        sudo mv "${IMAGE_ROOTFS}/etc/apt/sources-list" \
> +    sudo sh -c ' \
> +        rm "${IMAGE_ROOTFS}/etc/apt/sources.list.d/isar-apt.list"
> +        test ! -e "${IMAGE_ROOTFS}/usr/share/doc/qemu-user-static" && \
> +            find "${IMAGE_ROOTFS}/usr/bin" \
> +                -maxdepth 1 -name 'qemu-*-static' -type f -delete
> +             umount -l ${IMAGE_ROOTFS}/isar-apt
> +        rmdir ${IMAGE_ROOTFS}/isar-apt
> +        umount -l ${IMAGE_ROOTFS}/dev
> +        umount -l ${IMAGE_ROOTFS}/proc
> +        umount -l ${IMAGE_ROOTFS}/sys
> +        rm -f "${IMAGE_ROOTFS}/etc/apt/apt.conf.d/55isar-fallback.conf"
> +        if [ "${ISAR_USE_CACHED_BASE_REPO}" = "1" ]; then
> +            umount -l ${IMAGE_ROOTFS}/base-apt
> +            rmdir ${IMAGE_ROOTFS}/base-apt
> +            # Replace the local apt we bootstrapped with the
> +            # APT sources initially defined in DISTRO_APT_SOURCES
> +            rm -f "${IMAGE_ROOTFS}/etc/apt/sources.list.d/base-apt.list"
> +            mv "${IMAGE_ROOTFS}/etc/apt/sources-list" \
>                   "${IMAGE_ROOTFS}/etc/apt/sources.list.d/bootstrap.list"
> -    fi
> -    sudo rm -f "${IMAGE_ROOTFS}/etc/apt/sources-list"
> +        fi
> +        rm -f "${IMAGE_ROOTFS}/etc/apt/sources-list"
> +    '
>   }
>   
>   do_rootfs() {
> 


-- 
Maxim Osipov
ilbers GmbH
Maria-Merian-Str. 8
85521 Ottobrunn
Germany
+49 (151) 6517 6917
mosipov@ilbers.de
http://ilbers.de/
Commercial register Munich, HRB 214197
General Manager: Baurzhan Ismagulov

      reply	other threads:[~2019-01-07 15:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-19 11:16 Maxim Yu. Osipov
2019-01-07 15:19 ` Maxim Yu. Osipov [this message]

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=aeb8186c-1451-6f2f-c43b-2780692a4458@ilbers.de \
    --to=mosipov@ilbers.de \
    --cc=isar-users@googlegroups.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox