From 4839af6e6537a789b72cf304797a78a9393e7e27 Mon Sep 17 00:00:00 2001 From: Abraham Murciano Date: Tue, 21 Dec 2021 13:47:10 +0000 Subject: [PATCH 1/8] create install script --- README.md | 18 ++++++------------ install.sh | 22 ++++++++++++++++++++++ 2 files changed, 28 insertions(+), 12 deletions(-) create mode 100644 install.sh diff --git a/README.md b/README.md index 9097810..92e218d 100644 --- a/README.md +++ b/README.md @@ -10,16 +10,10 @@ advcpmv-0.5-8.21.patch was the last patch released by the author (on February 14 ## Build instructions -The latest GNU Core Utilities source can be found here: https://ftp.gnu.org/gnu/coreutils/ +Run the following command which will download, patch, then compile coreutils, producing two files: `./advcpmv/advcp` and `./advcpmv/advmv`. ``` -wget http://ftp.gnu.org/gnu/coreutils/coreutils-9.0.tar.xz -tar xvJf coreutils-9.0.tar.xz -cd coreutils-9.0/ -wget https://raw.githubusercontent.com/jarun/advcpmv/master/advcpmv-0.9-9.0.patch -patch -p1 -i advcpmv-0.9-9.0.patch -./configure -make +bash -c "$(wget -O- https://raw.githubusercontent.com/jarun/advcpmv/master/install.sh)" ``` ## Usage @@ -29,8 +23,8 @@ make You can install the binaries and use `cpg -g` and `mvg -g` instead of cp and mv: ``` -sudo mv ./src/cp /usr/local/bin/cpg -sudo mv ./src/mv /usr/local/bin/mvg +sudo mv ./advcpmv/advcp /usr/local/bin/cpg +sudo mv ./advcpmv/advmv /usr/local/bin/mvg ``` Progress bar does not work with reflink (introduced v9.0 onwards). So reflink is disabled if using progress bar, left unchanged otherwise. @@ -40,8 +34,8 @@ Progress bar does not work with reflink (introduced v9.0 onwards). So reflink is You can install the binaries and create aliases for bash (or whatever you use) ``` -sudo mv ./src/cp /usr/local/bin/advcp -sudo mv ./src/mv /usr/local/bin/advmv +sudo mv ./advcpmv/advcp /usr/local/bin/ +sudo mv ./advcpmv/advmv /usr/local/bin/ echo alias cp '/usr/local/bin/advcp -g' >> ~/.bashrc echo alias mv '/usr/local/bin/advmv -g' >> ~/.bashrc ``` diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..77bba43 --- /dev/null +++ b/install.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +ADVCPMV_VERSION=${1:-0.9} +CORE_UTILS_VERSION=${2:-9.0} + +mkdir advcpmv +( + cd advcpmv + wget http://ftp.gnu.org/gnu/coreutils/coreutils-$CORE_UTILS_VERSION.tar.xz + tar xvJf coreutils-$CORE_UTILS_VERSION.tar.xz + rm coreutils-$CORE_UTILS_VERSION.tar.xz + ( + cd coreutils-$CORE_UTILS_VERSION/ + wget https://raw.githubusercontent.com/jarun/advcpmv/master/advcpmv-$ADVCPMV_VERSION-$CORE_UTILS_VERSION.patch + patch -p1 -i advcpmv-$ADVCPMV_VERSION-$CORE_UTILS_VERSION.patch + ./configure + make + cp ./src/cp ../advcp + cp ./src/mv ../advmv + ) + rm -rf coreutils-$CORE_UTILS_VERSION +) \ No newline at end of file From 17957ce329a2db413916a74bdc7a518d627b7a1c Mon Sep 17 00:00:00 2001 From: Abraham Murciano Date: Tue, 21 Dec 2021 14:15:48 +0000 Subject: [PATCH 2/8] simplified directories --- README.md | 3 ++- install.sh | 28 ++++++++++++---------------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 92e218d..3694f54 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,8 @@ advcpmv-0.5-8.21.patch was the last patch released by the author (on February 14 Run the following command which will download, patch, then compile coreutils, producing two files: `./advcpmv/advcp` and `./advcpmv/advmv`. ``` -bash -c "$(wget -O- https://raw.githubusercontent.com/jarun/advcpmv/master/install.sh)" +curl https://raw.githubusercontent.com/jarun/advcpmv/master/install.sh --create-dirs -o ./advcpmv/install.sh" +(cd advcpmv && bash install.sh) ``` ## Usage diff --git a/install.sh b/install.sh index 77bba43..5535f26 100644 --- a/install.sh +++ b/install.sh @@ -3,20 +3,16 @@ ADVCPMV_VERSION=${1:-0.9} CORE_UTILS_VERSION=${2:-9.0} -mkdir advcpmv +wget http://ftp.gnu.org/gnu/coreutils/coreutils-$CORE_UTILS_VERSION.tar.xz +tar xvJf coreutils-$CORE_UTILS_VERSION.tar.xz +rm coreutils-$CORE_UTILS_VERSION.tar.xz ( - cd advcpmv - wget http://ftp.gnu.org/gnu/coreutils/coreutils-$CORE_UTILS_VERSION.tar.xz - tar xvJf coreutils-$CORE_UTILS_VERSION.tar.xz - rm coreutils-$CORE_UTILS_VERSION.tar.xz - ( - cd coreutils-$CORE_UTILS_VERSION/ - wget https://raw.githubusercontent.com/jarun/advcpmv/master/advcpmv-$ADVCPMV_VERSION-$CORE_UTILS_VERSION.patch - patch -p1 -i advcpmv-$ADVCPMV_VERSION-$CORE_UTILS_VERSION.patch - ./configure - make - cp ./src/cp ../advcp - cp ./src/mv ../advmv - ) - rm -rf coreutils-$CORE_UTILS_VERSION -) \ No newline at end of file + cd coreutils-$CORE_UTILS_VERSION/ + wget https://raw.githubusercontent.com/jarun/advcpmv/master/advcpmv-$ADVCPMV_VERSION-$CORE_UTILS_VERSION.patch + patch -p1 -i advcpmv-$ADVCPMV_VERSION-$CORE_UTILS_VERSION.patch + ./configure + make + cp ./src/cp ../advcp + cp ./src/mv ../advmv +) +rm -rf coreutils-$CORE_UTILS_VERSION \ No newline at end of file From 4e9c8bc2b49726173ee3cd6781ffba3ec7811730 Mon Sep 17 00:00:00 2001 From: Abraham Murciano Date: Tue, 21 Dec 2021 14:30:54 +0000 Subject: [PATCH 3/8] documented installing other versions --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 3694f54..2fbdef8 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,12 @@ curl https://raw.githubusercontent.com/jarun/advcpmv/master/install.sh --create- (cd advcpmv && bash install.sh) ``` +To install an older version than the latest one, you can specify which version you want by passing it as an argument to the install script. For example, if you want to install `advcpmv-0.8-8.32.patch` you would modify the second command above like so. + +``` +(cd advcpmv && bash install.sh 0.8 8.32) +``` + ## Usage ### Change your behaviour From 4989cfaf781b56925a834938b9c81ab20c6ed0f2 Mon Sep 17 00:00:00 2001 From: Abraham Murciano Date: Tue, 21 Dec 2021 16:50:13 +0200 Subject: [PATCH 4/8] set -e on install script make the script exit if any command fails --- install.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 5535f26..ac093dc 100644 --- a/install.sh +++ b/install.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -e + ADVCPMV_VERSION=${1:-0.9} CORE_UTILS_VERSION=${2:-9.0} @@ -15,4 +17,4 @@ rm coreutils-$CORE_UTILS_VERSION.tar.xz cp ./src/cp ../advcp cp ./src/mv ../advmv ) -rm -rf coreutils-$CORE_UTILS_VERSION \ No newline at end of file +rm -rf coreutils-$CORE_UTILS_VERSION From ac2cac8d4e20c7363594f9e520d2c79376cb8da6 Mon Sep 17 00:00:00 2001 From: Abraham Murciano Date: Mon, 27 Dec 2021 11:09:08 +0200 Subject: [PATCH 5/8] removed bash dependancy --- README.md | 4 ++-- install.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2fbdef8..2a1e52e 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,13 @@ Run the following command which will download, patch, then compile coreutils, pr ``` curl https://raw.githubusercontent.com/jarun/advcpmv/master/install.sh --create-dirs -o ./advcpmv/install.sh" -(cd advcpmv && bash install.sh) +(cd advcpmv && sh install.sh) ``` To install an older version than the latest one, you can specify which version you want by passing it as an argument to the install script. For example, if you want to install `advcpmv-0.8-8.32.patch` you would modify the second command above like so. ``` -(cd advcpmv && bash install.sh 0.8 8.32) +(cd advcpmv && sh install.sh 0.8 8.32) ``` ## Usage diff --git a/install.sh b/install.sh index ac093dc..e4a7544 100644 --- a/install.sh +++ b/install.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh set -e From 72b2b581179cfe85ab57f0ecfdbbf0109b4a3e36 Mon Sep 17 00:00:00 2001 From: Abraham Murciano Date: Mon, 27 Dec 2021 11:12:02 +0200 Subject: [PATCH 6/8] simplified language --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2a1e52e..02a6b50 100644 --- a/README.md +++ b/README.md @@ -10,14 +10,14 @@ advcpmv-0.5-8.21.patch was the last patch released by the author (on February 14 ## Build instructions -Run the following command which will download, patch, then compile coreutils, producing two files: `./advcpmv/advcp` and `./advcpmv/advmv`. +Run the following command to download, patch, compile coreutils and generate the files: `./advcpmv/advcp` and `./advcpmv/advmv`. ``` curl https://raw.githubusercontent.com/jarun/advcpmv/master/install.sh --create-dirs -o ./advcpmv/install.sh" (cd advcpmv && sh install.sh) ``` -To install an older version than the latest one, you can specify which version you want by passing it as an argument to the install script. For example, if you want to install `advcpmv-0.8-8.32.patch` you would modify the second command above like so. +To install an older version than the latest one, you can specify the version by passing it as an argument to the install script. For example, if you want to install `advcpmv-0.8-8.32.patch` you would modify the second command above like so. ``` (cd advcpmv && sh install.sh 0.8 8.32) From a054d7d892a660995d5f40aa8812ad502bcd89b8 Mon Sep 17 00:00:00 2001 From: Abraham Murciano Date: Mon, 27 Dec 2021 11:22:56 +0200 Subject: [PATCH 7/8] made installation command one line --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 02a6b50..67bcb75 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,7 @@ advcpmv-0.5-8.21.patch was the last patch released by the author (on February 14 Run the following command to download, patch, compile coreutils and generate the files: `./advcpmv/advcp` and `./advcpmv/advmv`. ``` -curl https://raw.githubusercontent.com/jarun/advcpmv/master/install.sh --create-dirs -o ./advcpmv/install.sh" -(cd advcpmv && sh install.sh) +curl https://raw.githubusercontent.com/jarun/advcpmv/master/install.sh --create-dirs -o ./advcpmv/install.sh" && (cd advcpmv && sh install.sh) ``` To install an older version than the latest one, you can specify the version by passing it as an argument to the install script. For example, if you want to install `advcpmv-0.8-8.32.patch` you would modify the second command above like so. From 60daf2a13367d347ef6604aca304349b4236e73d Mon Sep 17 00:00:00 2001 From: Abraham Murciano Date: Mon, 27 Dec 2021 11:25:20 +0200 Subject: [PATCH 8/8] clarified how to choose version --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 67bcb75..81b30c8 100644 --- a/README.md +++ b/README.md @@ -16,10 +16,10 @@ Run the following command to download, patch, compile coreutils and generate the curl https://raw.githubusercontent.com/jarun/advcpmv/master/install.sh --create-dirs -o ./advcpmv/install.sh" && (cd advcpmv && sh install.sh) ``` -To install an older version than the latest one, you can specify the version by passing it as an argument to the install script. For example, if you want to install `advcpmv-0.8-8.32.patch` you would modify the second command above like so. +To install an older version than the latest one, you can specify the version by passing it as an argument to the install script (at the end of the command, before the closing parenthesis). For example, if you want to install `advcpmv-0.8-8.32.patch` you would modify the command above like so. ``` -(cd advcpmv && sh install.sh 0.8 8.32) +... && (cd advcpmv && sh install.sh 0.8 8.32) ``` ## Usage