add tier option

This commit is contained in:
2025-11-12 01:12:18 -05:00
parent 1f454fa656
commit 259f439101
7 changed files with 133 additions and 94 deletions

View File

@@ -1,12 +1,14 @@
FROM archlinux/archlinux:base-devel FROM archlinux/archlinux:base-devel
COPY scripts/entrypoint.sh /scripts/entrypoint.sh COPY scripts/entrypoint.sh /scripts/entrypoint.sh
COPY scripts/pacman.conf.arch/* /scripts/pacman.conf/ COPY scripts/pacman.conf.arch/pacman.conf.pl /scripts/pacman.conf.pl
ARG MIRROR=https://mirror.sanin.dev/arch-linux/\$repo/os/\$arch ARG MIRROR=https://mirror.sanin.dev/arch-linux/\$repo/os/\$arch
RUN sed -i "1iServer = $MIRROR" /etc/pacman.d/mirrorlist && \ RUN sed -i "1iServer = $MIRROR" /etc/pacman.d/mirrorlist && \
pacman -Syu --noconfirm git clang sudo devtools vim bash-completion && \ pacman -Syu --noconfirm git clang sudo devtools vim bash-completion && \
pacman -Scc --noconfirm && \
rm -rf /var/lib/pacman/sync /var/cache/pacman/pkg && \
git config --global init.defaultBranch "master" && \ git config --global init.defaultBranch "master" && \
chmod +x /scripts/* && \ chmod +x /scripts/* && \
useradd -m user && \ useradd -m user && \

View File

@@ -1,12 +1,14 @@
FROM artixlinux/artixlinux:base-devel FROM artixlinux/artixlinux:base-devel
COPY scripts/entrypoint.sh /scripts/entrypoint.sh COPY scripts/entrypoint.sh /scripts/entrypoint.sh
COPY scripts/pacman.conf.artix/* /scripts/pacman.conf/ COPY scripts/pacman.conf.artix/pacman.conf.pl /scripts/pacman.conf.pl
ARG MIRROR=https://mirror.sanin.dev/artix-linux/\$repo/os/\$arch ARG MIRROR=https://mirror.sanin.dev/artix-linux/\$repo/os/\$arch
RUN sed -i "1iServer = $MIRROR" /etc/pacman.d/mirrorlist && \ RUN sed -i "1iServer = $MIRROR" /etc/pacman.d/mirrorlist && \
pacman -Syu --noconfirm git clang sudo vim glibc openssh bash-completion && \ pacman -Syu --noconfirm git clang sudo vim glibc openssh bash-completion && \
pacman -Scc --noconfirm && \
rm -rf /var/lib/pacman/sync /var/cache/pacman/pkg && \
git config --global init.defaultBranch "master" && \ git config --global init.defaultBranch "master" && \
chmod +x /scripts/* && \ chmod +x /scripts/* && \
useradd -m user && \ useradd -m user && \

View File

@@ -1,15 +1,13 @@
#!/bin/sh #!/bin/sh
if [ -n "$DEP" ] && [ "$DEP" != "stable" ] /scripts/pacman.conf.pl | sudo tee "/etc/pacman.conf" > /dev/null
then
sudo cp "/scripts/pacman.conf/pacman.$DEP.conf" "/etc/pacman.conf" && \
sudo pacman -Syu --noconfirm --noprogressbar
fi
if [ -z "$REPO" ] if [ -z "$REPO" ]
then then
/bin/bash /bin/bash
exit $?; exit $?;
else
sudo pacman -Syu --noconfirm --noprogressbar
fi fi
checkoutCommit() { checkoutCommit() {
@@ -34,6 +32,14 @@ postEntrypoint() {
fi fi
} }
doBuild() {
if [ -n "$POST" ] && [ -x "./post-entrypoint.sh" ] ; then
makepkg -smf --noconfirm --noprogressbar --skippgpcheck
else
makepkg -smf --noconfirm --noprogressbar --skippgpcheck --noarchive
fi
}
changeDir() { changeDir() {
if [ -n "$CD" ] if [ -n "$CD" ]
then then
@@ -50,6 +56,6 @@ cd "$DIR" && \
checkoutCommit && \ checkoutCommit && \
applyPatch && \ applyPatch && \
sudo pacman -Syu --noconfirm --noprogressbar &&\ sudo pacman -Syu --noconfirm --noprogressbar &&\
makepkg -smf --noconfirm --noprogressbar --skippgpcheck && \ doBuild && \
postEntrypoint postEntrypoint
exit $?; exit $?;

View File

@@ -1,3 +1,12 @@
#!/usr/bin/env perl
use strict;
use warnings;
my $dep = $ENV{DEP} // 'stable';
my $tier = $ENV{TIER} // '1';
#region header
print <<'EOHEADER';
# #
# /etc/pacman.conf # /etc/pacman.conf
# #
@@ -12,24 +21,61 @@ DownloadUser = alpm
SigLevel = Required DatabaseOptional SigLevel = Required DatabaseOptional
LocalFileSigLevel = Optional LocalFileSigLevel = Optional
EOHEADER
#endregion
#region core
if ($dep eq 'staging') {
print <<'EOCORESTAGING';
[core-staging] [core-staging]
Include = /etc/pacman.d/mirrorlist Include = /etc/pacman.d/mirrorlist
EOCORESTAGING
}
if ($dep eq 'staging' || $dep eq 'testing') {
print <<'EOCORETESTING';
[core-testing] [core-testing]
Include = /etc/pacman.d/mirrorlist Include = /etc/pacman.d/mirrorlist
EOCORETESTING
}
print <<'EOCORE';
[core] [core]
Include = /etc/pacman.d/mirrorlist Include = /etc/pacman.d/mirrorlist
EOCORE
#endregion
#region extra
if ($tier ne '0') {
if ($dep eq 'staging') {
print <<'EOEXTRASTAGING';
[extra-staging] [extra-staging]
Include = /etc/pacman.d/mirrorlist Include = /etc/pacman.d/mirrorlist
EOEXTRASTAGING
}
if ($dep eq 'staging' || $dep eq 'testing') {
print <<'EOEXTRATESTING';
[extra-testing] [extra-testing]
Include = /etc/pacman.d/mirrorlist Include = /etc/pacman.d/mirrorlist
EOEXTRATESTING
}
print <<'EOEXTRA';
[extra] [extra]
Include = /etc/pacman.d/mirrorlist Include = /etc/pacman.d/mirrorlist
EOEXTRA
}
#endregion
#region options
print <<'EOOPTIONS';
[options] [options]
NoExtract = usr/share/help/* !usr/share/help/en* !usr/share/help/C/* NoExtract = usr/share/help/* !usr/share/help/en* !usr/share/help/C/*
NoExtract = usr/share/gtk-doc/html/* usr/share/doc/* NoExtract = usr/share/gtk-doc/html/* usr/share/doc/*
@@ -43,3 +89,5 @@ NoExtract = !usr/share/*locales/C !usr/share/*locales/POSIX !usr/share/i18n/cha
NoExtract = usr/share/man/* usr/share/info/* NoExtract = usr/share/man/* usr/share/info/*
NoExtract = usr/share/vim/vim*/lang/* NoExtract = usr/share/vim/vim*/lang/*
NoExtract = etc/pacman.conf etc/pacman.d/mirrorlist NoExtract = etc/pacman.conf etc/pacman.d/mirrorlist
EOOPTIONS
#endregion

View File

@@ -1,40 +0,0 @@
#
# /etc/pacman.conf
#
[options]
HoldPkg = pacman glibc
Architecture = auto
NoProgressBar
VerbosePkgLists
ParallelDownloads = 5
DownloadUser = alpm
SigLevel = Required DatabaseOptional
LocalFileSigLevel = Optional
[core-testing]
Include = /etc/pacman.d/mirrorlist
[core]
Include = /etc/pacman.d/mirrorlist
[extra-testing]
Include = /etc/pacman.d/mirrorlist
[extra]
Include = /etc/pacman.d/mirrorlist
[options]
NoExtract = usr/share/help/* !usr/share/help/en* !usr/share/help/C/*
NoExtract = usr/share/gtk-doc/html/* usr/share/doc/*
NoExtract = usr/share/locale/* usr/share/X11/locale/* usr/share/i18n/*
NoExtract = !*locale*/en*/* !usr/share/i18n/charmaps/UTF-8.gz !usr/share/*locale*/locale.*
NoExtract = !usr/share/*locales/en_?? !usr/share/*locales/i18n* !usr/share/*locales/iso*
NoExtract = !usr/share/*locales/trans*
NoExtract = !usr/share/X11/locale/C/*
NoExtract = !usr/share/X11/locale/compose.dir !usr/share/X11/locale/iso8859-1/*
NoExtract = !usr/share/*locales/C !usr/share/*locales/POSIX !usr/share/i18n/charmaps/ANSI_X3.4-1968.gz
NoExtract = usr/share/man/* usr/share/info/*
NoExtract = usr/share/vim/vim*/lang/*
NoExtract = etc/pacman.conf etc/pacman.d/mirrorlist

View File

@@ -1,3 +1,12 @@
#!/usr/bin/env perl
use strict;
use warnings;
my $dep = $ENV{DEP} // 'stable';
my $tier = $ENV{TIER} // '1';
#region header
print <<'EOHEADER';
# #
# /etc/pacman.conf # /etc/pacman.conf
# #
@@ -12,33 +21,87 @@ DownloadUser = alpm
SigLevel = Required DatabaseOptional SigLevel = Required DatabaseOptional
LocalFileSigLevel = Optional LocalFileSigLevel = Optional
EOHEADER
#endregion
#region system
if ($dep eq 'staging') {
print <<'EOSYSTEMSTAGING';
[system-goblins] [system-goblins]
Include = /etc/pacman.d/mirrorlist Include = /etc/pacman.d/mirrorlist
EOSYSTEMSTAGING
}
if ($dep eq 'staging' || $dep eq 'testing') {
print <<'EOSYSTEMTESTING';
[system-gremlins] [system-gremlins]
Include = /etc/pacman.d/mirrorlist Include = /etc/pacman.d/mirrorlist
EOSYSTEMTESTING
}
print <<'EOSYSTEM';
[system] [system]
Include = /etc/pacman.d/mirrorlist Include = /etc/pacman.d/mirrorlist
EOSYSTEM
#endregion
#region world
if ($tier ne '0') {
if ($dep eq 'staging') {
print <<'EOWORLDSTAGING';
[world-goblins] [world-goblins]
Include = /etc/pacman.d/mirrorlist Include = /etc/pacman.d/mirrorlist
EOWORLDSTAGING
}
if ($dep eq 'staging' || $dep eq 'testing') {
print <<'EOWORLDTESTING';
[world-gremlins] [world-gremlins]
Include = /etc/pacman.d/mirrorlist Include = /etc/pacman.d/mirrorlist
EOWORLDTESTING
}
print <<'EOWORLD';
[world] [world]
Include = /etc/pacman.d/mirrorlist Include = /etc/pacman.d/mirrorlist
EOWORLD
}
#endregion
#region galaxy
if ($tier eq '2') {
if ($dep eq 'staging') {
print <<'EOGALAXYSTAGING';
[galaxy-goblins] [galaxy-goblins]
Include = /etc/pacman.d/mirrorlist Include = /etc/pacman.d/mirrorlist
EOGALAXYSTAGING
}
if ($dep eq 'staging' || $dep eq 'testing') {
print <<'EOGALAXYTESTING';
[galaxy-gremlins] [galaxy-gremlins]
Include = /etc/pacman.d/mirrorlist Include = /etc/pacman.d/mirrorlist
EOGALAXYTESTING
}
print <<'EOGALAXY';
[galaxy] [galaxy]
Include = /etc/pacman.d/mirrorlist Include = /etc/pacman.d/mirrorlist
EOGALAXY
}
#endregion
#region options
print <<'EOOPTIONS';
[options] [options]
NoExtract = usr/share/help/* !usr/share/help/en* !usr/share/help/C/* NoExtract = usr/share/help/* !usr/share/help/en* !usr/share/help/C/*
NoExtract = usr/share/gtk-doc/html/* usr/share/doc/* NoExtract = usr/share/gtk-doc/html/* usr/share/doc/*
@@ -51,3 +114,5 @@ NoExtract = !usr/share/X11/locale/compose.dir !usr/share/X11/locale/iso8859-1/
NoExtract = !usr/share/*locales/C !usr/share/*locales/POSIX !usr/share/i18n/charmaps/ANSI_X3.4-1968.gz NoExtract = !usr/share/*locales/C !usr/share/*locales/POSIX !usr/share/i18n/charmaps/ANSI_X3.4-1968.gz
NoExtract = usr/share/man/* usr/share/info/* NoExtract = usr/share/man/* usr/share/info/*
NoExtract = usr/share/vim/vim*/lang/* NoExtract = usr/share/vim/vim*/lang/*
EOOPTIONS
#endregion

View File

@@ -1,44 +0,0 @@
#
# /etc/pacman.conf
#
[options]
HoldPkg = pacman glibc
Architecture = auto
NoProgressBar
VerbosePkgLists
ParallelDownloads = 5
DownloadUser = alpm
SigLevel = Required DatabaseOptional
LocalFileSigLevel = Optional
[system-gremlins]
Include = /etc/pacman.d/mirrorlist
[system]
Include = /etc/pacman.d/mirrorlist
[world-gremlins]
Include = /etc/pacman.d/mirrorlist
[world]
Include = /etc/pacman.d/mirrorlist
[galaxy-gremlins]
Include = /etc/pacman.d/mirrorlist
[galaxy]
Include = /etc/pacman.d/mirrorlist
[options]
NoExtract = usr/share/help/* !usr/share/help/en* !usr/share/help/C/*
NoExtract = usr/share/gtk-doc/html/* usr/share/doc/*
NoExtract = usr/share/locale/* usr/share/X11/locale/* usr/share/i18n/*
NoExtract = !*locale*/en*/* !usr/share/i18n/charmaps/UTF-8.gz !usr/share/*locale*/locale.*
NoExtract = !usr/share/*locales/en_?? !usr/share/*locales/i18n* !usr/share/*locales/iso*
NoExtract = !usr/share/*locales/trans*
NoExtract = !usr/share/X11/locale/C/*
NoExtract = !usr/share/X11/locale/compose.dir !usr/share/X11/locale/iso8859-1/*
NoExtract = !usr/share/*locales/C !usr/share/*locales/POSIX !usr/share/i18n/charmaps/ANSI_X3.4-1968.gz
NoExtract = usr/share/man/* usr/share/info/*
NoExtract = usr/share/vim/vim*/lang/*