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
33981679
Verified
Commit
33981679
authored
Oct 27, 2024
by
Кирилл Уницаев
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add apt config generation to tmp
Signed-off-by:
Kirill Unitsaev
<
fiersik@altlinux.org
>
parent
b954c382
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
155 additions
and
37 deletions
+155
-37
build-distro
bin/build-distro
+46
-21
cleartmp
bin/cleartmp
+17
-16
gen-apt-conf
bin/gen-apt-conf
+92
-0
No files found.
bin/build-distro
View file @
33981679
...
@@ -7,32 +7,44 @@ VM=false
...
@@ -7,32 +7,44 @@ VM=false
CLEAN
=
false
CLEAN
=
false
DESKTOP_ENVS
=()
# Список выбранных рабочих окружений (например, gnome, hyprland)
DESKTOP_ENVS
=()
# Список выбранных рабочих окружений (например, gnome, hyprland)
# базовые функции
.
$(
dirname
$0
)
/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
"
$APTCONF
"
]
;
then
APTCONF
=
"/etc/eterbuild/apt/apt.conf.sisyphus"
fi
if
[
-z
"
$PROFILESDIR
"
]
;
then
if
[
-z
"
$PROFILESDIR
"
]
;
then
PROFILESDIR
=
"/home/
$USER
/Projects/ximper-builder/mkimage-profiles"
PROFILESDIR
=
"/home/
$USER
/Projects/ximper-builder/mkimage-profiles"
fi
fi
# базовые функции
create_tmp
()
{
.
$(
dirname
$0
)
/common
echo
$(
mktemp
-d
-t
ximper-builder.XXXXXXX
)
}
print_paths
()
{
remove_tmp
()
{
rm
-rf
"
$1
"
}
print_build_info
()
{
echo
"____________________"
echo
"____________________"
print_blue
"VMDIR:
$VMDIR
"
print_blue
"VMDIR:
$VMDIR
"
print_blue
"PROFILESDIR:
$PROFILESDIR
"
print_blue
"PROFILESDIR:
$PROFILESDIR
"
print_blue
"APTCONF:
$APTCONF
"
print_blue
"APTCONF:
$APTCONF
"
echo
"____________________"
if
[
"
$VER
"
==
"devel"
]
;
then
print_yellow
"VERSION:
$VER
"
else
print_green
"VERSION:
$VER
"
fi
print_green
"REPOSITORIES:
$REPOS
"
}
}
cleartmp
()
{
cleartmp
()
{
[
"
$CLEAN
"
==
true
]
||
return
[
"
$CLEAN
"
==
true
]
||
return
echo
"____________________"
echo
"____________________"
/home/
"
$USER
"
/Projects/ximper-builder/bin/cleartmp
-i
$HOME
/Projects/ximper-builder/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
--
{}
...
@@ -74,6 +86,7 @@ ifexit() {
...
@@ -74,6 +86,7 @@ ifexit() {
print_yellow
"Скрипт принудительно завершен. Выполняю некоторые действия..."
print_yellow
"Скрипт принудительно завершен. Выполняю некоторые действия..."
revert_temp_commit
revert_temp_commit
CLEAN
=
true
cleartmp
CLEAN
=
true
cleartmp
remove_tmp
$buildertmp
CLEAN
=
false
CLEAN
=
false
exit
1
exit
1
}
}
...
@@ -120,12 +133,9 @@ makebuild() {
...
@@ -120,12 +133,9 @@ makebuild() {
# Отмена временного коммита после завершения сборки
# Отмена временного коммита после завершения сборки
revert_temp_commit
revert_temp_commit
echo
"____________________"
}
}
pushd
"
$PROFILESDIR
"
||
exit
OPTS
=
$(
getopt
-o
h
--long
help
,nvidia,debug,clean,all,vm,gnome,hyprland,repos:
--
"
$@
"
)
OPTS
=
$(
getopt
-o
h
--long
help
,nvidia,debug,clean,all,vm,gnome,hyprland
--
"
$@
"
)
if
[
$?
!=
0
]
;
then
if
[
$?
!=
0
]
;
then
print_error
"Ошибка обработки опций."
print_error
"Ошибка обработки опций."
exit
1
exit
1
...
@@ -179,17 +189,33 @@ while true; do
...
@@ -179,17 +189,33 @@ while true; do
DESKTOP_ENVS+
=(
"hyprland"
)
DESKTOP_ENVS+
=(
"hyprland"
)
shift
shift
;;
;;
--repos
)
REPOS
=
"
$2
"
shift
;;
--
)
--
)
shift
shift
break
break
;;
;;
*
)
*
)
if
[
-n
"
$REPOS
"
]
&&
[
"
$1
"
=
"
$REPOS
"
]
;
then
shift
continue
fi
print_error
"Неверная опция:
$1
"
print_error
"Неверная опция:
$1
"
exit
1
exit
1
;;
;;
esac
esac
done
done
if
[
-z
"REPOS"
]
;
then
REPOS
=
"sisyphus,ximper"
fi
buildertmp
=
$(
create_tmp
)
APTCONF
=
$($(
dirname
$0
)
/gen-apt-conf
-d
$buildertmp
-r
$REPOS
)
APTTMP
=
$(
dirname
$APTCONF
)
# Установить GNOME по умолчанию, если ничего не выбрано
# Установить GNOME по умолчанию, если ничего не выбрано
if
[
${#
DESKTOP_ENVS
[@]
}
-eq
0
]
;
then
if
[
${#
DESKTOP_ENVS
[@]
}
-eq
0
]
;
then
DESKTOP_ENVS+
=(
"gnome"
)
DESKTOP_ENVS+
=(
"gnome"
)
...
@@ -198,19 +224,13 @@ fi
...
@@ -198,19 +224,13 @@ fi
# Обработка версии дистрибутива
# Обработка версии дистрибутива
if
[
-n
"
$1
"
]
;
then
if
[
-n
"
$1
"
]
;
then
VER
=
$1
VER
=
$1
echo
"____________________"
if
[
"
$VER
"
==
"devel"
]
;
then
print_yellow
"VERSION:
$VER
"
else
print_green
"VERSION:
$VER
"
fi
shift
shift
else
else
print_error
"Не указана версия дистрибутива."
print_error
"Не указана версия дистрибутива."
exit
1
exit
1
fi
fi
print_
paths
print_
build_info
# Генерация списка задач на сборку
# Генерация списка задач на сборку
build_list
=()
build_list
=()
...
@@ -228,6 +248,8 @@ for desktop_env in "${DESKTOP_ENVS[@]}"; do
...
@@ -228,6 +248,8 @@ for desktop_env in "${DESKTOP_ENVS[@]}"; do
fi
fi
done
done
pushd
"
$PROFILESDIR
"
>
/dev/null
||
exit
# Выполнение сборки для каждого элемента в списке
# Выполнение сборки для каждого элемента в списке
for
build_item
in
"
${
build_list
[@]
}
"
;
do
for
build_item
in
"
${
build_list
[@]
}
"
;
do
IFS
=
':'
read
-r
desktop_env build_type
<<<
"
$build_item
"
IFS
=
':'
read
-r
desktop_env build_type
<<<
"
$build_item
"
...
@@ -235,5 +257,8 @@ for build_item in "${build_list[@]}"; do
...
@@ -235,5 +257,8 @@ for build_item in "${build_list[@]}"; do
done
done
cleartmp
cleartmp
popd
||
exit
popd
>
/dev/null
||
exit
remove_tmp
$buildertmp
print_green
"ЗАВЕРШЕНО"
print_green
"ЗАВЕРШЕНО"
bin/cleartmp
View file @
33981679
...
@@ -3,24 +3,26 @@
...
@@ -3,24 +3,26 @@
# базовые функции
# базовые функции
.
$(
dirname
$0
)
/common
.
$(
dirname
$0
)
/common
print_blue
"
Cleaning
...."
print_blue
"
Очистка
...."
[
-d
"
$PROFILESDIR
/build"
]
&&
\
if
[
-d
$PROFILESDIR
/build
]
;
then
pushd
$PROFILESDIR
\
pushd
PROFILESDIR
&&
make clean
\
make clean
&&
rm
-rf
$TMP
/mkimage-profiles.build.
*
\
rm
-rf
$TMP
/mkimage-profiles.build.
*
&&
rm
-rf
./build
&&
popd
\
rm
-rf
./build
&&
print_green
"cleaning mkimage-profiles is DONE"
popd
print_green
"mkimage-profiles очищен"
[
-d
$TMP
/hasher-sisyphus-64
]
&&
rm
-rf
$TMP
/hasher-sisyphus-64/
\
fi
&&
print_green
"cleaning hasher-sisyphus is DONE"
rmiso
()
{
rmiso
()
{
rm
-rf
/tmp/.private/
"
$USER
"
/out/
*
if
[
-d
$TMP
/out/
]
;
then
rm
-rf
$TMP
/out/
*
print_green
"iso файлы удалены"
fi
}
}
while
[
-n
"
$1
"
]
;
do
for
param
in
"
$@
"
;
do
case
"
$
1
"
in
case
"
$
param
"
in
-h
|
--help
)
-h
|
--help
)
printf
"Использование:
$0
[опции]
\n\n
"
printf
"Использование:
$0
[опции]
\n\n
"
printf
"Опции:
\n
"
printf
"Опции:
\n
"
...
@@ -29,11 +31,10 @@ while [ -n "$1" ]; do
...
@@ -29,11 +31,10 @@ while [ -n "$1" ]; do
;;
;;
--iso
|
-i
)
--iso
|
-i
)
rmiso
rmiso
print_green
"iso файлы удалены"
shift
shift
;;
;;
esac
esac
shift
shift
done
done
print_green
"
DONE
"
print_green
"
Очистка завершена
"
bin/gen-apt-conf
0 → 100755
View file @
33981679
#!/bin/bash
# базовые функции
.
$(
dirname
$0
)
/common
OPTS
=
$(
getopt
-o
h,d:,r:
--long
help
,dir:,repos:
--
"
$@
"
)
if
[
$?
!=
0
]
;
then
print_error
"Ошибка обработки опций."
exit
1
fi
# Применение параметров
eval set
--
"
$OPTS
"
while
true
;
do
case
"
$1
"
in
-h
|
--help
)
printf
"Использование:
$0
[опции]
\n\n
"
printf
"Опции:
\n
"
printf
" -h, --help Вывод этой справки
\n
"
printf
" -d, --dir Путь к tmp
\n
"
printf
" -r, --repos Список репозиториев
\n
"
shift
;;
-d
|
--dir
)
buildertmp
=
"
$2
"
shift
;;
-r
|
--repos
)
REPOS
=
"
${
2
//,/
}
"
shift
;;
--
)
shift
break
;;
*
)
shift
;;
esac
done
APTCONF
=
"
$buildertmp
/apt.conf.ximper"
SOURCES
=
"
$buildertmp
/sources.list.ximper"
gen_sources
()
{
for
repo
in
$REPOS
;
do
case
"
$repo
"
in
*
sisyphus
*
)
cat
<<
EOF
>> "
$SOURCES
"
rpm [alt] file:/var/ftp/ pub/ALTLinux/Sisyphus/x86_64 classic
rpm [alt] file:/var/ftp/ pub/ALTLinux/Sisyphus/noarch classic
rpm [alt] file:/var/ftp/ pub/ALTLinux/Sisyphus/x86_64-i586 classic
EOF
;;
*
etersoft
*
)
cat
<<
EOF
>> "
$SOURCES
"
rpm file:/var/ftp/pub/Etersoft/WINE@Etersoft/9-testing/WINE x86_64/ALTLinux/Sisyphus main
rpm file:/var/ftp/pub/Etersoft/WINE@Etersoft/9-testing/WINE/x86_64 ALTLinux/Sisyphus/extra main
#rpm file:/var/ftp/pvt/Etersoft/WINE@Etersoft/9-testing/WINE-Network x86_64/ALTLinux/Sisyphus main
EOF
;;
*
ximper
*
)
cat
<<
EOF
>> "
$SOURCES
"
rpm file:/var/ftp/pub/download/ximper/ XimperLinuxRepository/x86_64 addon
rpm file:/var/ftp/pub/download/ximper/ XimperLinuxRepository/noarch addon
EOF
;;
esac
done
}
gen_config
()
{
cat
<<
EOF
>> "
$APTCONF
"
/*
* This is the main configuration file for the APT suite of tools,
* see apt.conf(5) for details.
*/
Dir::Etc::main "/dev/null";
Dir::Etc::parts "/var/empty";
Dir::Etc::SourceParts "/var/empty";
Dir::Etc::SourceList "
$SOURCES
";
EOF
}
gen_sources
gen_config
echo
$APTCONF
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