Skip to content

Commit

Permalink
confd: bump version for phys-address .cfg migration
Browse files Browse the repository at this point in the history
See issue #680

Signed-off-by: Joachim Wiberg <[email protected]>
  • Loading branch information
troglobit committed Oct 11, 2024
1 parent 0a5fd6f commit 035c462
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package/confd/confd.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
################################################################################

CONFD_VERSION = 1.1
CONFD_VERSION = 1.2
CONFD_SITE_METHOD = local
CONFD_SITE = $(BR2_EXTERNAL_INFIX_PATH)/src/confd
CONFD_LICENSE = BSD-3-Clause
Expand Down
3 changes: 2 additions & 1 deletion src/confd/configure.ac
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
AC_PREREQ(2.61)
# confd version is same as system YANG model version, step on breaking changes
AC_INIT([confd], [1.1], [https://github.com/kernelkit/infix/issues])
AC_INIT([confd], [1.2], [https://github.com/kernelkit/infix/issues])
AM_INIT_AUTOMAKE(1.11 foreign subdir-objects)
AM_SILENT_RULES(yes)

Expand All @@ -15,6 +15,7 @@ AC_CONFIG_FILES([
share/migrate/Makefile
share/migrate/1.0/Makefile
share/migrate/1.1/Makefile
share/migrate/1.2/Makefile
src/Makefile
yang/Makefile
])
Expand Down
15 changes: 15 additions & 0 deletions src/confd/share/migrate/1.2/10-ietf-interfaces-phys-address.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh
# Migrate phys-address -> custom-phys-address with static option

file=$1
temp=${file}.tmp

jq '(
.["ietf-interfaces:interfaces"].interface[] |=
if has("phys-address") then
.["infix-interfaces:custom-phys-address"] = { "static": .["phys-address"] } | del(.["phys-address"])
else
.
end
)' "$file" > "$temp" &&
mv "$temp" "$file"
2 changes: 2 additions & 0 deletions src/confd/share/migrate/1.2/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
migratedir = $(pkgdatadir)/migrate/1.2
dist_migrate_DATA = 10-ietf-interfaces-phys-address.sh
2 changes: 1 addition & 1 deletion src/confd/share/migrate/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
SUBDIRS = 1.0 1.1
SUBDIRS = 1.0 1.1 1.2
migratedir = $(pkgdatadir)/migrate

0 comments on commit 035c462

Please sign in to comment.