Skip to content

Commit

Permalink
Add option RUN_APT_GET_UPDATE_BEFORE
Browse files Browse the repository at this point in the history
  This changes can prevent running redundant `apt-get update`'s,
  that will save more time.
  • Loading branch information
bogdanvlviv committed Jan 4, 2017
1 parent f08466e commit 32a7e3a
Show file tree
Hide file tree
Showing 33 changed files with 113 additions and 52 deletions.
6 changes: 3 additions & 3 deletions Vagrantfile
Expand Up @@ -107,6 +107,9 @@ Vagrant.configure('2') do |config|

# ubuntu

# upgrade
config.vm.provision :shell, path: 'ubuntu/upgrade/make-upgrade_packages.sh', privileged: true

# bashrc
config.vm.provision :shell, path: 'ubuntu/bashrc/set-lc_all-variable.sh', privileged: false
config.vm.provision :shell, path: 'ubuntu/bashrc/set-term-variable.sh', privileged: false
Expand Down Expand Up @@ -206,9 +209,6 @@ Vagrant.configure('2') do |config|
# tree
config.vm.provision :shell, path: 'ubuntu/tree/install-tree.sh', privileged: true

# upgrade
config.vm.provision :shell, path: 'ubuntu/upgrade/make-upgrade_packages.sh', privileged: true

# vagrant
config.vm.provision :shell, path: 'ubuntu/vagrant/install-vagrant.sh', args: '1.8.5', privileged: true

Expand Down
6 changes: 3 additions & 3 deletions android-termux.sh
@@ -1,3 +1,6 @@
# upgrade
bash "android/termux/upgrade/make-upgrade_packages.sh"

# bashrc
bash "android/termux/bashrc/set-lc_all-variable.sh"
bash "android/termux/bashrc/set-term-variable.sh"
Expand Down Expand Up @@ -69,9 +72,6 @@ bash "android/termux/tmux/install-dottmux.sh"
# tree
bash "android/termux/tree/install-tree.sh"

# upgrade
bash "android/termux/upgrade/make-upgrade_packages.sh"

# vim
bash "android/termux/vim/install-vim.sh"
bash "android/termux/vim/install-dotvim.sh"
Expand Down
13 changes: 6 additions & 7 deletions android/README.md
Expand Up @@ -7,6 +7,12 @@ $ source android-termux.sh

#### How to configure `android-termux.sh` file

##### upgrade
To configure `android-termux.sh` file for upgrade packages need to set the row
```bash
bash "android/termux/upgrade/make-upgrade_packages.sh"
```

