Skip to content

Commit

Permalink
[meta] Rename values in saiattrversion.h (#2109)
Browse files Browse the repository at this point in the history
To be prefixed with SAI_METADATA_ATTR_VERSION_ to not duplicate actual attribute names
  • Loading branch information
kcudnik authored Nov 19, 2024
1 parent 9ff81be commit 8797aa9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion meta/attrversion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@ TAGS=$(git tag --sort=v:refname | grep -P "^v\d+\.\d+.\d+$" | sed -n -e '/'$BASE

(for tag in $TAGS; do git grep -P "^\s+SAI_\w+_ATTR_" $tag ../inc ../experimental | cat; done;
grep -P "^\s+SAI_\w+_ATTR_" ../inc/sai*h ../experimental/sai*h | perl -npe '$_.="HEAD:"' ) | \
perl -ne '/^(\S+):..\/(\S+)\/\S+.h:\s+(SAI_\w+_ATTR_\w+)/; print "#define $3 \"$1\" /* $2 */\n" if not defined $h{$3};$h{$3}=1' > $OUTPUT
perl -ne '/^(\S+):..\/(\S+)\/\S+.h:\s+(SAI_\w+_ATTR_\w+)/;
print "#define SAI_METADATA_ATTR_VERSION_$3 \"$1\" /* $2 */\n" if not defined $h{$3};$h{$3}=1' > $OUTPUT
2 changes: 1 addition & 1 deletion meta/parse.pl
Original file line number Diff line number Diff line change
Expand Up @@ -4432,7 +4432,7 @@ sub ExtractAttrApiVersion

for my $line (@lines)
{
if (not $line =~ /#define (SAI_\w+_ATTR_\w+) "(v\d+\.\d+\.\d+|HEAD)"/)
if (not $line =~ /#define SAI_METADATA_ATTR_VERSION_(SAI_\w+_ATTR_\w+) "(v\d+\.\d+\.\d+|HEAD)"/)
{
LogError "invalid line in saiattrversion.h: $line";
next;
Expand Down

0 comments on commit 8797aa9

Please sign in to comment.