diff options
author | TurtleRuss | 2023-12-15 23:30:03 +0800 |
---|---|---|
committer | TurtleRuss | 2023-12-15 23:30:03 +0800 |
commit | 74cc8125014636735949fba9d86e29bf62cba5cb (patch) | |
tree | e573ff6e05b28553879cd6a387815717411c2a7f | |
parent | 9fe5289b6d912d49d894d3c271c52feddd7b8ac5 (diff) | |
download | aur-74cc8125014636735949fba9d86e29bf62cba5cb.tar.gz |
patch:core/install
-rw-r--r-- | PKGBUILD | 48 | ||||
-rw-r--r-- | hustmirror-cli-1.0.1.patch | 69 | ||||
-rw-r--r-- | hustmirror-cli-1.0.1.tar.gz | bin | 0 -> 138077 bytes |
3 files changed, 97 insertions, 20 deletions
@@ -1,34 +1,42 @@ -# Maintainer: TurtleRuss <tttturtleruss@gmail.com> -pkgname=hustmirror-cli # '-bzr', '-git', '-hg' or '-svn' +# Maintainer:TurtleRuss <tttturtleruss@gmail.com> +pkgname=hustmirror-cli pkgver=1.0.1 pkgrel=1 +epoch= pkgdesc="The command line tool (hustmirror-cli) is a small tool that can help you quickly change sources to HUST mirror sources." -arch=("x86_64") -url="https://gitee.com/hustmirror/hustmirror-cli.git" +arch=('x86_64') +url="" license=('GPL') -depends=('python3') -makedepends=('git' 'make' 'docker') # 'bzr', 'git', 'mercurial' or 'subversion' -provides=("${pkgname%}") -conflicts=("${pkgname%}") -source=('git+https://gitee.com/hustmirror/hustmirror-cli.git') -md5sums=('SKIP') +groups=() +depends=() +makedepends=('make') +checkdepends=() +optdepends=() +provides=() +conflicts=() +replaces=() +backup=() +options=() +install= +changelog= +source=("$pkgname-$pkgver.tar.gz" + "$pkgname-$pkgver.patch") +noextract=() +sha256sums=('4dae90345d776c880fc1fb95013503337d9991c32e0222a530ab6ae3f991df5c' + '89db2182d83d6169514e7d45a4bb0dc5d0d85a2882ecabe89302b33aa1a6b16e') +validpgpkeys=() prepare() { - mkdir -p "$srcdir/${pkgname%-git}" - cd "$srcdir/${pkgname%-git}" + cd "$pkgname-$pkgver" + patch -p1 -i "$srcdir/$pkgname-$pkgver.patch" } build() { - cd "$srcdir/${pkgname%-git}" + cd "$pkgname-$pkgver" make } -check() { - cd "$srcdir/${pkgname%-git}" - make -f Makefile.arch test -} - package() { - cd "$srcdir/${pkgname%-git}" - sudo cp ./output/hustmirror-cli "/usr/bin/hustmirror-cli" + cd "$pkgname-$pkgver" + sudo make install } diff --git a/hustmirror-cli-1.0.1.patch b/hustmirror-cli-1.0.1.patch new file mode 100644 index 000000000000..a7da2a30140f --- /dev/null +++ b/hustmirror-cli-1.0.1.patch @@ -0,0 +1,69 @@ +From 94b8d7bfa706274269c5f940c0ec6d54071ac40f Mon Sep 17 00:00:00 2001 +From: TurtleRuss <tttturtleruss@gmail.com> +Date: Fri, 15 Dec 2023 23:05:56 +0800 +Subject: [PATCH] modify:core.sh + +--- + Makefile | 5 +++++ + src/core.sh | 25 +------------------------ + 2 files changed, 6 insertions(+), 24 deletions(-) + +diff --git a/Makefile b/Makefile +index fe7b8fb..1f6b4b6 100644 +--- a/Makefile ++++ b/Makefile +@@ -11,10 +11,15 @@ OUT_DIR := output + OUT_FILE := $(OUT_DIR)/hustmirror-cli + OUT_MIRROR_DIR := $(OUT_DIR)/mirrors + OUT_MIRROR_FILES := $(patsubst $(MIRROR_DIR)/%,$(OUT_MIRROR_DIR)/%,$(MIRROR_FILES)) ++INSTALL_DIR := /usr/local/bin/ + + all: $(OUT_FILE) + @echo "Done, object script is $(OUT_FILE)." + ++install: $(OUT_FILE) ++ @cp $(OUT_FILE) $(INSTALL_DIR) ++ @echo "Install in $(INSTALL_DIR)" ++ + test: $(OUT_FILE) + @tests/test.sh + +diff --git a/src/core.sh b/src/core.sh +index 91a0796..950c33d 100644 +--- a/src/core.sh ++++ b/src/core.sh +@@ -121,30 +121,7 @@ set_mirror_recover_list() { + + # install hust-mirror + install() { +- install_path="/usr/local/bin" +- if ! is_root; then +- print_warning "Install hust-mirror to /usr/local/bin need root permission." +- fi +- install_target="$install_path/hustmirror-cli" +- set_sudo +- if [ ! -d "$install_path" ]; then +- print_status "Creating directory: $install_path" +- $sudo mkdir -p "$install_path" +- fi +- has_command curl || { +- print_error "curl is required." +- exit 1 +- } +- print_status "Downloading latest hust-mirror..." +- $sudo curl -sSfL "${http}://${domain}/get" -o "$install_target" || { +- print_error "Failed to download hustmirror-cli." +- exit 1 +- } +- $sudo chmod +x "$install_target" +- print_success "Successfully install hustmirror-cli." +- $sudo ln -sf $install_target "$install_path/hustmirror" # make link for legacy name +- has_command hustmirror-cli || print_warning "It seems /usr/local/bin is not in your path, try to add it to your PATH in ~/.bashrc or ~/.zshrc." +- print_success "Now, you can use \`hustmirror-cli\` in your command line" ++ print_error "Using yay(or other aur helper) to update !" + } + + # $1 software to recover +-- +2.43.0 + diff --git a/hustmirror-cli-1.0.1.tar.gz b/hustmirror-cli-1.0.1.tar.gz Binary files differnew file mode 100644 index 000000000000..c45e16396ecb --- /dev/null +++ b/hustmirror-cli-1.0.1.tar.gz |