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

stratisd.spec: only extract upstream crate #510

Merged
merged 1 commit into from
Mar 11, 2024
Merged
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
21 changes: 6 additions & 15 deletions mockbuild_test/stratisd.spec
Original file line number Diff line number Diff line change
Expand Up @@ -84,22 +84,13 @@ Requires: stratisd
%{summary}. This package should not be used in production.

%prep
# Rename SOURCE0's top-level directory because it starts with
# stratisd-stratisd-v. GitHub calculates the directory name from the repo name
# + the tag. Extract the upstream crate on top of the extracted GitHub release,
# overwriting changed files. The primary purpose of this step is to ensure that
# the Cargo.toml that is used in building is the one that is generated by
# Extract the upstream crate on top of the extracted GitHub release, overwriting
# changed files. The primary purpose of this step is to ensure that the
# Cargo.toml that is used in building is the one that is generated by
# cargo-publish and cargo-package, not the file with path dependencies that
# GitHub packs up. Tar the overwritten files back up again into a tar file
# with the format and top-level directory that %setup expects cleaning up the
# previously extracted directory and its contents at the same time. Move the
# newly created tar file to the SOURCE0 location.
tar --transform="s/^stratisd\-stratisd-v/stratisd-/" --extract --file %{SOURCE0}
tar --directory=./stratisd-%{version} --strip-components=1 --extract --overwrite --file %{SOURCE2}
tar --create --gzip --file %{SOURCE0}.newfile ./stratisd-%{version} --remove-files
mv %{SOURCE0}.newfile %{SOURCE0}

%setup -q
# GitHub packs up.
%autosetup -n stratisd-stratisd-v%{version}
tar --strip-components=1 --extract --overwrite --file %{SOURCE2}

%if 0%{?rhel}
%cargo_prep -V 1
Expand Down
4 changes: 3 additions & 1 deletion release_management/create_artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ def _stratisd_artifacts(namespace):

filtered = namespace.vendor_method == "filtered"

source_tarfile_path = make_source_tarball("stratisd", release_version, output_path)
source_tarfile_path = make_source_tarball(
"stratisd", f"stratisd-v{release_version}", output_path
)
print(os.path.relpath(source_tarfile_path))

(vendor_tarfile_name, cargo_crate_path) = vendor(
Expand Down