Skip to content

Commit

Permalink
remove legacy archpkg operations
Browse files Browse the repository at this point in the history
Signed-off-by: Tin Lai <oscar@tinyiu.com>
  • Loading branch information
soraxas committed May 25, 2023
1 parent 4bff1b4 commit 928d96a
Show file tree
Hide file tree
Showing 25 changed files with 40 additions and 94 deletions.
1 change: 0 additions & 1 deletion completions/shsh.fish
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion libexec/shsh
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ for arg; do
;;
--version)
cat << EOF
shsh (shell script handler) v3.0.0
shsh (shell script handler) v3.0.1
Copyright (c) 2014 Juan Ibiapina, 2020 Tin Lai (@soraxas)
This is free software; see the source for copying conditions. There is NO
Expand Down
3 changes: 1 addition & 2 deletions libexec/shsh-_env-var
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand All @@ -47,4 +46,4 @@ 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"
export SHSH_JUNEST_BIN="$SHSH_JUNEST_ROOT/junest_bin"
23 changes: 0 additions & 23 deletions libexec/shsh-_utils
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
26 changes: 2 additions & 24 deletions libexec/shsh-install
Original file line number Diff line number Diff line change
Expand Up @@ -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 <package> as Arch package (or AUR)
# -f, --force force the installation even if the package exists
# --ssh use ssh protocal instead of https
#
Expand Down Expand Up @@ -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"
;;
Expand Down Expand Up @@ -146,10 +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"
Expand All @@ -158,15 +146,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=""
Expand Down Expand Up @@ -255,10 +241,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
Expand All @@ -284,11 +266,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"

