aboutsummaryrefslogtreecommitdiffhomepage
path: root/mini-debian8/prepare-pkg-list.sh
diff options
context:
space:
mode:
authorWilliam Yeh <william.pjyeh@gmail.com>2016-06-02 16:07:46 +0800
committerWilliam Yeh <william.pjyeh@gmail.com>2016-06-02 16:07:46 +0800
commit042ddec8383b0755e60bb01dc93ae3378374b637 (patch)
tree2bf2051dbe6a8143a981528297b6a462c4a2cb37 /mini-debian8/prepare-pkg-list.sh
parentf966242805e67f91bffdc5f9eb02096bb5e1f856 (diff)
downloaddocker-ansible-042ddec8383b0755e60bb01dc93ae3378374b637.tar.gz
docker-ansible-042ddec8383b0755e60bb01dc93ae3378374b637.tar.zst
docker-ansible-042ddec8383b0755e60bb01dc93ae3378374b637.zip
Add: `mini-debian8` tag.
Diffstat (limited to 'mini-debian8/prepare-pkg-list.sh')
-rwxr-xr-xmini-debian8/prepare-pkg-list.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/mini-debian8/prepare-pkg-list.sh b/mini-debian8/prepare-pkg-list.sh
new file mode 100755
index 0000000..ce2195d
--- /dev/null
+++ b/mini-debian8/prepare-pkg-list.sh
@@ -0,0 +1,37 @@
1#!/bin/sh
2#
3# Prepare the list of packages to be installed/uninstalled.
4#
5# ENVIRONMENT VARIABLES:
6#
7# - APT_LIST: APT package list; default = "apt-list"
8#
9
10echo "===> Preparing APT package list..."
11
12if [ -z "$APT_LIST" ]; then
13 APT_LIST=apt-list
14fi
15
16if [ -f "$APT_LIST" ]; then
17
18 awk '/^#/ {next} \
19 { split($0,arrayA); \
20 for (i in arrayA) { \
21 if (arrayA[i] == "!") { continue; } \
22 print arrayA[i] \
23 } \
24 }' \
25 $APT_LIST > ___APT_INSTALL_LIST
26
27 awk '/^(#|!)/ {next} \
28 { split($0,arrayA); for (i in arrayA) print arrayA[i] }' \
29 $APT_LIST |
30 awk '{ L[n++] = $0 } \
31 END { while(n--) \
32 print L[n] }' \
33 > ___APT_UNINSTALL_LIST
34
35fi
36#cat ___APT_INSTALL_LIST
37#cat ___APT_UNINSTALL_LIST