+2024-04-10 Bruno Haible <bruno@clisp.org>
+
+ gnulib-tool.sh: Handle .gitignore files that do not end in a newline.
+ * gnulib-tool.sh (func_import): If the .gitignore file ends with a
+ character other than a newline, add a newline before adding more lines.
+
2024-04-10 Bruno Haible <bruno@clisp.org>
gnulib-tool.py: Skip nonexistent modules instead of failing.
if test -n "$anchor"; then sed -e 's,/,\\/,g' -e "s,^,/^${doubly_escaped_anchor}," -e 's,$,$/d,' < "$tmp"/ignore-removed; fi
} > "$tmp"/sed-ignore-removed
{ cat "$destdir/$dir$ignore"~
+ # Add a newline if the original $dir$ignore file ended
+ # with a character other than a newline.
+ if test `tail -c 1 < "$destdir/$dir$ignore"~ | tr -d '\n' | wc -c` = 1; then echo; fi
sed -e "s|^|$anchor|" < "$tmp"/ignore-added
} | sed -f "$tmp"/sed-ignore-removed \
> "$destdir/$dir$ignore"