Refactor package install script
authorSiraaj Khandkar <siraaj@khandkar.net>
Sat, 31 Aug 2019 17:32:01 +0000 (13:32 -0400)
committerSiraaj Khandkar <siraaj@khandkar.net>
Sat, 31 Aug 2019 17:36:14 +0000 (13:36 -0400)
Makefile
install_pkgs.sh [deleted file]
list [new file with mode: 0755]
pkgs-install [moved from pkg-deb-install with 100% similarity]
pkgs-purge [moved from pkg-deb-purge with 100% similarity]

index 70a93f0..c029724 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -15,5 +15,5 @@ install_home:
        @cp       home/.tmux.conf   $(HOME)/
        @cp       home/.xbindkeysrc $(HOME)/
 
-install_pkgs: install_pkgs.sh pkg-deb-install
-       ./install_pkgs.sh
+install_pkgs: list pkgs-install
+       sudo apt install $(shell ./list pkgs-install)
diff --git a/install_pkgs.sh b/install_pkgs.sh
deleted file mode 100755 (executable)
index 573217f..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#! /bin/sh
-
-sudo apt install $(awk '! /^\#/ && ! /^$/ {pkgs[$1]++} END {for (p in pkgs) {printf "%s%s", sep, p; sep = " "}}' pkg-deb-install)
diff --git a/list b/list
new file mode 100755 (executable)
index 0000000..acfdde7
--- /dev/null
+++ b/list
@@ -0,0 +1,11 @@
+#! /usr/bin/awk -f
+
+! /^\#/ && ! /^$/ {
+    xs[$1]++
+}
+    
+END {
+    for (x in xs) {
+        printf("%s%s", sep, x, sep = " ")
+    }
+}
similarity index 100%
rename from pkg-deb-install
rename to pkgs-install
similarity index 100%
rename from pkg-deb-purge
rename to pkgs-purge
This page took 0.02358 seconds and 4 git commands to generate.