From patchwork Fri Dec 9 11:33:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13069535 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 05FAFC4332F for ; Fri, 9 Dec 2022 11:44:25 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p3bds-0003NF-G2; Fri, 09 Dec 2022 06:34:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p3bdj-0003LS-S8 for qemu-devel@nongnu.org; Fri, 09 Dec 2022 06:34:04 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p3bdS-0000IP-Ua for qemu-devel@nongnu.org; Fri, 09 Dec 2022 06:34:02 -0500 Received: by mail-wm1-x32f.google.com with SMTP id ay8-20020a05600c1e0800b003d0808d2826so5601364wmb.1 for ; Fri, 09 Dec 2022 03:33:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=dLA8QEjrYdTNf33My29KKVDGQuaGLbZ2RRxkNnsl2uI=; b=Uw4evc2tCg3N2e/Fnf2zQ4uznEWGggsANlDwOzhmJlXHJxTbLkZpy0VpFrwfynQEPK Wkw4EQ0VTOu1Cp8AN+azO8tKfs4HAoUbBBvY1EuIoyioCIyyzthPyVLYEcrrV6cNad/e tm6WHicVnLNMiPAEGmJdKhq6UhK8t6qAJrtsMzwGMn/CtGsVP9YFyvtHoSNkV/eIlYoo 1t0fqdHBsWxg+nPFCl5Zz/uTLMzwPZS0z2MtZj1qbiCkJPK5MM5uG8ARdxdPegiLlKdv 53jOO9SZB+ysyyLTG/fqAJCXTbv53mvWhgWQCk1HT6eFMm0DJUzvNKpDA/kftX6wnfC6 TILA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=dLA8QEjrYdTNf33My29KKVDGQuaGLbZ2RRxkNnsl2uI=; b=OlAJIba3I30bKoHhBwBvV13FFI7WXnOSVJA1Y0PVph/99AKip+oTrQph4u+KmLSazU /I1wA136HWLq4ZpzdvUpT4MMtP24M76xBRmhcFcP8ANgz6Uk3GxtkQFnij98VE49/itU 6e4nKZ5owvhy2F1mQVcAUJq9WEWbRX8tJjc9O+xv7KK5jWw4oNvbkc6E8CZhKztmdltr kMqMCvMlneC2n7Dmj+BkDg9SzwjI7KN85DNOYY5IzMQppUE+NZ2BwW68XjVLc+hSa7d7 0+SqWbQUzzfuTKTHs9WsdcINh6ViWZNkj+tz5AkkxcUw/uxNxmyPATVuS2Xxen9hEMz+ q2RQ== X-Gm-Message-State: ANoB5pkcGtTzdV1cg9CKEkrjzxZM3MobcI4N2EOEk6jdnrcJUw/gMhUI w8ltYysIf+Ia/1IFUMColfzPV9Xg78/JDYQnQwo= X-Google-Smtp-Source: AA0mqf5pZ8/0JzVg2RjX9zPCaZYkM3QE2Blevv5hbduTbNVBbtdIk/GKu66OgKj/i9GCQiIgHRKFlQ== X-Received: by 2002:a05:600c:538b:b0:3cf:8d51:fae1 with SMTP id hg11-20020a05600c538b00b003cf8d51fae1mr4825907wmb.0.1670585625010; Fri, 09 Dec 2022 03:33:45 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id v24-20020a05600c215800b003cf6a55d8e8sm1575290wml.7.2022.12.09.03.33.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 09 Dec 2022 03:33:44 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Wainer dos Santos Moschetta , Beraldo Leal , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Gerd Hoffmann , qemu-trivial@nongnu.org, =?utf-8?q?Danie?= =?utf-8?q?l_P_=2E_Berrang=C3=A9?= , Eric Blake , Thomas Huth Subject: [PATCH v2] scripts/archive-source: Use GNU tar on Darwin Date: Fri, 9 Dec 2022 12:33:42 +0100 Message-Id: <20221209113342.61053-1-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org When using the archive-source.sh script on Darwin we get: tar: Option --concatenate is not supported Usage: List: tar -tf Extract: tar -xf Create: tar -cf [filenames...] Help: tar --help 'tar' default to the BSD implementation: $ tar --version bsdtar 3.5.3 - libarchive 3.5.3 zlib/1.2.11 liblzma/5.0.5 bz2lib/1.0.8 Try to use the GNU implementation if it is available (from homebrew). Suggested-by: Daniel P. Berrangé Signed-off-by: Philippe Mathieu-Daudé --- Supersedes: <20221208162051.29509-1-philmd@linaro.org> --- scripts/archive-source.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/archive-source.sh b/scripts/archive-source.sh index 23e042dacd..e3d0c23fe5 100755 --- a/scripts/archive-source.sh +++ b/scripts/archive-source.sh @@ -18,6 +18,7 @@ if test $# -lt 1; then error "Usage: $0 " fi +test $(uname -s) = "Darwin" && tar=gtar || tar=tar tar_file=$(realpath "$1") sub_tdir=$(mktemp -d "${tar_file%.tar}.sub.XXXXXXXX") sub_file="${sub_tdir}/submodule.tar" @@ -67,7 +68,7 @@ for sm in $submodules; do esac (cd $sm; git archive --format tar --prefix "$sm/" $(tree_ish)) > "$sub_file" test $? -ne 0 && error "failed to archive submodule $sm ($smhash)" - tar --concatenate --file "$tar_file" "$sub_file" + $tar --concatenate --file "$tar_file" "$sub_file" test $? -ne 0 && error "failed append submodule $sm to $tar_file" done exit 0