From 035c46263ab3f99f1203986e8d9b7fc39f65db78 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Wed, 9 Oct 2024 03:37:37 +0200 Subject: [PATCH] confd: bump version for phys-address .cfg migration See issue #680 Signed-off-by: Joachim Wiberg --- package/confd/confd.mk | 2 +- src/confd/configure.ac | 3 ++- .../1.2/10-ietf-interfaces-phys-address.sh | 15 +++++++++++++++ src/confd/share/migrate/1.2/Makefile.am | 2 ++ src/confd/share/migrate/Makefile.am | 2 +- 5 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 src/confd/share/migrate/1.2/10-ietf-interfaces-phys-address.sh create mode 100644 src/confd/share/migrate/1.2/Makefile.am diff --git a/package/confd/confd.mk b/package/confd/confd.mk index 80b24e9fa..70f4b8e96 100644 --- a/package/confd/confd.mk +++ b/package/confd/confd.mk @@ -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 diff --git a/src/confd/configure.ac b/src/confd/configure.ac index 9f8ea9832..639ba8b69 100644 --- a/src/confd/configure.ac +++ b/src/confd/configure.ac @@ -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) @@ -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 ]) diff --git a/src/confd/share/migrate/1.2/10-ietf-interfaces-phys-address.sh b/src/confd/share/migrate/1.2/10-ietf-interfaces-phys-address.sh new file mode 100644 index 000000000..97233aae5 --- /dev/null +++ b/src/confd/share/migrate/1.2/10-ietf-interfaces-phys-address.sh @@ -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" diff --git a/src/confd/share/migrate/1.2/Makefile.am b/src/confd/share/migrate/1.2/Makefile.am new file mode 100644 index 000000000..5171e8b41 --- /dev/null +++ b/src/confd/share/migrate/1.2/Makefile.am @@ -0,0 +1,2 @@ +migratedir = $(pkgdatadir)/migrate/1.2 +dist_migrate_DATA = 10-ietf-interfaces-phys-address.sh diff --git a/src/confd/share/migrate/Makefile.am b/src/confd/share/migrate/Makefile.am index 62da76223..df1d8ba9d 100644 --- a/src/confd/share/migrate/Makefile.am +++ b/src/confd/share/migrate/Makefile.am @@ -1,2 +1,2 @@ -SUBDIRS = 1.0 1.1 +SUBDIRS = 1.0 1.1 1.2 migratedir = $(pkgdatadir)/migrate