From 5d3be9c8a5e3e3382999ea8016675f01346cee38 Mon Sep 17 00:00:00 2001 From: Manuel Reis Date: Thu, 23 Jun 2022 17:24:38 +0100 Subject: [PATCH] [Deb] Add buildinfo and changes files options for dpkg >= 1.21.1 It seems that dpkg-buildpackage creates the .buildinfo and .changes files in ../, and the .buildinfo is not seen in `deb_packaging` directory: ``` dpkg-genbuildinfo -udeb_packages --build=binary -O../xrootd_20220622-751c5fc46_amd64.buildinfo dpkg-genchanges -udeb_packages --build=binary -O../xrootd_20220622-751c5fc46_amd64.changes dpkg-genchanges: error: cannot fstat file deb_packages/xrootd_20220622-751c5fc46_amd64.buildinfo: No such file or directory dpkg-buildpackage: error: dpkg-genchanges -udeb_packages --build=binary -O../xrootd_20220622-751c5fc46_amd64.changes subprocess returned exit status 255 ``` these changes will produce the following instructions: ``` dpkg-genbuildinfo -udeb_packages --build=binary -Odeb_packages/xrootd_20220623-9a7325187_amd64.buildinfo dpkg-genchanges -udeb_packages --build=binary -Odeb_packages/xrootd_20220623-9a7325187_amd64.changes ``` --- .gitlab-ci.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7751c50f70d..a3a9e709852 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,14 +16,20 @@ stages: - cp -R packaging/debian/ . - mk-build-deps --build-dep debian/control - gdebi -n xrootd-build-deps-depends*.deb - - version=`./genversion.sh --print-only` - - dch --create -v `echo $version | sed 's/^v\(.*\)/\1/'` --package xrootd --urgency low --distribution ${DIST} -M "This package is built and released automatically. For important notices and releases subscribe to our maling lists or visit our website." - - dpkg_version=`dpkg-query --showformat='${Version}' --show dpkg` - - rc=0 ; dpkg --compare-versions $dpkg_version "ge" "1.18.11" || rc=$? + - version="$(./genversion.sh --print-only)" + - dch --create -v "$(echo $version | sed 's/^v\(.*\)/\1/')" --package xrootd --urgency low --distribution ${DIST} -M "This package is built and released automatically. For important notices and releases subscribe to our maling lists or visit our website." + - dpkg_version="$(dpkg-query --showformat='${Version}' --show dpkg)" + - dpkg_version=$(dpkg-query --showformat='${Version}' --show dpkg) + - rc=0 ; dpkg --compare-versions $dpkg_version "ge" "1.21.1" || rc=$? - if [ $rc -eq "0" ]; then - dpkg-buildpackage -b -us -uc -tc --buildinfo-option="-udeb_packages" --changes-option="-udeb_packages" ; + dpkg-buildpackage -b -us -uc -tc --buildinfo-option="-udeb_packages" --buildinfo-file="deb_packages/xrootd_$(dpkg-parsechangelog -S version)_$(dpkg-architecture -qDEB_BUILD_ARCH).buildinfo" --changes-option="-udeb_packages" --buildinfo-file="deb_packages/xrootd_$(dpkg-parsechangelog -S version)_$(dpkg-architecture -qDEB_BUILD_ARCH).changes" else - dpkg-buildpackage -b -us -uc -tc --changes-option="-udeb_packages" ; + rc=0 ; dpkg --compare-versions $dpkg_version "ge" "1.18.11" || rc=$? + if [ $rc -eq "0" ]; then + dpkg-buildpackage -b -us -uc -tc --buildinfo-option="-udeb_packages" --changes-option="-udeb_packages" ; + else + dpkg-buildpackage -b -us -uc -tc --changes-option="-udeb_packages" ; + fi fi - mkdir ${DIST}/ - cp deb_packages/*.deb ${DIST}/