Skip to content

Commit

Permalink
optimized
Browse files Browse the repository at this point in the history
  • Loading branch information
leleliu008 committed Aug 14, 2024
1 parent b11e5a2 commit ee5bc1e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/publish-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ jobs:
run ./ppkg setup --syspm
run ./ppkg update
if [ ${{ matrix.target-arch }} = riscv64 ] ; then
sed -i '/src-url: /c src-url: https://www.openssl.org/source/openssl-3.1.1.tar.gz' ~/.ppkg/repos.d/official-core/formula/libopenssl.yml
sed -i '/src-sha: /c src-sha: b3aa61334233b852b63ddb048df181177c2c659eb9d4376008118f9c08d07674' ~/.ppkg/repos.d/official-core/formula/libopenssl.yml
if [ ${{ matrix.target-arch }} = s390x ] ; then
sed -i '/src-url: /c src-url: https://curl.haxx.se/download/curl-8.4.0.tar.bz2' ~/.ppkg/repos.d/official-core/formula/libcurl.yml
sed -i '/src-sha: /c src-sha: e5250581a9c032b1b6ed3cf2f9c114c811fc41881069e9892d115cc73f9e88c6' ~/.ppkg/repos.d/official-core/formula/libcurl.yml
fi
run ./ppkg install [email protected] --static
Expand Down
37 changes: 31 additions & 6 deletions ppkg
Original file line number Diff line number Diff line change
Expand Up @@ -2544,7 +2544,11 @@ __fetch_resources_of_the_given_package() {

cd "$PACKAGE_INSTALLED_DIR/.ppkg"

fzf --preview='bat --color=always --theme=Dracula {}' --preview-window='right:75%'
if command -v bat > /dev/null ; then
fzf --preview='bat --color=always --theme=Dracula {}' --preview-window='right:75%'
else
fzf
fi
}

# }}}
Expand Down Expand Up @@ -3365,7 +3369,11 @@ EOF
fi

if [ "$VERBOSE_CMAKE" = 1 ] ; then
run bat --language=cmake --paging=never --style=plain "$CMAKE_TOOLCHAIN_FILE"
if command -v bat > /dev/null ; then
run bat --language=cmake --paging=never --style=plain "$CMAKE_TOOLCHAIN_FILE"
else
run cat "$CMAKE_TOOLCHAIN_FILE"
fi
fi

unset CMAKE_PROJECT_INCLUDE
Expand Down Expand Up @@ -4565,7 +4573,11 @@ EOF
step "load formula"

if [ "$DUMP_FORMULA" = 1 ] ; then
bat --language=yaml --paging=never "$PACKAGE_FORMULA_FILEPATH"
if command -v bat > /dev/null ; then
bat --language=yaml --paging=never "$PACKAGE_FORMULA_FILEPATH"
else
cat "$PACKAGE_FORMULA_FILEPATH"
fi
fi

__load_formula_of_the_given_package "$PACKAGE_NAME" "$PACKAGE_FORMULA_FILEPATH"
Expand Down Expand Up @@ -6011,8 +6023,15 @@ EOF
case $TARGET_PLATFORM_NAME in
linux)
case $TARGET_PLATFORM_VERS in
glibc) RUST_TARGET="$TARGET_PLATFORM_ARCH-unknown-linux-gnu" ;;
musl) RUST_TARGET="$TARGET_PLATFORM_ARCH-unknown-linux-musl" ;;
glibc) XX=gnu ;;
musl) XX=musl ;;
*) XX=
esac

case $TARGET_PLATFORM_ARCH in
ppc64le) RUST_TARGET="powerpc64le-unknown-linux-$XX" ;;
riscv64) RUST_TARGET="riscv64gc-unknown-linux-$XX" ;;
*) RUST_TARGET="$TARGET_PLATFORM_ARCH-unknown-linux-$XX" ;;
esac
;;
macos)
Expand Down Expand Up @@ -8477,7 +8496,13 @@ __setup_uppm() {
unset UPPM_PACKAGE_EXEFIND_PATH
unset UPPM_PACKAGE_ACLOCAL_PATH

for UPPM_PACKAGE_NAME in bash coreutils findutils gawk gsed grep bsdtar git curl tree sysinfo patchelf fzf bat xxd jq yq d2
if ./uppm is-available bat ; then
BAT=bat
else
BAT=
fi

for UPPM_PACKAGE_NAME in bash coreutils findutils gawk gsed grep bsdtar git curl tree sysinfo patchelf fzf xxd jq yq d2 $BAT
do
run ./uppm install "$UPPM_PACKAGE_NAME"

Expand Down

0 comments on commit ee5bc1e

Please sign in to comment.