-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrelease
executable file
·60 lines (55 loc) · 2.18 KB
/
release
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
#!/bin/bash
if [ $# != 1 ]
then
echo "Usage: $0 <version>" >&2
exit 1
fi
VERSION="$1"
AUTHOR="Julien Bigot <[email protected]>"
DEB_DATE="$(date -R)"
RPM_DATE="$(LC_ALL=C date "+%a %b %d %Y")"
DEB_PKG_VERSION="$(echo "${VERSION}"|sed 's/-/~/g')"
RPM_PKG_VERSION="$(echo "${VERSION}"|sed 's/-/~/g')"
BCF_SRC_VERSION="{upstream_version}"
RPM_SRC_VERSION="%{version}"
if [ "x${VERSION}" != "x${DEB_PKG_VERSION}" ]
then
BCF_SRC_VERSION="${VERSION}"
RPM_SRC_VERSION="${VERSION}"
fi
if [[ ! ${VERSION} =~ ^[0-9].* ]]
then
DEB_PKG_VERSION="$(date '+%s')${VERSION}"
BCF_SRC_VERSION="${VERSION}"
fi
if [ "x${VERSION}" == "xmain" ]
then
AUTHOR="Pending release on main <[email protected]>"
sed "s/%changelog/%changelog\n\* ${RPM_DATE} - ${AUTHOR}\n- Upstream release main/" -i pdi*/*.spec
sed 1p -i pdi/debian/changelog pdiplugin*/debian/changelog
sed "1s/(.*$/(${DEB_PKG_VERSION}-1) unstable devel; urgency=medium\n\n * Upstream release ${VERSION}\n\n -- ${AUTHOR} ${DEB_DATE}\n/" -i pdi/debian/changelog pdiplugin*/debian/changelog
sed 's/path: "/path: "pdi-main./' build.conf
else
sed 's/path: "pdi-main\./path: "/' build.conf
fi
sed \
"s%https://github\.com/pdidev/pdi/archive/refs/heads/[^/]*\.tar\.[a-zA-Z0-9]*%https://github.com/pdidev/pdi/archive/refs/heads/${BCF_SRC_VERSION}.tar.gz%" \
-i build.conf
sed \
-e "s/Pending release on main <[email protected]> [A-Za-z]*, [0-9]* [A-Za-z]* [0-9]* [0-9]*:[0-9]*:[0-9]* +[0-9]*/${AUTHOR} ${DEB_DATE}/" \
-e "s/([0-9]*main-1)/(${DEB_PKG_VERSION}-1)/" \
-e "s/\* Upstream release main/* Upstream release ${VERSION}/" \
-i pdi/debian/changelog pdiplugin*/debian/changelog
sed \
-e "s#https://github\.com/pdidev/pdi/archive/refs/heads/[^/]*\.tar\.[a-zA-Z0-9]*#https://github.com/pdidev/pdi/archive/refs/heads/${RPM_SRC_VERSION}.tar.gz#" \
-e "s/[A-Za-z]* [A-Za-z]* [0-9]* [0-9]* - Pending release on main <[email protected]>/${RPM_DATE} - ${AUTHOR}/" \
-e "s/Version: .*/Version: ${RPM_PKG_VERSION}/" \
-e "s/- Upstream release main/- Upstream release ${VERSION}/" \
-e "s/=\s*main\b/= %{version}/" \
-i pdi*/*.spec
if [ "x${VERSION}" != "x${RPM_PKG_VERSION}" ]
then
sed \
-e "s/%autosetup.*/%autosetup -n pdi-${VERSION}/" \
-i pdi*/*.spec
fi