From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7353323043876241408 X-Received: by 2002:a17:90a:fa04:b0:2a2:140b:7287 with SMTP id cm4-20020a17090afa0400b002a2140b7287mr1649969pjb.47.1712334745867; Fri, 05 Apr 2024 09:32:25 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:90a:ca8e:b0:2a2:3355:fe9a with SMTP id y14-20020a17090aca8e00b002a23355fe9als1356775pjt.1.-pod-prod-06-us; Fri, 05 Apr 2024 09:32:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGwn/1au6sY4uaBUNJueqLtxp3V+ZvqORh1kZ68LoiSxMWU2KyCXQGEbuXDZ5DBqk1qqoGP X-Received: by 2002:a17:903:2286:b0:1e0:b872:d862 with SMTP id b6-20020a170903228600b001e0b872d862mr2257254plh.52.1712334744143; Fri, 05 Apr 2024 09:32:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1712334744; cv=none; d=google.com; s=arc-20160816; b=PYUhXe1/yZXIu4av0OTsonGxuWvodySHZ5mioTlTZZlvLqCGqI5xbxpBicgV33WkyU T7VuOC9I7eYq+BwySirkDDbxOIrGoBTlzo4dqDRmk8G3F/tZInBFrQ1QNs2fhLB8t9sI a8UMKong0dgZ6tjnbW//OShXltwAZC2lNZVfc+Bkx1SWZRZ1cys7+ppD9d8lURwtF0FP Bxejl3aqoJVnvaulVmVR0z6ToHz3DRJEcGgDzYpSJ8ZpYA6OYmeQzPNji2CAPKoieAV5 vTOLjc42Kk3RXODCM17AILIcypmpBeM8E6gdrKRiHPtHCpgix3zmTptk3cQhTB+3waww WOhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=feedback-id:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=wyKwn6HscoV1RoKsg24H+Y8IfRwLm00bV1i7brRqD10=; fh=3bh9z2BWAzGAc1byRhMi0K+arMZmX5BQHE0sOxINdyU=; b=eHrxCeMKwfyQHeoJvym7aBnexZUR9ahq3oeGRtW86lV58kQntub4cfnZjjuj4RJ3xD 28jcJfXl5TV9lHF/BdoE/F1diHNCdEjIEzPEJ5DTeVGjMJcVPCPWNCw1hxoHHWDpZbix oLb6gSc7sZ0MueGZcmrEgdkQRSCO2kH18ZRUsC+If4yMWx8pKbUAynlvLILJ7cGiIa3a 1l9HX5FgffQY04GEyeLXcyhMx2vudKKsTEp4OZG2DzpLycEkynyoCsAzzCd2Vg2owNU8 1kOIFCeyUV54Mkjp+gGIQGvV/GqFybj8LYXwalqEIMUGr2cyY2hOFXeBlr6GtXiWZm0K XNuQ==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=NHniP2JY; spf=pass (google.com: domain of fm-1325773-20240405163223c0c83308707095f514-ljzsih@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) smtp.mailfrom=fm-1325773-20240405163223c0c83308707095f514-LJZsIH@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Return-Path: Received: from mta-64-228.siemens.flowmailer.net (mta-64-228.siemens.flowmailer.net. [185.136.64.228]) by gmr-mx.google.com with ESMTPS id mp6-20020a170902fd0600b001e2c4ecc402si110212plb.8.2024.04.05.09.32.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Apr 2024 09:32:24 -0700 (PDT) Received-SPF: pass (google.com: domain of fm-1325773-20240405163223c0c83308707095f514-ljzsih@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) client-ip=185.136.64.228; Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=NHniP2JY; spf=pass (google.com: domain of fm-1325773-20240405163223c0c83308707095f514-ljzsih@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) smtp.mailfrom=fm-1325773-20240405163223c0c83308707095f514-LJZsIH@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: by mta-64-228.siemens.flowmailer.net with ESMTPSA id 20240405163223c0c83308707095f514 for ; Fri, 05 Apr 2024 18:32:23 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=chris.larson@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=wyKwn6HscoV1RoKsg24H+Y8IfRwLm00bV1i7brRqD10=; b=NHniP2JYe3U6WGvxCp82jyfSUmYK/jxT5bczZSDATWOWsQf8O8zR63b4J9cu8LKeoBVYkZ AM3XxusoZFKkjVp/7rSH/0a7WfHI7gq+zphh+wJEiLcbLKuHUa73y0df0nRgiujQt/mdJBIa nYgQaDS13GBXQGKUU9NKwK8zhn+Pc=; From: chris.larson@siemens.com To: isar-users@googlegroups.com Cc: Christopher Larson Subject: [PATCH 3/9] isar-sstate: lint: check for absolute paths in SRC_URI Date: Fri, 5 Apr 2024 16:31:29 +0000 Message-Id: <20240405163135.2987489-4-chris.larson@siemens.com> In-Reply-To: <20240405163135.2987489-1-chris.larson@siemens.com> References: <20240405163135.2987489-1-chris.larson@siemens.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1325773:519-21489:flowmailer X-TUID: vbZ8apXSLR4M From: Christopher Larson In addition to the current checks for variables starting with an absolute path, particularly those within the build or sources directories, we should also check for absolute paths in SRC_URI file entries. Submitted at https://groups.google.com/g/isar-users/c/2NB-PXyswq8/m/C8LiWa1TAQAJ. Signed-off-by: Christopher Larson --- scripts/isar-sstate | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/scripts/isar-sstate b/scripts/isar-sstate index c14c2843..9b20cb8e 100755 --- a/scripts/isar-sstate +++ b/scripts/isar-sstate @@ -839,6 +839,23 @@ def sstate_lint(target, verbose, sources_dir, build_dir, exit_code, pedantic, ** continue # remove leading whitespaces possibly added by appending val = val.lstrip() + if name == 'SRC_URI': + src_uri = val.split() + for entry in src_uri: + if entry.startswith('file:///'): + entry_path = entry[7:] + if entry_path.startswith(build_dir): + pn_issues.append(f'\033[0;31m-> path in build-dir: SRC_URI entry "{entry}"\033[0m') + hits_builddir += 1 + elif entry_path.startswith(sources_dir): + pn_issues.append(f'\033[0;31m-> path in sources-dir: SRC_URI entry "{entry}"\033[0m') + hits_srcdir += 1 + else: + hits_other += 1 + if verbose: + pn_issues.append(f'\033[0;34m-> other absolute path: SRC_URI entry "{entry}"\033[0m') + continue + if not val[0] == '/': continue if val.startswith(build_dir): -- 2.39.2