diff mbox series

[OpenWrt-Devel] scripts/ipkg-build: quash error messages when conffiles.resolved is empty

Message ID 20180906151113.16805-1-yszhou4tech@gmail.com
State Accepted, archived
Delegated to: Yousong Zhou
Headers show
Series [OpenWrt-Devel] scripts/ipkg-build: quash error messages when conffiles.resolved is empty | expand

Commit Message

Yousong Zhou Sept. 6, 2018, 3:11 p.m. UTC
When Package/xx/conffiles only contains directories that are empty at
package time, conffiles.resolved will be missing and the following
error messages will appear in the build log.

	/home/yousong/git-repo/openwrt/openwrt/scripts/ipkg-build -c -o 0 -g 0 /home/yousong/git-repo/openwrt/openwrt/build_dir/target-mips_24kc_musl/linux-malta_be/openvswitch-2.10.0/ipkg-mips_24kc/openvswitch-common /home/yousong/git-repo/openwrt/openwrt/bin/packages/mips_24kc/packages
	mv: cannot stat 'CONTROL/conffiles.resolved': No such file or directory
	chmod: cannot access 'CONTROL/conffiles': No such file or directory

It will not break the ipkg-build process.  The change is merely cosmetic
to not cause confusion when reading logs

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
---
 scripts/ipkg-build | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/scripts/ipkg-build b/scripts/ipkg-build
index 845a6ed04e..e42da2ecbc 100755
--- a/scripts/ipkg-build
+++ b/scripts/ipkg-build
@@ -60,8 +60,10 @@  pkg_appears_sane() {
 		done
 
 		rm $CONTROL/conffiles
-		mv $CONTROL/conffiles.resolved $CONTROL/conffiles
-		chmod 0644 $CONTROL/conffiles
+		if [ -f $CONTROL/conffiles.resolved ]; then
+			mv $CONTROL/conffiles.resolved $CONTROL/conffiles
+			chmod 0644 $CONTROL/conffiles
+		fi
 	fi
 
 	cd $owd