[deb/rpm] Metadata is not generated for empty repos

Bug #1638631 reported by Alexandru Avadanii
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
packetary
Fix Released
Undecided
Alexandru Avadanii

Bug Description

In certain scenarios, mirror components (e.g. trusty-security)
are present in both packetary configuration input, and in target
system's apt source definitions, but contain no packages of interest.

For such repository/requirements combinations, packetary currently
skips creating metadata (Release, Packages) for those components,
which leads to the partial mirror missing some critical files for apt,
(an empty file would be enough).

e.g.: Using packetary to create a partial Ubuntu mirror, then trying
to build a bootstrap image from the new mirror leads to:

W: Failed to fetch http://127.0.0.1:8080/mirrors/ubuntu/dists/\
   trusty-security/multiverse/binary-amd64/Packages 404

Run packetary:

$ packetary --threads-num 10 clone \
  -t deb \
  -r ubuntu_mirror.yaml \
  -R ubuntu_packages.yaml \
  -d .

ubuntu_mirror.yaml:
- name: ubuntu
  path: /home/alav/fuel/build/f_isoroot/f_repobuild/nailgun/mirrors/ubuntu
  priority: null
  section:
  - main
  - multiverse
  - restricted
  - universe
  suite: trusty
  type: deb
  uri: http://mirror.zetup.net/ubuntu/

ubuntu_packages.yaml:
mandatory: exact
packages:
- name: acpi-support
[...]

Everything goes well, but the output artifacts do not contain metadata (Release, Packages etc.) for empty repositories.

$ test -f dists/trusty-security/multiverse/binary-amd64/Release && echo "OK!"
$ test -f dists/trusty/multiverse/binary-amd64/Release && echo "OK!"
OK!

I'll attach a patch for this; I can also submit it via gerrit if it looks ok.
I'm not really convinced my patch is the right way to do it, and I haven't tested it with RPM cloning, but it should "just work".

Revision history for this message
Alexandru Avadanii (alexandru-avadanii) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to packetary (master)

Fix proposed to branch: master
Review: https://review.openstack.org/392937

Changed in packetary:
assignee: nobody → Alexandru Avadanii (alexandru-avadanii)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to packetary (master)

Reviewed: https://review.openstack.org/392937
Committed: https://git.openstack.org/cgit/openstack/packetary/commit/?id=cb261b0994c605d1e3fd04fae53b65c7de3ed39f
Submitter: Jenkins
Branch: master

commit cb261b0994c605d1e3fd04fae53b65c7de3ed39f
Author: Alexandru Avadanii <email address hidden>
Date: Tue Nov 1 23:01:58 2016 +0100

    clone: Create metadata for empty components

    In certain scenarios, mirror components (e.g. trusty-security)
    are present in both packetary configuration input, and in target
    system's apt source definitions, but contain no packages of interest.

    For such repository/requirements combinations, packetary currently
    skips creating metadata (Release, Packages) for those components,
    which leads to the partial mirror missing some critical files for apt,
    (an empty file would be enough).

    e.g.: Using packetary to create a partial Ubuntu mirror, then trying
    to build a bootstrap image from the new mirror leads to:

    W: Failed to fetch http://127.0.0.1:8080/mirrors/ubuntu/dists/\
       trusty-security/multiverse/binary-amd64/Packages 404

    Closes-bug: 1638631

    Change-Id: I850b43d5b4d8742d99e9a5702cc9ad4de881a401
    Signed-off-by: Alexandru Avadanii <email address hidden>

Changed in packetary:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.