Skip to content

Commit 46703ea

Browse files
authored
Merge pull request jarun#12 from abrahammurciano/master
create install script
2 parents 54f1b79 + 60daf2a commit 46703ea

File tree

2 files changed

+32
-12
lines changed

2 files changed

+32
-12
lines changed

README.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ advcpmv-0.5-8.21.patch was the last patch released by the author (on February 14
1010

1111
## Build instructions
1212

13-
The latest GNU Core Utilities source can be found here: https://ftp.gnu.org/gnu/coreutils/
13+
Run the following command to download, patch, compile coreutils and generate the files: `./advcpmv/advcp` and `./advcpmv/advmv`.
1414

1515
```
16-
wget http://ftp.gnu.org/gnu/coreutils/coreutils-9.0.tar.xz
17-
tar xvJf coreutils-9.0.tar.xz
18-
cd coreutils-9.0/
19-
wget https://raw.githubusercontent.com/jarun/advcpmv/master/advcpmv-0.9-9.0.patch
20-
patch -p1 -i advcpmv-0.9-9.0.patch
21-
./configure
22-
make
16+
curl https://raw.githubusercontent.com/jarun/advcpmv/master/install.sh --create-dirs -o ./advcpmv/install.sh" && (cd advcpmv && sh install.sh)
17+
```
18+
19+
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.
20+
21+
```
22+
... && (cd advcpmv && sh install.sh 0.8 8.32)
2323
```
2424

2525
## Usage
@@ -29,8 +29,8 @@ make
2929
You can install the binaries and use `cpg -g` and `mvg -g` instead of cp and mv:
3030

3131
```
32-
sudo mv ./src/cp /usr/local/bin/cpg
33-
sudo mv ./src/mv /usr/local/bin/mvg
32+
sudo mv ./advcpmv/advcp /usr/local/bin/cpg
33+
sudo mv ./advcpmv/advmv /usr/local/bin/mvg
3434
```
3535

3636
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
4040
You can install the binaries and create aliases for bash (or whatever you use)
4141

4242
```
43-
sudo mv ./src/cp /usr/local/bin/advcp
44-
sudo mv ./src/mv /usr/local/bin/advmv
43+
sudo mv ./advcpmv/advcp /usr/local/bin/
44+
sudo mv ./advcpmv/advmv /usr/local/bin/
4545
echo alias cp '/usr/local/bin/advcp -g' >> ~/.bashrc
4646
echo alias mv '/usr/local/bin/advmv -g' >> ~/.bashrc
4747
```

install.sh

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
ADVCPMV_VERSION=${1:-0.9}
6+
CORE_UTILS_VERSION=${2:-9.0}
7+
8+
wget http://ftp.gnu.org/gnu/coreutils/coreutils-$CORE_UTILS_VERSION.tar.xz
9+
tar xvJf coreutils-$CORE_UTILS_VERSION.tar.xz
10+
rm coreutils-$CORE_UTILS_VERSION.tar.xz
11+
(
12+
cd coreutils-$CORE_UTILS_VERSION/
13+
wget https://raw.githubusercontent.com/jarun/advcpmv/master/advcpmv-$ADVCPMV_VERSION-$CORE_UTILS_VERSION.patch
14+
patch -p1 -i advcpmv-$ADVCPMV_VERSION-$CORE_UTILS_VERSION.patch
15+
./configure
16+
make
17+
cp ./src/cp ../advcp
18+
cp ./src/mv ../advmv
19+
)
20+
rm -rf coreutils-$CORE_UTILS_VERSION

0 commit comments

Comments
 (0)