From patchwork Mon Jul 18 22:16:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Schmidt, Adriaan" X-Patchwork-Id: 1991 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 08:16:57 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-oa1-f62.google.com (mail-oa1-f62.google.com [209.85.160.62]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 26J6GtsD013791 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 19 Jul 2022 08:16:56 +0200 Received: by mail-oa1-f62.google.com with SMTP id 586e51a60fabf-1015d202b74sf9403277fac.20 for ; Mon, 18 Jul 2022 23:16:56 -0700 (PDT) ARC-Seal: i=3; a=rsa-sha256; t=1658211410; cv=pass; d=google.com; s=arc-20160816; b=xcROmWb53iFJgHOwIP9rO4hYDVMcIn80aEVeno9jTpidbe7WkSkuOGsUUWzwda0OcJ btjvTTa9U0MkO1yMwc+neD33L8LazaG7iWT/LX43eS8P16n8tzlxcMcAfEeXPdf6Ldq9 SA6N2mVZDXbzv3mF+J//VWX+UzF+2uclOHGfVTKhe6G5w1GGievY4SqokP1cQb8stNO2 0KTx/ntqklg+y4C/KX40TPs0VhOTlyTjmR78tpTEKkAEgHnqgfHIfFZ4fejdAzc1vD6B SQJKwfH2jJvHux+1B2EzZWRnPn2oNkr7J/XaHm5yLDy7Jqco3UU3KKeHrYMkrzfcZMgE 93oA== 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=iJiKydUrQ5lLOCosxIjny/eYI9bBxhTJomLjBU2oTPY=; b=sByqfkmBgQiqJYrKEJlIxJBZwc7UuDFRf+fg/s1mYv8/Wz3jAYGFtG6ebHI6dALU+6 KS+QOVtuihTmopbzpniWc6htA7kNd8j+2cdvLgpA84Eym4Bu/4JKlGTfYHJ2eqi6Ex3h 8U2pFHt/Tj8mn88VdDWsNT6QRVhru1RSWODCgpLGXaznk8J1OOwTTFuIdz4ZBSqipygd FSJzOAC1NF+/q8KWmtvXuqwT064VTGvPctsF+1X+d5fcqPcukYqR9CMnnjb0F1PYquwy WfE55yMTBtZciOqiQaZlxiaOOabRSJfvQQ+zLc3kUY1lx5L2mB3LCN2Z03ox7nJQ7IVz OoHw== ARC-Authentication-Results: i=3; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=N7Cwfn87; 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.20.68 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=iJiKydUrQ5lLOCosxIjny/eYI9bBxhTJomLjBU2oTPY=; b=gGk+viyWFek0XmQocL/604I6DqJ8SYOAuc851wurwv0q4+S6fJ9uwjZfD8/8YzA8Ve xbyNVJnIDI8QEy00WTrlW5H2gik6CuQGvXy+zYF+oJqUKT1xSbE35uIr3P1pvAbbBTkU lgaK0W3Umbbb3cud6LKvKNboKIgxPw0oao2pOxpJ5LQ5VOdkG8yBgHNtZRkqlWdg0QGU m8NWyNtY5RUjOi35DvJLsvbyT4L9wrBYPzQjoxwWJNY/ClW0319T1KlAl4+4Gh+aTypQ uZmROuV/bMQhr75diA7jIKIlMY/eeyeiUhW4z54erGVcOreUo2GqSLBESoTKQn3GhkcQ AVMA== 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=iJiKydUrQ5lLOCosxIjny/eYI9bBxhTJomLjBU2oTPY=; b=A+Ln977yLXHAvC1lOebAeu3LM4rOKegCMpPflH9xXqBBje3LgkCH6eaE9qOkg39DLB aqoSE8uKWhOvPrXxxrTg1GyNWl/U/kJ1xsFBnRYPQIMK0w/3sGrifeiA4sL0ko3kcA5J v1huVT5/49YtZ2YLlKFHKd1fGwRR8czQnZLfca9F/ar7bCaZuxtrpfOFyYTUyFHnY/8Y GPmuSkJBJq+kCBzVkTdrpwd+jA3l567GozVmxVaZJRpmYU/HIblssXJrVYS15ETi07M5 4XTapQZAq2aqhuyCmuL5Atob903Imjy4eRU34kxXt2cTzEnK8Dqyx7cH7K0bmiqyOEXU WpxQ== Sender: isar-users@googlegroups.com X-Gm-Message-State: AJIora/W/+y7Kb8YWIbv9MqG5hDipiFs2BBHspE2Raj3CnAJq6KHENSp BjVV63EG3TS5bzyN88pcI20= X-Google-Smtp-Source: AGRyM1tY0GuRj/MOK/IS4e0Fcqxr127oGJkZQy3VDt+N2j73QEp2hCLlQ4QiFNKGymsBrlWsircteA== X-Received: by 2002:a05:6808:19a5:b0:335:cffd:b276 with SMTP id bj37-20020a05680819a500b00335cffdb276mr14875816oib.226.1658211409650; Mon, 18 Jul 2022 23:16:49 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6870:4946:b0:102:1a4:7a5c with SMTP id fl6-20020a056870494600b0010201a47a5cls79453oab.8.-pod-prod-gmail; Mon, 18 Jul 2022 23:16:49 -0700 (PDT) X-Received: by 2002:a05:6870:338e:b0:f3:1a36:9485 with SMTP id w14-20020a056870338e00b000f31a369485mr19785427oae.277.1658211409165; Mon, 18 Jul 2022 23:16:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1658211409; cv=pass; d=google.com; s=arc-20160816; b=aOdRH0tPQCypmGU0zlLeFUqSNIvBXS2FO6QvZfET8WG2F/ZrtF4BchoehUTnNvg/06 c5yxoV84BHnC/3KYolexVlZgyRPZaKOfhLVbABTaBG6WxbyUIPt+p3GF2+DRYhNhUyPt 9SKxnMSDwxKg9bpGNvx8mi+7uXkMYSfZYkFihkBMBKIt1/ZCYPd6pJqFvIcfb9ruEEnX nD9vG+zE8cmpHFcgm3yMRXZyO8GMtFvLFzru3fkVRB7f7A/UvNTS9xxSdYCSUO3pPb// PoBT8fbMOwMOM0gwxIbAMda8qJOsMbslY3xKsMyJy24cT1aA2J0HLRm1DQ4zn8ux7HVn v4Zw== 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=EusuwB1oNBCDxjjGQ1uWfOh3W8JsEQpkDDN2Ro6rmRk=; b=pnK5hFrRh5utKRWBpJ+2dCkCC6fu5FJ5pDg7rY+nEpsD0C/NDAHqaLke4cziyAE7QP +vSc8GAotHB1PFhkpW0IweUaYHaunHjo40+tvevIZZ5sR0lg/iG7JjGb0/PsDlF/O8CQ 3lhnxpB6nWbgOB7XgZ+p4rg8sF9NDu87rOCsN0Yk0PKU62PL7vqZfM102IzKBChuWQ3t mbxLbCfRtBZnn6P1M/3f8b2qtKfJPm2lX8CNFgtHQlxqzGKpohfZRL4NJnUB4Mbp6f55 D6dsz9EAj3lEpPSuiDyYEOCD3yxJqGgOgLZLdPWgklY8ieC/Aw6wI2GeBTRZzUFXluDp Nmog== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=N7Cwfn87; 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.20.68 as permitted sender) smtp.mailfrom=adriaan.schmidt@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2068.outbound.protection.outlook.com. [40.107.20.68]) by gmr-mx.google.com with ESMTPS id f14-20020a056830056e00b0061c81be91e8si603694otc.4.2022.07.18.23.16.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Jul 2022 23:16:48 -0700 (PDT) Received-SPF: pass (google.com: domain of adriaan.schmidt@siemens.com designates 40.107.20.68 as permitted sender) client-ip=40.107.20.68; ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ekrie5ux00rpPJ/EQlf+XtogzZRwT+1mDxRfM1gokWYE1bMvA/VJiSaY+HJAZ3IEkrfcSgyj8aZ/CbmjK36eibpLm9q1GD0MIFEZv+Y6u9015jv6uzPwWYTStdFElxcuse2lB5WWGyHFBmNBz2SfbiJnTFYwegU2jcVqLEc6XlHXYJ2AsaOw7M34mOB0KlZO3A2uKFY1O3812dwGA7Qzu5CieARM8pE57RmXfz4j0YXWBQT3goGKHQcEvEqb4GPDV4V3g5IzcnzgopNFOTwxahMg/akih3q8Qny0GyZDTcSF8k2kZTs0wf9Rp88Z5VvyMrSAwhBIQlJxc2ydtbMwAw== 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=EusuwB1oNBCDxjjGQ1uWfOh3W8JsEQpkDDN2Ro6rmRk=; b=l4EpbHgl+Jfdf6KTYpeSW19cQ8uvbImpSlye/fMdGJGw88478+KXSeNHcfJ3oOXQvFJl1SMIr2iRoWp7d+k/uqxibQYUeDWedttxY90MtmAEivaVJjRUZPV0vdOxul5Nrs9u7i0SUjt0Wef7DPe2b8ev7aHLobRT9PAcjx7dbzvG6Qrnyo1Xd1Tfu23E/OAPYbPB+ApKfRDT7V2555pqTlsyE0GDZjVwliwiuVqJpG983EdjiUmsc+TLTzYgKa67L31NwGNsIVJ3jdz53Y3byfevsZzrNtJkgUcgQcdwTCMc9ALG5dpsNmPkhOser2/ap75FR0O016UHligdHseXQw== 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 AM6PR08CA0021.eurprd08.prod.outlook.com (2603:10a6:20b:b2::33) by PAXPR10MB5160.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:102:288::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.23; Tue, 19 Jul 2022 06:16:43 +0000 Received: from VE1EUR01FT097.eop-EUR01.prod.protection.outlook.com (2603:10a6:20b:b2:cafe::e5) by AM6PR08CA0021.outlook.office365.com (2603:10a6:20b:b2::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.13 via Frontend Transport; Tue, 19 Jul 2022 06:16:43 +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 VE1EUR01FT097.mail.protection.outlook.com (10.152.3.60) 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 06:16:43 +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 08:16:43 +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 08:16:42 +0200 From: Adriaan Schmidt To: CC: Adriaan Schmidt , Felix Moessbauer Subject: [PATCH 2/3] isar-sstate: refactor exit codes and error messages Date: Tue, 19 Jul 2022 08:16:27 +0200 Message-ID: <20220719061628.192078-3-adriaan.schmidt@siemens.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220719061628.192078-1-adriaan.schmidt@siemens.com> References: <20220719061628.192078-1-adriaan.schmidt@siemens.com> MIME-Version: 1.0 X-Originating-IP: [139.25.68.25] X-ClientProxiedBy: DEMCHDC89XA.ad011.siemens.net (139.25.226.103) To DEMCHDC8A0A.ad011.siemens.net (139.25.226.106) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9b7cebce-03b7-4ab2-4c68-08da694e4067 X-MS-TrafficTypeDiagnostic: PAXPR10MB5160:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FIESHYkl8SwUoRtu4Vk1W2o6hf3CF6J71KxYteV/dqwcsP9BRxePV5bamd8lIgGWEojbta+A3Zb0xUR0kJxNL/sS2eHfTBhREbL0vwJ5P39ieIbpZ3vyJAl4JyreWCzhgA8C9mibiFquwqRF1T59HwVWsjQIZtRAF/6I/brO6FgqTinMc9Ex/MhD4kX8jxT6XNkmfB44/NLyaQYLgRTaUdd5Sk2Nn96j5YiLyZOBZyR1+6mpYMqfLD/493Fgbj0s0hUqEJx6WH70MSwLE7wFOkXk1al3u6DHeTXt8R7Dg+f8SHWsQmiRg11HzwlS2P9Wk6EKXawjrTYxMv+4oMfDVnSuJf5gizjSaBMO79Lp05eYi3herb41OhEDoDXdeg4zdQdhxIH6a0x/0sE0EfU5lwUaWFjP1U5V1ZVMpIUhG8HoKb6cwzrjGW86oxLDdye299hw5TIfKABdjMMP3U5Eo1GXBKbIPSUIvO9I3WZSoGR2NPSwdoVgGKfD7OqH1zCDbRLz5PgOVViQ7i9hWrIYhDsmyKd11Sdpd/4BunElV5/RBEwsEMfxEIqp1x7YiAL/l6iVNxc5cCY6Aa/xF5WvAFn+jNHTEEiJtmOvCtQ+EmeSSbnE6FBzE752tqjhKfcIKoKYxkZ47zFJzuQGeCYDg2OWXf+wPRPbZVzjvkqVNixnrrmXIpI+2xtAY4L5CUWWPL50ETqB2IFIhuK3d/H/pLCO2gDg8q5ume5KJQd/Gn8qIkmhmFkmfCcDQJRs9s4KQc3ZGbAN0OAlAHTORGnkIIvz2ps6+gzS71GSBWQ0wX5ydN0ct/RTf/yFTGLTEg/Q64xkUIimzSDaT1+cHQYIKA== 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)(396003)(346002)(376002)(136003)(39860400002)(40470700004)(36840700001)(46966006)(8936002)(5660300002)(44832011)(70586007)(70206006)(8676002)(40480700001)(4326008)(40460700003)(2906002)(82310400005)(336012)(81166007)(82740400003)(36860700001)(956004)(47076005)(36756003)(82960400001)(356005)(6666004)(41300700001)(478600001)(86362001)(26005)(54906003)(6916009)(316002)(16526019)(2616005)(107886003)(1076003)(83380400001)(186003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2022 06:16:43.4754 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9b7cebce-03b7-4ab2-4c68-08da694e4067 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: VE1EUR01FT097.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR10MB5160 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=N7Cwfn87; 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.20.68 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 9f5c17b0..b62aec47 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')} @@ -839,7 +840,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