forked from clearlinux/common
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.common.lts
90 lines (85 loc) · 3.01 KB
/
Makefile.common.lts
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#-*-makefile-*-
LTSUTILS = python $(TOPLVL)/projects/common/lts/main.py $(PKG_NAME)
#help lts-show: Display a summary of active LTS branches.
lts-show:
@$(LTSUTILS) sanity-check
@while read b; do \
if git show-ref $$b > /dev/null; then \
echo $$b $$(git log --oneline -1 $$b); \
else \
echo $$b Not found; \
fi; \
done < $(TOPLVL)/projects/common/lts/active-branches
#help lts-backport: Fast-forward the previous active branch to the current
#help branch.
lts-backport:
@$(LTSUTILS) sanity-check
@newer=$$(git symbolic-ref HEAD); \
newer=$${newer#refs/heads/}; \
if ! $(LTSUTILS) prev-branch --checkout; then \
echo Could not check out previous active branch.; \
exit 0; \
fi; \
if $(LTSUTILS) is-same-version $$newer; then \
$(LTSUTILS) fast-forward $$newer; \
else \
echo Most likely a patch needs to be manually re-applied for this version.; \
echo Alternatively, use \"git merge --ff-only $$newer\" to upgrade the package version.; \
fi
#help lts-build: Build RPM in Koji, or reuse existing build from older LTS
#help branch.
lts-build:
@$(LTSUTILS) sanity-check
@tag=$$(git tag --points-at); \
if [[ -z $$tag ]]; then \
echo This commit does not have a tag.; \
echo Proceeding to run \"make lts-koji\".; \
$(LTSUTILS) prompt || exit; \
$(MAKE) lts-koji; \
exit; \
fi; \
older=$$($(LTSUTILS) prev-branch); \
if [[ -z $$older ]]; then \
echo Could not determine previous active branch.; \
exit 1; \
fi; \
current=$$($(LTSUTILS) current-branch); \
if [[ $$(git rev-parse $$older) != $$(git rev-parse $$current) ]]; then \
echo Previous branch and current branch have different commits.; \
for b in $$older $$current; do echo $$b $$(git log --oneline -1 $$b); done; \
echo Proceeding to run \"make lts-koji\".; \
$(LTSUTILS) prompt || exit; \
$(MAKE) lts-koji; \
exit; \
fi; \
if $(LTSUTILS) can-reuse-binary $$older; then \
echo Reusing binary from $$older.; \
$(KOJI_CMD) tag-build $$current $(SRPMVERS); \
else \
echo Could not reuse binary from $$older.; \
echo Proceeding to run \"make bump lts-koji\".; \
$(LTSUTILS) prompt || exit; \
$(MAKE) bump lts-koji; \
fi
@$(LTSUTILS) next-branch --checkout
#help lts-koji: Same as "koji" but for working on LTS branches. Should not
#help be called directly, use lts-build instead.
lts-koji: prekoji-checks kojidef
@$(LTSUTILS) sanity-check
@$(MAKE) spdxcheck
@$(MAKE) checkblacklist
@current=$$($(LTSUTILS) current-branch); \
if ! grep $$current $(TOPLVL)/projects/common/lts/active-branches; then \
echo "Error: Must be on an active branch to submit to koji" >&2; \
exit 1; \
fi; \
if ! git diff --quiet HEAD ${SPECFILE}; then \
echo "Error: All changes to ${SPECFILE} must be committed first" >&2; \
exit 1; \
fi; \
if git rev-parse --verify --quiet origin/$$current > /dev/null; then \
git pull --rebase; \
fi
git tag $(SRPMVERS)-lts
git push origin $$($(LTSUTILS) current-branch) refs/tags/$(SRPMVERS)-lts
$(KOJI_CMD) build $$KOJI_NOWAIT $$($(LTSUTILS) current-branch) $(PKG_BASE_URL)/$(PKG_NAME)?#$(SRPMVERS)-lts