From 2a13f26eb5235cc242a00dc98565751bc8f5e133 Mon Sep 17 00:00:00 2001 From: Tin Lai Date: Fri, 1 Sep 2023 21:03:20 +1000 Subject: [PATCH] remove archpkg operation Signed-off-by: Tin Lai --- completions/shsh.fish | 1 - libexec/shsh-_env-var | 4 +--- libexec/shsh-_utils | 25 +------------------------ libexec/shsh-install | 27 ++------------------------- libexec/shsh-list | 2 -- libexec/shsh-uninstall | 1 - 6 files changed, 4 insertions(+), 56 deletions(-) diff --git a/completions/shsh.fish b/completions/shsh.fish index 991c595..785c196 100644 --- a/completions/shsh.fish +++ b/completions/shsh.fish @@ -73,7 +73,6 @@ complete -f -c shsh -n "__fish_shsh_using_command install" -l noconfirm -d "do n complete -f -c shsh -n "__fish_shsh_using_command install" -l ssh -d "use ssh protocal instead of https" complete -f -c shsh -n "__fish_shsh_using_command install" -l plain -d "build a plain package from the ground up" complete -f -c shsh -n "__fish_shsh_using_command install" -l gh-release -d "download binary from github release assets" -complete -f -c shsh -n "__fish_shsh_using_command install" -l archpkg -d "install the package as an Arch/AUR package" complete -f -c shsh -n "__fish_shsh_using_command uninstall" -l quiet -d "be quiet even if package does not exists" complete -f -c shsh -n "__fish_shsh_using_command uninstall" -l use-rc -d "uninstall all packages not present in SHSHRC" diff --git a/libexec/shsh-_env-var b/libexec/shsh-_env-var index c24de08..160bc53 100644 --- a/libexec/shsh-_env-var +++ b/libexec/shsh-_env-var @@ -38,7 +38,6 @@ export SHSH_PREFIX="${SHSH_PREFIX:=$SHSH_ROOT/cellar}" export SHSH_PACKAGES_PATH="${SHSH_PACKAGES_PATH:=$SHSH_PREFIX/packages}" export SHSH_INSTALL_BIN="${SHSH_INSTALL_BIN:=$SHSH_PREFIX/bin}" export SHSH_INSTALL_MAN="${SHSH_INSTALL_MAN:=$SHSH_PREFIX/man}" -export SHSH_INSTALL_ARCHPKG_ROOT="${SHSH_INSTALL_ARCHPKG_ROOT:=$SHSH_ROOT/cellar/archpkg_root}" _xdg_config_home="${XDG_CONFIG_HOME:=$HOME/.config}" export SHSHRC="${SHSHRC:=$_xdg_config_home/shshrc}" @@ -46,5 +45,4 @@ bin_path="$(dirname "$(resolve_link "$0")")" export PATH="${bin_path}:${PATH}" export UTILS_FUNC="$bin_path/shsh-_utils" -export SHSH_JUNEST_ROOT="$SHSH_ROOT/cellar/arch_junest_root" -export SHSH_JUNEST_BIN="$SHSH_JUNEST_ROOT/junest_bin" \ No newline at end of file +export SHSH_JUNEST_BIN="$SHSH_JUNEST_ROOT/junest_bin" diff --git a/libexec/shsh-_utils b/libexec/shsh-_utils index 7f4f3d4..710f330 100755 --- a/libexec/shsh-_utils +++ b/libexec/shsh-_utils @@ -305,7 +305,7 @@ parse_install_folder() { # if a second argunment is given (and non-empty), # if will be perform error check unset _folder_namespace _folder_target _folder_full - operation="$2" + # operation="$2" # error_check="$2" if [ -z "$1" ]; then # if [ -n "$error_check" ]; then @@ -340,14 +340,9 @@ EOF # fi _folder_namespace="$1" _folder_target="$1" - [ "$operation" = "archpkg" ] && _folder_namespace="_archpkg" info_echo "> Going to use '$_folder_namespace/$_folder_target' as the install folder" ;; esac - if [ -n "$operation" ] && [ "$operation" != "archpkg" ] && [ "$_folder_namespace" = "_archpkg" ]; then - error_echo "> The '_archpkg' namespace is reserved and cannot be used." - exit 1 - fi _folder_full="$_folder_namespace/$_folder_target" export _folder_namespace export _folder_target @@ -401,24 +396,6 @@ if ! command_exists jq; then } fi -get_archlinux_makepkg() { - _makepkg_path="$(shsh package-path _bootstrap/archmakepkg)" || true - - if [ -z "$_makepkg_path" ]; then - # bootstrap custom makepkg - info_echo "> Installing custom arch makepkg" - - # no linking - shsh install soraxas/archlinux-makepkg-stripped _bootstrap/archmakepkg -v BINS='' >/dev/null 2>&1 - _makepkg_path="$(shsh package-path _bootstrap/archmakepkg)" || true - if [ -z "$_makepkg_path" ]; then - error_echo "> error in bootstrapping makepkg" - exit 1 - fi - fi - echo "$_makepkg_path/makepkg" -} - parse_hooks_and_setvar() { echo_if_verbose ">> parsing install command: '$*'" # shellcheck disable=SC2116,SC2028 diff --git a/libexec/shsh-install b/libexec/shsh-install index 9ee42eb..0dc7783 100755 --- a/libexec/shsh-install +++ b/libexec/shsh-install @@ -24,7 +24,6 @@ # flag implies --plain # TODO: currently it is bias towards linux and amd64; # to-be generalised towards detecting current arch. -# --arch[pkg] install the as Arch package (or AUR) # -f, --force force the installation even if the package exists # --ssh use ssh protocal instead of https # @@ -90,17 +89,10 @@ if [ "$#" != 0 ]; then --ssh) use_ssh="true" ;; - --arch|--archpkg) - archpkg="true" - ;; --nocleanup) no_cleanup="true" export no_cleanup ;; - --noconfirm) - SHSH_ARCHPKG_NOCONFIRM="true" - export SHSH_ARCHPKG_NOCONFIRM - ;; -f|--force) force_install="true" ;; @@ -146,11 +138,6 @@ fi ############################################################ -if [ -n "$2" ] && [ -n "$archpkg" ]; then - error_echo "> Arch/AUR package cannot use custom folder name." - exit 1 -fi - # custom folder name parse_install_folder "$2" "$operation" && package="$_folder_full" @@ -158,15 +145,13 @@ parse_install_folder "$2" "$operation" && package="$_folder_full" ########################################## if [ -n "$plain_package" ]; then operation="plain" -elif [ -n "$archpkg" ]; then - operation="archpkg" else operation="gitclone" fi case "$operation" in ######### - plain|archpkg) + plain) if [ -z "$package" ]; then # extract ref if it exists ref="" @@ -255,10 +240,6 @@ case "$operation" in # plain package or github-release mkdir -p "${SHSH_PACKAGES_PATH}/$package" ;; - archpkg) - mkdir -p "${SHSH_PACKAGES_PATH}/$package" - shsh-_install-archpkg "$1" "$package" - ;; gitclone) # only perform link if clone is successful (and package not exists before) if ! shsh-_clone "$use_ssh" "$site" "$gitrepo" "$ref" "$package"; then @@ -284,11 +265,7 @@ fi # add successfully installed package to shshrc if [ -e "$SHSHRC" ]; then set +e # allow non-zero exit status in pattern matching - if [ "$operation" = "archpkg" ]; then - _target_package="$1" - else - _target_package="$package" - fi + _target_package="$package" shshrc_get_existing_install_cmd "$_target_package" new_statement="shsh install $original_args" diff --git a/libexec/shsh-list b/libexec/shsh-list index 1e97664..262c129 100755 --- a/libexec/shsh-list +++ b/libexec/shsh-list @@ -44,8 +44,6 @@ for package_path in "${SHSH_PACKAGES_PATH}"/*/*; do else extra_info="gh-release: unknown (missing jq)" fi - elif [ "$username" = "_archpkg" ]; then - extra_info="Arch-package: $package" else # is a plain package extra_info="plain package" diff --git a/libexec/shsh-uninstall b/libexec/shsh-uninstall index adf9c38..ec671c5 100755 --- a/libexec/shsh-uninstall +++ b/libexec/shsh-uninstall @@ -78,7 +78,6 @@ fi shsh-_unlink-man "$package" shsh-_unlink-bins "$package" shsh-_unlink-completions "$package" -shsh-_unlink-archpkg "$package" [ -n "$SHSH_HOOK_UNINSTALL" ] && execute_hooks "uninstall-hook" "$SHSH_PACKAGES_PATH/$package" "$SHSH_HOOK_UNINSTALL" rm -rf "${SHSH_PACKAGES_PATH:?}/$package"