DPDK patches and discussions
 help / color / mirror / Atom feed
From: fengchengwen <fengchengwen@huawei.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: <thomas@monjalon.net>, <dev@dpdk.org>, <cristian.dumitrescu@intel.com>
Subject: Re: [PATCH 4/4] cfgfile: add unique name flag
Date: Fri, 5 Jul 2024 17:37:08 +0800	[thread overview]
Message-ID: <72aca282-1e35-f857-b316-85bc78f6a1a7@huawei.com> (raw)
In-Reply-To: <20240704143646.1f19b480@hermes.local>

Hi Stephen,

On 2024/7/5 5:36, Stephen Hemminger wrote:
> On Tue, 20 Feb 2024 03:58:40 +0000
> Chengwen Feng <fengchengwen@huawei.com> wrote:
> 
>> The cfgfile supports duplicate section name and entry name when parsing
>> config file, which may confused and hard to debug when accidentally set
>> duplicate name.
>>
>> So add unique name flag, it will treat as error if encounter duplicate
>> section name or entry name.
>>
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
> 
> https://en.wikipedia.org/wiki/INI_file
> 
> 	Interpretation of multiple section declarations with the same name also varies. 
> 	In some implementations, duplicate sections simply merge their properties, as if
> 	they occurred contiguously. Others may abort, or ignore some aspect of the INI file.
> 
> The standard reference for INI file parsing on Linux is the Python configparser
> https://docs.python.org/3/library/configparser.html
> 
> 	strict, default value: True
> 
> 	When set to True, the parser will not allow for any section or option duplicates while reading from a single source 	(using read_file(), read_string() or read_dict()). It is recommended to use strict parsers in new applications.
> 
> The problem I see is that cfgfile allows duplicates on names, and sections.
> Perhaps there should be a new strict flag for this.

It is important to keep the naming consistent, already sent v2 to fix it.

Thanks

> .
> 

  reply	other threads:[~2024-07-05  9:37 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-20  3:58 [PATCH 0/4] cfgfile: enhance error detecting Chengwen Feng
2024-02-20  3:58 ` [PATCH 1/4] cfgfile: remove dead code Chengwen Feng
2024-07-04 21:28   ` Stephen Hemminger
2024-02-20  3:58 ` [PATCH 2/4] cfgfile: support verify name and value Chengwen Feng
2024-07-04 21:29   ` Stephen Hemminger
2024-02-20  3:58 ` [PATCH 3/4] cfgfile: verify add section and entry result Chengwen Feng
2024-07-04 21:30   ` Stephen Hemminger
2024-02-20  3:58 ` [PATCH 4/4] cfgfile: add unique name flag Chengwen Feng
2024-07-04 21:36   ` Stephen Hemminger
2024-07-05  9:37     ` fengchengwen [this message]
2024-07-04 15:12 ` [PATCH 0/4] cfgfile: enhance error detecting David Marchand
2024-07-05  0:14   ` Stephen Hemminger
2024-07-05  0:29     ` Stephen Hemminger
2024-07-04 21:40 ` Stephen Hemminger
2024-07-05  8:39   ` Bruce Richardson
2024-07-05  9:31 ` [PATCH v2 " Chengwen Feng
2024-07-05  9:31   ` [PATCH v2 1/4] cfgfile: remove dead code Chengwen Feng
2024-07-05  9:31   ` [PATCH v2 2/4] cfgfile: support verify name and value Chengwen Feng
2024-07-05  9:31   ` [PATCH v2 3/4] cfgfile: verify add section and entry result Chengwen Feng
2024-07-05  9:31   ` [PATCH v2 4/4] cfgfile: add strict parse flag Chengwen Feng
2024-09-06  1:03   ` [PATCH v2 0/4] cfgfile: enhance error detecting fengchengwen
2024-10-09 22:47   ` Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=72aca282-1e35-f857-b316-85bc78f6a1a7@huawei.com \
    --to=fengchengwen@huawei.com \
    --cc=cristian.dumitrescu@intel.com \
    --cc=dev@dpdk.org \
    --cc=stephen@networkplumber.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).