From b77a1cfce44c52504301a49535500e4f9b2a8649 Mon Sep 17 00:00:00 2001 From: Ariel Barreiro Date: Mon, 11 Nov 2024 23:28:56 -0300 Subject: [PATCH] refactor: fish with .deb download and two mirrors also updated fzf --- .../pimp-my-shell/manifest.yaml | 2 +- .ddev/config.pimp-my-shell.yaml | 1 + .ddev/web-build/Dockerfile.pimp-my-shell | 25 +++++++++++++------ config.pimp-my-shell.yaml | 1 + web-build/Dockerfile.pimp-my-shell | 25 +++++++++++++------ 5 files changed, 37 insertions(+), 17 deletions(-) diff --git a/.ddev/addon-metadata/pimp-my-shell/manifest.yaml b/.ddev/addon-metadata/pimp-my-shell/manifest.yaml index 6edfa58..d07c993 100644 --- a/.ddev/addon-metadata/pimp-my-shell/manifest.yaml +++ b/.ddev/addon-metadata/pimp-my-shell/manifest.yaml @@ -1,7 +1,7 @@ name: pimp-my-shell repository: . version: "" -install_date: "2024-11-10T20:02:05-03:00" +install_date: "2024-11-11T23:27:55-03:00" project_files: - web-build/Dockerfile.pimp-my-shell - homeadditions/.bashrc.d/pimp-my-shell.sh diff --git a/.ddev/config.pimp-my-shell.yaml b/.ddev/config.pimp-my-shell.yaml index 715824e..070ba88 100644 --- a/.ddev/config.pimp-my-shell.yaml +++ b/.ddev/config.pimp-my-shell.yaml @@ -16,6 +16,7 @@ webimage_extra_packages: - libarchive-tools - lolcat - lua5.4 + - man-db - net-tools - pipx - pv diff --git a/.ddev/web-build/Dockerfile.pimp-my-shell b/.ddev/web-build/Dockerfile.pimp-my-shell index 19b1a58..5518283 100644 --- a/.ddev/web-build/Dockerfile.pimp-my-shell +++ b/.ddev/web-build/Dockerfile.pimp-my-shell @@ -9,11 +9,13 @@ RUN set -eux; \ # fzf et al RUN set -eux; \ + FZF_SHA1=215ab48222ac5fa8855c1e5bbf56742276b57324; \ + FZFGIT_SHA1=f730cfa1860acdb64597a0cf060d4949f1cd02a8; \ mkdir -p /opt/fzf; \ cd /opt/fzf; \ git init; \ git remote add origin https://github.com/junegunn/fzf.git; \ - git fetch --depth 1 origin 64c61603e9b50470ba79737ade9e0a7d8402f1d7; \ + git fetch --depth 1 origin ${FZF_SHA1}; \ git checkout FETCH_HEAD; \ /opt/fzf/install --all; \ cp /root/.fzf.bash /opt; \ @@ -22,7 +24,7 @@ RUN set -eux; \ cd /opt/fzf-git.sh; \ git init; \ git remote add origin https://github.com/junegunn/fzf-git.sh.git; \ - git fetch --depth 1 origin f730cfa1860acdb64597a0cf060d4949f1cd02a8; \ + git fetch --depth 1 origin ${FZFGIT_SHA1}; \ git checkout FETCH_HEAD; # bat @@ -51,13 +53,20 @@ RUN set -eux; \ dpkg -i gum.deb; \ rm gum.deb; -# apt/repos -# - fish +# fish RUN set -eux; \ - echo "deb http://download.opensuse.org/repositories/shells:/fish:/release:/3/Debian_`lsb_release -rs`/ /" | sudo tee /etc/apt/sources.list.d/shells:fish:release:3.list; \ - curl -fsSL https://download.opensuse.org/repositories/shells:fish:release:3/Debian_`lsb_release -rs`/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/shells_fish_release_3.gpg > /dev/null; \ - apt update; \ - apt satisfy -y "fish (>=3.7.1)"; + FISH_VERSION=3.7.1-1; \ + DEBIAN=$(lsb_release -rs); \ + AARCH=$(dpkg --print-architecture); \ + # the two wget are because for some time, at least in Argentina, download.opensuse.org + # was redirecting to mirrorcache-us, which was down at a time. + # on a us server I was getting ftp.gwdg.de mirror which was working, so as a + # temporary workaround, I am trying first the regular url, and if not I try the + # other mirror + wget -q https://download.opensuse.org/repositories/shells:/fish:/release:/3/Debian_${DEBIAN}/${AARCH}/fish_${FISH_VERSION}_${AARCH}.deb -O fish.deb \ + || wget -q https://ftp.gwdg.de/pub/opensuse/repositories/shells%3A/fish%3A/release%3A/3/Debian_${DEBIAN}/${AARCH}/fish_${FISH_VERSION}_${AARCH}.deb -O fish.deb; \ + dpkg -i fish.deb; \ + rm fish.deb; # eza RUN set -eux; \ diff --git a/config.pimp-my-shell.yaml b/config.pimp-my-shell.yaml index 715824e..070ba88 100644 --- a/config.pimp-my-shell.yaml +++ b/config.pimp-my-shell.yaml @@ -16,6 +16,7 @@ webimage_extra_packages: - libarchive-tools - lolcat - lua5.4 + - man-db - net-tools - pipx - pv diff --git a/web-build/Dockerfile.pimp-my-shell b/web-build/Dockerfile.pimp-my-shell index 19b1a58..5518283 100644 --- a/web-build/Dockerfile.pimp-my-shell +++ b/web-build/Dockerfile.pimp-my-shell @@ -9,11 +9,13 @@ RUN set -eux; \ # fzf et al RUN set -eux; \ + FZF_SHA1=215ab48222ac5fa8855c1e5bbf56742276b57324; \ + FZFGIT_SHA1=f730cfa1860acdb64597a0cf060d4949f1cd02a8; \ mkdir -p /opt/fzf; \ cd /opt/fzf; \ git init; \ git remote add origin https://github.com/junegunn/fzf.git; \ - git fetch --depth 1 origin 64c61603e9b50470ba79737ade9e0a7d8402f1d7; \ + git fetch --depth 1 origin ${FZF_SHA1}; \ git checkout FETCH_HEAD; \ /opt/fzf/install --all; \ cp /root/.fzf.bash /opt; \ @@ -22,7 +24,7 @@ RUN set -eux; \ cd /opt/fzf-git.sh; \ git init; \ git remote add origin https://github.com/junegunn/fzf-git.sh.git; \ - git fetch --depth 1 origin f730cfa1860acdb64597a0cf060d4949f1cd02a8; \ + git fetch --depth 1 origin ${FZFGIT_SHA1}; \ git checkout FETCH_HEAD; # bat @@ -51,13 +53,20 @@ RUN set -eux; \ dpkg -i gum.deb; \ rm gum.deb; -# apt/repos -# - fish +# fish RUN set -eux; \ - echo "deb http://download.opensuse.org/repositories/shells:/fish:/release:/3/Debian_`lsb_release -rs`/ /" | sudo tee /etc/apt/sources.list.d/shells:fish:release:3.list; \ - curl -fsSL https://download.opensuse.org/repositories/shells:fish:release:3/Debian_`lsb_release -rs`/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/shells_fish_release_3.gpg > /dev/null; \ - apt update; \ - apt satisfy -y "fish (>=3.7.1)"; + FISH_VERSION=3.7.1-1; \ + DEBIAN=$(lsb_release -rs); \ + AARCH=$(dpkg --print-architecture); \ + # the two wget are because for some time, at least in Argentina, download.opensuse.org + # was redirecting to mirrorcache-us, which was down at a time. + # on a us server I was getting ftp.gwdg.de mirror which was working, so as a + # temporary workaround, I am trying first the regular url, and if not I try the + # other mirror + wget -q https://download.opensuse.org/repositories/shells:/fish:/release:/3/Debian_${DEBIAN}/${AARCH}/fish_${FISH_VERSION}_${AARCH}.deb -O fish.deb \ + || wget -q https://ftp.gwdg.de/pub/opensuse/repositories/shells%3A/fish%3A/release%3A/3/Debian_${DEBIAN}/${AARCH}/fish_${FISH_VERSION}_${AARCH}.deb -O fish.deb; \ + dpkg -i fish.deb; \ + rm fish.deb; # eza RUN set -eux; \