Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing generate_source_tarball.sh for influxdb and influx-cli to match other scripts #12142

Open
wants to merge 6 commits into
base: 3.0-dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 21 additions & 10 deletions SPECS/influx-cli/generate_source_tarball.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ OUT_FOLDER="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# parameters:
#
# --srcTarball : src tarball file
# this file contains the 'initial' source code of the component
# and should be replaced with the new/modified src code
# --outFolder : folder where to copy the new tarball(s)
# --pkgVersion : package version
# --srcTarball : src tarball file
# this file contains the 'initial' source code of the component
# and should be replaced with the new/modified src code
# --outFolder : folder where to copy the new tarball(s)
# --pkgVersion : package version
# --vendorVersion : vendor version
#
PARAMS=""
while (( "$#" )); do
Expand Down Expand Up @@ -46,6 +47,15 @@ while (( "$#" )); do
echo "Error: Argument for $1 is missing" >&2
exit 1
fi
;;
--vendorVersion)
if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
VENDOR_VERSION=$2
shift 2
else
echo "Error: Argument for $1 is missing" >&2
exit 1
fi
;;
-*|--*=) # unsupported flags
echo "Error: Unsupported flag $1" >&2
Expand All @@ -58,9 +68,10 @@ while (( "$#" )); do
esac
done

echo "--srcTarball -> $SRC_TARBALL"
echo "--outFolder -> $OUT_FOLDER"
echo "--pkgVersion -> $PKG_VERSION"
echo "--srcTarball -> $SRC_TARBALL"
echo "--outFolder -> $OUT_FOLDER"
echo "--pkgVersion -> $PKG_VERSION"
echo "--vendorVersion -> $VENDOR_VERSION"

if [ -z "$PKG_VERSION" ]; then
echo "--pkgVersion parameter cannot be empty"
Expand All @@ -83,7 +94,7 @@ pushd $tmpdir > /dev/null

PKG_NAME="influx-cli"
NAME_VER="$PKG_NAME-$PKG_VERSION"
VENDOR_TARBALL="$OUT_FOLDER/$NAME_VER-vendor.tar.gz"
VENDOR_TARBALL="$OUT_FOLDER/$NAME_VER-govendor-v$VENDOR_VERSION.tar.gz"

echo "Unpacking source tarball..."
tar -xf $SRC_TARBALL
Expand All @@ -102,4 +113,4 @@ tar --sort=name \
-cf "$VENDOR_TARBALL" vendor

popd > /dev/null
echo "$PKG_NAME vendored modules are available at $VENDOR_TARBALL and static assets in $STATIC_ASSETS_TARBALL"
echo "$PKG_NAME vendored modules are available at $VENDOR_TARBALL"
2 changes: 1 addition & 1 deletion SPECS/influx-cli/influx-cli.signatures.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Signatures": {
"influx-cli-2.7.3.tar.gz": "1be63bfdf39ee5e038c464b97994967183e9c6db05a3829172f0045b84e2b247",
"influx-cli-2.7.3-vendor.tar.gz": "8548981c0df5d6330c612ec9fd2aeaa8203aa2e86868087f9b9410dc1758d56b"
"influx-cli-2.7.3-govendor-v1.tar.gz": "8548981c0df5d6330c612ec9fd2aeaa8203aa2e86868087f9b9410dc1758d56b"
}
}
23 changes: 6 additions & 17 deletions SPECS/influx-cli/influx-cli.spec
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,14 @@
Summary: CLI for managing resources in InfluxDB
Name: influx-cli
Version: 2.7.3
Release: 2%{?dist}
Release: 3%{?dist}
License: MIT
Vendor: Microsoft Corporation
Distribution: Azure Linux
Group: Productivity/Databases/Servers
URL: https://github.com/influxdata/influx-cli
Source0: %{url}/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
# Below is a manually created tarball, no download link.
# We're using pre-populated Go modules from this tarball, since network is disabled during build time.
# Use generate_source_tarbbal.sh to get this generated from a source code file.
# How to re-build this file:
# 1. wget https://github.com/influxdata/influx-cli/archive/refs/tags/v%%{version}.tar.gz -O %%{name}-%%{version}.tar.gz
# 2. tar -xf %%{name}-%%{version}.tar.gz
# 3. cd %%{name}-%%{version}
# 4. go mod vendor
# 5. tar --sort=name \
# --mtime="2021-04-26 00:00Z" \
# --owner=0 --group=0 --numeric-owner \
# --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime \
# -cf %%{name}-%%{version}-vendor.tar.gz vendor
#
Source1: %{name}-%{version}-vendor.tar.gz
Source1: %{name}-%{version}-govendor-v1.tar.gz
BuildRequires: golang
BuildRequires: systemd-rpm-macros

