From patchwork Sat Mar 28 23:49:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gleb Mazovetskiy X-Patchwork-Id: 1263334 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=IsysUgBP; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48qb783ZRfz9sQt for ; Sun, 29 Mar 2020 10:49:55 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 6249220353; Sat, 28 Mar 2020 23:49:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QyR-QCviV-Pm; Sat, 28 Mar 2020 23:49:53 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 22F1A20362; Sat, 28 Mar 2020 23:49:53 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 9EFC21BF3E0 for ; Sat, 28 Mar 2020 23:49:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 9B88820362 for ; Sat, 28 Mar 2020 23:49:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cKefOmuBbear for ; Sat, 28 Mar 2020 23:49:50 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by silver.osuosl.org (Postfix) with ESMTPS id 781A720353 for ; Sat, 28 Mar 2020 23:49:50 +0000 (UTC) Received: by mail-wm1-f46.google.com with SMTP id g62so17095442wme.1 for ; Sat, 28 Mar 2020 16:49:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ei5H64SGs8sMITcHkB6NnBN+TR3i052tKso0tFSR5vc=; b=IsysUgBPauzJ/wgOtDQ+AWC+5R3PigAWGXQd2Dw17za0qr+REG/kCPZxGY0GyTK7sI +AokhVCjWDVPGSEeqJ1Q17llp8T0kRfHhA/WQHSbIst2phtbbe8aixhweeiS0G/jSfJX f3+nOgUfao52nsKCxVoh6lGmJUvZ980ZbiM5QkAnIw4MvKlgceULFZDm6AG7/AEzOHr/ OehJED43dwwxvwz49Zrsr4lJjsTVVZvE6Lqig7I6oWq7tHDMvAJjZPvj4gLC7pS3683D ayiegegojaml+IaOGl0WOce1eMpnLLJKLDIUV8mf6ya8W32cm8blg0itGP1YGaBFTvZL CJCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ei5H64SGs8sMITcHkB6NnBN+TR3i052tKso0tFSR5vc=; b=R88tPqbg5k/8h3mOG30IuQZ/ITnZDt4Y8BuOkXmPR3JEwErGFwCmcmDqN8DH1INMxi Scbpae8bhGWXVbHCejBXD9J4avUHjbNrDcPDfV/fgZ+Q994gDxcU/Qy9bzi3vK8zelyD 3ICdSxVzGlJpeytgMRiqCqNvpWSZX1/FZkrdSWTs2ihEMZ5XfEV8ZFNnRA0QiRmIzAYs Aa8eU8nrs0OnDGG3FnJp74jWcqEgmhHhWXRgWyTpEFVsRuSmllhTfGhpNAPkR5mLrzlL Q55Pg+Twl95MsQZEWB0aQElpcwQzXRz7YBPnMjGAZgO3a7Y+S8ABgKdhMhVjxngiprw8 g8sw== X-Gm-Message-State: ANhLgQ39vP6aW2GKmemhPtIYv7JHoRUlDZ4u1pQEmrYTmYLyhlBz24wm LWnTWbJQum06ob1D0oUhq7RhPrw5XCg= X-Google-Smtp-Source: ADFU+vuuaV+W3e3s+bqIifPudC9BuxVyOFiDxbw6GkDfKBg9e9TcwCjTZiZoKPWBI5GOTCnFsyCuVQ== X-Received: by 2002:a1c:195:: with SMTP id 143mr5971135wmb.0.1585439388609; Sat, 28 Mar 2020 16:49:48 -0700 (PDT) Received: from localhost (cpc76906-dals22-2-0-cust502.20-2.cable.virginm.net. [81.106.81.247]) by smtp.gmail.com with ESMTPSA id d13sm14696584wrv.34.2020.03.28.16.49.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 28 Mar 2020 16:49:48 -0700 (PDT) From: Gleb Mazovetskiy To: buildroot@buildroot.org Date: Sat, 28 Mar 2020 23:49:44 +0000 Message-Id: <20200328234945.12552-1-glex.spb@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH] relocate-sdk: Allow relocating to any location X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gleb Mazovetskiy Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Previously, the script could only relocate to the current location. This caused issues for SDK maintainers, as the default target location (e.g. /opt/my-sdk) would need to be created and the content copied to it during the build process, which is error-prone. With this change you can now pass a target location argument to ./relocate-sdk.sh (this does not move the directory). --- support/misc/relocate-sdk.sh | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/support/misc/relocate-sdk.sh b/support/misc/relocate-sdk.sh index caabeaa6f6..981d272425 100755 --- a/support/misc/relocate-sdk.sh +++ b/support/misc/relocate-sdk.sh @@ -1,15 +1,20 @@ #!/bin/sh -# -if [ "$#" -ne 0 ]; then - echo "Run this script to relocate the buildroot SDK at that location" + +if [ "$#" -gt 1 ]; then + echo "Usage: $0 [path]" + echo "Run this script to relocate the buildroot SDK to the current location" + echo "If [path] is given, sets the location to [path] (without moving it)" exit 1 fi -LOCFILE="share/buildroot/sdk-location" -FILEPATH="$(readlink -f "$0")" -NEWPATH="$(dirname "${FILEPATH}")" +cd "$(dirname "$(readlink -f "$0")")" +if [ "$#" -eq 1 ]; then + NEWPATH="$1" +else + NEWPATH="${PWD}" +fi -cd "${NEWPATH}" +LOCFILE="share/buildroot/sdk-location" if [ ! -r "${LOCFILE}" ]; then echo "Previous location of the buildroot SDK not found!" exit 1