public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Cedric Hombourger <Cedric_Hombourger@mentor.com>
To: <isar-users@googlegroups.com>
Cc: Cedric Hombourger <Cedric_Hombourger@mentor.com>
Subject: [PATCH 1/1] isar-bootstrap-helper: fix "Argument list too long" error
Date: Sun, 9 Dec 2018 16:21:40 +0100	[thread overview]
Message-ID: <20181209152140.9013-2-Cedric_Hombourger@mentor.com> (raw)
In-Reply-To: <20181209152140.9013-1-Cedric_Hombourger@mentor.com>

The mv command used to move downloaded .deb files to the apt cache will
fail with an "Argument list too long" error when the root file-system
includes many packages. Use 'find -execdir {} +' to call /bin/mv with
as many packages as possible but without exceeding system limits.

Signed-off-by: Cedric Hombourger <Cedric_Hombourger@mentor.com>
---
 meta/classes/isar-bootstrap-helper.bbclass | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/meta/classes/isar-bootstrap-helper.bbclass b/meta/classes/isar-bootstrap-helper.bbclass
index 641138a..d780b85 100644
--- a/meta/classes/isar-bootstrap-helper.bbclass
+++ b/meta/classes/isar-bootstrap-helper.bbclass
@@ -145,8 +145,9 @@ setup_root_file_system() {
     if [ ${CLEAN} ]; then
         if [ ${KEEP_APT_CACHE} -eq 1 ]; then
             mkdir -p ${WORKDIR}/apt_cache
-            sudo mv $(find $ROOTFSDIR/var/cache/apt -name '*.deb') ${WORKDIR}/apt_cache
-            sudo chown `whoami` ${WORKDIR}/apt_cache/*
+            sudo find ${ROOTFSDIR}/var/cache/apt/archives \
+                -maxdepth 1 -name '*.deb' -execdir /bin/mv -t ${WORKDIR}/apt_cache '{}' '+'
+            sudo chown -R $(whoami) ${WORKDIR}/apt_cache
         fi
         sudo -E chroot "$ROOTFSDIR" \
             /usr/bin/apt-get autoremove --purge --yes
-- 
2.11.0


  reply	other threads:[~2018-12-09 15:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-09 15:21 [PATCH 0/1] " Cedric Hombourger
2018-12-09 15:21 ` Cedric Hombourger [this message]
2018-12-11  8:12   ` [PATCH 1/1] " Maxim Yu. Osipov

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=20181209152140.9013-2-Cedric_Hombourger@mentor.com \
    --to=cedric_hombourger@mentor.com \
    --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