Replace comments patch with an AWK script
authorSiraaj Khandkar <siraaj@khandkar.net>
Mon, 22 Mar 2021 12:29:27 +0000 (08:29 -0400)
committerSiraaj Khandkar <siraaj@khandkar.net>
Mon, 22 Mar 2021 12:31:09 +0000 (08:31 -0400)
which replaces uncommented file-A.$1 with file-B.$0 where file-A.$1 = file-B.$1

Makefile
TODO.md
patch-comments [new file with mode: 0755]
pkgs-void.list
pkgs-void.list.comments [new file with mode: 0644]
pkgs-void.list.comments.patch [deleted file]

index 4e7ab3c..cfec937 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -73,7 +73,7 @@ pkgs_void:
 
 pkgs_void_update:
        xbps-query -m | awk -F - '{sub("-" $$NF "$$", ""); print}' | sort -u > pkgs-void.list
-       patch pkgs-void.list pkgs-void.list.comments.patch
+       (echo '#'; ./patch-comments pkgs-void.list.comments pkgs-void.list) | sponge pkgs-void.list
 
 #
 # Golang
diff --git a/TODO.md b/TODO.md
index d1d2e32..ca0215e 100644 (file)
--- a/TODO.md
+++ b/TODO.md
@@ -1,3 +1,5 @@
+- [x] Replace comments patch with an AWK script which replaces uncommented
+  file-A.$1 with file-B.$0 where file-A.$1 = file-B.$1
 - [ ] Track components which have their own repos. How? Submodules? What else?
     - [ ] [khatus](https://github.com/khandkar/khatus)
     - [ ] [dwm](https://github.com/khandkar/dwm)
diff --git a/patch-comments b/patch-comments
new file mode 100755 (executable)
index 0000000..f7a5f6f
--- /dev/null
@@ -0,0 +1,13 @@
+#! /usr/bin/awk -f
+
+FILENAME ~ /\.comments$/ {
+    commented[$1] = $0
+    next
+}
+
+commented[$1] {
+    print commented[$1]
+    next
+}
+
+1
index b50b685..eafc950 100644 (file)
@@ -5,7 +5,7 @@ R
 Signal-Desktop
 alsa-plugins-pulseaudio
 apache-fop
-ario  # GUI (GTK) MPD client
+ario                    # GUI (GTK) MPD client
 aspell-en
 aspell-ru
 autoconf
@@ -31,7 +31,7 @@ dmenu
 docker
 docker-compose
 dunst
-element-desktop  # Matrix.org client, replaces Riot
+element-desktop         # Matrix.org client, replaces Riot
 encfs
 extra-cmake-modules
 feh
@@ -70,7 +70,7 @@ libtool
 lm_sensors
 lvm2
 lxdm
-mDNSResponder  # Bonjour
+mDNSResponder           # Bonjour
 make
 man-pages-devel
 mate
@@ -82,12 +82,12 @@ mpc
 mpd
 mpv
 mupdf
-nawk  # The one, true implementation of AWK
+nawk                    # The one, true implementation of AWK
 ncmpc
 ncmpcpp
 ncurses-devel
 neofetch
-net-tools  # ifconfig et al
+net-tools               # ifconfig et al
 netbsd-wtf
 network-manager-applet
 nmap
@@ -101,7 +101,7 @@ patch
 pcmanfm
 perl-List-MoreUtils-XS  # Dependency of feedgnuplot, which isn't in Void repos.
 pfetch
-picom  # Replaces compton.
+picom                   # Replaces compton.
 pidgin
 pkg-config
 python3-devel
@@ -132,7 +132,7 @@ tig
 tmux
 tree
 udisks2
-ueberzug  # For drawing images on terminals. Something built from src needed it.
+ueberzug                # For drawing images on terminals. Something built from src needed it.
 unixodbc-devel
 unzip
 vim
@@ -156,7 +156,7 @@ xprop
 xrandr
 xscreensaver
 xtools
-xwininfo  # Needed for picom-trans to work, but isn't a dep of picom.
+xwininfo                # Needed for picom-trans to work, but isn't a dep of picom.
 youtube-dl
 zathura
 zathura-djvu
diff --git a/pkgs-void.list.comments b/pkgs-void.list.comments
new file mode 100644 (file)
index 0000000..4c57a90
--- /dev/null
@@ -0,0 +1,9 @@
+ario                    # GUI (GTK) MPD client
+element-desktop         # Matrix.org client, replaces Riot
+mDNSResponder           # Bonjour
+nawk                    # The one, true implementation of AWK
+net-tools               # ifconfig et al
+perl-List-MoreUtils-XS  # Dependency of feedgnuplot, which isn't in Void repos.
+picom                   # Replaces compton.
+ueberzug                # For drawing images on terminals. Something built from src needed it.
+xwininfo                # Needed for picom-trans to work, but isn't a dep of picom.
diff --git a/pkgs-void.list.comments.patch b/pkgs-void.list.comments.patch
deleted file mode 100644 (file)
index 1c0adc8..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
---- pkgs-void.list     2021-03-14 09:27:42.795179658 -0400
-+++ pkgs-void.list     2021-03-14 09:22:20.202107907 -0400
-@@ -1,10 +1,11 @@
-+#
- GraphicsMagick
- MultiMC
- R
- Signal-Desktop
- alsa-plugins-pulseaudio
- apache-fop
--ario
-+ario  # GUI (GTK) MPD client
- aspell-en
- aspell-ru
- autoconf
-@@ -30,7 +31,7 @@
- docker
- docker-compose
- dunst
--element-desktop
-+element-desktop  # Matrix.org client, replaces Riot
- encfs
- extra-cmake-modules
- feh
-@@ -69,7 +70,7 @@
- lm_sensors
- lvm2
- lxdm
--mDNSResponder
-+mDNSResponder  # Bonjour
- make
- man-pages-devel
- mate
-@@ -81,12 +82,12 @@
- mpd
- mpv
- mupdf
--nawk
-+nawk  # The one, true implementation of AWK
- ncmpc
- ncmpcpp
- ncurses-devel
- neofetch
--net-tools
-+net-tools  # ifconfig et al
- netbsd-wtf
- network-manager-applet
- nmap
-@@ -98,9 +99,9 @@
- parallel
- patch
- pcmanfm
--perl-List-MoreUtils-XS
-+perl-List-MoreUtils-XS  # Dependency of feedgnuplot, which isn't in Void repos.
- pfetch
--picom
-+picom  # Replaces compton.
- pidgin
- pkg-config
- python3-devel
-@@ -131,7 +132,7 @@
- tmux
- tree
- udisks2
--ueberzug
-+ueberzug  # For drawing images on terminals. Something built from src needed it.
- unixodbc-devel
- unzip
- vim
-@@ -155,7 +156,7 @@
- xrandr
- xscreensaver
- xtools
--xwininfo
-+xwininfo  # Needed for picom-trans to work, but isn't a dep of picom.
- youtube-dl
- zathura
- zathura-djvu
This page took 0.039899 seconds and 4 git commands to generate.