- [bashrc](#bashrc)
- [ctags](#ctags)
- [curl](#curl)
Expand All @@ -29,7 +35,6 @@ $ source android-termux.sh
- [the_silver_searcher](#the_silver_searcher)
- [tmux](#tmux)
- [tree](#tree)
- [upgrade](#upgrade)
- [vim](#vim)
- [xterm](#xterm)
- [zip](#zip)
Expand Down Expand Up @@ -195,12 +200,6 @@ To configure `android-termux.sh` file for installing `tree` need to set the row
bash "android/termux/tree/install-tree.sh"
```

##### upgrade
To configure `android-termux.sh` file for upgrade packages need to set the row
```bash
bash "android/termux/upgrade/make-upgrade_packages.sh"
```

##### vim
To configure `android-termux.sh` file for installing `vim` need to set the row
```bash
Expand Down
8 changes: 5 additions & 3 deletions ubuntu.sh
Expand Up @@ -2,6 +2,11 @@

UBUNTU_RELEASE_CODENAME="$(lsb_release -cs)"

export RUN_APT_GET_UPDATE_BEFORE="no"

# upgrade
sudo bash "ubuntu/upgrade/make-upgrade_packages.sh"

# bashrc
bash "ubuntu/bashrc/set-lc_all-variable.sh"
bash "ubuntu/bashrc/set-term-variable.sh"
Expand Down Expand Up @@ -102,9 +107,6 @@ bash "ubuntu/tmux/install-dottmux.sh"
# tree
sudo bash "ubuntu/tree/install-tree.sh"

# upgrade
sudo bash "ubuntu/upgrade/make-upgrade_packages.sh"

# vagrant
sudo bash "ubuntu/vagrant/install-vagrant.sh" 1.9.1

Expand Down
18 changes: 11 additions & 7 deletions ubuntu/README.md
Expand Up @@ -7,6 +7,17 @@ $ source ubuntu.sh

#### How to configure `ubuntu.sh` file

To configure `ubuntu.sh` don't run `apt-get update` before some scripts need to set the row
```bash
export RUN_APT_GET_UPDATE_BEFORE="no"
```

##### upgrade
To configure `ubuntu.sh` file for upgrade packages need to set the row
```bash
sudo bash "ubuntu/upgrade/make-upgrade_packages.sh"
```

- [bashrc](#bashrc)
- [curl](#curl)
- [exuberant-ctags](#exuberant-ctags)
Expand Down Expand Up @@ -34,7 +45,6 @@ $ source ubuntu.sh
- [the_silver_searcher](#the_silver_searcher)
- [tmux](#tmux)
- [tree](#tree)
- [upgrade](#upgrade)
- [vagrant](#vagrant)
- [vim](#vim)
- [xclip](#xclip)
Expand Down Expand Up @@ -293,12 +303,6 @@ To configure `ubuntu.sh` file for installing `tree` need to set the row
sudo bash "ubuntu/tree/install-tree.sh"
```

##### upgrade
To configure `ubuntu.sh` file for upgrade packages need to set the row
```bash
sudo bash "ubuntu/upgrade/make-upgrade_packages.sh"
```

##### vagrant
To configure `ubuntu.sh` file for installing `vagrant` need to set the row
```bash
Expand Down
4 changes: 3 additions & 1 deletion ubuntu/curl/install-curl.sh
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

apt-get update
if [[ "$RUN_APT_GET_UPDATE_BEFORE" != "no" ]]; then
apt-get update
fi

apt-get install -y curl
4 changes: 3 additions & 1 deletion ubuntu/exuberant-ctags/install-exuberant-ctags.sh
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

apt-get update
if [[ "$RUN_APT_GET_UPDATE_BEFORE" != "no" ]]; then
apt-get update
fi

apt-get install -y exuberant-ctags
4 changes: 3 additions & 1 deletion ubuntu/fzf/install-fzf.sh
@@ -1,6 +1,8 @@
#!/usr/bin/env bash

sudo apt-get update
if [[ "$RUN_APT_GET_UPDATE_BEFORE" != "no" ]]; then
apt-get update
fi

sudo apt-get install -y git

Expand Down
4 changes: 3 additions & 1 deletion ubuntu/git/install-git.sh
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

apt-get update
if [[ "$RUN_APT_GET_UPDATE_BEFORE" != "no" ]]; then
apt-get update
fi

apt-get install -y git
4 changes: 3 additions & 1 deletion ubuntu/graphviz/install-graphviz.sh
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

apt-get update
if [[ "$RUN_APT_GET_UPDATE_BEFORE" != "no" ]]; then
apt-get update
fi

apt-get install -y graphviz
4 changes: 3 additions & 1 deletion ubuntu/htop/install-htop.sh
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

apt-get update
if [[ "$RUN_APT_GET_UPDATE_BEFORE" != "no" ]]; then
apt-get update
fi

apt-get install -y htop
4 changes: 3 additions & 1 deletion ubuntu/imagemagick/install-imagemagick.sh
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

apt-get update
if [[ "$RUN_APT_GET_UPDATE_BEFORE" != "no" ]]; then
apt-get update
fi

apt-get install -y imagemagick
4 changes: 3 additions & 1 deletion ubuntu/letsencrypt/install-letsencrypt.sh
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

apt-get update
if [[ "$RUN_APT_GET_UPDATE_BEFORE" != "no" ]]; then
apt-get update
fi

apt-get install -y letsencrypt
4 changes: 3 additions & 1 deletion ubuntu/mc/install-mc.sh
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

apt-get update
if [[ "$RUN_APT_GET_UPDATE_BEFORE" != "no" ]]; then
apt-get update
fi

apt-get install -y mc
4 changes: 3 additions & 1 deletion ubuntu/mosh/install-mosh.sh
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

apt-get update
if [[ "$RUN_APT_GET_UPDATE_BEFORE" != "no" ]]; then
apt-get update
fi

apt-get install -y mosh
5 changes: 4 additions & 1 deletion ubuntu/mysql/install-mysql.sh
@@ -1,6 +1,9 @@
#!/usr/bin/env bash

apt-get update
if [[ "$RUN_APT_GET_UPDATE_BEFORE" != "no" ]]; then
apt-get update
fi

echo "mysql-server mysql-server/root_password password $1" | debconf-set-selections
echo "mysql-server mysql-server/root_password_again password $1" | debconf-set-selections

Expand Down
4 changes: 3 additions & 1 deletion ubuntu/nmap/install-nmap.sh
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

apt-get update
if [[ "$RUN_APT_GET_UPDATE_BEFORE" != "no" ]]; then
apt-get update
fi

apt-get install -y nmap
4 changes: 3 additions & 1 deletion ubuntu/nmcli/install-nmcli.sh
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

apt-get update
if [[ "$RUN_APT_GET_UPDATE_BEFORE" != "no" ]]; then
apt-get update
fi

apt-get install -y nmcli
4 changes: 3 additions & 1 deletion ubuntu/phantomjs/install-phantomjs.sh
@@ -1,6 +1,8 @@
#!/usr/bin/env bash

apt-get update
if [[ "$RUN_APT_GET_UPDATE_BEFORE" != "no" ]]; then
apt-get update
fi

apt-get install -y curl

Expand Down
4 changes: 3 additions & 1 deletion ubuntu/postgresql/install-postgresql.sh
@@ -1,6 +1,8 @@
#!/usr/bin/env bash

apt-get update
if [[ "$RUN_APT_GET_UPDATE_BEFORE" != "no" ]]; then
apt-get update
fi

apt-get install -y curl

Expand Down
5 changes: 3 additions & 2 deletions ubuntu/redis/install-redis.sh
@@ -1,7 +1,8 @@
#!/usr/bin/env bash


apt-get update
if [[ "$RUN_APT_GET_UPDATE_BEFORE" != "no" ]]; then
apt-get update
fi

apt-get install -y curl

Expand Down
4 changes: 3 additions & 1 deletion ubuntu/ruby/install-rvm.sh
@@ -1,6 +1,8 @@
#!/usr/bin/env bash

apt-get update
if [[ "$RUN_APT_GET_UPDATE_BEFORE" != "no" ]]; then
apt-get update
fi

apt-get install -y curl

Expand Down
4 changes: 3 additions & 1 deletion ubuntu/sqlite3/install-sqlite3.sh
@@ -1,6 +1,8 @@
#!/usr/bin/env bash

apt-get update
if [[ "$RUN_APT_GET_UPDATE_BEFORE" != "no" ]]; then
apt-get update
fi

apt-get install -y sqlite3

Expand Down
4 changes: 3 additions & 1 deletion ubuntu/ssh/install-openssh-client.sh
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

apt-get update
if [[ "$RUN_APT_GET_UPDATE_BEFORE" != "no" ]]; then
apt-get update
fi

apt-get install -y openssh-client
4 changes: 3 additions & 1 deletion ubuntu/ssh/install-openssh-server.sh
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

apt-get update
if [[ "$RUN_APT_GET_UPDATE_BEFORE" != "no" ]]; then
apt-get update
fi

apt-get install -y openssh-server
4 changes: 3 additions & 1 deletion ubuntu/the_silver_searcher/install-the_silver_searcher.sh
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

apt-get update
if [[ "$RUN_APT_GET_UPDATE_BEFORE" != "no" ]]; then
apt-get update
fi

apt-get install -y silversearcher-ag
4 changes: 3 additions & 1 deletion ubuntu/tmux/install-dottmux.sh
@@ -1,6 +1,8 @@
#!/usr/bin/env bash

sudo apt-get update
if [[ "$RUN_APT_GET_UPDATE_BEFORE" != "no" ]]; then
apt-get update
fi

sudo apt-get install -y git

Expand Down
4 changes: 3 additions & 1 deletion ubuntu/tree/install-tree.sh
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

apt-get update
if [[ "$RUN_APT_GET_UPDATE_BEFORE" != "no" ]]; then
apt-get update
fi

apt-get install -y tree
4 changes: 3 additions & 1 deletion ubuntu/vim/install-dotvim.sh
@@ -1,6 +1,8 @@
#!/usr/bin/env bash

sudo apt-get update
if [[ "$RUN_APT_GET_UPDATE_BEFORE" != "no" ]]; then
apt-get update
fi

sudo apt-get install -y git

Expand Down
4 changes: 3 additions & 1 deletion ubuntu/vim/install-vim.sh
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

apt-get update
if [[ "$RUN_APT_GET_UPDATE_BEFORE" != "no" ]]; then
apt-get update
fi

apt-get install -y vim
4 changes: 3 additions & 1 deletion ubuntu/xclip/install-xclip.sh
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

apt-get update
if [[ "$RUN_APT_GET_UPDATE_BEFORE" != "no" ]]; then
apt-get update
fi

apt-get install -y xclip
4 changes: 3 additions & 1 deletion ubuntu/xterm/install-dotX.sh
@@ -1,6 +1,8 @@
#!/usr/bin/env bash

sudo apt-get update
if [[ "$RUN_APT_GET_UPDATE_BEFORE" != "no" ]]; then
apt-get update
fi

sudo apt-get install -y git

Expand Down
4 changes: 3 additions & 1 deletion ubuntu/xterm/install-xterm.sh
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

apt-get update
if [[ "$RUN_APT_GET_UPDATE_BEFORE" != "no" ]]; then
apt-get update
fi

apt-get install -y xterm

0 comments on commit 32a7e3a

Please sign in to comment.