Makefile: Serialize git commands using flock
We previously made directories depend on files for the synthetic serialization of git commands. git does not track directories, and time stamps across repos (starter-kit vs. bots) work rather poorly -- for example, this broke "bots" being a symlink to a previously existing checkout. Use file locking instead, which is a more direct way of ensuring that there is only one git operation that affects the current checkout. We don't need to flock bots/, as that's an independent git repository. Closes #371
This commit is contained in:
parent
661ca771b3
commit
6bd2f3ed94
1 changed files with 9 additions and 11 deletions
20
Makefile
20
Makefile
|
|
@ -153,21 +153,19 @@ bots:
|
||||||
# checkout Cockpit's test API; this has no API stability guarantee, so check out a stable tag
|
# checkout Cockpit's test API; this has no API stability guarantee, so check out a stable tag
|
||||||
# when you start a new project, use the latest release, and update it from time to time
|
# when you start a new project, use the latest release, and update it from time to time
|
||||||
test/common:
|
test/common:
|
||||||
git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 228
|
flock Makefile sh -ec '\
|
||||||
git checkout --force FETCH_HEAD -- test/common
|
git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 228; \
|
||||||
git reset test/common
|
git checkout --force FETCH_HEAD -- test/common; \
|
||||||
|
git reset test/common'
|
||||||
|
|
||||||
src/lib/patternfly/_fonts.scss:
|
src/lib/patternfly/_fonts.scss:
|
||||||
git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 227
|
flock Makefile sh -ec '\
|
||||||
mkdir -p pkg/lib/patternfly && git add pkg/lib/patternfly
|
git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 227; \
|
||||||
git checkout --force FETCH_HEAD -- pkg/lib/patternfly
|
mkdir -p pkg/lib/patternfly && git add pkg/lib/patternfly; \
|
||||||
git reset -- pkg/lib/patternfly
|
git checkout --force FETCH_HEAD -- pkg/lib/patternfly; \
|
||||||
|
git reset -- pkg/lib/patternfly'
|
||||||
mkdir -p src/lib && mv pkg/lib/patternfly src/lib/patternfly && rmdir -p pkg/lib
|
mkdir -p src/lib && mv pkg/lib/patternfly src/lib/patternfly && rmdir -p pkg/lib
|
||||||
|
|
||||||
# force serialization of the targets that call git, as they compete for the git lock
|
|
||||||
bots: test/common
|
|
||||||
test/common: src/lib/patternfly/_fonts.scss
|
|
||||||
|
|
||||||
$(NODE_MODULES_TEST): package.json
|
$(NODE_MODULES_TEST): package.json
|
||||||
# if it exists already, npm install won't update it; force that so that we always get up-to-date packages
|
# if it exists already, npm install won't update it; force that so that we always get up-to-date packages
|
||||||
rm -f package-lock.json
|
rm -f package-lock.json
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue