packit / packit.dev

packit.dev website content
https://packit.dev/
MIT License
9 stars 50 forks source link

faq says to use wget to get spec, but wget is not available #581

Closed evgeni closed 1 year ago

evgeni commented 1 year ago

Ohai,

https://packit.dev/docs/faq/#how-can-i-download-rpm-spec-file-if-it-is-not-part-of-upstream-repository says that the following snippet should produce a downloaded spec file:

specfile_path: packit.spec
files_to_sync:
  - packit.spec
  - .packit.yaml
upstream_package_name: packitos
downstream_package_name: packit
actions:
    post-upstream-clone: "wget https://src.fedoraproject.org/rpms/packit/raw/main/f/packit.spec -O packit.spec"

However, when I run this in my project, I get:

2023-01-05 11:00:48.355 commands.py       DEBUG  Command: wget https://raw.githubusercontent.com/theforeman/foreman-packaging/rpm/develop/packages/foreman/rubygem-foreman_maintain/rubygem-foreman_maintain.spec -O rubygem-foreman_maintain.spec
2023-01-05 11:00:48.356 utils.py          ERROR  [Errno 2] No such file or directory: 'wget'
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/packit/cli/utils.py", line 47, in covered_func
    func(config=config, *args, **kwargs)
  File "/usr/lib/python3.11/site-packages/packit/cli/prepare_sources.py", line 148, in prepare_sources
    api.prepare_sources(
  File "/usr/lib/python3.11/site-packages/packit/api.py", line 1250, in prepare_sources
    self.up.run_action(actions=ActionName.post_upstream_clone)
  File "/usr/lib/python3.11/site-packages/packit/base_git.py", line 208, in run_action
    if self.with_action(action=actions) and method:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/packit/base_git.py", line 289, in with_action
    self.command_handler.run_command(command=cmd, env=env, print_live=True)
  File "/usr/lib/python3.11/site-packages/packit/command_handler.py", line 89, in run_command
    return commands.run_command(
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/packit/utils/commands.py", line 98, in run_command
    shell = subprocess.Popen(
            ^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/subprocess.py", line 1024, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib64/python3.11/subprocess.py", line 1901, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'wget'

This can be fixed by setting srpm_build_deps:

srpm_build_deps:
  - wget

but the docs don't tell one to do so.

nforro commented 1 year ago

Thank you for reporting this. You are right, that part of the documentation is outdated, let us take care of it.