Merge branch 'main' of https://git.101010.fr/gardouille/eza-docker-build
This commit is contained in:
commit
3824b947d8
|
@ -7,6 +7,7 @@ TARGET="$PWD"
|
||||||
|
|
||||||
export DEBIAN_FRONTEND
|
export DEBIAN_FRONTEND
|
||||||
|
|
||||||
|
# dependencies {{{
|
||||||
dependencies() {
|
dependencies() {
|
||||||
# Update system and install basic tools
|
# Update system and install basic tools
|
||||||
apt-get update -yq && apt-get install -yq aptitude curl git patch wget
|
apt-get update -yq && apt-get install -yq aptitude curl git patch wget
|
||||||
|
@ -20,18 +21,23 @@ dependencies() {
|
||||||
apt-get update -yq
|
apt-get update -yq
|
||||||
aptitude --quiet --assume-yes install just
|
aptitude --quiet --assume-yes install just
|
||||||
}
|
}
|
||||||
|
# }}}
|
||||||
|
|
||||||
|
# get_eza_sources {{{
|
||||||
get_eza_sources() {
|
get_eza_sources() {
|
||||||
# Clone Eza repo
|
# Clone Eza repo
|
||||||
cd "$(mktemp -d)"
|
cd "$(mktemp -d)"
|
||||||
git clone https://github.com/eza-community/eza
|
git clone https://github.com/eza-community/eza
|
||||||
cd eza
|
cd eza
|
||||||
}
|
}
|
||||||
|
# }}}
|
||||||
|
|
||||||
|
# Patch sample (from a PR…) {{{
|
||||||
patch_justfile() {
|
patch_justfile() {
|
||||||
# If issue 458 is still open
|
# If issue 458 is still open
|
||||||
gh_justfile_issue_opened=$(curl --location --no-progress-meter -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" \
|
gh_justfile_issue_opened=$(curl --location --no-progress-meter -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" \
|
||||||
"https://api.github.com/search/issues?q=repo:eza-community/eza+is:open+is:issue+author:gardouille" | \grep --extended-regexp --count '"url":.*issues/458",')
|
"https://api.github.com/search/issues?q=repo:eza-community/eza+is:open+is:issue+author:gardouille" | \grep --extended-regexp --count '"url":.*issues/458",' \
|
||||||
|
|| echo "0")
|
||||||
|
|
||||||
if [ "${gh_justfile_issue_opened}" = "1" ]; then
|
if [ "${gh_justfile_issue_opened}" = "1" ]; then
|
||||||
echo "Patch Justfile to fix issue https://github.com/eza-community/eza/issues/458"
|
echo "Patch Justfile to fix issue https://github.com/eza-community/eza/issues/458"
|
||||||
|
@ -47,27 +53,33 @@ patch_justfile() {
|
||||||
git config --global user.email "ci@ci.ci"
|
git config --global user.email "ci@ci.ci"
|
||||||
git config --global user.name "CI me"
|
git config --global user.name "CI me"
|
||||||
git commit -a -m "Fix #458 Patch Justfile and devtools script"
|
git commit -a -m "Fix #458 Patch Justfile and devtools script"
|
||||||
elif [ "${gh_justfile_issue_opened}" != "1" ]; then
|
elif [ ! "${gh_justfile_issue_opened}" = "1" ]; then
|
||||||
echo "Justfile 458 patch section can be removed."
|
echo "Justfile 458 patch section can be removed."
|
||||||
else
|
else
|
||||||
echo "Case that is not supposed to happen !"
|
echo "Case that is not supposed to happen !"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
# }}}
|
||||||
|
|
||||||
|
# build_eza_deb_package {{{
|
||||||
build_eza_deb_package() {
|
build_eza_deb_package() {
|
||||||
# Build
|
# Build
|
||||||
./devtools/deb-package.sh
|
./devtools/deb-package.sh
|
||||||
}
|
}
|
||||||
|
# }}}
|
||||||
|
|
||||||
|
# copy builded package {{{
|
||||||
copy() {
|
copy() {
|
||||||
TARGET_UID="$(stat --printf %u "$TARGET")"
|
TARGET_UID="$(stat --printf %u "$TARGET")"
|
||||||
TARGET_GID="$(stat --printf %g "$TARGET")"
|
TARGET_GID="$(stat --printf %g "$TARGET")"
|
||||||
install -o "$TARGET_UID" -g "$TARGET_GID" -t "$TARGET/target" eza_*.deb
|
install -o "$TARGET_UID" -g "$TARGET_GID" -t "$TARGET/target" eza_*.deb
|
||||||
}
|
}
|
||||||
|
# }}}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
dependencies
|
dependencies
|
||||||
get_eza_sources
|
get_eza_sources
|
||||||
patch_justfile
|
#patch_justfile
|
||||||
build_eza_deb_package
|
build_eza_deb_package
|
||||||
copy
|
copy
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue