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 35B8945E2B; Wed, 4 Dec 2024 09:59:24 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BF52240648; Wed, 4 Dec 2024 09:59:23 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) by mails.dpdk.org (Postfix) with ESMTP id D46B840261 for ; Wed, 4 Dec 2024 09:59:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1733302762; x=1764838762; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=HugJoBHiQsmQWISunapcxqU1dMJeyzueyFx3PAUr4As=; b=aEsw2YAWRmqqI0P938FBF1aM4/jl6Em4CyAdEA0e8UUfhRiLZtyjelDg 2hekJA2+rD+gUeyvs2lNj3oEOdcbbF1tLy/3C0937sOC73XIssRT03b2E Xf6TURhaYhEXSaRJoqbj2qIpDmUdK0pI4C2xTJK2Jrfab1XZpSqTJsuxf RoDjsYRrMOKezBZQCxsypu/dVDUNKcVnTcz523v1jUVOJcCjDJk8w7PYE gEQP+THVhLGFmxbHwmdIqAD5Dp3CmaRL+PS1VAZO20N1fcOH4xH9PfBuk uIdixPkQMOq6tjsoZdkLvjG8n7o0bDfWkFQy18U3fjXvna0aBazegd3hI w==; X-CSE-ConnectionGUID: rvrqomjKROWQETsA88WHrg== X-CSE-MsgGUID: 3tvs9cLlQGChW98RHbyCCQ== X-IronPort-AV: E=McAfee;i="6700,10204,11275"; a="32916501" X-IronPort-AV: E=Sophos;i="6.12,207,1728975600"; d="scan'208";a="32916501" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2024 00:59:20 -0800 X-CSE-ConnectionGUID: WVTMRxOtQzaPAf7xST849Q== X-CSE-MsgGUID: ZiMQ+fCIRjS0rFvUPz95gA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,207,1728975600"; d="scan'208";a="94047925" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmviesa010.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 04 Dec 2024 00:59:19 -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.39; Wed, 4 Dec 2024 00:59:18 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) 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.39 via Frontend Transport; Wed, 4 Dec 2024 00:59:18 -0800 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.171) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 4 Dec 2024 00:59:15 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=epMTK7d4B4PXNWf++gDJW/ouBdyNsUL7ms8PXzAcq0xW7v+Rm+Wyx8fT9q06iuW2CtsB30Rsqj1+znMXJ3hWN9S2rLH9T6qDqUpX53YMx0c9HQ7m2t/iyNwvKCA01SrcNNhcNDotPYphkLfc8uz53PjpxzDxAVfY0Zw8zSIM8fZsm2degdIvYu/QwmG4ssCk+4d0GB0m8/cu/++zBYH7+iKVt1MvdFLOguuIQNM8N3my6g8gk2kuk4EKv6UXgXKbROVXFojDhtc2VLapb45Dd+djeWOfzWZsclQQruy+fjFTy8DN/Q42nu5vcJLuD5d4kZFlEWiFVtFm/yEo0fjT4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=jaVi4so7MMC9I7geHhdb3D9s0W2sawuWFSdZW3A9OMQ=; b=oIK4K3zsW/3T9GwhseLIzZqs1lpxOPCs3Ss1iZ1CBZzEhlNCXC8otlQDLesXEkOOY4s1IOHoDksHM89eTX0/9XQd9Nv5Upi8/c2lbJ2TT9ZHtNfxLZtTO4vYlvjJFtmvMgnDWaVDHxV6wxvysX+U5pSdR6qwnjafuLvGyWHq5+NLsj7eHMgsmYb7ZZEr5PnnB/Ts7Plk2/lJxJUWABT9eD1WxdWqAnPfBbimdXcRNoZp1dLHvU0Qij1moYjZq8PO8tcA66K2BBUvbzr6nYbOHxipej4tQM+PFdGgKAVkdSXWhTJdXzUpgGNdQF6a0jSgv9RvTBBzLBKUVprib/TPvQ== 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 DM4PR11MB6502.namprd11.prod.outlook.com (2603:10b6:8:89::7) by CH3PR11MB7179.namprd11.prod.outlook.com (2603:10b6:610:142::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8207.20; Wed, 4 Dec 2024 08:59:13 +0000 Received: from DM4PR11MB6502.namprd11.prod.outlook.com ([fe80::21e4:2d98:c498:2d7a]) by DM4PR11MB6502.namprd11.prod.outlook.com ([fe80::21e4:2d98:c498:2d7a%3]) with mapi id 15.20.8207.017; Wed, 4 Dec 2024 08:59:13 +0000 Message-ID: Date: Wed, 4 Dec 2024 09:59:08 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/2] usertools/devbind: update coding style To: Stephen Hemminger CC: , Robin Jarry References: <236299d7081f4a06a6f6d06eb575539582c0344f.1733224995.git.anatoly.burakov@intel.com> <20241203090752.39f9c89d@hermes.local> Content-Language: en-US From: "Burakov, Anatoly" In-Reply-To: <20241203090752.39f9c89d@hermes.local> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: DB9PR02CA0017.eurprd02.prod.outlook.com (2603:10a6:10:1d9::22) To DM4PR11MB6502.namprd11.prod.outlook.com (2603:10b6:8:89::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR11MB6502:EE_|CH3PR11MB7179:EE_ X-MS-Office365-Filtering-Correlation-Id: de08e98f-b9d0-4113-b8a8-08dd1441ec7a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?SG13SkpNNG51SUJXZVQ4OWhVdXVMZ0ttTnRBeDJzWEpmdy9LK2hWeXdEbi9S?= =?utf-8?B?TjBHVjBPanNqYUlYYWRzSVRrMGRjU0hRZ2lEcGpKTkZpOWoxRy9nUS9FRWxH?= =?utf-8?B?VWxNeXFEdjhieTR3dHRDc1FiMHRjeEVpdzlnalY5M3pvUWFlUGZWOEdobVF2?= =?utf-8?B?cmtyc0liOFFsaE9jODAzMkNUSFU3RFlwTHdhamtPOVRJWVQyZXo2TllmLzRF?= =?utf-8?B?YitzYjJ6SkhRT3RvOXdjNUVlbVhqL0gvdVVjT1ZRWWFzMmx4cEpWeEFsbkJn?= =?utf-8?B?QWNMT0pISmFVbHFnRU05TEVaWTVDVnN6NURGbncvdFFyajB4VVJiN3dUR3pX?= =?utf-8?B?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utf-8?B?SS9BeUt2dkhYQ2pyRU9sWS9NaWh0dDhKNU4vbFhWQXplVER4S0FFbHVsOFNp?= =?utf-8?B?SUZUOThjVUp4eGVZRTE1MnprQTVUb2NEVVpkeEJDUlhWVVNUMTladFdndDVl?= =?utf-8?B?SDJ2QzlveGQwanI0UFRnYkpjc3c5REJOdlBDa0t0OVNPUG5LYXRVVVNVYklk?= =?utf-8?B?ZWc0ZU5GeDFFemdURW9ZNlJGeHVJaS9ZRlhsWFFOYmo4OUVPMDluc3Rscjhk?= =?utf-8?B?TEU1SUxhQ2dqakYvaEliWG10MjFGbmNRQWdHazVSdkowYlVoMkNRZklodXF5?= =?utf-8?B?dVpKVU9YakVTOUQ3OEo2VXFzTEUwczk3QnAyUUdoRHkvODZGWWxWSHBsK1Ix?= =?utf-8?B?RXp5Um11azRUN0hDY251eUVzV05iZWpaa2x6Tzc2TG5obW1oaEJSc0lPWlNt?= =?utf-8?B?Y05LZ25Qa2tRY0pMak1kYjBtdzV1WDQvOFcyV05ub21JTjczRWhvZHJVejJv?= =?utf-8?B?QUFJTENCSTVreGtYUGtSeGJFLzdCZkxtb0I4YVNEYk1BNTUxbEorU0JpQWRS?= =?utf-8?B?ZTZwY2p2WmFCU2ZoOEQvZz09?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB6502.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?OThxZ2JRaHUyTHFSaVUyQVE4M3B4UnBqcFU0QitaWDRDVDMrZ01Ob3UvajU2?= =?utf-8?B?dkgyWVhFNHJQVmMrRWRZTUQ1N3Nhell1NlZQY2phaVBsdy83bElnY1ltdExW?= =?utf-8?B?S3RhS2RvTXdMS0w0cHVNcWwzSTF2TW0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TZB?= =?utf-8?B?VE1qMzc0ZDdpZzVlVWNGUlc3UmJLanhTWmNYM0ZEcWZOZHZGRVRhWXY3aEFs?= =?utf-8?B?Q2VobWYvWDAzam90OTRxUStVRWF3ejVPWGJkYlUvRm94dDJhcVNVWFdGVkMv?= =?utf-8?B?N0lkbDNtUmF1U0xWa2crcFg4SUVmbmdZT3pKRDQ1Vkg0Mkx5Q1I3a0xtdjZL?= =?utf-8?B?VzJQUDMvbnY1MHg3WnhsZ3RyRDFVQW0xQXZQQWowRGZtdXl0UUo2ZDRQc1dI?= =?utf-8?B?T2c9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: de08e98f-b9d0-4113-b8a8-08dd1441ec7a X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB6502.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Dec 2024 08:59:13.0743 (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: tfTRv7OXM8MxpC+Z7d3NGyG0X5HR7hnO0FKbnoZcKdOt3ueVP1wt6kynbYl9JSZB5SWrQYSzwRXFeUFL0luZvJJEleL/48Ja38qmthqH05s= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR11MB7179 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 12/3/2024 6:07 PM, Stephen Hemminger wrote: > On Tue, 3 Dec 2024 11:25:00 +0000 > Anatoly Burakov wrote: > >> + >> +def check_installed(program: str, package: str) -> None: >> + """Check if a program is installed.""" >> + if subprocess.call( >> + ["which", program], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL >> + ): >> + raise DevbindError(f"'{program}' not found - please install '{package}'.") >> + > > Apparently the posix way to do this is to use command -v not "which" > > > command [-pVv] command [arg ...] > Run command with args suppressing the normal shell function > lookup. Only builtin commands or commands found in the PATH are > executed. If the -p option is given, the search for command is > performed using a default value for PATH that is guaranteed to > find all of the standard utilities. If either the -V or -v op‐ > tion is supplied, a description of command is printed. The -v > option causes a single word indicating the command or filename > used to invoke command to be displayed; the -V option produces a > more verbose description. If the -V or -v option is supplied, > the exit status is 0 if command was found, and 1 if not. If nei‐ > ther option is supplied and an error occurred or command cannot > be found, the exit status is 127. Otherwise, the exit status of > the command builtin is the exit status of command. Yes but that's for shell, it is not accessible from Python. Well, it wouldn't be unless you're suggesting calling into bash and running `command -v`? -- Thanks, Anatoly