Expand Down Expand Up @@ -81,6 +67,9 @@ bin/influx completion zsh > %{buildroot}/%{_datadir}/zsh/site-functions/_influx
%{_datadir}/zsh

%changelog
* Wed Jan 29 2025 Mykhailo Bykhovtsev <[email protected]> - 2.7.3-3
- Change vendor naming convention to match other go packages.

* Thu Mar 07 2024 Andrew Phelps <[email protected]> - 2.7.3-2
- Remove restriction on golang BR version

Expand All @@ -102,7 +91,7 @@ bin/influx completion zsh > %{buildroot}/%{_datadir}/zsh/site-functions/_influx
* Thu Jun 15 2023 CBL-Mariner Servicing Account <[email protected]> - 2.6.1-9
- Bump release to rebuild with go 1.19.10

* Thu May 25 2023 Mykhailo Bykhovtsev <mbykhovtsev@microsft.com> - 2.6.1-8
* Thu May 25 2023 Mykhailo Bykhovtsev <mbykhovtsev@microsoft.com> - 2.6.1-8
- Removed bash-completion subpackage since the script produced is included in original bash-completion.

* Wed Apr 05 2023 CBL-Mariner Servicing Account <[email protected]> - 2.6.1-7
Expand Down
31 changes: 21 additions & 10 deletions SPECS/influxdb/generate_source_tarball.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ OUT_FOLDER="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# parameters:
#
# --srcTarball : src tarball file
# this file contains the 'initial' source code of the component
# and should be replaced with the new/modified src code
# --outFolder : folder where to copy the new tarball(s)
# --pkgVersion : package version
# --srcTarball : src tarball file
# this file contains the 'initial' source code of the component
# and should be replaced with the new/modified src code
# --outFolder : folder where to copy the new tarball(s)
# --pkgVersion : package version
# --vendorVersion : vendor version
#
PARAMS=""
while (( "$#" )); do
Expand Down Expand Up @@ -47,6 +48,15 @@ while (( "$#" )); do
exit 1
fi
;;
--vendorVersion)
if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
VENDOR_VERSION=$2
shift 2
else
echo "Error: Argument for $1 is missing" >&2
exit 1
fi
;;
-*|--*=) # unsupported flags
echo "Error: Unsupported flag $1" >&2
exit 1
Expand All @@ -58,9 +68,10 @@ while (( "$#" )); do
esac
done

echo "--srcTarball -> $SRC_TARBALL"
echo "--outFolder -> $OUT_FOLDER"
echo "--pkgVersion -> $PKG_VERSION"
echo "--srcTarball -> $SRC_TARBALL"
echo "--outFolder -> $OUT_FOLDER"
echo "--pkgVersion -> $PKG_VERSION"
echo "--vendorVersion -> $VENDOR_VERSION"

if [ -z "$PKG_VERSION" ]; then
echo "--pkgVersion parameter cannot be empty"
Expand All @@ -83,7 +94,7 @@ pushd $tmpdir > /dev/null

PKG_NAME="influxdb"
NAME_VER="$PKG_NAME-$PKG_VERSION"
VENDOR_TARBALL="$OUT_FOLDER/$NAME_VER-vendor.tar.gz"
VENDOR_TARBALL="$OUT_FOLDER/$NAME_VER-govendor-v$VENDOR_VERSION.tar.gz"

echo "Unpacking source tarball..."
tar -xf $SRC_TARBALL
Expand All @@ -101,7 +112,7 @@ tar --sort=name \
--pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime \
-cf "$VENDOR_TARBALL" vendor

STATIC_ASSETS_TARBALL="$OUT_FOLDER/$NAME_VER-static-data.tar.gz"
STATIC_ASSETS_TARBALL="$OUT_FOLDER/$NAME_VER-static-data-v$VENDOR_VERSION.tar.gz"

