Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
ximper-builder
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
ximper-builder
Commits
111192d9
Verified
Commit
111192d9
authored
Nov 27, 2024
by
Кирилл Уницаев
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add deploy and md5 flags
parent
60fff9e5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
29 deletions
+60
-29
build-distro
bin/build-distro
+60
-29
No files found.
bin/build-distro
View file @
111192d9
...
@@ -5,10 +5,10 @@ BUILDERDIR=$(realpath "$(dirname "$0")"/..)
...
@@ -5,10 +5,10 @@ BUILDERDIR=$(realpath "$(dirname "$0")"/..)
#DEBUG=false
#DEBUG=false
ALLDISTROS
=
false
ALLDISTROS
=
false
NVIDIA
=
false
NVIDIA
=
false
VM
=
false
CLEAN
=
false
CLEAN
=
false
DESKTOP_ENVS
=()
# Список выбранных рабочих окружений (например, gnome, hyprland)
DESKTOP_ENVS
=()
# Список выбранных рабочих окружений (например, gnome, hyprland)
NETWORK
=
false
NETWORK
=
false
MD5
=
false
# базовые функции
# базовые функции
# shellcheck disable=SC1091
# shellcheck disable=SC1091
...
@@ -22,6 +22,11 @@ if [ -z "$PROFILESDIR" ]; then
...
@@ -22,6 +22,11 @@ if [ -z "$PROFILESDIR" ]; then
PROFILESDIR
=
"
$BUILDERDIR
/mkimage-profiles"
PROFILESDIR
=
"
$BUILDERDIR
/mkimage-profiles"
fi
fi
if
[
-z
"
$FTPDIR
"
]
;
then
FTPDIR
=
"/var/ftp/pub/Etersoft/XimperLinux/Devel/ISO"
fi
create_tmp
()
{
create_tmp
()
{
mktemp
-d
-t
ximper-builder.XXXXXXX
mktemp
-d
-t
ximper-builder.XXXXXXX
}
}
...
@@ -42,23 +47,16 @@ print_build_info() {
...
@@ -42,23 +47,16 @@ print_build_info() {
print_green
"VERSION:
$VER
"
print_green
"VERSION:
$VER
"
fi
fi
print_green
"REPOSITORIES:
$REPOS
"
print_green
"REPOSITORIES:
$REPOS
"
}
if
[
-n
"
$DEPLOY_DIR
"
]
;
then
print_green
"DEPLOY:
$DEPLOY_DIR
"
check_repos
()
{
if
[
"
$VER
"
==
"devel"
]
;
then
return
fi
fi
}
local
list_repos
check
()
{
list_repos
=
"
${
1
//,/
}
"
if
[
"
$MD5
"
==
"true"
]
&&
[
"
$DEPLOY_DIR
"
!=
"ftp"
]
;
then
for
repo
in
$list_repos
;
do
print_error
"--md5 можно использовать только при --deploy=ftp"
case
"
$repo
"
in
ximper-devel|hasher
)
print_error
"Использовать репозитории ximper-devel и hasher можно только в devel сборках."
exit
1
exit
1
;;
fi
esac
done
}
}
cleartmp
()
{
cleartmp
()
{
...
@@ -71,12 +69,6 @@ cleartmp() {
...
@@ -71,12 +69,6 @@ cleartmp() {
[
"
$VER
"
==
"devel"
]
&&
ls
-t
"
$VMDIR
"
/ximper-
"
$desktop_env
""
$iso_suffix
"
-devel-
*
-x86_64
.iso |
tail
-n
+2 | xargs
-I
{}
rm
-v
--
{}
[
"
$VER
"
==
"devel"
]
&&
ls
-t
"
$VMDIR
"
/ximper-
"
$desktop_env
""
$iso_suffix
"
-devel-
*
-x86_64
.iso |
tail
-n
+2 | xargs
-I
{}
rm
-v
--
{}
}
}
vm
()
{
find
"
$TMP
"
/out/
-type
l
-exec
rm
{}
+
[
"
$VM
"
==
true
]
||
return
mv
-vf
"
$TMP
"
/out/ximper-
*
.iso
"
$VMDIR
"
/
"
$DFILENAME
"
}
handle_uncommitted_changes
()
{
handle_uncommitted_changes
()
{
# Проверка наличия незакоммиченных изменений
# Проверка наличия незакоммиченных изменений
if
git diff-index
--quiet
HEAD
--
;
then
if
git diff-index
--quiet
HEAD
--
;
then
...
@@ -152,13 +144,35 @@ makebuild() {
...
@@ -152,13 +144,35 @@ makebuild() {
DFILENAME+
=
"-x86_64.iso"
DFILENAME+
=
"-x86_64.iso"
vm
deploy
# Отмена временного коммита после завершения сборки
# Отмена временного коммита после завершения сборки
revert_temp_commit
revert_temp_commit
}
}
OPTS
=
$(
getopt
-o
h
--long
help
,nvidia,debug,clean,all,vm,gnome,hyprland,net,network,repos:
--
"
$@
"
)
||
{
create_md5
()
{
[
"
$MD5
"
==
true
]
||
return
print_green
"Создание md5sum для
$2
"
md5sum
"
$1
"
/
"
$2
"
>
"
$1
"
/
"
$2
"
.md5
}
deploy
()
{
find
"
$TMP
"
/out/
-type
l
-exec
rm
{}
+
case
"
$DEPLOY_DIR
"
in
ftp
)
mv
-vf
"
$TMP
"
/out/ximper-
*
.iso
"
$FTPDIR
"
/
"
$DFILENAME
"
create_md5
"
$FTPDIR
"
"
$DFILENAME
"
;;
vm
)
mv
-vf
"
$TMP
"
/out/ximper-
*
.iso
"
$VMDIR
"
/
"
$DFILENAME
"
;;
*
)
return
;;
esac
}
OPTS
=
$(
getopt
-o
h
--long
help
,nvidia,debug,clean,all,deploy::,md5,gnome,hyprland,net,network,repos:
--
"
$@
"
)
||
{
print_error
"Ошибка обработки опций."
print_error
"Ошибка обработки опций."
exit
1
exit
1
}
}
...
@@ -171,16 +185,16 @@ while true; do
...
@@ -171,16 +185,16 @@ while true; do
case
"
$1
"
in
case
"
$1
"
in
-h
|
--help
)
-h
|
--help
)
printf
"
\n
"
printf
"
\n
"
printf
"Использование: %s [
опции] [версия дистрибутива
]
\n\n
"
"
$0
"
printf
"Использование: %s [
версия дистрибутива] [опции
]
\n\n
"
"
$0
"
printf
"Опции:
\n
"
printf
"Опции:
\n
"
printf
" -h | --help Вывод этой справки
\n
"
printf
" -h | --help Вывод этой справки
\n
"
printf
" Окружения:
\n
"
printf
" Окружения:
\n
"
printf
" --gnome Собрать дистрибутив с GNOME (по умолчанию)
\n
"
printf
" --gnome Собрать дистрибутив с GNOME (по умолчанию)
\n
"
printf
" --hyprland Собрать дистрибутив с Hyprland
\n
"
printf
" --hyprland Собрать дистрибутив с Hyprland
\n
"
printf
" --all Собрать все дистрибутивы
\n
"
printf
"
\n
"
printf
"
\n
"
printf
" Настройки образа:
\n
"
printf
" Настройки образа:
\n
"
printf
" --nvidia Собрать дистрибутив с драйверами NVIDIA
\n
"
printf
" --nvidia Собрать дистрибутив с драйверами NVIDIA
\n
"
printf
" --all Собрать все дистрибутивы (default + nvidia)
\n
"
printf
" -r | --repos Установить используемые репозитории
\n
"
printf
" -r | --repos Установить используемые репозитории
\n
"
printf
" (По умолчанию: sisyphus,ximper)
\n
"
printf
" (По умолчанию: sisyphus,ximper)
\n
"
printf
" (репозитории используются тольок во время сборки)
\n
"
printf
" (репозитории используются тольок во время сборки)
\n
"
...
@@ -192,6 +206,11 @@ while true; do
...
@@ -192,6 +206,11 @@ while true; do
printf
" - hasher
\n
"
printf
" - hasher
\n
"
printf
"
\n
"
printf
"
\n
"
printf
" Прочее:
\n
"
printf
" Прочее:
\n
"
printf
" --deploy Задеплоить образ
\n
"
printf
" Параметры:
\n
"
printf
" - vm (по умолчанию) -> %s
\n
"
"
$VMDIR
"
printf
" - ftp -> %s
\n
"
"
$FTPDIR
"
printf
" --md5 Создать файл md5 суммы образа (только при --deploy=ftp)
\n
"
printf
" --debug Включить режим отладки
\n
"
printf
" --debug Включить режим отладки
\n
"
printf
" --clean Очистить TMP перед сборкой
\n
"
printf
" --clean Очистить TMP перед сборкой
\n
"
printf
" --vm Собрать дистрибутив для виртуальной машины
\n
"
printf
" --vm Собрать дистрибутив для виртуальной машины
\n
"
...
@@ -215,9 +234,18 @@ while true; do
...
@@ -215,9 +234,18 @@ while true; do
ALLDISTROS
=
true
ALLDISTROS
=
true
shift
shift
;;
;;
--vm
)
--md5
)
VM
=
true
MD5
=
true
shift
;;
--deploy
)
if
[
-n
"
$2
"
]
&&
[[
"
$2
"
!=
"--"
*
]]
;
then
DEPLOY_DIR
=
"
$2
"
shift
2
else
DEPLOY_DIR
=
"vm"
shift
shift
fi
;;
;;
--gnome
)
--gnome
)
DESKTOP_ENVS+
=(
"gnome"
)
DESKTOP_ENVS+
=(
"gnome"
)
...
@@ -233,12 +261,15 @@ while true; do
...
@@ -233,12 +261,15 @@ while true; do
;;
;;
--repos
)
--repos
)
REPOS
=
"
$2
"
REPOS
=
"
$2
"
shift
shift
2
;;
;;
--
)
--
)
shift
shift
break
break
;;
;;
""
)
shift
;;
*
)
*
)
if
[
-n
"
$REPOS
"
]
&&
[
"
$1
"
=
"
$REPOS
"
]
;
then
if
[
-n
"
$REPOS
"
]
&&
[
"
$1
"
=
"
$REPOS
"
]
;
then
shift
shift
...
@@ -273,7 +304,7 @@ else
...
@@ -273,7 +304,7 @@ else
exit
1
exit
1
fi
fi
check
_repos
"
$REPOS
"
check
print_build_info
print_build_info
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment