From patchwork Tue Jul 19 04:35:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Schmidt, Adriaan" X-Patchwork-Id: 1995 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Tue, 19 Jul 2022 14:35:40 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-ot1-f62.google.com (mail-ot1-f62.google.com [209.85.210.62]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 26JCZd2J014975 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 19 Jul 2022 14:35:40 +0200 Received: by mail-ot1-f62.google.com with SMTP id f95-20020a9d03e8000000b0061c75d3deaasf8230635otf.12 for ; Tue, 19 Jul 2022 05:35:40 -0700 (PDT) ARC-Seal: i=3; a=rsa-sha256; t=1658234133; cv=pass; d=google.com; s=arc-20160816; b=bEDftrAPnM7P7yTr3ZJlDNbKfkk924spIJRUP5jMVLvtM16/DZgjaYGlE5MHeZVteo gLmOIriNc+JPs+zn55tEGO2BPZkWr+0U+79r3dHjM33VqsQ/Iz/dxP6TfDthFPXXIsqD dL7+MBvgJ5b9mmsC/Iz7SK631zo1sbvKmO5JU8UEU6CKbeXRY644I8zs1R9aI/ugba9o HnUszGHkHMJWToU3dJJ6ZJTsMKWNFPGvW7KscY3wHxDWvCNgvZcCThEpCUv+BzZjU/qs bjyVjEFY69sNrb2kQzybRyWM7J2I2/1YedU2BURa5JpYsjwnYO+B3OiDKPok7ybjNvYC VAew== ARC-Message-Signature: i=3; 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:sender:dkim-signature; bh=WxG/Ynkit6jflx1FNM7IPt5VFQdkHE+9Nf3ElijlJlQ=; b=XDNMcJY10M8Z8LeyePZiEUc1aUNtt9ZYvyLYtYov74kGW9y+tQ0jPkb7FBZDoN/HHb gVBCU0+ZX28Z39TC/OHqbOJjvnH/Wcj8vvz9HSMKzG4/nQOrbsfI+1EbN0AVLyJ/j5YK UgQ30O1xJ/sFKdO91JKChUa2Pn71ufAqDvenZ63CNw54sllwUqyL0lDeFR7hBYxQyjp4 9qH1VyFvHWgIZsv054TLLhf2eOk++4ZrIXuqnbbaekz7zwGDFSz27LWVRehUpok/M8nZ eQv1kNHLO4a4HEodUrrCXpXPreO4WlVsF0+YkQxTXdI/40xiRlTZFIjmRs/g/jxV0Yc5 CA2g== ARC-Authentication-Results: i=3; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=dhnT6wlQ; arc=pass (i=1 spf=pass spfdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of adriaan.schmidt@siemens.com designates 40.107.7.72 as permitted sender) smtp.mailfrom=adriaan.schmidt@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender: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=WxG/Ynkit6jflx1FNM7IPt5VFQdkHE+9Nf3ElijlJlQ=; b=C+P1XCbqMc5aOLqZZ06hNgCb4yNhtbWAp2KFGGwHDQODly0Nw21vnDBYKzV5GHsi4n DoHYkbYl9VLLGf2/MjWvlbnV9+Tz+brPRyF12o0MqJBpIpRe3mkApRNB6+l2XF4mpt9z HCeBOgavGmvVwxr30bLVq7BSyhgQ5loHxKWQ2oprkGAG9nwjtI51bOaJdqu/BlD/Qeh+ BPhsFBq6wYUA/FENUSycuz8UpxyUTic/QDPhMlMobPNfW6+JVGiHg34RstVCd6B2/MO4 rhSNtJn1Gh+g0m6hPe2cdEsyAy3nRXdTNA02Z11nQG0VwrK36eOeEfzDqbJTuY7neWZm v2HA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state: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=WxG/Ynkit6jflx1FNM7IPt5VFQdkHE+9Nf3ElijlJlQ=; b=cIf7BF2vsKC270edwufjDvH3b5DiBNM/8H0ychOoxSSdc0VfEFlyLpvykAIyauRjBi 7i0zxLnA0baSvmGWQBJCG+SEnaWVcJ0lMLGxyZSVn1+i3hmlkSCt53Ci+XMQBKawnMUD Nj45WaMF7NamtzJLo5Sbwi7lXyoCNFoi/X8w0BtZiXFvwCF2x8dEEvv5TNwJIv62RSol yRdCTtnrrRV4yY5YC0+AxVVwOleECtYo9X4+T45HlErJztaEgwDmn1upoWzFSd6UT+SW BdbYIUsYq7P19PrISSaNGCNc+BZDUfS1msL+1A60TB/t9716uZA6qaJOhOeJ0GelrlER bLYw== Sender: isar-users@googlegroups.com X-Gm-Message-State: AJIora+Zg9vW/QuCBR+SM/fY7iboLGqtahhwh/yPtgaVMhpn36AOT8YN mXm5Nf9CE4SEaC9mULc+eXI= X-Google-Smtp-Source: AGRyM1tIav4iz558ltHxnUgaLY4Ion+/R7APTyuz+nEhTONa1putrz+YjYiElVdnVL3f34rlMy1uHw== X-Received: by 2002:a05:6870:888d:b0:10d:6b96:2074 with SMTP id m13-20020a056870888d00b0010d6b962074mr1599083oam.218.1658234133749; Tue, 19 Jul 2022 05:35:33 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:aca:c155:0:b0:33a:322:8c2e with SMTP id r82-20020acac155000000b0033a03228c2els163292oif.0.-pod-prod-gmail; Tue, 19 Jul 2022 05:35:33 -0700 (PDT) X-Received: by 2002:a05:6808:3097:b0:33a:4534:c845 with SMTP id bl23-20020a056808309700b0033a4534c845mr11531437oib.184.1658234133266; Tue, 19 Jul 2022 05:35:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1658234133; cv=pass; d=google.com; s=arc-20160816; b=FyTOoQoRYYegOkTxqa2PFbkYnurlQP/RfCjQvIF7Akf1iTAxAtW9IM6bYWC8rWkm2Y 6xFR7OGnwN5D27ZCQPxU2eMOA85aVMvwlmeoveHq+LpuLpEVXxc4qgPs7O2YmidXOJJS Kxn+cvX/BdREyqhiwUpw0kQIFk6V/Zw5TMfWiR+wSQKisfaNwYUafz335+HudobHA975 zJA5R/UCXJqm/gPPAdSziW4gYIrzcH0kU+576t4mxdUu/dZcF5MtDgTxsxLexL2zldW5 BFLA9VSjt8OBZLsIoZI6EhHJ24vTGfHC59RaRC1pb2pU/ssJ4J5ha2Goxpfkbc6JtaYk pMfg== ARC-Message-Signature: i=2; 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:dkim-signature; bh=nEBCqCtuSDFw8+W1GSN6KM8DCuQwwuJ7VKrXUf8VftY=; b=qFIrV24Q4HYBlpxabvJ0yytZVkri92YlqkZviam4vaJrSZdWs6iJawwO8LO50w3tMa xXjU1qYLgCrd5R22kHYk9uIymlwdwtexGrza12+vvp/3jLpKwrM+hSGY/c6G4jFXhSKG YJEOvxB288iGePtN1F8vSIKf3FW+/8AqauPcRYqHMuKjyDv1UAJKXLc2FHX/gkod7qhA LsUpEy//HoIIDzxGdQ12Fj9m/U3BBq/mB/9XDb0222/kIdfPWFJrJtvB8ZBMKNttXhtx H1WkJPIRKNUl78rQiWh86mOJ1mVlIUKi53MOKhOgPguHM8ESdlTqP9ZqwBrsHzT2bvtY SrbQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=dhnT6wlQ; arc=pass (i=1 spf=pass spfdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of adriaan.schmidt@siemens.com designates 40.107.7.72 as permitted sender) smtp.mailfrom=adriaan.schmidt@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70072.outbound.protection.outlook.com. [40.107.7.72]) by gmr-mx.google.com with ESMTPS id z14-20020a056870e30e00b000ddac42441esi1584565oad.0.2022.07.19.05.35.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jul 2022 05:35:33 -0700 (PDT) Received-SPF: pass (google.com: domain of adriaan.schmidt@siemens.com designates 40.107.7.72 as permitted sender) client-ip=40.107.7.72; ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hg2YKtt3Yo882NUtYvHVrwmeYfTO5j7LPWbTo2EyNrgnhPyBmq0t1pnH/EQDitlPxfD5KfojLUZ+t36F9F6x2sjau4Ixk8D0UvAD9bjBKFeYNDkpKd0vZo2KL5tgjfKnU2cHJWk5FX2dKhOl9wYMrLAvk1GAyIJ6h3YSy3/fvuMVACJXkkmA5uCQN4zkFy1mfuUfRT21+7LS1OWrlyq0J6iyD3dbAokHwDMoxgdgWQL/kmVjR/2ITJmlb8rw+9c64kSJdTecAcYGNZVKQnAa6TMcyknb0jRMk3P1aqGztSSOO0A58LkL/dl7J3u2ipCwbLGO0BlJp+C7VvHUj1qAPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nEBCqCtuSDFw8+W1GSN6KM8DCuQwwuJ7VKrXUf8VftY=; b=RMRqDO9FIamZOcQMDDkzkRrQq9WaCGL5epWOv9L9bIMPlMB7mBXDi+l6hDyw3yUnRIOLZQxm6fOzAx5/5zd9qlsLFTa5nlskt2hY8GN28HMWadbENp26VkDGPRvmMG2VwXkUtPBImT/PwIRn3lnzX9W57aCzj2I3DWxACekB6LRnjEDUSZivAuA7HYIwVAxTvyh7VBo47Vwi17q2+aEK+ZS0NbSiIsLI2D3YyghkeF2AEfdfrlcWf4nbu64G1n6/0NnPuTaeFCXyPQD0B5ApsLaAd7/Zw+e3rAuqpuX6NiSsd+GnseI1AX15w2MTiqGEvjQH0SRyguVI9W2BGtK9lw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 194.138.21.73) smtp.rcpttodomain=googlegroups.com smtp.mailfrom=siemens.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=siemens.com; dkim=none (message not signed); arc=none Received: from DB3PR08CA0007.eurprd08.prod.outlook.com (2603:10a6:8::20) by AM4PR1001MB1268.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:200:90::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.12; Tue, 19 Jul 2022 12:35:27 +0000 Received: from DB5EUR01FT098.eop-EUR01.prod.protection.outlook.com (2603:10a6:8:0:cafe::8) by DB3PR08CA0007.outlook.office365.com (2603:10a6:8::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.12 via Frontend Transport; Tue, 19 Jul 2022 12:35:27 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 194.138.21.73) smtp.mailfrom=siemens.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=siemens.com; Received-SPF: Pass (protection.outlook.com: domain of siemens.com designates 194.138.21.73 as permitted sender) receiver=protection.outlook.com; client-ip=194.138.21.73; helo=hybrid.siemens.com; pr=C Received: from hybrid.siemens.com (194.138.21.73) by DB5EUR01FT098.mail.protection.outlook.com (10.152.5.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.12 via Frontend Transport; Tue, 19 Jul 2022 12:35:27 +0000 Received: from DEMCHDC8A0A.ad011.siemens.net (139.25.226.106) by DEMCHDC9SNA.ad011.siemens.net (194.138.21.73) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.9; Tue, 19 Jul 2022 14:35:26 +0200 Received: from random.ppmd.siemens.net (139.25.68.25) by DEMCHDC8A0A.ad011.siemens.net (139.25.226.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.9; Tue, 19 Jul 2022 14:35:26 +0200 From: Adriaan Schmidt To: CC: Adriaan Schmidt , Felix Moessbauer Subject: [PATCH v2 2/3] isar-sstate: refactor exit codes and error messages Date: Tue, 19 Jul 2022 14:35:08 +0200 Message-ID: <20220719123509.308439-3-adriaan.schmidt@siemens.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220719123509.308439-1-adriaan.schmidt@siemens.com> References: <20220719123509.308439-1-adriaan.schmidt@siemens.com> MIME-Version: 1.0 X-Originating-IP: [139.25.68.25] X-ClientProxiedBy: DEMCHDC8A0A.ad011.siemens.net (139.25.226.106) To DEMCHDC8A0A.ad011.siemens.net (139.25.226.106) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5d0e8950-9a56-4ba9-dd24-08da69832916 X-MS-TrafficTypeDiagnostic: AM4PR1001MB1268:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OgcevIKhu9GQMTIx5i64aTjHCzrI+5/g6+w4IOxt4ywjMxppdnZLN923Z44l2+kp6tFATarpkVWBnzi7Fm7bG6vJExQFJ4I0qzfWvoMGhGXYGcf6sE0juuAsrzgBtk9wX2n0xRNIn8mGljuZPzL3f90kbzPC8KkS6YkFNKLGBa0jXDlVNLscYBg0fP4E7DBnse6uzeGIuYCQuZBCyEwyYBRycq3ez1YFC+oECZaT122nQuu/rn5jlWcZYc20xjvPhNCZ42zMoIyFKmWIDpDpvUqSSEDLzE+sYI0t+xQNH6K797HA66+POgeAdYSJVJTR09kTLl4VjxgYwgPhf5gX2ovifKLY9Uv4pXGdSF0bNftLBhr3nBbJSVR8ZRBQdtGiHHjNOSvwig0tzwudEzLe5uQyvBRY7VZ2uGqa8+6UgCXj6NWoW494tUCyiqrI6LDT/HkGQM2Mr4cwpXt3ZRYM6Xy6cgVAv8RN2uberWfoavNRvmprX2TKVQJw1mGvRFQWaNso8ZqjQkJ++bq6gKc84up1ArMQjhUX3rOYEbx6/Xno77EFnbCk8705iEdzgdEaEjtLOdjXJIHUrkKaXDRVGajkouqGUuXDKu3YBk3tjOPhAx3I7S2nXvVXUO5nGyyNJd5vpiEQ+B8UpRjFkWfgeCrncnQTAzun4DW+LLr++5YQf2sFLyRlLIBYBAGy1Pro33H9RddAlP8G/APvMW2kbaLUGX6oUcU6hPxOpyxQLH+ey+lD9YHYBQHuPAqXIc1o8/W1U6C9mILRifKeuBFiVkMwsBNxkzjPbR/XZkVLtbmukRiphDJh+SNRvZqmc23nqcwvyclMlTD7p+UCWqpfGg== X-Forefront-Antispam-Report: CIP:194.138.21.73; CTRY:DE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:hybrid.siemens.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230016)(4636009)(39860400002)(396003)(136003)(346002)(376002)(40470700004)(36840700001)(46966006)(956004)(2616005)(5660300002)(86362001)(1076003)(2906002)(41300700001)(82310400005)(107886003)(26005)(6666004)(478600001)(82740400003)(356005)(82960400001)(8936002)(44832011)(70586007)(81166007)(40460700003)(83380400001)(186003)(336012)(36860700001)(47076005)(40480700001)(16526019)(4326008)(54906003)(6916009)(316002)(8676002)(36756003)(70206006)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2022 12:35:27.6561 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5d0e8950-9a56-4ba9-dd24-08da69832916 X-MS-Exchange-CrossTenant-Id: 38ae3bcd-9579-4fd4-adda-b42e1495d55a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=38ae3bcd-9579-4fd4-adda-b42e1495d55a; Ip=[194.138.21.73]; Helo=[hybrid.siemens.com] X-MS-Exchange-CrossTenant-AuthSource: DB5EUR01FT098.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR1001MB1268 X-Original-Sender: adriaan.schmidt@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=dhnT6wlQ; arc=pass (i=1 spf=pass spfdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of adriaan.schmidt@siemens.com designates 40.107.7.72 as permitted sender) smtp.mailfrom=adriaan.schmidt@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.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.8 required=5.0 tests=DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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 The behavior of isar-sstate in error conditions is not consistent. This patch tries to fix that: - If an operation cannot be performed because source/target cannot be accessed it's a WARNING (useful when running in CI, so scripts can continue). - The exit code returned by the script is either 0 (no error), or 1 (error), but never -1. - Issues found be the lint operation are not returned as WARNINGS. Signed-off-by: Adriaan Schmidt Signed-off-by: Felix Moessbauer --- scripts/isar-sstate | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/scripts/isar-sstate b/scripts/isar-sstate index 5c47b479..76bae544 100755 --- a/scripts/isar-sstate +++ b/scripts/isar-sstate @@ -602,10 +602,9 @@ def sstate_upload(source, target, verbose, **kwargs): if not os.path.isdir(source): print(f"WARNING: source {source} does not exist. Not uploading.") return 0 - if not target.exists() and not target.create(): - print(f"ERROR: target {target} does not exist and could not be created.") - return -1 + print(f"WARNING: target {target} does not exist and could not be created. Not uploading.") + return 0 print(f"INFO: uploading {source} to {target}") os.chdir(source) @@ -636,8 +635,7 @@ def sstate_clean(target, max_age, max_sig_age, verbose, **kwargs): seconds_per_unit = {'s': 1, 'm': 60, 'h': 3600, 'd': 86400, 'w': 604800} m = re.match(r'^(\d+)(w|d|h|m|s)?', x) if m is None: - print(f"ERROR: cannot parse MAX_AGE '{max_age}', needs to be a number followed by w|d|h|m|s") - sys.exit(-1) + return None unit = m.group(2) if unit is None: print("WARNING: MAX_AGE without unit, assuming 'days'") @@ -645,12 +643,15 @@ def sstate_clean(target, max_age, max_sig_age, verbose, **kwargs): return int(m.group(1)) * seconds_per_unit[unit] max_age_seconds = convert_to_seconds(max_age) + if max_age_seconds is None: + print(f"ERROR: cannot parse MAX_AGE '{max_age}', needs to be a number followed by w|d|h|m|s") + return 1 if max_sig_age is None: max_sig_age = max_age max_sig_age_seconds = max(max_age_seconds, convert_to_seconds(max_sig_age)) if not target.exists(): - print(f"INFO: cannot access target {target}. Nothing to clean.") + print(f"WARNING: cannot access target {target}. Nothing to clean.") return 0 print(f"INFO: scanning {target}") @@ -679,7 +680,7 @@ def sstate_clean(target, max_age, max_sig_age, verbose, **kwargs): def sstate_info(target, verbose, **kwargs): if not target.exists(): - print(f"INFO: cannot access target {target}. No info to show.") + print(f"WARNING: cannot access target {target}. No info to show.") return 0 print(f"INFO: scanning {target}") @@ -720,11 +721,11 @@ def sstate_info(target, verbose, **kwargs): def sstate_analyze(source, target, **kwargs): if not os.path.isdir(source): - print(f"ERROR: source {source} does not exist. Nothing to analyze.") - return -1 + print(f"WARNING: source {source} does not exist. Nothing to analyze.") + return 0 if not target.exists(): - print(f"ERROR: target {target} does not exist. Nothing to analyze.") - return -1 + print(f"INFO: target {target} does not exist. Nothing to analyze.") + return 0 source = SstateFileTarget(source) target.enable_cache() @@ -795,8 +796,8 @@ def sstate_analyze(source, target, **kwargs): def sstate_lint(target, verbose, sources_dir, build_dir, exit_code, **kwargs): ADDITIONAL_IGNORED_VARNAMES = 'PP'.split() if not target.exists(): - print(f"ERROR: target {target} does not exist. Nothing to analyze.") - return -1 + print(f"WARNING: target {target} does not exist. Nothing to analyze.") + return 0 cache_sigs = {s.hash: s for s in target.list_all() if s.suffix.endswith('.siginfo')} @@ -843,7 +844,7 @@ def sstate_lint(target, verbose, sources_dir, build_dir, exit_code, **kwargs): if sum_hits == 0: print(f'no cachability issues found (scanned {len(cache_sigs)} signatures)') else: - print(f'warning: found cachability issues (scanned {len(cache_sigs)} signatures)') + print(f'found cachability issues (scanned {len(cache_sigs)} signatures)') print(f'-> absolute paths: sources-dir {hits_srcdir}, build-dir {hits_builddir}, other {hits_other}') if exit_code is not None: return exit_code