From patchwork Thu Feb 8 16:24:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Adler X-Patchwork-Id: 1896649 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20230601 header.b=OvzEzrlr; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2001:4860:4864:20::37; helo=mail-oa1-x37.google.com; envelope-from=swupdate+bncbclp7i7wwmhrb3eassxamgqevfbj4ay@googlegroups.com; receiver=patchwork.ozlabs.org) Received: from mail-oa1-x37.google.com (mail-oa1-x37.google.com [IPv6:2001:4860:4864:20::37]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TW2QZ1cxyz23hr for ; Fri, 9 Feb 2024 03:25:24 +1100 (AEDT) Received: by mail-oa1-x37.google.com with SMTP id 586e51a60fabf-2190667f9bcsf2030749fac.1 for ; Thu, 08 Feb 2024 08:25:24 -0800 (PST) ARC-Seal: i=3; a=rsa-sha256; t=1707409517; cv=pass; d=google.com; s=arc-20160816; b=EgvcrHlOIvZNayongsLj3vxOAuH6wYg99VJO8B6OeuLVe2ouGNzLBN2K3L4nx6usz4 b0YGnx0goy5TiPlM7H/vTqWv5dgE7DLj4Q7a5/Glzdx1rRyfasDRenvazS9ZjIa3/hnH O7851H7UeCNTC2CsnQYu/s/jzUEcSIVmCnA/AIAGh3YXrvHz2TIZ8FWXMm0uIV/Xbgci u9hNo+AtSVI0293Mwdsh/rJKIc1Uw3fN63ACmXrb+r5Ixe5oZcnaA4R1uouEOqsPCjuY WApvNorM/jfDUo0v480odWHrCxd9VlbD6VcoBl5QPBKxnqw2MBJZ/0Gw9i4eSLjmJtZg afQQ== 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:reply-to:mime-version:message-id :date:subject:cc:to:from:dkim-signature; bh=Et8dCx77EqgwYsb69oC6vULvLVT/G2OjJZm2timTtUU=; fh=uwlNWjhFZJQPpYiAnr65HGHnFEWqBXfi3Xa9JgC7Zhs=; b=y/yNhMdN5KYV5VqRZyct1kQ6YxYieSqQIE7FAg/bvspiahUxXbTd32Wjm4h6qwkDZU mWE6XQuUvkAf8iNKZSneOtYjxZn8LSZ7VWXAIYr0IhIZGlhlvjzbdQ+EgMip15o8ORDQ peVobRDssdIp9szCXkc7uKq8hMV9HS9Bs1z3mskSjZaobeHpQMRzLMNw98Fxl1aYNYRM Ki4nV4JPvzE74xvM4T2ACSqRcaE0oTz/hIyNMAE9BmdItuWqIkDU6lCQHN/Ikm342qoX iAaDHhhsib8hKeqTKS4/eZW+EEFgLj5h+HAYNPwR4fjxlNi/DW6insI9fmrmgxoOKvI3 fTNw==; darn=patchwork.ozlabs.org ARC-Authentication-Results: i=3; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=uImD4rkx; arc=pass (i=1 spf=pass spfdomain=siemens.com dkim=pass dkdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of michael.adler@siemens.com designates 2a01:111:f403:2612::601 as permitted sender) smtp.mailfrom=michael.adler@siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1707409517; x=1708014317; darn=patchwork.ozlabs.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:mime-version :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Et8dCx77EqgwYsb69oC6vULvLVT/G2OjJZm2timTtUU=; b=OvzEzrlr3JXcYL/PaEUP52Pf8K8tGrWu0hSmZrVdqRnXj4vVJy+5DRoPkBd8Mx5mmH 389VMyAafePeV6t45fzvs8loBvyAOjKJbamQfyn/RYnTKKts1vcLNX/9RsQw5R+8Zuvf s2TtohTJADI39BSjDv9I3bBRF7p53F01mIc4ABwbzjAGSYObzXPMltOP8OokGCn3QPnw +t8zlKcTlh2RbYG+Y37lDNlZ9dhlD/wNn4f0lqXR0zoVjgrGLE4B60IDnXFXv0coMTQt ZCQE9R48PHu1Rj0VV5D7H+38ON7OreT7T2w7X38mXwHwUfM+ilSaFlZpP58/5miEQDhV pB8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707409517; x=1708014317; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:mime-version :message-id:date:subject:cc:to:from:x-beenthere:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Et8dCx77EqgwYsb69oC6vULvLVT/G2OjJZm2timTtUU=; b=Kj1hc4t7qkHccABCc5fa1sYx+rIBICrwOTPi0uInQR4TGmIDBx5wJ5XcxuRGRigkNu ukAZBNkmBozaXMB+cTseLYS1WJPsCgo7YY2hLZmmVoSBeavp5rMJxr1vrzQae66DONiH Z5eqZWtKMBy+PAt86TeOyx2DEp+m3YVVS/XMGd6LLmNvrgienQyuNqgPoqSAiC3TJAQF UXDyCXmxkx1ifLDNSblxF/JUBdMgUDME+qce4zPsJUGnFYjtxZI96HbL5+aEWVpz1gAb iLdt4Nrc/axx4INfBSYBiRxvU73qXnM0h7qCgFdBa7qJ+0aiLb6rL6WhVjyesG5VweCl 6hEw== X-Forwarded-Encrypted: i=3; AJvYcCUF0P9PQRZg6EpGAi3NKQtqzP4zdW6uIvxnscfnMPPX/RJzgocK0PcOMzCK+niLmfCfMdlXiu0+59T3j4T1JWc+GZy7+rAqyyhYokz3SA== X-Gm-Message-State: AOJu0Yy74OOEL6gMTiTpP1aAoXFrjTbFWHcajICBOi5gjQ08/GaG39St mxTQ8ge0rpoJ1pwBjXl0POy/+uZ2gPABJ+fwsd7xBUVU3zwwkGYv X-Google-Smtp-Source: AGHT+IHfurszDpgLoTvZwmmRMYqXqQ/KnUmw0jQm7zt5c45X8ALO4PqosijhzOrL/OHoPwXUFpA77w== X-Received: by 2002:a05:6870:819b:b0:219:ec5:9bd8 with SMTP id k27-20020a056870819b00b002190ec59bd8mr10161674oae.35.1707409517146; Thu, 08 Feb 2024 08:25:17 -0800 (PST) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a05:6871:4190:b0:219:d6b0:b13f with SMTP id lc16-20020a056871419000b00219d6b0b13fls38858oab.0.-pod-prod-04-us; Thu, 08 Feb 2024 08:25:16 -0800 (PST) X-Received: by 2002:a05:6358:3408:b0:176:5b4f:492b with SMTP id h8-20020a056358340800b001765b4f492bmr6864746rwd.12.1707409516164; Thu, 08 Feb 2024 08:25:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707409516; cv=pass; d=google.com; s=arc-20160816; b=mOU9giHJvatjL5lm0AFhQgubBZfnkIo47kLPnpCa1yXA1k47ZcGM2DFAa8MhabtbdW gNRvbQr01oNPH5W34ADGtGtY6dIJFkGDSz8dwF0CFad8yPGOsS7Enfftq6hgnQh0/hb9 3qrNx9MjC3ApT73URPigygnKcS6Dip14rbcca54D81f3kkkyzKulD9vWHL7YpTHK2FNn q+amCZq+h1C/ZDVBLICzRw+aHGvo+6pfdhIWRDvzExX/Y2icsdUI7UdHkYi64yXtL1uk DnZ6rIjwPNSuYBBy9R/0IvbvOzlaFRc9qiJSp8F1v5w8NgEpfr5hmxGhe5E50c5Ntlz6 AWgA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:content-transfer-encoding:message-id:date:subject:cc :to:from:dkim-signature; bh=04nJO54VbGMkWUDis8VhOlQ8AllE+HVq2BY4hwGeGPg=; fh=ABKl2hkLkVElsdzSMxFRbD9HQUVPavwWTq8CSKqhwmE=; b=NOwgMyI1zwon7G39yyXpvcHgoh5VhHViClwkwiJlFNH+xcXlfWww1KggRYrQnhZKK1 RwmhvhMIJlajuTJm1eCi/yQVztj7GldlBoNTiYKaoy1EYucdKZ3oS9dyjmR6K2vR0ZY+ BXpcFrCuwG20xyC2/MvJp1PyFw2S3pVI3dAom4xt0PTu6j+R4x740WoDDdz92oe+nh4N hjFEPJTTw5tlsGwo8JKkviE7lNaQssedw+2bviuo7UiIvnxscvfoNsWEbx/ZkYXZUrji I54r17xB/pbI8zEMTw2Xv1KALJVbhIrKddvLO34zNhxNnwZsdqA/OgpP1rIgqIml9cok bmCA==; dara=google.com ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=uImD4rkx; arc=pass (i=1 spf=pass spfdomain=siemens.com dkim=pass dkdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of michael.adler@siemens.com designates 2a01:111:f403:2612::601 as permitted sender) smtp.mailfrom=michael.adler@siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on20601.outbound.protection.outlook.com. [2a01:111:f403:2612::601]) by gmr-mx.google.com with ESMTPS id q17-20020a638c51000000b005dc190f9c40si433002pgn.1.2024.02.08.08.25.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Feb 2024 08:25:16 -0800 (PST) Received-SPF: pass (google.com: domain of michael.adler@siemens.com designates 2a01:111:f403:2612::601 as permitted sender) client-ip=2a01:111:f403:2612::601; ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MpQP2Xm9ahlNIRmeJ2rE8e+qJccy3oTNYnYHsz5GVRq+sfLNfLLExN6V3FL/wR7swGBpXvN/azOCSnt8MOnRYxs6lLwjuYOtBalSpRrez6yv8iozU7DodHht8dfj8xzUsoPaac/oVIvjKQiAtqvF2EOaJTIKo1X81UEpaaQ499NQGkCrKeXNwhNEzld//IO/FwtoLXh3sRhqGcJEv/KpEQfqDkwmkuOoIyQ+9XLWSnV4fxMBFKHNPkcv73puAZq1i6+yXjKKwleSMmPCn70Nkzr65c2qOBi3J83KgnLlK2sNZoWSMxcochkEpXS4m07hlIjcGcZL9YmAe1wcPSQGnw== 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=04nJO54VbGMkWUDis8VhOlQ8AllE+HVq2BY4hwGeGPg=; b=TiwZvPmsFkxCSbVdeEHSeLLeZOJTsHc7CoLnYFxcq/mELcjZ9AQ1lxKztM3XFj+IPZjZll3FKsXUIfJyEPjrwj+9ZqkYloR051Q+A4R4mBrJabRyxUWREGNf6JH897Iy+WAIxcLRPvlw4dTTe5Y6jh2xctONuLHyiqdq8H3OpCgd6k5vMqFEAvk+5V8WGdJlxMGUZSwdmu5OdORg10BqZW3rQJSD2yVyUZ1gHM35cY1uWzRADmQhGUUdzDygZp9UGIXMtv6VqHwmUYa+EIKNgNdY02Ki2+nACOpHmGCH1CZ3mGHUijMwdqfyj8lDl5oK0hgK71mW9tHMxr/LXWc1sg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=siemens.com; dmarc=pass action=none header.from=siemens.com; dkim=pass header.d=siemens.com; arc=none Received: from PAXPR10MB4734.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:102:12e::15) by VI1PR10MB3728.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:800:131::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.39; Thu, 8 Feb 2024 16:25:13 +0000 Received: from PAXPR10MB4734.EURPRD10.PROD.OUTLOOK.COM ([fe80::7720:2de0:b5f0:63aa]) by PAXPR10MB4734.EURPRD10.PROD.OUTLOOK.COM ([fe80::7720:2de0:b5f0:63aa%7]) with mapi id 15.20.7249.035; Thu, 8 Feb 2024 16:25:13 +0000 X-Patchwork-Original-From: "'Michael Adler' via swupdate" From: Michael Adler To: swupdate@googlegroups.com Cc: Oleksandr Makhmudov , Michael Adler , Christian Storm Subject: [swupdate] [PATCH] parsers: Fix false positive parser format errors Date: Thu, 8 Feb 2024 17:24:30 +0100 Message-ID: <20240208162430.208984-1-michael.adler@siemens.com> X-Mailer: git-send-email 2.43.0 X-ClientProxiedBy: FR4P281CA0307.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:f6::20) To PAXPR10MB4734.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:102:12e::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR10MB4734:EE_|VI1PR10MB3728:EE_ X-MS-Office365-Filtering-Correlation-Id: a113458e-8c9d-4702-7fbb-08dc28c286f3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SWhS70S+62xckS6J+6PUepZ3gw69TbojrVqjM+BCzAFIi2b88Ne4uSG3m/0qhCidVm8HSqfDNA0L68w6XWlymS/nxFXSpBSCJMrEiGrbX4JXU2A1sEhWkcVTktJWKVYLRIbci2BJTX4tOuauSxJlWh9so5Q32awxxksy09e+MHsjFxh8022INB0LIYRHz7obCeMfzHRkAdO2Cs/WWDqkZz0hbMeqqvE9doO8ILSaCZwJizeZ2HR3tjpwWpT2xUR3cCBOZp6m8EvfB8IYdRQXMFXHbhAZxc2j55qXNVTu0skCJIOBlCbZVvunj8eQWre35OgeA7j/sngyiz7RMLRVHy4/TAY4QakNr7AwqIXiLDKiye00BF/4OCup/u4/dK4i3sQ49aqFalwGnusrjxolBMf/THcoHfzKcj/Pkh+VavVNTGUQQukNCxL9Wx6PuwixQC6gQ60TO+wNlY9XMl+0VGKRxKAEcc6wLcdgns3SJnyGzGD+9+5IFN162cU4ikcjNQkzpY3mTQeKO+JC2b7/fGOyZiqHQ6yC5r8bE5RZTxPRXBLLBObnHeyVl6Jhl7s9 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR10MB4734.EURPRD10.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230031)(39860400002)(366004)(136003)(376002)(396003)(346002)(230922051799003)(230273577357003)(64100799003)(1800799012)(451199024)(186009)(41300700001)(6486002)(6666004)(478600001)(2906002)(6916009)(66556008)(66476007)(66946007)(316002)(54906003)(5660300002)(26005)(1076003)(6512007)(44832011)(2616005)(107886003)(36756003)(6506007)(86362001)(4326008)(8936002)(83380400001)(38100700002)(82960400001)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: fv8e20Jc9ruOenXs5qXv4DucnOtgacU/O9E1drfQfLVgVUmj+WixqBRv7vS3E2CPJau+4zglhlsDjx6apjT2NI4nfI+wFggP0X0GaKHcG3mjKOjKw9Q1K02yQYQjZ4s06MnhWyCLbP3PB3/qvOZKd6y7EvFF2uxE8Ow6eKYvy+QcO2GRse/Y9vRIL6zW+2LlijFJJS1ffAueOzv3oe5v6TNekqoDXjZ+IfNbd9PNnsIl4MkCqa6JzgazOAWGpvG1B3sdOCyUZq21EcU9woaI0jqjzVHlC26XeSPf+/Qp7naWq1WZBduXLmWXlvNjBwE8lmIgrIH4L6tbsEF6iFH7oPYwOcMds1hCDI9QzCdFFNtTYvjHo2pXLLxEJWQ8LPyI3txZq4OSvF+jO8tXR7qqR6Iurep906RWAG6SjdU6pxA8DUvl+xUjbayzeEKb2sPr9CqTzmShOJCXn7yTtuDuSncSGYZDS/1SZDSZ7UylIlEdHGFGPCyarN0E0tSYpa4fH40i6bM7RZoEKBR4AATFhzalSKaR+0WFCqmuSyCLCLKZxpttQYU32N4DorpzCoxsHUC9QXrRoqExVgVMmJ/2ABPapjs6lX2aXXClz1zo8/oo6+j1/fnDcVSxxcI4KikJ6NCJRjTcanbXlDI9pqFalgMaB0b6rJ8E4bQNHk4vHUmlH/tPkTnPOtv8CmGfUxC9hia0VwROsOnIzTAFNnhNSP3YZbJSVpPzMow1Lub0JuatH8yOwnHUs4SUeLH5es77nFTPLnRMerueRVSUDMz75iaxqH6wqtWragwkSi9bimJPJxVcmTE+3KM0I5ln5pw2eCHX+HwLbDdhuylKisKZUQqRIdLaiA3iL4YPsF0V6raloW8TkOna8/aU+nEr9NNU5VvdBgiWfm2rKA6VL0p2L7hwMS1iJYvjtXhBFdIGdZvDMJWYuN5hWQsh/XlWv6pFc/GCAkJVRKcAvg9A5+kfSeMSTU2gFaEe/Bdm9G45JOztCi5H0wJXLhVZKzKybdJrF8+MfsG7q4SZ+8SfgIkvnewWK/gV7pzgoCl60dNcmFXQb/Re2sAUfYtuu+YkJLgMNZXmWIbCIGnt4NWs1+CashgWsueMncZe4sI4Le9b4AzQX0QaNeRSIewsQHYo/Et/pQ3QAHTF1Zl+ZcOnSqdY1FFzBuhe436v07PIZPQiMOq8d+M0wkusDsgjWxA/wcf3PzJElEBox7ltdTemJa6FvPyB6TSvg/Fipj/NiwvU22hw+9kun9VxxZWD/LE3Za3so4CI9eZybJLCl+hyVDhLubGaI20WZ0StMyPR5QeGpCcwPVVujETe8lJXMPbRukQVyMm1k/hw6UAKsukmkDKhg4vPURjiXCFOO8i0IL+TKEikF0aA9TdrOtKR5MuhmPrm/wfCsteZ9TDg4fwD3B/yls49/bjAzl07HhZl3ifC71aq8LY+oyULrgRSVYHeMO6FQksZD8z4mUxo7UROaDHMbDZQgIRtymCTEm9R5341Xm/dOFDpDIb2GwVuAGsYo74m/4qk1MmN5QsZfj6/nunG/ZAtw8AdeUMGtZsnmSt//hHjhHwBGQsp+R2dNJVyPTGqEv+3ftjHW2ATP0BiKWSHHg== X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-Network-Message-Id: a113458e-8c9d-4702-7fbb-08dc28c286f3 X-MS-Exchange-CrossTenant-AuthSource: PAXPR10MB4734.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2024 16:25:13.3862 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 38ae3bcd-9579-4fd4-adda-b42e1495d55a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lL3UaPsL/Ffo0imPDf32yzWbY71mqjvO6DioYlH4n/OUfjuq+HlgzTnqZi+LYHCGsQ78sTVHrpkCOI/4SFtN2reTnwRHx+OukX9nt0zeN0g= X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR10MB3728 X-Original-Sender: Michael.Adler@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=uImD4rkx; arc=pass (i=1 spf=pass spfdomain=siemens.com dkim=pass dkdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of michael.adler@siemens.com designates 2a01:111:f403:2612::601 as permitted sender) smtp.mailfrom=michael.adler@siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com X-Original-From: Michael Adler Reply-To: Michael Adler Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , From: Oleksandr Makhmudov Parsers output errors to log when config format doesn't match the parser. This causes false positive errors when config format is json due to the libconfig parser being run first. This can be fixed by caching these errors and only outputting them if all parsers fail. Signed-off-by: Oleksandr Makhmudov Signed-off-by: Michael Adler Signed-off-by: Christian Storm --- core/parser.c | 13 ++++++++++++- include/parsers.h | 8 ++++---- parser/parse_external.c | 8 +++++--- parser/parser.c | 21 ++++++++++++++------- 4 files changed, 35 insertions(+), 15 deletions(-) diff --git a/core/parser.c b/core/parser.c index 02fb38a7..5cd611fc 100644 --- a/core/parser.c +++ b/core/parser.c @@ -151,20 +151,31 @@ int parse(struct swupdate_cfg *sw, const char *descfile) return ret; #endif + char *errors[ARRAY_SIZE(parsers)] = {0}; for (unsigned int i = 0; i < ARRAY_SIZE(parsers); i++) { current = parsers[i]; - ret = current(sw, descfile); + ret = current(sw, descfile, &errors[i]); if (ret == 0) break; } if (ret != 0) { + for (unsigned int i = 0; i < ARRAY_SIZE(parsers); i++) { + if (errors[i] != NULL) { + ERROR("%s", errors[i]); + free(errors[i]); + } + } ERROR("no parser available to parse " SW_DESCRIPTION_FILENAME "!"); return ret; } + for (unsigned int i = 0; i < ARRAY_SIZE(parsers); i++) + if (errors[i] != NULL) + free(errors[i]); + ret = check_handler_list(&sw->scripts, SCRIPT_HANDLER, IS_SCRIPT, "scripts"); ret |= check_handler_list(&sw->images, IMAGE_HANDLER | FILE_HANDLER, IS_IMAGE_FILE, "images / files"); diff --git a/include/parsers.h b/include/parsers.h index 0e94c2b6..7d8abc1f 100644 --- a/include/parsers.h +++ b/include/parsers.h @@ -15,9 +15,9 @@ #define SW_DESCRIPTION_FILENAME CONFIG_SWDESCRIPTION #endif -typedef int (*parser_fn)(struct swupdate_cfg *swcfg, const char *filename); +typedef int (*parser_fn)(struct swupdate_cfg *swcfg, const char *filename, char **error); int parse(struct swupdate_cfg *swcfg, const char *filename); -int parse_cfg (struct swupdate_cfg *swcfg, const char *filename); -int parse_json(struct swupdate_cfg *swcfg, const char *filename); -int parse_external(struct swupdate_cfg *swcfg, const char *filename); +int parse_cfg(struct swupdate_cfg *swcfg, const char *filename, char **error); +int parse_json(struct swupdate_cfg *swcfg, const char *filename, char **error); +int parse_external(struct swupdate_cfg *swcfg, const char *filename, char **error); diff --git a/parser/parse_external.c b/parser/parse_external.c index bacf4b40..eef2b09a 100644 --- a/parser/parse_external.c +++ b/parser/parse_external.c @@ -104,7 +104,8 @@ static void sw_append_stream(struct img_type *img, const char *key, img->id.install_if_higher = 1; } -int parse_external(struct swupdate_cfg *software, const char *filename) +int parse_external(struct swupdate_cfg *software, const char *filename, + char __attribute__((__unused__)) **error) { int ret; unsigned int nstreams; @@ -200,8 +201,9 @@ int parse_external(struct swupdate_cfg *software, const char *filename) } #else -int parse_external(struct swupdate_cfg __attribute__ ((__unused__)) *software, - const char __attribute__ ((__unused__)) *filename) +int parse_external(struct swupdate_cfg __attribute__((__unused__)) *software, + const char __attribute__((__unused__)) *filename, + char __attribute__((__unused__)) **error) { return -1; } diff --git a/parser/parser.c b/parser/parser.c index c7616cb8..f988dc5a 100644 --- a/parser/parser.c +++ b/parser/parser.c @@ -1056,7 +1056,7 @@ static int parser(parsertype p, void *cfg, struct swupdate_cfg *swcfg) } #ifdef CONFIG_LIBCONFIG -int parse_cfg (struct swupdate_cfg *swcfg, const char *filename) +int parse_cfg(struct swupdate_cfg *swcfg, const char *filename, char **error) { config_t cfg; parsertype p = LIBCFG_PARSER; @@ -1068,8 +1068,11 @@ int parse_cfg (struct swupdate_cfg *swcfg, const char *filename) /* Read the file. If there is an error, report it and exit. */ DEBUG("Parsing config file %s", filename); if(config_read_file(&cfg, filename) != CONFIG_TRUE) { - ERROR("%s:%d - %s\n", config_error_file(&cfg), - config_error_line(&cfg), config_error_text(&cfg)); + if (asprintf(error, "%s:%d - %s\n", config_error_file(&cfg), + config_error_line(&cfg), config_error_text(&cfg)) == ENOMEM_ASPRINTF) { + ERROR("OOM when caching error"); + return -ENOMEM; + } config_destroy(&cfg); return -1; } @@ -1084,8 +1087,9 @@ int parse_cfg (struct swupdate_cfg *swcfg, const char *filename) return ret; } #else -int parse_cfg (struct swupdate_cfg __attribute__ ((__unused__)) *swcfg, - const char __attribute__ ((__unused__)) *filename) +int parse_cfg(struct swupdate_cfg __attribute__((__unused__)) *swcfg, + const char __attribute__((__unused__)) *filename, + char __attribute__((__unused__)) **error) { return -1; } @@ -1093,7 +1097,7 @@ int parse_cfg (struct swupdate_cfg __attribute__ ((__unused__)) *swcfg, #define JSON_OBJECT_FREED 1 -int parse_json(struct swupdate_cfg *swcfg, const char *filename) +int parse_json(struct swupdate_cfg *swcfg, const char *filename, char **error) { int fd, ret; struct stat stbuf; @@ -1134,7 +1138,10 @@ int parse_json(struct swupdate_cfg *swcfg, const char *filename) cfg = json_tokener_parse(string); if (!cfg) { - ERROR("JSON File corrupted"); + if (asprintf(error, "JSON File corrupted") == ENOMEM_ASPRINTF) { + ERROR("OOM when caching error"); + return -ENOMEM; + } free(string); return -1; }