gitoria

jukebox

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Branchday418ed6da45|||PR README: media-player pin df9e7dfmreday41/tools/sync-components.sh

2.9 KB

  1. #!/usr/bin/env bash
  2. # tools/sync-components.sh — copy the components.hybriel.worldapi.org blocks jukebox uses, BYTE-VERBATIM from a commit
  3. # (mission JB2; the model is layouts.worldapi.org's tools/sync-components.sh).
  4. # tools/sync-components.sh [46fefaa] copy pinned icons and the player (df9e7df); virtual list e5b98ec
  5. # tools/sync-components.sh --check compare the copies with the commit in components/SOURCE (exit 1 on any difference)
  6. # Source repo: $COMPONENTS_REPO (default loreana /media/STORAGE/projects/WorldAPI/components.hybriel.worldapi.org). The files come out of
  7. # git (`git show <commit>:<path>`), not the working tree, so uncommitted edits there never land here. Never edit the copies:
  8. # change them in components.hybriel, commit there, run this, then the gates (README "Files").
  9. set -euo pipefail
  10. APP="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
  11. SRC="${COMPONENTS_REPO:-/media/STORAGE/projects/WorldAPI/components.hybriel.worldapi.org}"
  12. # what is copied: the media player, the virtual list and the icons: each block own file + README (no demo.hl).
  13. FILES=(
  14. media-player/media-player.hl media-player/README.md
  15. virtual-list/virtual-list.hl virtual-list/README.md
  16. icons/icons.hl icons/README.md
  17. )
  18. # a git worktree has a .git FILE, a clone a .git directory: either is a repo
  19. [ -e "$SRC/.git" ] || { echo "no git repo at $SRC (set COMPONENTS_REPO)"; exit 2; }
  20. if [ "${1:-}" = "--check" ]; then
  21. REF="$(head -n1 "$APP/components/SOURCE" | cut -d' ' -f1)"
  22. bad=0
  23. for f in "${FILES[@]}"; do
  24. repo="$SRC"
  25. ref="$REF"
  26. case "$f" in
  27. icons/*) ref="46fefaa" ;;
  28. media-player/*) ref="df9e7df" ;;
  29. virtual-list/*) ref="e5b98ec" ;;
  30. esac
  31. if ! git -C "$repo" show "$ref:components/$f" | cmp -s - "$APP/components/$f"; then echo "DIFFERS: components/$f (vs $ref)"; bad=1; fi
  32. done
  33. [ $bad = 0 ] && echo "verbatim: icons 46fefaa; virtual-list e5b98ec; media-player df9e7df (${#FILES[@]} files)"
  34. exit $bad
  35. fi
  36. REF="$(git -C "$SRC" rev-parse --short "${1:-46fefaa}^{commit}")"
  37. [ "$REF" = "46fefaa" ] || { echo "icons are pinned to 46fefaa; update the provenance check before changing the pin"; exit 2; }
  38. for f in icons/icons.hl icons/README.md; do
  39. mkdir -p "$APP/components/$(dirname "$f")"
  40. git -C "$SRC" show "$REF:components/$f" > "$APP/components/$f"
  41. done
  42. printf 'e5b98ec virtual-list from components.hybriel\n46fefaa icons from components.hybriel\ndf9e7df media-player from components.hybriel (repeat-one fix, day41)\n' > "$APP/components/SOURCE"
  43. for f in media-player/media-player.hl media-player/README.md; do
  44. mkdir -p "$APP/components/$(dirname "$f")"
  45. git -C "$SRC" show "df9e7df:components/$f" > "$APP/components/$f"
  46. done
  47. for f in virtual-list/virtual-list.hl virtual-list/README.md; do
  48. mkdir -p "$APP/components/$(dirname "$f")"
  49. git -C "$SRC" show "e5b98ec:components/$f" > "$APP/components/$f"
  50. done
  51. echo "copied 2 icon files from components.hybriel $REF, 2 media-player files from df9e7df and 2 virtual-list files from e5b98ec"
  52. "$0" --check

Branches

Latest commits

  • 8ed6da45|||PR README: media-player pin df9e7dfmre
  • d5d45fc3|||PR media-player df9e7df (repeat-one fix), sync pin and SOURCEmre
  • 89cdabb1Vendor Hybriel day41 (57054d9e): plugin dirs, set .somre
  • 1fecd6a7Merge branch 'records-day39' into mainJukebox
  • d6b3e068|||PR Records: day39 live (PR #2), mission 011 PR step, statusmre
  • 5fa19e89Merge branch 'day39' into mainJukebox
  • cfe95440|||PR day39 re-vendor: Hybriel 51e921d7 (bin 6b481aa7), ids kebab-case since hybriel#256: quoted state rule and tests use jb-shuffle / jb-repeatmre
  • f3614c9bRe-vendor to Hybriel day39 (51e921d7, bin 6b481aa7)mre
  • 9f5c6532Merge branch 'status-22-pr' into mainJukebox
  • 5838d6c7|||PR STATUS: #22 pending decision, PR-only rulemre
  • 29d2029cRecords: PR-only rule (Kunibert)mre
  • adacb0abRecords: neutral ticket rule, #22 decision recordedmre
  • b2d6f121Records: #308 hold liftedmre
  • 7ab67533Records: day39 on hold (hybriel#308)mre
  • 22f21739Records: note rebase before mergemre
  • f7368ea3Records: mission 011 day39, waits for lisbethmre
  • 9515d2cdRecords: jb20 livemre
  • 019f6601ui gate: comment names the open bug components#27 (workaround, not fixed)mre
  • 277a2722README: provenance linemre
  • 4169ca6aREADME: sync pinmre