slitaz-dev-tools diff slitaz-release/slitaz-release @ rev 291
Add: slitaz-release (A hellper script to release SliTaz stable :-)
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Sun Mar 19 03:23:21 2017 +0100 (2017-03-19) |
parents | |
children | f369836fad7e |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/slitaz-release/slitaz-release Sun Mar 19 03:23:21 2017 +0100 1.3 @@ -0,0 +1,128 @@ 1.4 +#!/bin/sh 1.5 +# 1.6 +# slitaz-release - SliTaz stable and cooking release helper. The script 1.7 +# will check hostname to handle host specifics release tasks (tank, pangolin, 1.8 +# mirror, local) 1.9 +# 1.10 +# Copyright (C) 2017 SliTaz GNU/Linux - BSD License 1.11 +# 1.12 +#. /lib/libtaz.sh # Is not installed on pangolin & mirror (slitaz 4.0) 1.13 + 1.14 +version="$1" 1.15 + 1.16 +if [ "$2" ]; then 1.17 + local_repos="$2" 1.18 +else 1.19 + local_repos="$HOME/Projects" 1.20 +fi 1.21 + 1.22 +help() { 1.23 + cat << EOT 1.24 + 1.25 +$(colorize 032 "Usage:") slitaz-release [version] [repos_path] 1.26 + 1.27 +$(colorize 033 "Local repos :") $local_repos 1.28 +$(colorize 033 "Documentation :") http://www.slitaz.org/en/devel/release.php 1.29 + 1.30 +EOT 1.31 +} 1.32 + 1.33 +# Colorize message 1.34 +colorize() { 1.35 + : ${color=$1} 1.36 + shift 1.37 + case "$color" in 1.38 + 0*) echo -e "\\033[${color:-38}m$@\\033[39m" ;; 1.39 + *) echo -e "\\033[1;${color:-38}m$@\\033[0;39m" ;; 1.40 + esac; unset color 1.41 +} 1.42 + 1.43 +title() { 1.44 + echo ""; colorize 033 "$@" 1.45 +} 1.46 + 1.47 +check_string() { 1.48 + if [ "$slitaz_release" != "$version" ]; then 1.49 + colorize 031 "Wrong string: $slitaz_release" 1.50 + echo " * $1" 1.51 + else 1.52 + colorize 031 "SliTaz release: $version" 1.53 + fi 1.54 +} 1.55 + 1.56 +# 1.57 +# Handle commands 1.58 +# 1.59 +case "$1" in 1.60 + "") help; exit 0 ;; 1.61 +esac 1.62 + 1.63 +# 1.64 +# Handle host specifics task 1.65 +# 1.66 +case "$(hostname)" in 1.67 + 1.68 + tank) 1.69 + # Build host with chroots and builded ISO's 1.70 + slitaz="/home/slitaz" 1.71 + ;; 1.72 + 1.73 + mirror) 1.74 + # Host packages and official ISO's 1.75 + packages="" 1.76 + ;; 1.77 + 1.78 + pangolin) 1.79 + # Host all Hg repositories 1.80 + repos="/home/slitaz/repos" 1.81 + 1.82 + # Stable wok 1.83 + title "Checking repo: wok-stable" 1.84 + cd $repos/wok-stable; hg up 1.85 + slitaz_release=$(hg parents --template '{latesttag}') 1.86 + check_string "stable wok is not yet tagged to $version" 1.87 + 1.88 + # Cooking wok 1.89 + title "Checking repo: wok" 1.90 + cd $repos/wok; hg up 1.91 + slitaz_release=$(hg parents --template '{latesttag}') 1.92 + check_string "cooking wok is not yet ready to be copied" ;; 1.93 + 1.94 + *) 1.95 + # Local Hg repos: set stable string and Hg tags 1.96 + for repo in slitaz-base-files slitaz-doc wok; do 1.97 + if [ ! -d "$local_repos/$repo" ]; then 1.98 + colorize 031 "Missing repos: $local_repos/$repo"; exit 1 1.99 + fi 1.100 + done 1.101 + 1.102 + # /etc/slitaz-release 1.103 + title "Checking file: /etc/slitaz-release" 1.104 + base_files="$local_repos/slitaz-base-files/rootfs" 1.105 + slitaz_release=$(cat $base_files/etc/slitaz-release) 1.106 + check_string "slitaz-base-files must be modified and wok updated" 1.107 + 1.108 + # isolinux.cfg 1.109 + title "Checking file: isolinux.cfg" 1.110 + isolinux_cfg="$local_repos/wok/syslinux/stuff/isolinux.cfg" 1.111 + slitaz_release=$(grep "MENU TITLE" $isolinux_cfg | cut -d " " -f 6) 1.112 + check_string "syslinux package must be modified and wok updated" 1.113 + 1.114 + # slitaz-doc 1.115 + title "Checking repo: slitaz-doc" 1.116 + cd $local_repos/slitaz-doc 1.117 + slitaz_release=$(hg parents --template '{latesttag}') 1.118 + check_string "slitaz-doc should provide relnotes and be tagged" 1.119 + 1.120 + # wok: the current cooking wok will be copied to wok-stable on 1.121 + # Hg server and then it will continue it own life with security updates. 1.122 + # Tagging the wok let us have the initial state of the new release. 1.123 + title "Checking repo: wok" 1.124 + cd $local_repos/wok 1.125 + slitaz_release=$(hg parents --template '{latesttag}') 1.126 + check_string "the wok should be tagged to $version" 1.127 + 1.128 + echo "" ;; 1.129 +esac 1.130 + 1.131 +exit 0