From patchwork Tue Feb 8 22:12:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cedric Hombourger X-Patchwork-Id: 1432 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3) with LMTPA; Wed, 09 Feb 2022 09:13:18 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-wr1-f55.google.com (mail-wr1-f55.google.com [209.85.221.55]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8) with ESMTPS id 2198DHqS023332 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 9 Feb 2022 09:13:18 +0100 Received: by mail-wr1-f55.google.com with SMTP id d13-20020adfa34d000000b001e33a1c56f3sf767619wrb.20 for ; Wed, 09 Feb 2022 00:13:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1644394392; cv=pass; d=google.com; s=arc-20160816; b=EDJ1e5guKtG31JgEn8mtFRw7Huu53D62V8NgtEc1MKmbjg26PoYaXw3QS7NBu6FeRQ qr/CVZxDd7RDFqHk6xMTI22qUdH2Z4kNOhgwygChc0NCuZW03h4aGAZOC/HKsX+GctcQ 1h7NvbzpIRTX/cG5tgTG6dAM2rIQtTmvDGL2PHygwbnQsHgR0F/qBSawf62+nkJV1y5g THYxecLEL6RwS3OwBnYFdTpuYrGMGxsBrd9HXxlDd5ecx9qHYE2aTd1SOH45Ax5i/mBU cK3jS8KvoH2AB5TVzH5p3Fwf4Fd5qQG91XN5TA8QGFXGPfVV86Cymc848TDkrt9RAwqq j53g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:ironport-sdr:ironport-sdr:sender :dkim-signature; bh=Oz25JXCLHrqrsyLiK2r7rTKRVLU5Xv9srD+gjHLnJC0=; b=l+fHv7KffS5q9BKJ5kXcncsG0zYYaPDdm8Yc6hUVKGU2pys5d5erVCv9tJXP+b3D5L NMfTibi6sPUUNJ6vSnIQD3K5cUn2gzV0mhuYyZzpthvcz68VI7t/bMisn4q59qzDMJjQ tCcjYk69ANJAyGEcp8p9gDTT/U6UQ/tZCHhxlkLmaukuVO+MCi1MDNLqoGucFxzwE3zN aIK0bkp2uvC62KKHrSzPs0X0hvEh9clf1mqh+5xhKHXC//ZNax4b/Q597xnJnLRG3Ru6 3prvocABgYj/3UzbTfBaM0gxtaYV3Yqf0XNKf464NyasLS0Onf6pQY1AzXADIXLVWGgL CuIg== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of cedric_hombourger@mentor.com designates 68.232.137.180 as permitted sender) smtp.mailfrom=Cedric_Hombourger@mentor.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:ironport-sdr:ironport-sdr:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=Oz25JXCLHrqrsyLiK2r7rTKRVLU5Xv9srD+gjHLnJC0=; b=J2CoDbEAZT7MbSCWfsouI06sASoKIhbrv8jUaqCWxLLQ+hEk1VJwr0jyO6JzwhMotY AA6HKiy2tJJZAC2ih8wTxIuIN8oAOwJ6/Zt0nO0b5c6WrsMYvH8FhzTbqqu1CYkfNUbd v0vB9soX9qFI6u0CFcNgFuMFUaEKbNpqdpcsnlDQGZl+r4hT5z1j94JEtfvN9ScTx8sK 6uFpixZmVRNrR0JXZ+npZsc3hbIvWsWKVR3Uo2Zbz/Q0oE5nnedRltpZyyDxdC2Q6PF2 GphBrdKGINIO0ningjHa4pnydrSOr4sUzENuVpjtiZICQareUrJkdbLPCGE5jM2r2AMs Z/5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:ironport-sdr:ironport-sdr:from:to:cc :subject:date:message-id:in-reply-to:references:mime-version :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=Oz25JXCLHrqrsyLiK2r7rTKRVLU5Xv9srD+gjHLnJC0=; b=2f7OUnSKpRU3GejYXywBguiPrvd41J7dCkelv6zyIpY7BYr056uaTgNvPTt1SnTYHq HpUELaBWhXyCsepAMSZwMc3OsKaKQGUPxv89uzOt1xf++LWujJSv7o3khc/0seSYLlsd VoS1sMERWehDTb168H0kcjva8JoQy52dXx8TfeaT2R2yo24NLZTXOVegnzksRHwnOe3f BhO8LO5SdP61LcV4p5vQ3C1xjNr+x3pxaEXIhyEGtXWXNlJJNNVBYnOZX2M+GrDAYKtr y8VyRJo6OC15HgsC+8bmaBu7J7xn1tjX2F0qKkITDHClkZ8q02hoACLOICi4kdKpHfg2 hXIg== Sender: isar-users@googlegroups.com X-Gm-Message-State: AOAM531D2TgHxXYYlpSb2MosMOlAo6G+aflss8Sqe50yCHa9oAuPJ99b F1vDOzlkmwho+WEZn/PWfS0= X-Google-Smtp-Source: ABdhPJw4kO04qK1NVlMzZRUEqu0QWtzo0CKceU+fzomzuXrGbhTC99nKRidMsYw3C9FHR2glSCHPTQ== X-Received: by 2002:a1c:f307:: with SMTP id q7mr943014wmq.85.1644394392461; Wed, 09 Feb 2022 00:13:12 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a1c:19c1:: with SMTP id 184ls1826005wmz.0.canary-gmail; Wed, 09 Feb 2022 00:13:11 -0800 (PST) X-Received: by 2002:a05:600c:1e88:: with SMTP id be8mr958011wmb.42.1644394391598; Wed, 09 Feb 2022 00:13:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644394391; cv=none; d=google.com; s=arc-20160816; b=jzqa8o3XLaFrauTcwX2KZwIdqimI7cdAyEBv3DIT1hR//FcIl7vxSu6i7wlIsopIdc pgctr9thaPPB+nkn+wuf3T4gXV5GvDms49blIUzC7J1tL2PC4nvrlaA9nRXeuw8W6Jw4 4Q7TL/lUwRjxguZyTK9s5ym4dfCTVFmk3r0FcmxVj9EWhU3yV2pVu6T8MPySj/iP93My G5xygc30Nvyp+1fd8bRSa0olbwCdRe3fe0ekv+hicEoIzU+VpwANWzZrOrT3oRBgKnw5 7Ejf6M9bi5pPE3xj2Eh3EJUoo1udVCqLQkirYLa8rI2ragF0LZokgo3OcY+LkErIYpp5 KRow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=qiR2Yy4jbtCBkATmcS/twZqi258USt1QKUIyr6xZA8Q=; b=DBfYCaqO6ym/wZ7QfK19HrThPY673GKAizAcLLNykKpZtMCpMVw44QSl7EOWHXk/YY TL9Mriaw4OFeLvXfOQF4uNjwTiWFk1JCayFzZMNjDDTC/QsrlM/wwv8lHVmp6PsuPwQF 80PuSssG/nZPaXhoq64hqNoSNRjDMu4gqI0OWlTxME6GeEMaQ4NWqFEBmVQc1xi8Dh6z 5SPQdyF2uiB3lanFZN8o7n2YnebDBhmTS3JrkfpIRPw39GmRIMp/hAr95cfGuMbg7jLY HFJ86tNgrcrlZrGTfBg27rZO7qwqAEOJ7NBEikms/92S9OaQzBt7pLXwvroU9vUnha1d ogTA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of cedric_hombourger@mentor.com designates 68.232.137.180 as permitted sender) smtp.mailfrom=Cedric_Hombourger@mentor.com Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com. [68.232.137.180]) by gmr-mx.google.com with ESMTPS id l27si68602wrz.7.2022.02.09.00.13.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Feb 2022 00:13:11 -0800 (PST) Received-SPF: pass (google.com: domain of cedric_hombourger@mentor.com designates 68.232.137.180 as permitted sender) client-ip=68.232.137.180; IronPort-SDR: kcPxfrV4Lon5130NPq6z/CByxGTDpX+Beznlgm/nqZrQiG21JZRlbyX/WAgD2bYLY5e7/9Z25V a4JtBDnq+1VTPzN+xw/esS7MvDE8/fjoJpf+Sqf4/LLS6Oaltnwfzf710v+A3GD0qy6UlO8CjL 11wboEb5ztgIhSOUl2hUizs0E96k6cxeF/VCzUanryJonGb8xLr1KyvUh/h1n4mipnOXbVCwDR yK3fbxsvED5yn8tdv3P2YHNVqV1MVJfyre1exkdJ72AO0Run6vcKQUjA+rMqBmGSg9GTc1Zk38 fTPNn3FcV21TLKI5GHV0SSjR X-IronPort-AV: E=Sophos;i="5.88,355,1635235200"; d="scan'208";a="71592632" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 09 Feb 2022 00:13:11 -0800 IronPort-SDR: 7MU/a6fA82GwyMSuEJkcWUdxGNVXTCsAxSpkEOM4tXwrcLs2d7AXWe/Dc1pVQ4HR7QuIDd4+d8 wQVedXOsWLURQoiTl1c+o9/zHmbE/fPn8cnYYcvkp4uqEhAvURC93JKPNa3eCKMU/YELpRx3yQ 3Fr0r2LHBgpS/yQdGv8GzbGqhEjUpKCTwEMGwP3Fd+vBovtEzpe/j2TNOa8ltJRoyO5SXpqDle /4rq0GQJH82KSEkU1a6OlzL6Mco8FTCRthu+E/K1pQ+B5tFdWlln6OMDPqLjFZ4vIaCrtX9Lgi WDk= From: Cedric Hombourger To: CC: Cedric Hombourger Subject: [PATCH v4 1/1] dpkg-base: resolve DL_DIR in do_adjust_git Date: Wed, 9 Feb 2022 09:12:44 +0100 Message-ID: <20220209081244.814-2-Cedric_Hombourger@mentor.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220209081244.814-1-Cedric_Hombourger@mentor.com> References: <6de834583c405b429ad6eb921e363d0e2a3cf7da.camel@mentor.com> <20220209081244.814-1-Cedric_Hombourger@mentor.com> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-13.mgc.mentorg.com (139.181.222.13) To svr-ies-mbx-02.mgc.mentorg.com (139.181.222.2) X-Original-Sender: cedric_hombourger@mentor.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of cedric_hombourger@mentor.com designates 68.232.137.180 as permitted sender) smtp.mailfrom=Cedric_Hombourger@mentor.com Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-getmail-retrieved-from-mailbox: INBOX From: Cedric Hombourger git_link is resolved using os.path.realpath() but git_dl is not. If DL_DIR points to a symbolic link, the comparison will always fail and do_adjust_git() will attempt to re-create the symbolic link. Resolve DL_DIR for a comparison between resolved paths. In the event where paths do differ, the symbolic link needs to be deleted first. Disposition: Submit upstream Signed-off-by: Cedric Hombourger --- meta/classes/dpkg-base.bbclass | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass index 2add0b2..4d496fc 100644 --- a/meta/classes/dpkg-base.bbclass +++ b/meta/classes/dpkg-base.bbclass @@ -20,9 +20,13 @@ python do_adjust_git() { rootdir = d.getVar('WORKDIR', True) git_link = os.path.join(d.getVar('GIT_DL_LINK_DIR'), '.git-downloads') - git_dl = os.path.join(d.getVar("DL_DIR"), "git") + dl_dir = d.getVar("DL_DIR") + git_dl = os.path.join(dl_dir, "git") - if not os.path.exists(git_link) or os.path.realpath(git_link) != git_dl: + if os.path.exists(git_link) and os.path.realpath(git_link) != os.path.realpath(git_dl): + os.unlink(git_link) + + if not os.path.exists(git_link): os.symlink(git_dl, git_link) for src_uri in (d.getVar("SRC_URI", True) or "").split(): @@ -34,7 +38,7 @@ python do_adjust_git() { if os.path.islink(ud.localpath): realpath = os.path.realpath(ud.localpath) - filter_out = os.path.join(d.getVar("DL_DIR"), "git") + "/" + filter_out = git_dl + "/" if realpath.startswith(filter_out): # make the link relative link = realpath.replace(filter_out, '', 1)