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
ba38bd59
Commit
ba38bd59
authored
Nov 23, 2024
by
Roman Alifanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some fixes
parent
821b8707
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
build-distro
bin/build-distro
+13
-8
No files found.
bin/build-distro
View file @
ba38bd59
#!/bin/bash
#!/bin/bash
BUILDERDIR
=
$(
realpath
"
$(
dirname
"
$0
"
)
"
/..
)
DEBUG
=
false
DEBUG
=
false
ALLDISTROS
=
false
ALLDISTROS
=
false
NVIDIA
=
false
NVIDIA
=
false
...
@@ -9,18 +11,19 @@ DESKTOP_ENVS=() # Список выбранных рабочих окружен
...
@@ -9,18 +11,19 @@ DESKTOP_ENVS=() # Список выбранных рабочих окружен
NETWORK
=
false
NETWORK
=
false
# базовые функции
# базовые функции
.
$(
dirname
$0
)
/common
# shellcheck disable=SC1091
.
"
$BUILDERDIR
"
/bin/common
if
[
-z
"
$VMDIR
"
]
;
then
if
[
-z
"
$VMDIR
"
]
;
then
VMDIR
=
"/var/ftp/pvt/ISO/testing/template/iso"
VMDIR
=
"/var/ftp/pvt/ISO/testing/template/iso"
fi
fi
if
[
-z
"
$PROFILESDIR
"
]
;
then
if
[
-z
"
$PROFILESDIR
"
]
;
then
PROFILESDIR
=
"
/home/
$USER
/Projects/ximper-builder
/mkimage-profiles"
PROFILESDIR
=
"
$BUILDERDIR
/mkimage-profiles"
fi
fi
create_tmp
()
{
create_tmp
()
{
echo
$(
mktemp
-d
-t
ximper-builder.XXXXXXX
)
mktemp
-d
-t
ximper-builder.XXXXXXX
}
}
remove_tmp
()
{
remove_tmp
()
{
...
@@ -45,7 +48,7 @@ cleartmp() {
...
@@ -45,7 +48,7 @@ cleartmp() {
[
"
$CLEAN
"
==
true
]
||
return
[
"
$CLEAN
"
==
true
]
||
return
echo
"____________________"
echo
"____________________"
$HOME
/Projects/ximper-builder/bin
/cleartmp
-i
"
$BUILDERDIR
/bin"
/cleartmp
-i
# shellcheck disable=SC2012
# shellcheck disable=SC2012
# Удаляем все, кроме самого нового
# Удаляем все, кроме самого нового
[
"
$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
--
{}
...
@@ -66,6 +69,7 @@ handle_uncommitted_changes() {
...
@@ -66,6 +69,7 @@ handle_uncommitted_changes() {
fi
fi
# Обнаружены незакоммиченные изменения
# Обнаружены незакоммиченные изменения
# shellcheck disable=SC2155
local
temp_commit_msg
=
"TEMP: Commit before building
$(
date
+
'%Y-%m-%d %H:%M:%S'
)
"
local
temp_commit_msg
=
"TEMP: Commit before building
$(
date
+
'%Y-%m-%d %H:%M:%S'
)
"
# Создание временного коммита
# Создание временного коммита
...
@@ -87,7 +91,7 @@ ifexit() {
...
@@ -87,7 +91,7 @@ ifexit() {
print_yellow
"Скрипт принудительно завершен. Выполняю некоторые действия..."
print_yellow
"Скрипт принудительно завершен. Выполняю некоторые действия..."
revert_temp_commit
revert_temp_commit
CLEAN
=
true
cleartmp
CLEAN
=
true
cleartmp
remove_tmp
$buildertmp
remove_tmp
"
$buildertmp
"
CLEAN
=
false
CLEAN
=
false
exit
1
exit
1
}
}
...
@@ -137,6 +141,7 @@ makebuild() {
...
@@ -137,6 +141,7 @@ makebuild() {
}
}
OPTS
=
$(
getopt
-o
h
--long
help
,nvidia,debug,clean,all,vm,gnome,hyprland,net,network,repos:
--
"
$@
"
)
OPTS
=
$(
getopt
-o
h
--long
help
,nvidia,debug,clean,all,vm,gnome,hyprland,net,network,repos:
--
"
$@
"
)
# shellcheck disable=SC2181
if
[
$?
!=
0
]
;
then
if
[
$?
!=
0
]
;
then
print_error
"Ошибка обработки опций."
print_error
"Ошибка обработки опций."
exit
1
exit
1
...
@@ -234,8 +239,8 @@ fi
...
@@ -234,8 +239,8 @@ fi
if
[
-z
"
$APTCONF
"
]
;
then
if
[
-z
"
$APTCONF
"
]
;
then
buildertmp
=
$(
create_tmp
)
buildertmp
=
$(
create_tmp
)
APTCONF
=
$(
$(
dirname
$0
)
/gen-apt-conf
$NETWORK
-d
$buildertmp
-r
$REPOS
)
APTCONF
=
$(
"
$BUILDERDIR
"
/bin/gen-apt-conf
$NETWORK
-d
"
$buildertmp
"
-r
"
$REPOS
"
)
APTTMP
=
$(
dirname
$APTCONF
)
APTTMP
=
$(
dirname
"
$APTCONF
"
)
fi
fi
# Установить GNOME по умолчанию, если ничего не выбрано
# Установить GNOME по умолчанию, если ничего не выбрано
...
@@ -281,6 +286,6 @@ done
...
@@ -281,6 +286,6 @@ done
cleartmp
cleartmp
popd
>
/dev/null
||
exit
popd
>
/dev/null
||
exit
remove_tmp
$buildertmp
remove_tmp
"
$buildertmp
"
print_green
"ЗАВЕРШЕНО"
print_green
"ЗАВЕРШЕНО"
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