diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2017-10-12 10:51:29 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2017-10-12 10:51:29 +0200 |
commit | 071929539b26dfcb0fa3887e2fd6c0224ff2e5df (patch) | |
tree | ef86db711acf46e92ae3a1cefdaf75309e941597 | |
parent | 08fa9540f080bb458b43cb4bdeeac663c1bfd595 (diff) |
Extract version from manifest in bootstrap script
-rwxr-xr-x | bootstrap | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -97,6 +97,14 @@ if [ "$stage" -lt "1" -o "$stage" -gt "$stage_max" ]; then error "invalid stage number $stage" fi +# Extract version. +# +version="$(sed -n -re 's/^version: ([0-9]+\.[0-9]+\.[0-9]+).*$/\1/p' ./manifest)" +version_id="$(sed -n -re 's/^([0-9]+\.[0-9]+)\.[0-9]+$/\1/p' <<<"$version")" +if [ -z "$version" -o -z "$version_id" ]; then + error "unable to extract version from manifest" +fi + # Btrfs subvolume manipulation. # function subvol_delete () # <path> @@ -244,24 +252,24 @@ chattr +i /etc/localtime # cat <<EOF1 >/etc/os-release NAME="Build OS" -VERSION="0.6.0" +VERSION="$version" ID=buildos ID_LIKE=debian -PRETTY_NAME="Build OS 0.6.0 (Based on Debian)" -VERSION_ID="0.6" +PRETTY_NAME="Build OS $version (Based on Debian)" +VERSION_ID="$version_id" HOME_URL="https://build2.org/" SUPPORT_URL="https://lists.build2.org/" BUG_REPORT_URL="https://lists.build2.org/" EOF1 cat <<EOF1 >/etc/issue -Build OS 0.6.0 (Based on Debian) \n \l +Build OS $version (Based on Debian) \n \l EOF1 cat <<EOF1 >/etc/motd -Welcome to Build OS 0.6.0 (https://build2.org)! +Welcome to Build OS $version (https://build2.org)! EOF1 |