summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCole Mickens <cole.mickens@gmail.com>2018-10-27 04:16:30 -0700
committerCole Mickens <cole.mickens@gmail.com>2018-10-27 04:17:29 -0700
commit2d94fe3f3f01a8c6bcf6f51629373aefeec41ead (patch)
tree7d77315d742c990916a232a7f60235eff63b59fe
parentf523a1ec8f9989b10f1d6ba7f130fa6e126de9a7 (diff)
nicer README.md
-rw-r--r--README.md18
-rwxr-xr-xupdate.sh30
2 files changed, 26 insertions, 22 deletions
diff --git a/README.md b/README.md
index 0667741..5341730 100644
--- a/README.md
+++ b/README.md
@@ -9,15 +9,15 @@ This is a `nixpkgs` overlay containing `HEAD` revisions of:
<!--pkgs-->
| Attribute Name | Last Upstream Commit Time |
| -------------- | ------------------------- |
-| nixpkgs | [2018-10-16T09:33:58Z](https://github.com/nixos/nixpkgs-channels/commits/45a419ab5a23c93421c18f3d9cde015ded22e712) |
-| wlroots | [2018-10-22T12:51:06Z](https://github.com/swaywm/wlroots/commits/c55d1542fe30ea7872a60a732fa88028cd4d4b06) |
-| sway-beta | [2018-10-27T09:23:57Z](https://github.com/swaywm/sway/commits/de250a523fb765531744d3a363693da9e9ac270b) |
-| slurp | [2018-10-24T19:37:45Z](https://github.com/emersion/slurp/commits/0dbd03991462397eb92bb40af712c837c898ebf1) |
-| grim | [2018-10-24T19:39:44Z](https://github.com/emersion/grim/commits/61df6f0a9531520c898718874c460826bc7e2b42) |
-| wlstream | [2018-07-15T21:10:14Z](https://github.com/atomnuker/wlstream/commits/182076a94562b128c3a97ecc53cc68905ea86838) |
-| waybar | [2018-10-27T09:23:43Z](https://github.com/Alexays/waybar/commits/ed3e4b13959874a168d62885d8ea1c7617db43b8) |
-| wayfire | [2018-10-27T08:31:50Z](https://github.com/WayfireWM/wayfire/commits/f2abe624c8f45d69ca51a7bf88933804589fb230) |
-| wf-config | [2018-10-22T07:05:46Z](https://github.com/WayfireWM/wf-config/commits/8f7046e6c67d4a277b0793b56ff6535f53997bc5) |
+| wlroots | [2018-20-27 03:20](https://github.com/swaywm/wlroots/commits/266b3df6781409facd679d680f7335e156446d17) |
+| sway-beta | [2018-23-27 02:23](https://github.com/swaywm/sway/commits/de250a523fb765531744d3a363693da9e9ac270b) |
+| slurp | [2018-37-24 12:37](https://github.com/emersion/slurp/commits/0dbd03991462397eb92bb40af712c837c898ebf1) |
+| grim | [2018-39-24 12:39](https://github.com/emersion/grim/commits/61df6f0a9531520c898718874c460826bc7e2b42) |
+| wlstream | [2018-10-15 14:10](https://github.com/atomnuker/wlstream/commits/182076a94562b128c3a97ecc53cc68905ea86838) |
+| waybar | [2018-23-27 02:23](https://github.com/Alexays/waybar/commits/ed3e4b13959874a168d62885d8ea1c7617db43b8) |
+| wayfire | [2018-31-27 01:31](https://github.com/WayfireWM/wayfire/commits/f2abe624c8f45d69ca51a7bf88933804589fb230) |
+| wf-config | [2018-05-22 00:05](https://github.com/WayfireWM/wf-config/commits/8f7046e6c67d4a277b0793b56ff6535f53997bc5) |
+| redshift-wayland | [2018-25-01 12:25](https://github.com/minus7/redshift/commits/a2177ed9942477868ccc514372f32a0fbcbe189e) |
<!--pkgs-->
Please open an issue if something is out of date.
diff --git a/update.sh b/update.sh
index ba94015..0542ef9 100755
--- a/update.sh
+++ b/update.sh
@@ -7,7 +7,7 @@ GHPASS="${GHPASS:-"$(cat /etc/nixos/secrets/github-token)"}"
# keep track of what we build and only upload at the end
builtattrs=()
-pkglist=""
+pkgentries=()
function update() {
attr="${1}"
@@ -18,8 +18,8 @@ function update() {
rev=""
commitdate=""
url="https://api.github.com/repos/${owner}/${repo}/commits?sha=${ref}"
- commit="$(curl --silent --fail "${url}")"
- #commit="$(curl -u "${GHUSER}:${GHPASS}" --silent --fail "${url}")"
+ #commit="$(curl --silent --fail "${url}")"
+ commit="$(curl -u "${GHUSER}:${GHPASS}" --silent --fail "${url}")"
rev="$(echo "${commit}" | jq -r ".[0].sha")"
commitdate="$(echo "${commit}" | jq -r ".[0].commit.committer.date")"
sha256="$(nix-prefetch-url --unpack "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz" 2>/dev/null)"
@@ -33,15 +33,14 @@ function update() {
readarray -t out <<< "$(echo "${results}")"
builtattrs=("${builtattrs[@]}" "${out[@]}")
- # update the README with the latest date/url
- d="$(date -Iseconds)"
+ d="$(date '+%Y-%M-%d %H:%M' --date="${commitdate}")"
m='(.*)'
- txt="| ${attr} | [${commitdate}](https://github.com/${owner}/${repo}/commits/${rev}) |"
- pkglist="$(printf "%s\n%s" "${pkglist}" "${txt}")" # bashism
+ txt="| ${attr} | [${d}](https://github.com/${owner}/${repo}/commits/${rev}) |"
+ pkgentries=("${pkgentries[@]}" "${txt}")
}
# attr_name repo_owner repo_name repo_rev
-update "nixpkgs" "nixos" "nixpkgs-channels" "nixos-unstable"
+#update "nixpkgs" "nixos" "nixpkgs-channels" "nixos-unstable"
update "wlroots" "swaywm" "wlroots" "master"
update "sway-beta" "swaywm" "sway" "master"
update "slurp" "emersion" "slurp" "master"
@@ -51,6 +50,7 @@ update "waybar" "Alexays" "waybar" "master"
update "wayfire" "WayfireWM" "wayfire" "master"
update "wf-config" "WayfireWM" "wf-config" "master"
update "redshift-wayland" "minus7" "redshift" "wayland"
+
#update "bspwc" "Bl4ckb0ne" "bspwc" "master"
#update "mahogany" "sdilts" "mahogany" "master"
#update "tablecloth" "topisani" "tablecloth" "master"
@@ -60,18 +60,22 @@ update "redshift-wayland" "minus7" "redshift" "wayland"
#update "waymonad" "waymonad" "waymonad" "master"
# update README.md
-replace="$(printf "| Attribute Name | Last Upstream Commit Time |\n")"
-replace="$(printf "%s| -------------- | ------------------------- |\n" "${replace}")"
-replace="$(printf "%s%s\n" "${replace}" "${pkglist}")"
+replace="$(printf "<!--pkgs-->")"
+replace="$(printf "%s\n| Attribute Name | Last Upstream Commit Time |" "${replace}")"
+replace="$(printf "%s\n| -------------- | ------------------------- |" "${replace}")"
+for p in "${pkgentries[@]}"; do
+ replace="$(printf "%s\n%s\n" "${replace}" "${p}")"
+done
+replace="$(printf "%s\n<!--pkgs-->" "${replace}")"
+
rg \
--multiline '(?s)(.*)<!--pkgs-->(.*)<!--pkgs-->(.*)' \
"README.md" \
- --replace "\$1<!--pkgs-->${replace}<!--pkgs-->\$3" \
+ --replace "\$1${replace}\$3" \
> README2.md
mv README2.md README.md
# optimisitically upload any "builtattrs" to our cache
-unset builtattrs[0]
copy="/etc/nixcfg/utils/azure/nix-copy-azure.sh"
[[ -f "${copy}" ]] \
&& printf "==> uploading" \