[LEDE-DEV] [PATCH] base-files: do not backup unchanged files
luizluca at gmail.com
luizluca at gmail.com
Thu Nov 16 16:41:10 PST 2017
From: Luiz Angelo Daros de Luca <luizluca at gmail.com>
Only backup /aaa/bbb/ccc if /rom/aaa/bbb/ccc does not exist
or /aaa/bbb/ccc is different from /rom/aaa/bbb/ccc.
Signed-off-by: Luiz Angelo Daros de Luca <luizluca at gmail.com>
---
package/base-files/files/sbin/sysupgrade | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/package/base-files/files/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade
index 359f21f51c..0085dbe07e 100755
--- a/package/base-files/files/sbin/sysupgrade
+++ b/package/base-files/files/sbin/sysupgrade
@@ -101,8 +101,10 @@ add_uci_conffiles() {
local file="$1"
( find $(sed -ne '/^[[:space:]]*$/d; /^#/d; p' \
/etc/sysupgrade.conf /lib/upgrade/keep.d/* 2>/dev/null) \
- -type f -o -type l 2>/dev/null;
- opkg list-changed-conffiles ) | sort -u > "$file"
+ $(opkg list-changed-conffiles) \
+ \( -type f -o -type l \) \
+ \( \( -exec test -e /rom{} \; -exec cmp -s {} /rom{} \; \) -o -print \) 2>/dev/null;
+ ) | sort -u > "$file"
return 0
}
--
2.14.1
More information about the Lede-dev
mailing list