@@ -134,19 +134,24 @@ cd $pkg_dir
for file_mode in $file_modes; do
case $file_mode in
/*:*:*:*)
- ;;
+ ;;
*)
- echo "ERROR: file modes must use absolute path and contain user:group:mode"
- echo "$file_mode"
- exit 1
- ;;
+ echo "ERROR: file modes must use absolute path and contain user:group:mode"
+ echo "$file_mode"
+ exit 1
+ ;;
esac
- path=$(echo "$file_mode" | cut -d ':' -f 1)
- user_group=$(echo "$file_mode" | cut -d ':' -f 2-3)
- mode=$(echo "$file_mode" | cut -d ':' -f 4)
- chown "$user_group" "$pkg_dir/$path"
- chmod "$mode" "$pkg_dir/$path"
+ path=$(echo "$file_mode" | cut -d ':' -f 1)
+ if [ -e "$pkg_dir/$path" ]; then
+ user_group=$(echo "$file_mode" | cut -d ':' -f 2-3)
+ mode=$(echo "$file_mode" | cut -d ':' -f 4)
+
+ chown "$user_group" "$pkg_dir/$path"
+ chmod "$mode" "$pkg_dir/$path"
+ else
+ echo "WARNING: skip mod change for non existing $path"
+ fi
done
$TAR -X $tmp_dir/tarX --format=gnu --sort=name -cpf - --mtime="$TIMESTAMP" . | $GZIP -n - > $tmp_dir/data.tar.gz
The `ipkg-build` script uses `file_modes` (-m) to set file modes during package creation. If a single OpenWrt package results in multiple `ipk` packages, the `PKG_FILE_MODES` are applied to every single one of them. This can cause in errors files can be missing between e.g. a *full* and a *mini* variant. This commit checks if the file/folder exists, if not a warning is printed but no longer a positive exit code produced. Also clean up indention of surrounding lines. Signed-off-by: Paul Spooren <mail@aparcar.org> --- scripts/ipkg-build | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-)