Skip to content

Commit ff26f58

Browse files
dustymabejlebon
authored andcommitted
cmdlib: skip blank and comment lines when building fast-track repo
This is mostly cosmetic, but nice to have them formatted in a human readable way.
1 parent 677fe26 commit ff26f58

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/cmdlib.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ EOF
505505
cat "${tmp_overridesdir}"/*.repo > "${tmp_overridesdir}/all.repo"
506506
# shellcheck disable=SC2002
507507
cat "${configdir}/fast-tracks.yaml" | python3 -c "
508-
import sys, yaml, subprocess, glob
508+
import sys, yaml, subprocess, glob, re
509509
fast_tracks = yaml.safe_load(sys.stdin)
510510
for (repo, spec) in fast_tracks.items():
511511
with open(f'${tmp_overridesdir}/{repo}.repo', 'w') as f:
@@ -518,6 +518,9 @@ for (repo, spec) in fast_tracks.items():
518518
line = f'[{repo}]'
519519
# we're in the repo definition
520520
passthrough = True
521+
elif passthrough and re.match(r'^(\s*#.*)?$', line):
522+
# Skip blank lines and comment lines
523+
continue
521524
elif passthrough and line.startswith('name='):
522525
line = f'name={repo}'
523526
elif line.startswith('['):

0 commit comments

Comments
 (0)