Skip to content

Commit

Permalink
Merge branch '3.x' into PT-2340_Support_MySQL_8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
svetasmirnova committed Oct 4, 2024
2 parents 287a1c0 + 0822deb commit ec677f4
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 27 deletions.
2 changes: 1 addition & 1 deletion config/deb/control
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Vcs-Browser: https://github.com/percona/percona-toolkit
Vcs-Git: git://github.com/percona/percona-toolkit.git

Package: percona-toolkit
Architecture: amd64
Architecture: @@ARCHITECTURE@@
Depends: ${perl:Depends}, libdbi-perl (>= 1.13), libdbd-mysql-perl | libdbd-mysql-5.1-perl, libterm-readkey-perl (>=2.10),
libio-socket-ssl-perl
Description: Advanced MySQL and system command-line tools
Expand Down
2 changes: 1 addition & 1 deletion config/rpm/percona-toolkit.spec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Vendor: Percona
URL: http://www.percona.com/software/percona-toolkit/
Source: percona-toolkit-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildArch: x86_64
BuildArch: @@ARCHITECTURE@@

BuildRequires: perl(ExtUtils::MakeMaker) make
Requires: perl(DBI) >= 1.13, perl(DBD::mysql) >= 1.0, perl(Time::HiRes), perl(IO::Socket::SSL), perl(Digest::MD5), perl(Term::ReadKey)
Expand Down
4 changes: 2 additions & 2 deletions config/scripts/pt_builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ build_srpm(){
cd ${WORKDIR}/rpmbuild/SPECS
echo '%undefine _missing_build_ids_terminate_build' | cat - percona-toolkit.spec > pt.spec && mv pt.spec percona-toolkit.spec
echo '%define debug_package %{nil}' | cat - percona-toolkit.spec > pt.spec && mv pt.spec percona-toolkit.spec
sed -i "s/@@ARHITECTURE@@/x86_64/" percona-toolkit.spec
sed -i "s/@@ARCHITECTURE@@/x86_64/" percona-toolkit.spec
cd ${WORKDIR}/${PRODUCT_FULL}
rm -rf bin/govendor
rm -rf bin/glide
Expand Down Expand Up @@ -417,7 +417,7 @@ build_source_deb(){
mv ${TARFILE} ${PRODUCT}_${VERSION}.orig.tar.gz
update_go
cd ${WORKDIR}/${BUILDDIR}
sed -i 's/@@ARHITECTURE@@/amd64/' debian/control
sed -i 's/@@ARCHITECTURE@@/amd64/' debian/control
cd debian
echo "${PRODUCT} (${VERSION}) unstable; urgency=low" > changelog
echo " * Initial Release." >> changelog
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ require (
github.com/stretchr/testify v1.9.0
github.com/xlab/treeprint v1.2.0
go.mongodb.org/mongo-driver v1.16.1
golang.org/x/crypto v0.26.0
golang.org/x/crypto v0.27.0
golang.org/x/exp v0.0.0-20230321023759-10a507213a29
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22
gopkg.in/yaml.v2 v2.4.0
Expand Down Expand Up @@ -61,9 +61,9 @@ require (
github.com/yusufpapurcu/wmi v1.2.2 // indirect
golang.org/x/net v0.26.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.23.0 // indirect
golang.org/x/term v0.23.0 // indirect
golang.org/x/text v0.17.0 // indirect
golang.org/x/sys v0.25.0 // indirect
golang.org/x/term v0.24.0 // indirect
golang.org/x/text v0.18.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apimachinery v0.31.0 // indirect
Expand Down
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw=
golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54=
golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A=
golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70=
golang.org/x/exp v0.0.0-20230321023759-10a507213a29 h1:ooxPy7fPvB4kwsA2h+iBNHkAbp/4JxTSwCmvdjEYmug=
golang.org/x/exp v0.0.0-20230321023759-10a507213a29/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
Expand Down Expand Up @@ -170,18 +170,18 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM=
golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU=
golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk=
golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM=
golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224=
golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
Expand Down
6 changes: 6 additions & 0 deletions src/go/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@ linux-amd64: ## Build Go tools for linux-amd64.
@$(foreach pkg,$(pkgs),rm -f ${BIN_DIR}/$(pkg) 2> /dev/null;)
@$(foreach pkg,$(pkgs),GOOS=linux GOARCH=amd64 go build -ldflags ${LDFLAGS} -o ${BIN_DIR}/$(pkg) ./$(pkg);)

linux-arm64: ## Build Go tools for linux-arm64.
@echo "Building linux/arm64 binaries in ${BIN_DIR} as version ${VERSION}"
@cd ${TOP_DIR} && go get ./...
@$(foreach pkg,$(pkgs),rm -f ${BIN_DIR}/$(pkg) 2> /dev/null;)
@$(foreach pkg,$(pkgs),GOOS=linux GOARCH=arm64 go build -ldflags ${LDFLAGS} -o ${BIN_DIR}/$(pkg) ./$(pkg);)

linux-386: ## Build Go tools for linux-386
@echo "Building linux/386 binaries in ${BIN_DIR} as version ${VERSION}"
@cd ${TOP_DIR} && go get ./...
Expand Down
21 changes: 10 additions & 11 deletions util/build-packages
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ update_manifest() {
echo -n "Updating MANIFEST... "
cd $BRANCH
echo -n > MANIFEST
for file in * bin/* docs/*.pod; do
for file in * bin/* docs/*.pod $(find src/go); do
if [ -f $file ]; then
echo $file >> MANIFEST
fi
Expand Down Expand Up @@ -343,12 +343,9 @@ prep_release_dir() {
elif [ -d $RELEASE_DIR/$PKG ]; then
rm -rf $RELEASE_DIR/$PKG
fi
(
cd $RELEASE_DIR
mkdir -p $PKG $PKG/bin $PKG/docs $PKG/lib
)
update_manifest
for file in `cat MANIFEST`; do
mkdir -p $RELEASE_DIR/$PKG/$(dirname $file)
cp $file $RELEASE_DIR/$PKG/$file
done
echo "OK"
Expand All @@ -364,6 +361,7 @@ build_tar() {
build_rpm() {
echo -n "Building $PKG-1.$ARCH.rpm... "
cd $RELEASE_DIR
sed -e "s/@@ARCHITECTURE@@/$ARCH/" $RPM_CONFIG_DIR/percona-toolkit.spec > $RELEASE_DIR/percona-toolkit.spec
if [ ! -f "$PKG.tar.gz" ]; then
die "Cannot build RPM because $PKG.tar.gz does not exist"
fi
Expand All @@ -373,7 +371,7 @@ build_rpm() {
cd rpm
local topdir=`pwd`
# Build RPM package from the tarball.
rpmbuild -bb --clean $RPM_CONFIG_DIR/percona-toolkit.spec \
rpmbuild -bb --clean $RELEASE_DIR/percona-toolkit.spec \
--quiet \
--define "_topdir $PWD" \
--define "_sourcedir $RELEASE_DIR" \
Expand Down Expand Up @@ -409,6 +407,7 @@ build_deb() {
rm -rf * $RELEASE_DIR/$PKG/debian
fi
cp $BRANCH/config/deb/* $RELEASE_DIR/$PKG/debian/
sed -e "s/@@ARCHITECTURE@@/$DEB_ARCH/" $DEB_CONFIG_DIR/control > $RELEASE_DIR/$PKG/debian/control

# Build Debian binary and source packages.
cd $RELEASE_DIR/$PKG
Expand Down Expand Up @@ -485,13 +484,16 @@ OS_ARCH=${3:-linux-amd64}
ONLY_UPDATE_VERSION=${ONLY_UPDATE_VERSION:-0}
ONLY_UPDATE_COPYRIGHT_YEAR=${ONLY_UPDATE_COPYRIGHT_YEAR:-0}

if [ $OS_ARCH != "linux-amd64" ] && [ $OS_ARCH != "linux-386" ] && [ $OS_ARCH != "darwin-amd64" ]; then
die "Valid OS-ARCH combinations are: linux-amd64, linux-386, darwin-amd64"
if [ $OS_ARCH != "linux-amd64" ] && [ $OS_ARCH != "linux-arm64" ] && [ $OS_ARCH != "linux-386" ] && [ $OS_ARCH != "darwin-amd64" ]; then
die "Valid OS-ARCH combinations are: linux-amd64, linux-arm64, linux-386, darwin-amd64"
fi

if [ $OS_ARCH == "linux-amd64" ]; then
ARCH="x86_64"
DEB_ARCH="amd64"
elif [ $OS_ARCH == "linux-arm64" ]; then
ARCH="aarch64"
DEB_ARCH="arm64"
elif [ $OS_ARCH == "linux-386" ]; then
ARCH="i386"
DEB_ARCH="i386"
Expand All @@ -500,9 +502,6 @@ else
DEB_ARCH="all"
fi

sed -i'.bak' -e "s/@@ARHITECTURE@@/$ARCH/" $RPM_CONFIG_DIR/percona-toolkit.spec
sed -i'.bak' -e "s/@@ARHITECTURE@@/$DEB_ARCH/" $DEB_CONFIG_DIR/control

if [ ! -f $REL_NOTES ]; then
die "$REL_NOTES does not exist"
fi
Expand Down

0 comments on commit ec677f4

Please sign in to comment.