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

Make offline transactions work with local rpm files #1586

Merged
merged 4 commits into from
Jul 31, 2024
Merged

Conversation

m-blaha
Copy link
Member

@m-blaha m-blaha commented Jul 16, 2024

Offline transactions now copy also local (command line repo) packages to the
cache.

Changes:

f30fd65 (Marek Blaha, 2 hours ago)
dnf5: Offline transactions work with local rpm files

9ab4e87 (Marek Blaha, 2 hours ago)
package_downloader: Handle local files

Local packages are not passed to librepo for download, but directly copied
to the destination directory.

74e0177 (Marek Blaha, 7 hours ago)
transaction: Flag whether download local packages

By default the transaction during the download() call does not copy local
packages to the destination directory. These packages are used directly
from their original location. For some use-cases (like offline transaction
involving the command line repo packages) we need to copy them to the
package cache.

Resolves: #1583

Copy link

We were not able to find or create Copr project packit/rpm-software-management-dnf5-1586 specified in the config with the following error:

Cannot create a new Copr project (owner=packit project=rpm-software-management-dnf5-1586 chroots=['fedora-rawhide-x86_64']): Copr: 'packit/rpm-software-management-dnf5-1586' already exists. Copr HTTP response is 400 BAD REQUEST.

Unless the HTTP status code above is >= 500, please check your configuration for:

  1. typos in owner and project name (groups need to be prefixed with @)
  2. whether the project name doesn't contain not allowed characters (only letters, digits, underscores, dashes and dots must be used)
  3. whether the project itself exists (Packit creates projects only in its own namespace)
  4. whether Packit is allowed to build in your Copr project
  5. whether your Copr project/group is not private

@kontura
Copy link
Contributor

kontura commented Jul 22, 2024

I have created a couple of tests: rpm-software-management/ci-dnf-stack#1529

@kontura
Copy link
Contributor

kontura commented Jul 23, 2024

There are some failing CI tests.

I think the problem is with normal repo packages that are already downloaded in cache (using --downloadonly option).

They don't have the repo type COMMANDLINE so they are always set to be downloaded, in the PackageDownloader::download they are available locally so they are selected for copy but their source (pkg_target.package.get_location()) comes from the repo data - for example: Packages/h/hwloc-libs-2.10.0-3.fc40.x86_64.rpm and this fails to copy because the packages is not present at the path.

By default the transaction during the `download()` call does not copy
local packages to the destination directory. These packages are used
directly from their original location. For some use-cases (like offline
transaction involving the command line repo packages) we need to copy
them to the package cache.
Local packages are not passed to librepo for download, but directly
copied to the destination directory.
Execute callbacks when copying local files to the destination during the
download() method.
@m-blaha
Copy link
Member Author

m-blaha commented Jul 30, 2024

Thanks! The get_location() was wrong, get_package_path() is needed to cover also the cached packages.
I added a commit that fixes it and also executes download callbacks to inform the user about the package being copied.

@kontura
Copy link
Contributor

kontura commented Jul 31, 2024

Thanks 👍

@kontura kontura added this pull request to the merge queue Jul 31, 2024
Merged via the queue into main with commit 59538f3 Jul 31, 2024
16 checks passed
@kontura kontura deleted the mblaha/offline-local branch July 31, 2024 05:26
kontura added a commit to kontura/ci-dnf-stack that referenced this pull request Jul 31, 2024
m-blaha pushed a commit to rpm-software-management/ci-dnf-stack that referenced this pull request Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

offline: Running update with local package fails
2 participants