# HG changeset patch # User Christophe Lincoln # Date 1489890201 -3600 # Node ID af4dbddd22bb158993a414503b71b053c9472ef4 # Parent 4c3e0cb9e2b066db9af0a73ec032be760e81d2ab Add: slitaz-release (A hellper script to release SliTaz stable :-) diff -r 4c3e0cb9e2b0 -r af4dbddd22bb slitaz-release/README --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/slitaz-release/README Sun Mar 19 03:23:21 2017 +0100 @@ -0,0 +1,24 @@ +slitaz-release - SliTaz stable and cooking release helper +================================================================================ +Doc: http://www.slitaz.org/en/devel/release.php + + +The slitaz-release script is designed to help SliTaz releases process on +all hosts: tank, pangolin, mirror and localy. + + + * Localy it will check release string into slitaz-base-files, the wok + and slitaz-doc repos as well as isolinux.cfg in syslinux package + + * On tank it will check for build chroot and ISO's + + * On Pangolin it will check for wok-stable and wok latest Hg tag + + * On mirror it will check for packages/[version] and uploaded ISO's + + +Examples: + + # slitaz-release 5.0 + # slitaz-release 6.0 /path/to/local/repos + diff -r 4c3e0cb9e2b0 -r af4dbddd22bb slitaz-release/slitaz-release --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/slitaz-release/slitaz-release Sun Mar 19 03:23:21 2017 +0100 @@ -0,0 +1,128 @@ +#!/bin/sh +# +# slitaz-release - SliTaz stable and cooking release helper. The script +# will check hostname to handle host specifics release tasks (tank, pangolin, +# mirror, local) +# +# Copyright (C) 2017 SliTaz GNU/Linux - BSD License +# +#. /lib/libtaz.sh # Is not installed on pangolin & mirror (slitaz 4.0) + +version="$1" + +if [ "$2" ]; then + local_repos="$2" +else + local_repos="$HOME/Projects" +fi + +help() { + cat << EOT + +$(colorize 032 "Usage:") slitaz-release [version] [repos_path] + +$(colorize 033 "Local repos :") $local_repos +$(colorize 033 "Documentation :") http://www.slitaz.org/en/devel/release.php + +EOT +} + +# Colorize message +colorize() { + : ${color=$1} + shift + case "$color" in + 0*) echo -e "\\033[${color:-38}m$@\\033[39m" ;; + *) echo -e "\\033[1;${color:-38}m$@\\033[0;39m" ;; + esac; unset color +} + +title() { + echo ""; colorize 033 "$@" +} + +check_string() { + if [ "$slitaz_release" != "$version" ]; then + colorize 031 "Wrong string: $slitaz_release" + echo " * $1" + else + colorize 031 "SliTaz release: $version" + fi +} + +# +# Handle commands +# +case "$1" in + "") help; exit 0 ;; +esac + +# +# Handle host specifics task +# +case "$(hostname)" in + + tank) + # Build host with chroots and builded ISO's + slitaz="/home/slitaz" + ;; + + mirror) + # Host packages and official ISO's + packages="" + ;; + + pangolin) + # Host all Hg repositories + repos="/home/slitaz/repos" + + # Stable wok + title "Checking repo: wok-stable" + cd $repos/wok-stable; hg up + slitaz_release=$(hg parents --template '{latesttag}') + check_string "stable wok is not yet tagged to $version" + + # Cooking wok + title "Checking repo: wok" + cd $repos/wok; hg up + slitaz_release=$(hg parents --template '{latesttag}') + check_string "cooking wok is not yet ready to be copied" ;; + + *) + # Local Hg repos: set stable string and Hg tags + for repo in slitaz-base-files slitaz-doc wok; do + if [ ! -d "$local_repos/$repo" ]; then + colorize 031 "Missing repos: $local_repos/$repo"; exit 1 + fi + done + + # /etc/slitaz-release + title "Checking file: /etc/slitaz-release" + base_files="$local_repos/slitaz-base-files/rootfs" + slitaz_release=$(cat $base_files/etc/slitaz-release) + check_string "slitaz-base-files must be modified and wok updated" + + # isolinux.cfg + title "Checking file: isolinux.cfg" + isolinux_cfg="$local_repos/wok/syslinux/stuff/isolinux.cfg" + slitaz_release=$(grep "MENU TITLE" $isolinux_cfg | cut -d " " -f 6) + check_string "syslinux package must be modified and wok updated" + + # slitaz-doc + title "Checking repo: slitaz-doc" + cd $local_repos/slitaz-doc + slitaz_release=$(hg parents --template '{latesttag}') + check_string "slitaz-doc should provide relnotes and be tagged" + + # wok: the current cooking wok will be copied to wok-stable on + # Hg server and then it will continue it own life with security updates. + # Tagging the wok let us have the initial state of the new release. + title "Checking repo: wok" + cd $local_repos/wok + slitaz_release=$(hg parents --template '{latesttag}') + check_string "the wok should be tagged to $version" + + echo "" ;; +esac + +exit 0