Merge pull request #12 from abrahammurciano/master

create install script
This commit is contained in:
Arun
2022-02-10 23:42:46 +05:30
committed by GitHub
2 changed files with 32 additions and 12 deletions

View File

@@ -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
```

20
install.sh Normal file
View File

@@ -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