From a203752484de9ab8bcd0b98a3b42277ab42a76bb Mon Sep 17 00:00:00 2001 From: dzhang Date: Wed, 4 Dec 2019 23:00:05 -0800 Subject: [PATCH] [Enhancement] debian/conffiles will give prompt when file existing, need a way to supress prompt --- common/Makefile.am | 7 +++++-- debian/conffiles | 1 + debian/libswsscommon.install | 2 +- debian/postinst | 11 ----------- 4 files changed, 7 insertions(+), 14 deletions(-) create mode 100644 debian/conffiles delete mode 100755 debian/postinst diff --git a/common/Makefile.am b/common/Makefile.am index 96fc1d9fa..a6231cb57 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -7,12 +7,15 @@ EXTRA_DIST = \ consumer_table_pops.lua \ producer_state_table_apply_view.lua \ table_dump.lua \ - fdb_flush.lua \ - database_config.json + fdb_flush.lua + +EXTRA_CONF_DIST = database_config.json swssdir = $(datadir)/swss +swsscommondir = /var/run/redis/sonic-db dist_swss_DATA = $(EXTRA_DIST) +dist_swsscommon_DATA = $(EXTRA_CONF_DIST) bin_PROGRAMS = swssloglevel diff --git a/debian/conffiles b/debian/conffiles new file mode 100644 index 000000000..a0adcd238 --- /dev/null +++ b/debian/conffiles @@ -0,0 +1 @@ +/var/run/redis/sonic-db/database_config.json diff --git a/debian/libswsscommon.install b/debian/libswsscommon.install index 252737866..93868bf2c 100644 --- a/debian/libswsscommon.install +++ b/debian/libswsscommon.install @@ -1,4 +1,4 @@ usr/lib/*/lib*.so.* usr/share/swss/*.lua -usr/share/swss/*.json +var/run/redis/sonic-db/database_config.json usr/bin/swssloglevel diff --git a/debian/postinst b/debian/postinst deleted file mode 100755 index afc335656..000000000 --- a/debian/postinst +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -# This `DEBIAN/postinst` script is run post-installation -DST_PATH="/var/run/redis/sonic-db" -DST_FILE="database_config.json" -SRC_PATH="/usr/share/swss" - -# if there is no $DST_FILE, it is needed to copy one default to $DST_FILE -if [ ! -e $DST_PATH/$DST_FILE ]; then - mkdir -p $DST_PATH - cp $SRC_PATH/$DST_FILE $DST_PATH/$DST_FILE -fi