diff options
author | P. J. McDermott <pj@pehjota.net> | 2014-06-26 12:47:01 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2014-06-26 12:47:01 (EDT) |
commit | 9f42329a148e697b4aebbba73df16301c379d2f7 (patch) | |
tree | 698bc9eeef308676d12560482d0bcb3f0a42a34f | |
parent | 8008dc934ac51b68a231dc79460ee657b06fdc21 (diff) |
Read distribution name & banner from dist-vars.sh.
Also, automatically add the correct number of newlines in /etc/motd.
-rwxr-xr-x | build | 9 | ||||
-rw-r--r-- | dist-vars.sh | 14 | ||||
-rw-r--r-- | src/etc/motd | 1 |
3 files changed, 20 insertions, 4 deletions
@@ -8,7 +8,7 @@ version = $$(printf '%s\n' '$(OPK_SOURCE_VERSION)' | \ sed 's|\(^[0-9][0-9]*\.[0-9][0-9]*\).*$$|\1|') script = \ - s|@DISTRIBUTION@|ProteanOS|; \ + s|@DISTRIBUTION@|$${dist_name}|; \ s|@OS@|$(os)|; \ s|@VERSION@|$(version)|; @@ -27,9 +27,12 @@ install: build ln -s /run/lock base-files.data/var/lock # Install base files. set -e; \ + . ../dist-vars.sh; \ + printf "%s$${dist_motd_banner:+\n}\n" \ + "$$(printf '%s' "$${dist_motd_banner}")" \ + >base-files.data/etc/motd; \ sed ':l; N; $$!bl; s/\([^\n]\)\n\([^\n]\)/\1 \2/g' src/etc/motd | \ - sed "$(script)" | fold -s -w 72 >base-files.data/etc/motd - set -e; \ + sed "$(script)" | fold -s -w 72 >>base-files.data/etc/motd; \ for file in /etc/issue; do \ sed "$(script)" "src/$${file}" >"base-files.data/$${file}"; \ done diff --git a/dist-vars.sh b/dist-vars.sh new file mode 100644 index 0000000..36fd2fc --- /dev/null +++ b/dist-vars.sh @@ -0,0 +1,14 @@ +# Distribution variables. + +dist_name='ProteanOS' +dist_motd_banner="$(cat <<'EOF' + _ + .' '. + __ ___ _ | |.' + | '. _ _ _|_ _ __ _ .' '. .' `- ~~| |~~~ + |__.' |.' .' '. | .' '. _;. |' `. | | `-. ~~~~ + | | | | | |---' .' | | | | | `. + | | '._.' '.- '._. '_.'| | | '.___.' `._.' TM +EOF +)" +# A single quote to fix Vim syntax highlighting: ' diff --git a/src/etc/motd b/src/etc/motd index fafa60e..03e8ff4 100644 --- a/src/etc/motd +++ b/src/etc/motd @@ -1,4 +1,3 @@ - The programs included with @DISTRIBUTION@ @OS@ are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. |