Expand Down
2 changes: 0 additions & 2 deletions libexec/shsh-list
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion libexec/shsh-uninstall
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 2 additions & 2 deletions man/man1/shsh-cleanup.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands"
.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands"
.SH NAME
shsh \- manual page for shsh v3.0.0
shsh \- manual page for shsh v3.0.1
.SH SYNOPSIS
.B shsh
\fI\,cleanup \/\fR[\fI\,-d|--dry\/\fR]
Expand Down
4 changes: 2 additions & 2 deletions man/man1/shsh-commands.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands"
.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands"
.SH NAME
shsh \- manual page for shsh v3.0.0
shsh \- manual page for shsh v3.0.1
.SH SYNOPSIS
.B shsh
\fI\,commands\/\fR
Expand Down
4 changes: 2 additions & 2 deletions man/man1/shsh-completions.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands"
.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands"
.SH NAME
shsh \- manual page for shsh v3.0.0
shsh \- manual page for shsh v3.0.1
.SH SYNOPSIS
.B shsh
\fI\,completions <command>\/\fR
Expand Down
4 changes: 2 additions & 2 deletions man/man1/shsh-edit.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands"
.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands"
.SH NAME
shsh \- manual page for shsh v3.0.0
shsh \- manual page for shsh v3.0.1
.SH SYNOPSIS
.B shsh
\fI\,edit\/\fR
Expand Down
4 changes: 2 additions & 2 deletions man/man1/shsh-get.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands"
.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands"
.SH NAME
shsh \- manual page for shsh v3.0.0
shsh \- manual page for shsh v3.0.1
.SH SYNOPSIS
.B shsh
\fI\,get <package>\/\fR
Expand Down
4 changes: 2 additions & 2 deletions man/man1/shsh-help.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands"
.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands"
.SH NAME
shsh \- manual page for shsh v3.0.0
shsh \- manual page for shsh v3.0.1
.SH SYNOPSIS
.B shsh
\fI\,help \/\fR[\fI\,--usage\/\fR] \fI\,COMMAND\/\fR
Expand Down
4 changes: 2 additions & 2 deletions man/man1/shsh-init.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands"
.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands"
.SH NAME
shsh \- manual page for shsh v3.0.0
shsh \- manual page for shsh v3.0.1
.SH SYNOPSIS
.B eval
\fI\,"$(shsh init SHELL)"\/\fR
Expand Down
6 changes: 2 additions & 4 deletions man/man1/shsh-install.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands"
.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands"
.SH NAME
shsh \- manual page for shsh v3.0.0
shsh \- manual page for shsh v3.0.1
.SH SYNOPSIS
.B shsh
\fI\,install \/\fR[\fI\,site\/\fR]\fI\,/<package>\/\fR[\fI\,@ref\/\fR] [\fI\,<folder>/<folder>\/\fR]
Expand Down Expand Up @@ -42,8 +42,6 @@ flag implies \fB\-\-plain\fR
TODO: currently it is bias towards linux and amd64;
.IP
to\-be generalised towards detecting current arch.
.HP
\fB\-\-arch[pkg]\fR install the <package> as Arch package (or AUR)
.TP
\fB\-f\fR, \fB\-\-force\fR
force the installation even if the package exists
Expand Down
4 changes: 2 additions & 2 deletions man/man1/shsh-junest.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands"
.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands"
.SH NAME
shsh \- manual page for shsh v3.0.0
shsh \- manual page for shsh v3.0.1
.SH SYNOPSIS
.B shsh
\fI\,junest \/\fR[\fI\,-h|--help\/\fR] \fI\,<sub_command>\/\fR
Expand Down
4 changes: 2 additions & 2 deletions man/man1/shsh-link.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands"
.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands"
.SH NAME
shsh \- manual page for shsh v3.0.0
shsh \- manual page for shsh v3.0.1
.SH SYNOPSIS
.B shsh
\fI\,link \/\fR[\fI\,--no-deps\/\fR] \fI\,<directory> <package> \/\fR[\fI\,-h|--hook <hook>\/\fR] [\fI\,-v|--variable <VAR>=<VAL>\/\fR]
Expand Down
4 changes: 2 additions & 2 deletions man/man1/shsh-list.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands"
.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands"
.SH NAME
shsh \- manual page for shsh v3.0.0
shsh \- manual page for shsh v3.0.1
.SH SYNOPSIS
.B shsh
\fI\,list \/\fR[\fI\,-d|--details\/\fR]
Expand Down
4 changes: 2 additions & 2 deletions man/man1/shsh-outdated.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands"
.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands"
.SH NAME
shsh \- manual page for shsh v3.0.0
shsh \- manual page for shsh v3.0.1
.SH SYNOPSIS
.B shsh
\fI\,outdated \/\fR[\fI\,-q|--quiet\/\fR]
Expand Down
4 changes: 2 additions & 2 deletions man/man1/shsh-package-path.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands"
.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands"
.SH NAME
shsh \- manual page for shsh v3.0.0
shsh \- manual page for shsh v3.0.1
.SH SYNOPSIS
.B source
\fI\,"$(shsh package-path <package>)/file.sh"\/\fR
Expand Down
4 changes: 2 additions & 2 deletions man/man1/shsh-refresh.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands"
.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands"
.SH NAME
shsh \- manual page for shsh v3.0.0
shsh \- manual page for shsh v3.0.1
.SH SYNOPSIS
.B shsh
\fI\,refresh <package> \/\fR[\fI\,--verbose\/\fR] [\fI\,-a|--all\/\fR]
Expand Down
4 changes: 2 additions & 2 deletions man/man1/shsh-self-upgrade.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands"
.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands"
.SH NAME
shsh \- manual page for shsh v3.0.0
shsh \- manual page for shsh v3.0.1
.SH SYNOPSIS
.B shsh
\fI\,self-upgrade\/\fR
Expand Down
4 changes: 2 additions & 2 deletions man/man1/shsh-uninstall.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands"
.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands"
.SH NAME
shsh \- manual page for shsh v3.0.0
shsh \- manual page for shsh v3.0.1
.SH SYNOPSIS
.B shsh
\fI\,uninstall <package>\/\fR
Expand Down
4 changes: 2 additions & 2 deletions man/man1/shsh-upgrade.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands"
.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands"
.SH NAME
shsh \- manual page for shsh v3.0.0
shsh \- manual page for shsh v3.0.1
.SH SYNOPSIS
.B shsh
\fI\,upgrade <package> \/\fR[\fI\,-f|--force\/\fR]
Expand Down
6 changes: 2 additions & 4 deletions man/man1/shsh.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands"
.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands"
.SH NAME
shsh \- manual page for shsh v3.0.0
shsh \- manual page for shsh v3.0.1
.SH SYNOPSIS
.B shsh
\fI\,<command> \/\fR[\fI\,<command args>\/\fR] [\fI\,--verbose\/\fR] [\fI\,--help\/\fR]
Expand Down Expand Up @@ -175,8 +175,6 @@ flag implies \fB\-\-plain\fR
TODO: currently it is bias towards linux and amd64;
.IP
to\-be generalised towards detecting current arch.
.HP
\fB\-\-arch[pkg]\fR install the <package> as Arch package (or AUR)
.TP
\fB\-f\fR, \fB\-\-force\fR
force the installation even if the package exists
Expand Down

0 comments on commit 928d96a

Please sign in to comment.