From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8BA9543352; Fri, 17 Nov 2023 12:22:49 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 26FD340ED1; Fri, 17 Nov 2023 12:22:49 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 2C1EC40648 for ; Fri, 17 Nov 2023 12:22:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700220167; x=1731756167; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=eIXo7BQ9t1iGuvH8Z66vHQsbiEOzzR2Z5a/sSs/QUEg=; b=VZgGH2/rdeGzcSNOJt0PzZvgs8giNlnTv1gYiPR7DZThTtu/x60uL9DT +302GNy/ZJbLKHi1MXeNrAC1dI0/TUaFx5n1jtHyif5q9Y44b8TZcZIcQ R9P+4/7nVRGXXcAK5XuQMhhBRRkTr7/4bziklMIEV0BD2Ru9kry3TCph+ VRLF9gEXXHX9o7uk2ov/eBMLfA0sxaLNVhJDuKUzEXkf1vwhccECQ9jxP w3pzYvkhECcGsRUgFU0ktngomgf4mPeD3VHInLuIGNZaq612pZcjhTvv6 z3xfRhjw/uaIY9KqzjzoQ5xfVqs1xBYShbdTLIGrxbvJgTOIDQGPfzJOg g==; X-IronPort-AV: E=McAfee;i="6600,9927,10896"; a="376331030" X-IronPort-AV: E=Sophos;i="6.04,206,1695711600"; d="scan'208";a="376331030" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2023 03:22:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10896"; a="759150719" X-IronPort-AV: E=Sophos;i="6.04,206,1695711600"; d="scan'208";a="759150719" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga007.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 17 Nov 2023 03:22:46 -0800 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Fri, 17 Nov 2023 03:22:45 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34 via Frontend Transport; Fri, 17 Nov 2023 03:22:45 -0800 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.41) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.34; Fri, 17 Nov 2023 03:22:45 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UWYSF2Hs/Jv1RktOewO5BfpZ44b8aUNQp27CP9EWwtP1M6zrkU9iMXxraxObIXimI4Gaiq5V6pC6u0l5UYINWxQVy8MD9OB6rY4didQQ0Rz+xUARw7SRvaS4A7wVgRv3IESfx47rMJv9g6SPuBnUivwdCGpAExel6W+yU36kj6cBZ80ha8cyI/DyxzRUrVoOl1Jml6xWtSbdWWlFGJS8pN+d1meTbRc33L3Dk4gVlWLoOX6lN+KTloiRQcuuAl2Vc5xJ0AJclhul9gRjCBv42nN7MNvIFEgfuSY4TKUEQXJHjg42eSeuduHPDrCFeTHSzts2PyJfDupXSRyg1FFo4Q== 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=AJREYkczVIg+O1VJ2B/vCxxqcwm1J4GERWv74KRzc84=; b=DHe2zbJoBUL122ilf2231wkLOdWFpuZ0DARcLjz2a/i5/7z5UFiO5p1O0BTLilRsm1IkcUcxTq+FI59apNU3ey1RjPyuIvbmiiVCPo6JAAsCqipuVNhVe6jXRH3j346FsUqV4/SDjel9G7ojdSAwGjrk0gWmz3gEcIosL/lLqiLvauTpuSdftUuiob6RNBKWOBAQo0L+rBQX/eNK4OckXF3ocbyKQUYUsHGxFFbMU+6fVn+XjtJ2WQswIJQ1W2GiL3xA2608x/lgigDP0YTMEzQue8Ao1OEdQm1ftZlmyA3hiIg3Dj9u/xj5N+CS+LGvVjyby9hwLg5o0VTdclkAbA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by SN7PR11MB6850.namprd11.prod.outlook.com (2603:10b6:806:2a2::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7002.23; Fri, 17 Nov 2023 11:22:43 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::4782:d54a:209d:cb49]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::4782:d54a:209d:cb49%7]) with mapi id 15.20.7002.021; Fri, 17 Nov 2023 11:22:43 +0000 Date: Fri, 17 Nov 2023 11:22:38 +0000 From: Bruce Richardson To: Robin Jarry CC: Subject: Re: [PATCH] cmdline-gen: fix error when command list has empty lines Message-ID: References: <20231116111812.296090-2-rjarry@redhat.com> Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231116111812.296090-2-rjarry@redhat.com> X-ClientProxiedBy: FR3P281CA0139.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:95::13) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|SN7PR11MB6850:EE_ X-MS-Office365-Filtering-Correlation-Id: 139fd8e6-f2d3-42d4-3b87-08dbe75f844e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 65Njy982icVYEOKOOa2ATzoHPPHDlCip1F/69EgOt+2hqcFpl43/6KlA7W20QcRNKq/lBoskYTmbnKF/co9QAZYypNYRu9YCTVxSE0yvsZeGbnEKzBiqiQpaYhEWGDCAftBEjitFuO5cQf6MNVp01AJT3pOiGvl2dK9LVq8izbRZLdR1ugibI505r3fs32WyBBV1Y2dxfqhwdAYx5nO0nAbriMEeeXqtdRPKpLcl486Wew2gTj3LGvP9aa1LVoThjMuKlfCF1joVXoiG26ACQhbkvQxN2Nz1V/apiLhN6uPISnMzUwDVAD7wbroM0SPviwdNxjEFCXewYZOP8DOuCAbmm8fp7d+Ys5wuG2Foe50o4M2eZBJ1Ut9NYrpGfDfKw7GeH2HI+1DCE8+UYEt7E5h20cVRmmnjpz/iAdmLw9t1ld8ym2qSeSnyh0EZq4ul8LI09i8aa9mRsLVQghYaCP6w/Ox25e2oxgLjV6ZDH8BFslmbU9BFkMdlctf7J39C+s4BrXwQv7g9MsRTfgn4sc1pvd9b2U+nNFYaIs+SZ6ycyXLNyK7vSCnY2PM83MJH X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(396003)(136003)(39860400002)(366004)(346002)(376002)(230922051799003)(186009)(451199024)(64100799003)(1800799009)(8676002)(8936002)(4326008)(41300700001)(86362001)(5660300002)(6506007)(6486002)(66556008)(316002)(66946007)(38100700002)(2906002)(44832011)(66476007)(26005)(6916009)(6512007)(82960400001)(478600001)(6666004); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UlFONEthZjBmQitPdUo5NzZGZVBSWm9RVnZXRGo0OVQ1T05XY2FWNXNKcEla?= =?utf-8?B?TGh3Z2VwU05SOCtKMEtPNk8wRUQyaWJIMUVSeEprR1pPb0FvQ1RKNjN3RGNa?= =?utf-8?B?aE9XSGFGV2J6aHBpWFhGK1huYWtqL3F3Ym95SkdxWE9Ec0U2NjBtM3diRTRY?= =?utf-8?B?aVA2ZGdDSFE1OVQ3Rlc5WnFWTTk4OTI1Mm1zY0F1cnRETEVSWDZmd1ZtYzU4?= =?utf-8?B?RGVCZjJwWDBmVElGRGZMcnpteUJscU9SaHA1Q1UvLzNQdHlKQnN5N01GN0RL?= =?utf-8?B?SnRhZ3owODRoZ3Z6TUVYdXZCcFRvWXBPbkkrdUFqaDBWVHZGVGt4dkRrb2VR?= =?utf-8?B?Rzl3RkNNamFtZG5laHVib0J2azlTOUJsY2p4ejNFOHIzK0J2N1JjWnNJL0pm?= =?utf-8?B?ZlBvMXhrWTdKSGJVUUtHNVkySEwzcHRTQXNaR2FMQTZwUk9nVWNCWmRsVlN2?= =?utf-8?B?LzIzUTFHSFZ3STZoeXJpZzVETkNGTE1UMWd4Y3NFSGVQeTFxYzBGbFltL01u?= =?utf-8?B?S0lDZG1tLzA2S1c4d082djRtZW1PQTFJaWFma3h6VnFHRm1yZWZ3RW9mS3R5?= =?utf-8?B?RGgzYUo1TEZNYXpUc3RVYTNJK1VXNDlTYnIxYXJWaXhDYn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hOUHJ3cEEvck5PMzBpZDR0bUJqbGNscjVj?= =?utf-8?B?YWZEM2RkWStQbE5qbWVhS09DeTlyUXZhdkhLUEErTGVZVGZ5dExVMUsrSmRC?= =?utf-8?B?UnpyUWQ1QzF4YUdHWDJaYlh2QUlwZkRkUXFmVWlRb25hcVFPdndjcnY3Q2Yz?= =?utf-8?B?RFczSFE2ZklaeXljMTJqSGhJUTdHZ0pEZUwxYWVJRVkveWl3cnJnbWxua3p6?= =?utf-8?B?RG4vdGNQOWZ4d05tcmFrQXZrenVTbVBvbThKanpWTFpOY05mRnllOFR3S0Zn?= =?utf-8?B?VHVDajVZSGhLMGdHc2NJMmsrYUdQaDlRQU9pSHFjY2RwMU1oVUpoSllBMFB3?= =?utf-8?B?RkNyZU1QdXlLYWloUlhuWFdvSWZXZzRJQTR0Vk9hc3kyQUhKK0dhSkpmSnZy?= =?utf-8?B?RnVQcmNJcDFJNlFkRUxMdjlmMk5LUmdnVG94UjZlejI0RnJoL2V2cnhGcGZp?= =?utf-8?B?dFlteU12Tzl6bWJybTNkQXV4Z1VTaWlzNnZVWWlSdWRsbzNOOXNoRHVNaDdT?= =?utf-8?B?bzA4Qkc0TDhJT3dDRGxhWm90cUFrU2dSNUFLaDR5S203SEt1Q2V2VjZ5Y3N3?= =?utf-8?B?enF4TFpnc0RhS3hkZFJONEZuSy9kOE1vZ0ZscjF6bHAwL2ZaQkYxMVRPR0Iz?= =?utf-8?B?UUE9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: 139fd8e6-f2d3-42d4-3b87-08dbe75f844e X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Nov 2023 11:22:43.1560 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lrS3VRreWSkc9PSN8K6PikKrATKK8gvA+lAPz4kSE7Dbxp4OZX3d6QZxvQZkwKWL799XXBV0FTIFCB4zW3AOa1nC/gr+10SRq+RN4QLVzS8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR11MB6850 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Thu, Nov 16, 2023 at 12:18:13PM +0100, Robin Jarry wrote: > Fix the following error when a command list file contains empty lines: > > Traceback (most recent call last): > File "buildtools/dpdk-cmdline-gen.py", line 202, in > main() > File "buildtools/dpdk-cmdline-gen.py", line 184, in main > process_commands(args.infile, sys.stdout, None, args.context_name) > File "buildtools/dpdk-cmdline-gen.py", line 141, in process_commands > cmd_inst, h_out, c_out = process_command(lineno, tokens.strip().spl… > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^… > File "buildtools/dpdk-cmdline-gen.py", line 36, in process_command > if tokens[0].startswith("<"): > ~~~~~~^^^ > IndexError: list index out of range > > Use shlex.split() to properly split each line arguments into tokens and > strip comments. > > If there are no tokens, ignore the line. > > Fixes: 37666691e9ed ("buildtools: add a tool to generate cmdline boilerplate") > > Cc: Bruce Richardson > Signed-off-by: Robin Jarry > --- LGTM, thanks. Acked-by: Bruce Richardson