From patchwork Fri Dec 14 13:38:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 10731171 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0E3865DE2 for ; Fri, 14 Dec 2018 13:39:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F274E2D49D for ; Fri, 14 Dec 2018 13:39:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E67302D4A0; Fri, 14 Dec 2018 13:39:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EB7632D49D for ; Fri, 14 Dec 2018 13:39:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A05596F4DE; Fri, 14 Dec 2018 13:39:10 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id 364FA6F4CE; Fri, 14 Dec 2018 13:39:09 +0000 (UTC) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20181214133900euoutp01b6fd28cbbde0e0412fa5a6e494e364c9~wNqHUIhLE0784307843euoutp01e; Fri, 14 Dec 2018 13:39:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20181214133900euoutp01b6fd28cbbde0e0412fa5a6e494e364c9~wNqHUIhLE0784307843euoutp01e Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20181214133900eucas1p240f84b464bc468c595b9c76fd1f4d33f~wNqG2uqWj0610306103eucas1p22; Fri, 14 Dec 2018 13:39:00 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 00.78.04294.472B31C5; Fri, 14 Dec 2018 13:39:00 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20181214133859eucas1p2354f9ece984a7c97c3b4dcd720439657~wNqGKRVUr1012110121eucas1p2F; Fri, 14 Dec 2018 13:38:59 +0000 (GMT) X-AuditID: cbfec7f4-c77a99c0000010c6-8f-5c13b2746597 Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id E4.17.04284.372B31C5; Fri, 14 Dec 2018 13:38:59 +0000 (GMT) Received: from AMDC3748.DIGITAL.local ([106.120.43.17]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PJQ007PHB8Y1V20@eusync1.samsung.com>; Fri, 14 Dec 2018 13:38:59 +0000 (GMT) From: Andrzej Hajda To: dri-devel@lists.freedesktop.org, dim-tools@lists.freedesktop.org Subject: [maintainer-tools PATCH RFC 3/3] dim: fix rr_cache_dir discovery Date: Fri, 14 Dec 2018 14:38:52 +0100 Message-id: <20181214133852.19665-4-a.hajda@samsung.com> X-Mailer: git-send-email 2.17.1 In-reply-to: <20181214133852.19665-1-a.hajda@samsung.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wi4SNz68ZgFpIFZoI9RovHvKrCEsICnRNOzX0wgNouAqsStrpmsIDavgIXE2ke/WCG2yUus 3nCAGcTmFLCUOL55PiPEMguJQ+t2s01g5FnAyLCKUSS1tDg3PbfYUK84Mbe4NC9dLzk/dxMj MBS2Hfu5eQfjpY3BhxgFOBiVeHgPTBGKEWJNLCuuzD3EKMHBrCTCG9YqHCPEm5JYWZValB9f VJqTWnyIUZqDRUmc97xBZZSQQHpiSWp2ampBahFMlomDU6qBUboyX6bo5qYfrzP4U/7Nvqv4 pu2JPd+BDeZRpreYqyaL9Fyc+sX8IEPqHkc+jleP9db9NvO+vls8dpl2yNtlIbe1H7P4LUyc 4rz5ya4K/c3qCq7r+Q7XzZta8uDct6znc/W92+/aXb99QqFUSOfWtp67wWEz5NiETBrYojjy A2wNL72R8NJ/qsRSnJFoqMVcVJwIAJ5TdgUBAgAA X-CMS-MailID: 20181214133859eucas1p2354f9ece984a7c97c3b4dcd720439657 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181214133859eucas1p2354f9ece984a7c97c3b4dcd720439657 References: <20181214133852.19665-1-a.hajda@samsung.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Szyprowski , Bartlomiej Zolnierkiewicz MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP rr_cache_dir function cannot assume REPO/.git is a directory. On the other side it should be backward compatible - if rr-cache directory/link already exists it should be returned. Signed-off-by: Andrzej Hajda --- Hi, I am not sure of the purpose of rr-cache symbolic link, dim does not use it (except its creation/removal). So this patch should be verified by someone who knows better what is going on here. Regards Andrzej --- dim | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/dim b/dim index 3afa8b6..b72ebfd 100755 --- a/dim +++ b/dim @@ -554,15 +554,6 @@ function check_conflicts # tree true } -function rr_cache_dir -{ - if [ -d $DIM_PREFIX/drm-tip/.git/ ] ; then - echo $DIM_PREFIX/drm-tip/.git/rr-cache - else - echo $DIM_PREFIX/$DIM_REPO/.git/rr-cache - fi -} - function git_dir { local dir=${1:-$PWD} @@ -574,6 +565,17 @@ function git_dir fi } +function rr_cache_dir +{ + local dir=$(git_dir $DIM_PREFIX/$DIM_REPO)/rr-cache + + if [ -d $dir ]; then + echo $dir + else + echo $(git_dir $DIM_PREFIX/drm-tip)/rr-cache + fi +} + function pull_rerere_cache { cd $DIM_PREFIX/drm-rerere/