diff --git a/README.md b/README.md index 9097810..81b30c8 100644 --- a/README.md +++ b/README.md @@ -10,16 +10,16 @@ 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 to download, patch, compile coreutils and generate the 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 +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 (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) ``` ## Usage @@ -29,8 +29,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 +40,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..e4a7544 --- /dev/null +++ b/install.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +set -e + +ADVCPMV_VERSION=${1:-0.9} +CORE_UTILS_VERSION=${2:-9.0} + +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