• R/O
  • HTTP
  • SSH
  • HTTPS

alterlinux-channels: Commit

GitHubのミラーです
https://github.com/FascodeNet/alterlinux-calamares


Commit MetaInfo

Révisionfe3885da6b4ec22082172b9bf8f678d274054eff (tree)
l'heure2020-10-10 12:02:30
Auteurhayao <shun819.mail@gmai...>
Commiterhayao

Message de Log

[add] : start-build.sh

Change Summary

Modification

--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
1+build_work
\ No newline at end of file
--- /dev/null
+++ b/start-build.sh
@@ -0,0 +1,71 @@
1+#!/usr/bin/env bash
2+startbuild_script_path="$( cd -P "$( dirname "$(readlink -f "$0")" )" && pwd )"
3+startbuild_work_dir="${startbuild_script_path}/build_work"
4+startbuild_alteriso2_branch="alteriso-2"
5+startbuild_alteriso3_branch="dev-stable"
6+
7+startbuild_script_path="${startbuild_script_path%/}"
8+startbuild_work_dir="${startbuild_work_dir%/}"
9+
10+msg_error() {
11+ echo -e "Error: ${@}" >&2
12+}
13+
14+
15+_help () {
16+ echo "usage ${0} [option] [channel]"
17+ echo
18+ echo "AlterISO Easy builder"
19+ echo "Get AlterISO and start build"
20+ echo
21+ echo " General options:"
22+ echo " -o [option] Specify build options"
23+ echo " -x Enable bash debug"
24+ echo " -h This help message"
25+}
26+
27+
28+while getopts "o:xh" arg; do
29+ case ${arg} in
30+ o)
31+ OPTIONS="${OPTARG}"
32+ ;;
33+ x)
34+ set -xv
35+ ;;
36+ h)
37+ _help
38+ shift 1
39+ exit 0
40+ ;;
41+ esac
42+done
43+
44+shift $((OPTIND - 1))
45+channel_name="${1}"
46+
47+
48+mkdir -p "${startbuild_work_dir}"
49+if [[ -n "$(ls "${startbuild_work_dir}" 2> /dev/null )" ]]; then
50+ msg_error "Working directory is not empty"
51+ exit 1
52+fi
53+
54+git clone "https://github.com/FascodeNet/alterlinux.git" "${startbuild_work_dir}"
55+cp -r "${startbuild_script_path}/"*".add" "${startbuild_work_dir}/channels"
56+
57+if [[ "$(cat "${startbuild_work_dir}/channels/${channel_name}.add/alteriso" 2> /dev/null)" = "alteriso=3.0" ]] || [[ "$(cat "${startbuild_work_dir}/channels/${channel_name}/alteriso" 2> /dev/null)" = "alteriso=3.0" ]]; then
58+ (
59+ cd "${startbuild_work_dir}"
60+ git checkout "${startbuild_alteriso3_branch}"
61+ )
62+else
63+ (
64+ cd "${startbuild_work_dir}"
65+ git checkout "${startbuild_alteriso2_branch}"
66+ )
67+fi
68+
69+sudo "${startbuild_work_dir}/build.sh" -w "${startbuild_work_dir}/work" -o "${startbuild_script_path}/out" ${OPTIONS} ${channel_name}
70+
71+sudo rm -rf "${startbuild_work_dir}"
Afficher sur ancien navigateur de dépôt.