debrepack: got inconsistent debver from meta_data.yaml

Bug #2060436 reported by hqbai
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Low
hqbai

Bug Description

Brief Description
-----------------
If the package version(debver field) that defined in meta_data.yaml has two digits before the decimal point, followed by a trailing zero after the decimal point, for example '23.10' or '10.10', the 'full_version' got by debrepack.py is '23.1' or '10.1', this cause the below errors during package building:
dpkg-source: error: can't build with format 3.0(quit): no upstream tar found at ....

Severity
--------
Minor

Steps to Reproduce
------------------
1. Create a package like mlnx-ofed-kernel_23.10, the 'debver' in meta_data.yaml is '23.10'
2. The meta_data.yaml is like:
---
debver: 23.10
debname: mlnx-ofed-kernel
dl_path:
  name: mlnx-ofa-kernel-23.10.tgz
  url: "https://linux.mellanox.com/public/repo/mlnx_ofed/\
    23.10-2.1.3.1/SRPMS/mlnx-ofa_kernel-23.10.tgz"
  sha256sum: 9d0082bd7379098f750d0127c623ed0a29629bb149944f213d43429eea7d9519
revision:
  dist: $STX_DIST
  GITREVCOUNT:
    BASE_SRCREV: 4937b3712f6ada593a2cfd78e06cdd9452403868
    SRC_DIR: ${MY_REPO}/stx/kernel/kernel-modules/mlnx-ofa_kernel
3. downloader -s
4. build-pkgs -c -p mlnx-ofa_kernel

Expected Behavior
------------------
"mlnx-ofa_kernel" can be built ok

Actual Behavior
----------------
dpkg-source: error: can't build with format 3.0(quit): no upstream tar found at ....

Reproducibility
---------------
Reproducible

System Configuration
--------------------
NA

Branch/Pull Time/Commit
-----------------------
NA

Last Pass
---------
NA

Timestamp/Logs
--------------
NA

Test Activity
-------------
NA

Workaround
N
----------

hqbai (hbai)
Changed in starlingx:
assignee: nobody → hqbai (hbai)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to root (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/starlingx/root/+/915251

Changed in starlingx:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to root (f/kernel-6.6)

Fix proposed to branch: f/kernel-6.6
Review: https://review.opendev.org/c/starlingx/root/+/916966

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to root (f/kernel-6.6)

Reviewed: https://review.opendev.org/c/starlingx/root/+/916966
Committed: https://opendev.org/starlingx/root/commit/4b7b091d44b4d434c959ee84da8d3d0f531931dc
Submitter: "Zuul (22348)"
Branch: f/kernel-6.6

commit 4b7b091d44b4d434c959ee84da8d3d0f531931dc
Author: Haiqing Bai <email address hidden>
Date: Mon Apr 8 15:16:09 2024 +0800

    debrepack: Fixed debver inconsistent issue

    When python yaml module loads meta_data.yaml into a dict
    with 'yaml.full_load', it discards trailing zeros in the
    'debver' that has two digits before the decimal point,
    and followed by a trailing zero after the decimal point.
    For example, if the 'debver' in meta_data.yaml is '23.10',
    the version in debrepack is '23.1' which will cause build
    failure.

    Test Plan:
    Pass: The fix should not impact the normal build
          build-pkgs -a

    Pass: Add new package 'mlnx-ofed-kernel_23.10' with 'debver'
          in meta_data.yaml is '23.10':
          build-pkgs -c -p mlnx-ofed-kernel

    Closes-bug: 2060436

    Change-Id: I33042f1d15440e72ad8a4b33061390f7dbb9bb64
    Signed-off-by: Haiqing Bai <email address hidden>
    [Cherry pick from https://review.opendev.org/c/starlingx/root/+/915251]
    Signed-off-by: Jiping Ma <email address hidden>

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to root (master)

Reviewed: https://review.opendev.org/c/starlingx/root/+/915251
Committed: https://opendev.org/starlingx/root/commit/56e6534880f09141d2bb572ed217246ba8454cdd
Submitter: "Zuul (22348)"
Branch: master

commit 56e6534880f09141d2bb572ed217246ba8454cdd
Author: Haiqing Bai <email address hidden>
Date: Mon Apr 8 15:16:09 2024 +0800

    debrepack: Fixed debver inconsistent issue

    When python yaml module loads meta_data.yaml into a dict
    with 'yaml.full_load', it discards trailing zeros in the
    'debver' that has two digits before the decimal point,
    and followed by a trailing zero after the decimal point.
    For example, if the 'debver' in meta_data.yaml is '23.10',
    the version in debrepack is '23.1' which will cause build
    failure.

    Test Plan:
    Pass: The fix should not impact the normal build
          build-pkgs -a

    Pass: Add new package 'mlnx-ofed-kernel_23.10' with 'debver'
          in meta_data.yaml is '23.10':
          build-pkgs -c -p mlnx-ofed-kernel

    Closes-bug: 2060436

    Change-Id: I33042f1d15440e72ad8a4b33061390f7dbb9bb64
    Signed-off-by: Haiqing Bai <email address hidden>

Changed in starlingx:
status: In Progress → Fix Released
Ghada Khalil (gkhalil)
Changed in starlingx:
importance: Undecided → Low
tags: added: stx.10.0 stx.build
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.