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

Rework cargo pattern use #862

Merged
merged 1 commit into from
Jan 3, 2025
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
2 changes: 1 addition & 1 deletion autospec/buildreq.py
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ def scan_for_configure(self, dirn, tname, config):
for dirpath, _, files in os.walk(dirn):
default_score = 2 if dirpath == dirn else 1

if "Cargo.toml" in files:
if "Cargo.toml" in files and 'Makefile' not in files:
config.set_build_pattern('cargo', default_score)

if "CMakeLists.txt" in files and "configure.ac" not in files:
Expand Down
13 changes: 5 additions & 8 deletions autospec/specfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -2067,14 +2067,11 @@ def write_cargo_pattern(self):
self.write_license_files()
if self.config.subdir:
self._write_strip("pushd " + self.config.subdir)
if self.config.install_macro:
self._write_strip(self.config.install_macro)
else:
self._write_strip("cargo install --path .")
self._write_strip("mkdir -p %{buildroot}/usr/bin")
self._write_strip('pushd "${HOME}/.cargo/bin/"')
self._write_strip("mv * %{buildroot}/usr/bin/")
self._write_strip("popd")
self._write_strip("cargo install --path .")
self._write_strip("mkdir -p %{buildroot}/usr/bin")
self._write_strip('pushd "${HOME}/.cargo/bin/"')
self._write_strip("mv * %{buildroot}/usr/bin/")
self._write_strip("popd")
if self.config.subdir:
self._write_strip("popd")
self.write_install_append()
Expand Down
Loading