File: update_submodules

package info (click to toggle)
ruby-commonmarker 0.23.10-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,456 kB
  • sloc: ansic: 10,575; ruby: 1,741; sh: 36; makefile: 22
file content (29 lines) | stat: -rwxr-xr-x 796 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash

set -euo pipefail

if [ -z "$1" ]; then
  BRANCH="main"
else
  BRANCH=$1
fi

echo "Using $BRANCH..."

echo "Checking out cmark-upstream"
echo "---------------------"
cd ext/commonmarker/cmark-upstream
git fetch origin
# when checking out a tag, for whatever reason the git pull step fails
# so we comment it out for now:
# git checkout $BRANCH && git pull
git checkout $BRANCH
sha=`git rev-parse HEAD`
cd ../../..
make
cp ext/commonmarker/cmark-upstream/extensions/*.{c,h} ext/commonmarker
cp ext/commonmarker/cmark-upstream/src/*.{inc,c,h} ext/commonmarker
rm ext/commonmarker/main.c
git add ext/commonmarker/cmark-upstream
git add ext/commonmarker/
git commit -m "Update cmark-upstream to $(git config submodule.ext/commonmarker/cmark-upstream.url | sed s_.git\$__)/commit/${sha}"