From patchwork Wed Nov 15 09:17:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 118920 Delivered-To: patch@linaro.org Received: by 10.80.225.132 with SMTP id k4csp3269882edl; Wed, 15 Nov 2017 01:20:14 -0800 (PST) X-Google-Smtp-Source: AGs4zMal//nzzxGoan6pSzbtV4mEIxjU9jDC/IPjKsTZ1eGHAsje6DzTKhU3Gb+O7i8IMLbh77Sf X-Received: by 10.84.233.131 with SMTP id l3mr12161414plk.295.1510737613849; Wed, 15 Nov 2017 01:20:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510737613; cv=none; d=google.com; s=arc-20160816; b=Gj9MXQCiOtn/cAAsVaEYLyvQ329bOwJ0LvZkH+ZfoF/dec3nMbgpaGJAA9wKvWqPZ8 b3+UsMPNjJMGApJj4VLSGLsRmCd8vLAGXcd+U9qsrP5uCRP/EAbkr+2ECvTBfVaxpQ30 SAA3HoyeSA5RI2NShQ2NGikrXoHKufjNbW3qi0usOwnRZT8EFaTKHx6AgpgtTp29k1KW 4oUDsHz+2J/FmuHc5o4ggepTdR68jkjqeIV0P0CXAbEJtF7oXW2iKfVWLWSFNcbyqduc fF07WAlXlUlvPyWGFk4jmEXdWO0HjIN12LzU8uDN5YPTdXQJQV3++8CR2ZzRxlUq2V7s UyLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter:arc-authentication-results; bh=WI5SVE2/5FI4PJXJfGLu54btPqlnugOV7Kda4X2/5o8=; b=EjyiLHFYvKiPbILWIqfT5b5jflHFqu93fpYG3CGxBXgUSlGNbLrDENugibHD45Za9c ttAes+PwlqPvG3xBvXq3a0zDznASTknhbOrvBy+lL4p7jpHoLn9YgCKQMb1Mk0gSCnRn qk1eMoi114n4okoWkhbvPFAEFo/q1yACyk+n/+BbbGGwNY5jLmKtA1fZerfvFSvYJQCI bfPFFd6tiIvbEE8z8bzWTH2Kn0omeu4VAeYukC5RlgdOU/TM348BSvsa6pN4i38oA1a+ vppL0++HqZKT2wS4vn4gRHY3JUL3eIw89SDR2r+FMyk/mDGiwm1GLHBdI0ThD1oVHPr+ uc0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=UD844wp/; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e7si19111251pfb.298.2017.11.15.01.20.13; Wed, 15 Nov 2017 01:20:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=UD844wp/; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757290AbdKOJUK (ORCPT + 28 others); Wed, 15 Nov 2017 04:20:10 -0500 Received: from conuserg-10.nifty.com ([210.131.2.77]:20858 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756973AbdKOJTG (ORCPT ); Wed, 15 Nov 2017 04:19:06 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id vAF9HXd5029146; Wed, 15 Nov 2017 18:17:34 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com vAF9HXd5029146 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1510737454; bh=WI5SVE2/5FI4PJXJfGLu54btPqlnugOV7Kda4X2/5o8=; h=From:To:Cc:Subject:Date:From; b=UD844wp/jYDj3bk2dKLAALrxPM9ju6A/EyRMS34YeGgX0a9pLOxAg3LajXbN0um7j hozGYvdBtE2o9/KrHqn7D2CDyGqgGPTZh0OnR+ASzH99M402WvMIlFP3jV+zR4bAl/ laJIZw3zjI+jb1U59O1IagxhymmRk4PF3j0BsRHAyGlOQJvqh/8hdRQX5LilXmmoLY h9S+KKnzF50rRHRntsowggd5/GqZV8JwK9pkYwifAY2pue1znMepiit4/To39QkxyB FdemXJRR9DE8NmC8rI2XSgDc1wHWukRlHnDisNQEqgshBPTh9wWiH/2KnMjmNv/z4W K0LlFTKmJdtFQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Sam Ravnborg , Michal Marek , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH] kbuild: package: use --transform option to prefix paths in tar Date: Wed, 15 Nov 2017 18:17:07 +0900 Message-Id: <1510737427-12510-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For rpm-pkg and deb-pkg, a source tar file is created. All paths in the archive must be prefixed with the base name of the tar. That means, everything is contained in the directory when you extract it. Currently, scripts/package/Makefile uses a symlink for that, and removes it after the tar is created. If you terminate the build during the tar creation, the symlink is left over. Then, at the next package build, you will see a warning like follows: ln: '.' and 'kernel-4.14.0+/.' are the same file It is possible to fix it by adding -n (--no-dereference) option to the "ln" command, but a cleaner way is to use --transform option of "tar" command. This option is GNU extension, but it should not hurt to use it in the Linux build system. The 'S' flag is needed to exclude symlinks from the path fixup. Without it, symlinks in the kernel are broken. Signed-off-by: Masahiro Yamada --- scripts/package/Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.7.4 diff --git a/scripts/package/Makefile b/scripts/package/Makefile index 9ed96aef..c30bcf8 100644 --- a/scripts/package/Makefile +++ b/scripts/package/Makefile @@ -39,10 +39,9 @@ if test "$(objtree)" != "$(srctree)"; then \ false; \ fi ; \ $(srctree)/scripts/setlocalversion --save-scmversion; \ -ln -sf $(srctree) $(2); \ tar -cz $(RCS_TAR_IGNORE) -f $(2).tar.gz \ - $(addprefix $(2)/,$(TAR_CONTENT) $(3)); \ -rm -f $(2) $(objtree)/.scmversion + --transform 's:^:$(2)/:S' $(TAR_CONTENT) $(3); \ +rm -f $(objtree)/.scmversion # rpm-pkg # ---------------------------------------------------------------------------