OSDN Git Service

Update info
[rebornos/cnchi-gnome-osdn.git] / HELP_ME.sh
1 #  Copyright © 2016-2019 RebornOS
2 #
3 #  This file is part of RebornOS.
4 #
5 #  Reborn OS is free software; you can redistribute it and/or modify
6 #  it under the terms of the GNU General Public License as published by
7 #  the Free Software Foundation; either version 3 of the License, or
8 #  (at your option) any later version.
9 #
10 #  Reborn OS is distributed in the hope that it will be useful,
11 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
12 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 #  GNU General Public License for more details.
14 #
15 #  The following additional terms are in effect as per Section 7 of the license:
16 #
17 #  The preservation of all legal notices and author attributions in
18 #  the material or in the Appropriate Legal Notices displayed
19 #  by works containing it is required.
20 #
21 #  You should have received a copy of the GNU General Public License
22 #  along with Reborn OS; If not, see <http://www.gnu.org/licenses/>.
23
24 #!/bin/bash
25 #####################################
26 # Script to make ISO testing easier #
27 #####################################
28
29 QUESTION(){
30 echo
31 echo "Please select your preferred course of action:"
32 echo
33 options=("Build an ISO" "Update code to latest stuff on Gitlab" "Change Branches" "Quit")
34 select opt in "${options[@]}"
35 do
36     case $opt in
37         "Build an ISO")
38             BUILD;break;;
39         "Update code to latest stuff on Gitlab")
40             UPDATE;break;;
41         "Change Branches")
42            BRANCHES;break;;
43         "Quit")
44             break
45             ;;
46         *) echo "ERROR!!! ERROR!!!! SOUND THE ALARM!!!" 
47             echo "Sadly, option $REPLY is not possible! Please select either option 1, 2, or 3 instead. Thank you!";;
48     esac
49 done
50 }
51
52 BRANCHES(){
53 touch /tmp/branch.txt
54 yad --form --separator='\n' \
55     --field="Branch:cb" "master!development!">/tmp/branch.txt \
56 MY_BRANCH=$(sed '1q;d' /tmp/branch.txt)
57 sudo git checkout $(sed '1q;d' /tmp/branch.txt)
58 echo
59 echo
60 echo "DONE"
61 rm -f /tmp/branch.txt
62 echo
63 echo
64 }
65
66 BUILD(){
67 echo "ENSURING ALL DEPENDENCIES ARE ALREADY INSTALLED..."
68 sudo pacman -S arch-install-scripts cpio dosfstools git libisoburn mkinitcpio-nfs-utils make patch squashfs-tools wget lynx archiso yad --noconfirm --needed
69 echo
70 if [ -f ./work/pacman.conf ]; then
71 echo "REMOVING FILES FROM PREVIOUS BUILD..."
72 rm -rf ./work 
73 echo "WELL THAT TOOK AWHILE! BUT NOW WE'RE DONE :)"
74 fi
75 echo
76 echo 
77 echo "###################"
78 echo "# BUILDING ISO... #"
79 echo "###################"
80 echo
81 echo
82 ./build.sh -v
83 }
84
85 UPDATE(){
86 if [ -f ./work/pacman.conf ]; then
87 echo
88 echo "CLEANING EVERYTHING FRIST FROM PREVIOUS BUILDS..."
89 rm -rf ./work 
90 echo
91 echo "WELL THAT TOOK AWHILE! BUT NOW WE'RE DONE :)"
92 fi
93 echo
94 echo
95 echo "UPDATING TO THE LATEST AND GREATEST..."
96 sudo git pull
97 echo
98 echo "DONE"
99 }
100
101 export -f QUESTION BUILD UPDATE BRANCHES
102 QUESTION