echo ""
echo "========================="
Expand Down
4 changes: 2 additions & 2 deletions SPECS/influxdb/influxdb.signatures.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"Signatures": {
"influxdb-2.7.3.tar.gz": "b1bc78feff1940774f3d017d292b9fd4187ce2041ceaf94fa5fa7ff7546d8944",
"influxdb-2.7.3-vendor.tar.gz": "d59a7652ffac6b108fd4815289dd65148bedaa747a932b9a52b76b1628ab9d4c",
"influxdb-2.7.3-static-data.tar.gz": "23e0f0503368bae46d41840934f3c907f3978cdbbc9a1f8f250e396b2d004842",
"influxdb-2.7.3-govendor-v1.tar.gz": "d59a7652ffac6b108fd4815289dd65148bedaa747a932b9a52b76b1628ab9d4c",
"influxdb-2.7.3-static-data-v1.tar.gz": "23e0f0503368bae46d41840934f3c907f3978cdbbc9a1f8f250e396b2d004842",
"config.yaml": "f0eb56d58d2685bdfc16ee73d835f022c2df6905458381a972375449fde6170c",
"influxdb.service": "570fdbb685c8468f3c4e75b7f482bbc5c0ab4382ad2259a595e7839244747645",
"influxdb-user.conf": "ca5a50bb6ca9f4fcb91d745d552e70af934fdad86196c535c4eb8699a20e7aa0",
Expand Down
35 changes: 7 additions & 28 deletions SPECS/influxdb/influxdb.spec
Original file line number Diff line number Diff line change
Expand Up @@ -18,39 +18,15 @@
Summary: Scalable datastore for metrics, events, and real-time analytics
Name: influxdb
Version: 2.7.3
Release: 9%{?dist}
Release: 10%{?dist}
License: MIT
Vendor: Microsoft Corporation
Distribution: Azure Linux
Group: Productivity/Databases/Servers
URL: https://github.com/influxdata/influxdb
Source0: %{url}/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
# Below is a manually created tarball, no download link.
# We're using pre-populated Go modules from this tarball, since network is disabled during build time.
# Use generate_source_tarbbal.sh to get this generated from a source code file.
# How to re-build this file:
# 1. wget https://github.com/influxdata/influxdb/archive/refs/tags/v%%{version}.tar.gz -O %%{name}-%%{version}.tar.gz
# 2. tar -xf %%{name}-%%{version}.tar.gz
# 3. cd %%{name}-%%{version}
# 4. go mod vendor
# 5. tar --sort=name \
# --mtime="2021-04-26 00:00Z" \
# --owner=0 --group=0 --numeric-owner \
# --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime \
# -cf %%{name}-%%{version}-vendor.tar.gz vendor
#
Source1: %{name}-%{version}-vendor.tar.gz
# Below is a manually created tarball, no download link.
# predownloaded assets include ui assets and swager json. Used to replace fetch-assets and fetch-swagger script.
# Use generate_source_tarbbal.sh to get this generated from a source code file.
# How to rebuild this file:
# 1. wget https://github.com/influxdata/influxdb/archive/refs/tags/v%%{version}.tar.gz -O %%{name}-%%{version}.tar.gz
# 2. tar -xf %%{name}-%%{version}.tar.gz
# 3. cd %%{name}-%%{version}
# 4. make generate-web-assets
# 5. cd static
# 6. tar -cvf %%{name}-%%{version}-static-data.tar.gz data/
Source2: %{name}-%{version}-static-data.tar.gz
Source1: %{name}-%{version}-govendor-v1.tar.gz
Source2: %{name}-%{version}-static-data-v1.tar.gz
Source3: influxdb.service
Source4: influxdb.tmpfiles
Source5: config.yaml
Expand Down Expand Up @@ -151,13 +127,16 @@ go test ./...
%{_tmpfilesdir}/influxdb.conf

%changelog
* Wed Jan 29 2025 Mykhailo Bykhovtsev <[email protected]> - 2.7.3-10
- Change vendor naming convention to match other go packages.

* Wed Jan 27 2025 Kavya Sree Kaitepalli <[email protected]> - 2.7.3-9
- Fix CVE-2024-28180

* Tue Dec 31 2024 Rohit Rawat <[email protected]> - 2.7.3-8
- Add patch for CVE-2024-45338

- Mon Nov 25 2024 Bala <[email protected]> - 2.7.3-7
* Mon Nov 25 2024 Bala <[email protected]> - 2.7.3-7
- Fix CVE-2024-24786

* Thu Oct 10 2024 Sumedh Sharma <[email protected]> - 2.7.3-6
Expand Down
Loading