From patchwork Fri Feb 4 00:50:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cedric Hombourger X-Patchwork-Id: 1417 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3) with LMTPA; Fri, 04 Feb 2022 11:51:25 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-wm1-f55.google.com (mail-wm1-f55.google.com [209.85.128.55]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8) with ESMTPS id 214ApOMF032640 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 4 Feb 2022 11:51:25 +0100 Received: by mail-wm1-f55.google.com with SMTP id t2-20020a7bc3c2000000b003528fe59cb9sf2219929wmj.5 for ; Fri, 04 Feb 2022 02:51:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1643971879; cv=pass; d=google.com; s=arc-20160816; b=zSvqJ3mDguC2egyyjrKcrOqcj4q6va7UTSZwraKZJ/Lag/UkMMBrWYuRAmb8Nb3GoK auK2bV3u/c/yyu3UdPEpCEO0i24Q0syl3W3jLPKHycMq1acR+Vd3I0/bKp7a+/nnv7T+ /he63iCqljQXt/z6TrYOi/NrJURJy9V3l/Qo8hg6B/D/MJAUEw4zI9ZDKjXq5yCL9+uD hGohT51nUosSo2CTdeVnOf6+dCJMfHfcroleI1DEtbhhWYnAdPNNgRymfpb23v+qC4Ca Xj71TKArCD2gYm5Z+uuZAfyqttNLlbNWHIXkeCT8yZ7yRbY1oPt582OYGWyb1Ie67p96 biMA== 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=HcHVVMgnTJprUfxViXzwy3PQiR+VogWWd8WV5/KhIdM=; b=09PIaBVLiIZOzJtf21sQqtoQG9N+1OG0HesqCsQRZ/QyX/hU51OANaowOgCgdTVp4D oj+ZSPAxbt6pfa0kniNjQX9+s3e5UmHyNLYI4EwGdhHhebjmcyJ0KsMR7D07rlGCJBv0 XpmOgwGiSYskrxEoEBU1YUrtAA4b/+5zRG9T99Jrit7j1GFyOzGjzPJOUABkWPm4Iq0q TfXyXQWUmIoqX6r+tFWnjcdY4YMwYiB3KtGrYdLkJEpaaNwBNRWk54kv33dhuKap5mWI CwS64HG1sR4lMeTXahyhwaQnNOhPTzntk6a9XL6nV4tIXnjGw45Ryh/Zb4E+jwS4/zg4 l4XQ== 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=HcHVVMgnTJprUfxViXzwy3PQiR+VogWWd8WV5/KhIdM=; b=In3Qt8qv0sUcP4MXz7mgp/losba3IQDiEsEGo2bxM5InGTFeWQFPV/CL8bi18lwTkA nqzyzv/sjzEpNBb0J22mb6xU1mS0xP+zNAEdEQoZWa4Jg42mvkDWwB7nltYa9KC4OQ6k 1k8vwlM+zlCP5fXwOUPQFUV3X3cNMtUPjCgD6Yzze078mpLZFPV529Fo31Xs+l1Dklxs rBd3sUsRB8kMsIzOHyG0vl+bQJmuXKqK+bamI8wbrHoPEd2NySFL1whnqDXXarfhWwS+ hSFjt4bU/OjrlLgdlklvxH07sQ2isM+Zw5PgZW7s7lTX++i6hGi6ot4VnKR0q4x7hUyd iCnA== 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=HcHVVMgnTJprUfxViXzwy3PQiR+VogWWd8WV5/KhIdM=; b=Dlfo9KaLiMcKVjWbMnAPVm7O40rCLEAcOhIpa2efq16DCw7HDQ5X4T156bqS/mdJtz EiqwQPPyW77Q+7josxObWytJEysmW4mspaDDhI1hciYM53LUcJXHFleOYKoj9LMl8h02 hjp8bwshsDeiXPgCDRRBpt5AMIqGH3j6iS4MbYJAUw/0U2LENX8oo1MS2ZnVhPlLmZ+4 I4Ay2oY2PKBAGF/fT7A4yKG7TIOYeNGO03kpEcmceGHOhDMpoV1UqJB2oWcD0jxDLU9I 0qv/n7EiCbox90meM9AULNuTvbND+jPnrPxJLBhpiWhcV457g4hgzIQk/yVrmSNVE7Dp auFQ== Sender: isar-users@googlegroups.com X-Gm-Message-State: AOAM533Oh4Dfl/+XlG4/fZJEIi4LB2cvfRmM/znbj/589MSTivD5bEi7 7esCKhX0w4fYesyOtHMgFG0= X-Google-Smtp-Source: ABdhPJyL/sWQ66n3I1YQGDAZe65UERcmP8av2SPQMzELFq6WbsmeDcQ4ZFKDZsbhUX/zHpHZOerkHQ== X-Received: by 2002:a7b:c302:: with SMTP id k2mr1777154wmj.182.1643971879183; Fri, 04 Feb 2022 02:51:19 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:600c:3487:: with SMTP id a7ls6022778wmq.2.canary-gmail; Fri, 04 Feb 2022 02:51:18 -0800 (PST) X-Received: by 2002:a05:600c:4308:: with SMTP id p8mr1742545wme.72.1643971878327; Fri, 04 Feb 2022 02:51:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643971878; cv=none; d=google.com; s=arc-20160816; b=xfip/46XRn7eXS8k5V0ZiGt3w2MnJUgi65Ate/M8HWQ8XQ/t4Ht5lJBTMLHoDpXAf6 p1Ep/m5+oYYOCLSvLYRhYO0iSprogOMp3h3TugU1Ew+9J+p4KU2+lzBEzwHY4xBwRX13 km17QFKBSKupzHzJUCJhLLdVc0IrjYgt6KcrlWOYHY8IZ0EKgQQn2LL8W3+oOdb0zvro OFmln8wP6t8YsRkT/FzOsLx2ZzaIfp7+HmyqsnXH6F3P2VqwX8h7/HV6uXz9cJ8WKSED +94mKwqynNdWvQK1xLQegyY+6pKP4ywOk2Sh1fXldb36la8ycirel+w0v03FdLMJEIol hehA== 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=2GZDAAYYldAndGXyIqUg+n3ZPrmSxOookFXfi2acu3w=; b=imEwMe/o786BCDhXByNpawYonSqC0ctgDuCSRuiUBeWOoHbuRgkNraoKPnoX+Ufviz 2goD/xkx8jrMV/Uu+1lFQAjSUSsuX5DP2uQw7zwOjPc8usDh1ojSYVqPBTS6HBTSeAjK u1ENB+bvGZwIgxR/JWPBz5HlQJr+kfXoPmrkxht2sOVUVU52YdQsd8Yg/HL4qsE21YV9 iABr0aiel78d3tn2VgmpFkzgWN/LNYaMcgkFUqbEzKEihoQ8gxeECAoT/MyeNGx8cfwV a0lQ4gzdSqb8Axl2SDBhTiIPvbVTJVOB7scvQBGWYKGtd4wXGTj90PRiylr3HPlHiAtE e6Mg== 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 be15si347876wmb.0.2022.02.04.02.51.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Feb 2022 02:51:18 -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: dNGypEWXkp3ushT5Q2dFclP9kRUKTBmthtyGG5eTRMEOHQ+BpZDE3tCOPyWwaU1yidld0kuq3l ok3gEXplTKW/CLu/kCxLpfaJ26cvGrTmUeBN8Z9glMuvOTme9NWynh8i/YkXgZVnVhe7QOdtht FXRJZ+ZbE8TkehJLZmAEjYf6vj3BtvMNeNKaMW3he5/yFPWhLls74RF9hTBJuwjgEWTI6UZ2qx eJGmAwCo2qyQBeVyWsgwlw9IY9DglmLwxS+P3Hmn1lUVUfK+RyVSaeWJ7rrUZpNt/eBtGr+MCh miWC+f/6ZewhfXp9ljE+hNFh X-IronPort-AV: E=Sophos;i="5.88,342,1635235200"; d="scan'208";a="71428267" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 04 Feb 2022 02:51:16 -0800 IronPort-SDR: Cc4vCZo71NMUu/NhwFzdwvYbOBLXD4YQS1SuWe3ho55aENONC8xmbq5+0Eodjtb0d+pEriGp7K OTMZ0/NWgsricZV/dRdW6I2igTz9NauadQXatEu/zhTvTtsUh5Ix1/Gzv6T45HLYad5pzVgoU6 PijbJ8S1+93EiaQyMgaD325vkkjNVvk/K9F2e+mvvnWfGRJ9byM1dM/HSGjnek+GHg4KfhH1ec KkiXXSDG758CdgFyn0TuxzlMHDEHRwiFp25BoTLXBgQkxKQtLnszWQAqxCJb3Q+X1EdMhVBvAb Uxc= From: Cedric Hombourger To: CC: Cedric Hombourger Subject: [[PATCH v2]] dpkg-base: resolve DL_DIR in do_adjust_git Date: Fri, 4 Feb 2022 11:50:55 +0100 Message-ID: <20220204105055.30050-1-Cedric_Hombourger@mentor.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <0a7f590d-63f5-5505-a9c9-718f9d8c81fb@siemens.com> References: <0a7f590d-63f5-5505-a9c9-718f9d8c81fb@siemens.com> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-14.mgc.mentorg.com (139.181.222.14) 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..258e040 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 = os.path.realpath(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) != 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)