mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-04-19 19:28:22 +00:00
deb: fix importing dbgsym packages with versioned Source field
dpkg-gencontrol can be called with -v flag which set binary package's version separated from source version. When this happen, the Source field will contain version number in addition to source package name. This tripped Aptly's dbgsym restriction, which check for exact source package name, which in turn prevents the dbgsym & the whole .changes file from being imported. From the git history, it seems like this condition is a leftover from when Aptly filter dbgsym packages using "*-dbgsym". So, I decided to remove it. A test case has been added to prevent regression.
This commit is contained in:
committed by
Lorenzo Bolla
parent
2c68175b5c
commit
814d4dbb51
@@ -195,11 +195,6 @@ func (c *Changes) PackageQuery() PackageQuery {
|
||||
}
|
||||
}
|
||||
|
||||
ddebQuery = &AndQuery{
|
||||
L: &FieldQuery{Field: "Source", Relation: VersionEqual, Value: c.Source},
|
||||
R: ddebQuery,
|
||||
}
|
||||
|
||||
binaryQuery = &OrQuery{
|
||||
L: binaryQuery,
|
||||
R: ddebQuery,
|
||||
|
||||
@@ -131,6 +131,23 @@ func (s *ChangesSuite) TestImportChangesFiles(c *C) {
|
||||
c.Check(processedFiles, DeepEquals, expectedProcessedFiles)
|
||||
}
|
||||
|
||||
func (s *ChangesSuite) TestImportDbgsymWithVersionedSourceField(c *C) {
|
||||
repo := NewLocalRepo("test", "Test Comment")
|
||||
c.Assert(s.localRepoCollection.Add(repo), IsNil)
|
||||
|
||||
changesFiles, failedFiles := CollectChangesFiles(
|
||||
[]string{"testdata/dbgsym-with-source-version"}, s.Reporter)
|
||||
c.Check(changesFiles, HasLen, 1)
|
||||
c.Check(failedFiles, HasLen, 0)
|
||||
|
||||
_, failedFiles, err := ImportChangesFiles(
|
||||
changesFiles, s.Reporter, true, true, false, true, &NullVerifier{},
|
||||
template.Must(template.New("test").Parse("test")), s.progress, s.localRepoCollection, s.packageCollection, s.packagePool, func(database.ReaderWriter) aptly.ChecksumStorage { return s.checksumStorage },
|
||||
nil, nil)
|
||||
c.Assert(err, IsNil)
|
||||
c.Check(failedFiles, IsNil)
|
||||
}
|
||||
|
||||
func (s *ChangesSuite) TestPrepare(c *C) {
|
||||
changes, err := NewChanges("testdata/changes/hardlink_0.2.1_amd64.changes")
|
||||
c.Assert(err, IsNil)
|
||||
@@ -150,5 +167,5 @@ func (s *ChangesSuite) TestPackageQuery(c *C) {
|
||||
|
||||
q := changes.PackageQuery()
|
||||
c.Check(q.String(), Equals,
|
||||
"(($Architecture (= amd64)) | (($Architecture (= source)) | ($Architecture (= )))), ((($PackageType (= source)), (Name (= calamares))) | ((!($PackageType (= source))), (((Name (= calamares-dbg)) | (Name (= calamares))) | ((Source (= calamares)), ((Name (= calamares-dbg-dbgsym)) | (Name (= calamares-dbgsym)))))))")
|
||||
"(($Architecture (= amd64)) | (($Architecture (= source)) | ($Architecture (= )))), ((($PackageType (= source)), (Name (= calamares))) | ((!($PackageType (= source))), (((Name (= calamares-dbg)) | (Name (= calamares))) | ((Name (= calamares-dbg-dbgsym)) | (Name (= calamares-dbgsym))))))")
|
||||
}
|
||||
|
||||
Binary file not shown.
BIN
deb/testdata/dbgsym-with-source-version/dbgsym-with-source-version_0.1+aptly2021.01_amd64.deb
vendored
Normal file
BIN
deb/testdata/dbgsym-with-source-version/dbgsym-with-source-version_0.1+aptly2021.01_amd64.deb
vendored
Normal file
Binary file not shown.
16
deb/testdata/dbgsym-with-source-version/dbgsym-with-source-version_2021.01.dsc
vendored
Normal file
16
deb/testdata/dbgsym-with-source-version/dbgsym-with-source-version_2021.01.dsc
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
Format: 3.0 (native)
|
||||
Source: dbgsym-with-source-version
|
||||
Binary: dbgsym-with-source-version
|
||||
Architecture: any
|
||||
Version: 2021.01
|
||||
Maintainer: Ratchanan Srirattanamet <ratchanan@ubports.com>
|
||||
Standards-Version: 4.4.1
|
||||
Build-Depends: debhelper-compat (= 12)
|
||||
Package-List:
|
||||
dbgsym-with-source-version deb unknown optional arch=any
|
||||
Checksums-Sha1:
|
||||
626c500200d9837b475f61a2563a647e785a9ccf 1664 dbgsym-with-source-version_2021.01.tar.xz
|
||||
Checksums-Sha256:
|
||||
00e1915300d0996056867b66d2cfc608e3839febb9feb596fe940f99ced632b0 1664 dbgsym-with-source-version_2021.01.tar.xz
|
||||
Files:
|
||||
5f50d8d87421226d33536471d294140e 1664 dbgsym-with-source-version_2021.01.tar.xz
|
||||
BIN
deb/testdata/dbgsym-with-source-version/dbgsym-with-source-version_2021.01.tar.xz
vendored
Normal file
BIN
deb/testdata/dbgsym-with-source-version/dbgsym-with-source-version_2021.01.tar.xz
vendored
Normal file
Binary file not shown.
182
deb/testdata/dbgsym-with-source-version/dbgsym-with-source-version_2021.01_amd64.buildinfo
vendored
Normal file
182
deb/testdata/dbgsym-with-source-version/dbgsym-with-source-version_2021.01_amd64.buildinfo
vendored
Normal file
@@ -0,0 +1,182 @@
|
||||
Format: 1.0
|
||||
Source: dbgsym-with-source-version
|
||||
Binary: dbgsym-with-source-version
|
||||
Architecture: amd64 source
|
||||
Version: 2021.01
|
||||
Checksums-Md5:
|
||||
d411f22d5ae7a68256faa2d02276da33 646 dbgsym-with-source-version_2021.01.dsc
|
||||
91adadcd5b04c89a6775e6be20d03705 2668 dbgsym-with-source-version-dbgsym_0.1+aptly2021.01_amd64.ddeb
|
||||
1e3c04499395851894fda69903b1c6ff 3520 dbgsym-with-source-version_0.1+aptly2021.01_amd64.deb
|
||||
Checksums-Sha1:
|
||||
07b21e2cf16c966695455a56343f653b0322d00c 646 dbgsym-with-source-version_2021.01.dsc
|
||||
c8b0e5ef412749c60ada84f07b9a9abeb8a9b58f 2668 dbgsym-with-source-version-dbgsym_0.1+aptly2021.01_amd64.ddeb
|
||||
e46bb74e4ca1a8b6013b145d95db90264b873225 3520 dbgsym-with-source-version_0.1+aptly2021.01_amd64.deb
|
||||
Checksums-Sha256:
|
||||
f1d6a9ab1b73d8ed798ebac79b472433712cc964fa73c60fc4b82e828a279070 646 dbgsym-with-source-version_2021.01.dsc
|
||||
afba2bf24c4978de82d49dc196ee26ed678ef54386fa4f1982f70aec985ccc02 2668 dbgsym-with-source-version-dbgsym_0.1+aptly2021.01_amd64.ddeb
|
||||
7834699e4f3f27ed7cb8776e6846e8367d6e18d0c589bb283900841a2a5bbcd5 3520 dbgsym-with-source-version_0.1+aptly2021.01_amd64.deb
|
||||
Build-Origin: Ubuntu
|
||||
Build-Architecture: amd64
|
||||
Build-Date: Fri, 08 Jan 2021 20:59:06 +0700
|
||||
Build-Tainted-By:
|
||||
usr-local-has-libraries
|
||||
usr-local-has-programs
|
||||
Installed-Build-Depends:
|
||||
autoconf (= 2.69-11.1),
|
||||
automake (= 1:1.16.1-4ubuntu6),
|
||||
autopoint (= 0.19.8.1-10build1),
|
||||
autotools-dev (= 20180224.1),
|
||||
base-files (= 11ubuntu5.2),
|
||||
base-passwd (= 3.5.47),
|
||||
bash (= 5.0-6ubuntu1.1),
|
||||
binutils (= 2.34-6ubuntu1),
|
||||
binutils-common (= 2.34-6ubuntu1),
|
||||
binutils-x86-64-linux-gnu (= 2.34-6ubuntu1),
|
||||
bsdmainutils (= 11.1.2ubuntu3),
|
||||
bsdutils (= 1:2.34-0.1ubuntu9.1),
|
||||
build-essential (= 12.8ubuntu1.1),
|
||||
bzip2 (= 1.0.8-2),
|
||||
coreutils (= 8.30-3ubuntu2),
|
||||
cpp (= 4:9.3.0-1ubuntu2),
|
||||
cpp-7 (= 7.5.0-6ubuntu2),
|
||||
cpp-9 (= 9.3.0-17ubuntu1~20.04),
|
||||
dash (= 0.5.10.2-6),
|
||||
debconf (= 1.5.73),
|
||||
debhelper (= 12.10ubuntu1),
|
||||
debianutils (= 4.9.1),
|
||||
dh-autoreconf (= 19),
|
||||
dh-strip-nondeterminism (= 1.7.0-1),
|
||||
diffutils (= 1:3.7-3),
|
||||
dpkg (= 1.19.7ubuntu3),
|
||||
dpkg-dev (= 1.19.7ubuntu3),
|
||||
dwz (= 0.13-5),
|
||||
file (= 1:5.38-4),
|
||||
findutils (= 4.7.0-1ubuntu1),
|
||||
g++ (= 4:9.3.0-1ubuntu2),
|
||||
g++-9 (= 9.3.0-17ubuntu1~20.04),
|
||||
gawk (= 1:5.0.1+dfsg-1),
|
||||
gcc (= 4:9.3.0-1ubuntu2),
|
||||
gcc-10-base (= 10.2.0-5ubuntu1~20.04),
|
||||
gcc-7 (= 7.5.0-6ubuntu2),
|
||||
gcc-7-base (= 7.5.0-6ubuntu2),
|
||||
gcc-8-base (= 8.4.0-3ubuntu2),
|
||||
gcc-9 (= 9.3.0-17ubuntu1~20.04),
|
||||
gcc-9-base (= 9.3.0-17ubuntu1~20.04),
|
||||
gettext (= 0.19.8.1-10build1),
|
||||
gettext-base (= 0.19.8.1-10build1),
|
||||
grep (= 3.4-1),
|
||||
groff-base (= 1.22.4-4build1),
|
||||
gzip (= 1.10-0ubuntu4),
|
||||
hostname (= 3.23),
|
||||
init-system-helpers (= 1.57),
|
||||
install-info (= 6.7.0.dfsg.2-5),
|
||||
intltool-debian (= 0.35.0+20060710.5),
|
||||
libacl1 (= 2.2.53-6),
|
||||
libarchive-zip-perl (= 1.67-2),
|
||||
libasan4 (= 7.5.0-6ubuntu2),
|
||||
libasan5 (= 9.3.0-17ubuntu1~20.04),
|
||||
libatomic1 (= 10.2.0-5ubuntu1~20.04),
|
||||
libattr1 (= 1:2.4.48-5),
|
||||
libaudit-common (= 1:2.8.5-2ubuntu6),
|
||||
libaudit1 (= 1:2.8.5-2ubuntu6),
|
||||
libbinutils (= 2.34-6ubuntu1),
|
||||
libblkid1 (= 2.34-0.1ubuntu9.1),
|
||||
libbsd0 (= 0.10.0-1),
|
||||
libbz2-1.0 (= 1.0.8-2),
|
||||
libc-bin (= 2.31-0ubuntu9.1),
|
||||
libc-dev-bin (= 2.31-0ubuntu9.1),
|
||||
libc6 (= 2.31-0ubuntu9.1),
|
||||
libc6-dev (= 2.31-0ubuntu9.1),
|
||||
libcap-ng0 (= 0.7.9-2.1build1),
|
||||
libcc1-0 (= 10.2.0-5ubuntu1~20.04),
|
||||
libcilkrts5 (= 7.5.0-6ubuntu2),
|
||||
libcroco3 (= 0.6.13-1),
|
||||
libcrypt-dev (= 1:4.4.10-10ubuntu4),
|
||||
libcrypt1 (= 1:4.4.10-10ubuntu4),
|
||||
libctf-nobfd0 (= 2.34-6ubuntu1),
|
||||
libctf0 (= 2.34-6ubuntu1),
|
||||
libdb5.3 (= 5.3.28+dfsg1-0.6ubuntu2),
|
||||
libdebconfclient0 (= 0.251ubuntu1),
|
||||
libdebhelper-perl (= 12.10ubuntu1),
|
||||
libdpkg-perl (= 1.19.7ubuntu3),
|
||||
libelf1 (= 0.176-1.1build1),
|
||||
libffi7 (= 3.3-4),
|
||||
libfile-stripnondeterminism-perl (= 1.7.0-1),
|
||||
libgcc-7-dev (= 7.5.0-6ubuntu2),
|
||||
libgcc-9-dev (= 9.3.0-17ubuntu1~20.04),
|
||||
libgcc-s1 (= 10.2.0-5ubuntu1~20.04),
|
||||
libgcrypt20 (= 1.8.5-5ubuntu1),
|
||||
libgdbm-compat4 (= 1.18.1-5),
|
||||
libgdbm6 (= 1.18.1-5),
|
||||
libglib2.0-0 (= 2.64.3-1~ubuntu20.04.1),
|
||||
libgmp10 (= 2:6.2.0+dfsg-4),
|
||||
libgomp1 (= 10.2.0-5ubuntu1~20.04),
|
||||
libgpg-error0 (= 1.37-1),
|
||||
libicu66 (= 66.1-2ubuntu2),
|
||||
libisl22 (= 0.22.1-1),
|
||||
libitm1 (= 10.2.0-5ubuntu1~20.04),
|
||||
liblsan0 (= 10.2.0-5ubuntu1~20.04),
|
||||
liblz4-1 (= 1.9.2-2),
|
||||
liblzma5 (= 5.2.4-1ubuntu1),
|
||||
libmagic-mgc (= 1:5.38-4),
|
||||
libmagic1 (= 1:5.38-4),
|
||||
libmount1 (= 2.34-0.1ubuntu9.1),
|
||||
libmpc3 (= 1.1.0-1),
|
||||
libmpfr6 (= 4.0.2-1),
|
||||
libmpx2 (= 8.4.0-3ubuntu2),
|
||||
libpam-modules (= 1.3.1-5ubuntu4.1),
|
||||
libpam-modules-bin (= 1.3.1-5ubuntu4.1),
|
||||
libpam-runtime (= 1.3.1-5ubuntu4.1),
|
||||
libpam0g (= 1.3.1-5ubuntu4.1),
|
||||
libpcre2-8-0 (= 10.34-7),
|
||||
libpcre3 (= 2:8.39-12build1),
|
||||
libperl5.30 (= 5.30.0-9ubuntu0.2),
|
||||
libpipeline1 (= 1.5.2-2build1),
|
||||
libquadmath0 (= 10.2.0-5ubuntu1~20.04),
|
||||
libreadline8 (= 8.0-4),
|
||||
libseccomp2 (= 2.4.3-1ubuntu3.20.04.3),
|
||||
libselinux1 (= 3.0-1build2),
|
||||
libsigsegv2 (= 2.12-2),
|
||||
libsmartcols1 (= 2.34-0.1ubuntu9.1),
|
||||
libstdc++-9-dev (= 9.3.0-17ubuntu1~20.04),
|
||||
libstdc++6 (= 10.2.0-5ubuntu1~20.04),
|
||||
libsub-override-perl (= 0.09-2),
|
||||
libsystemd0 (= 245.4-4ubuntu3.3),
|
||||
libtinfo6 (= 6.2-0ubuntu2),
|
||||
libtool (= 2.4.6-14),
|
||||
libtsan0 (= 10.2.0-5ubuntu1~20.04),
|
||||
libubsan0 (= 7.5.0-6ubuntu2),
|
||||
libubsan1 (= 10.2.0-5ubuntu1~20.04),
|
||||
libuchardet0 (= 0.0.6-3build1),
|
||||
libudev1 (= 245.4-4ubuntu3.3),
|
||||
libunistring2 (= 0.9.10-2),
|
||||
libuuid1 (= 2.34-0.1ubuntu9.1),
|
||||
libxml2 (= 2.9.10+dfsg-5),
|
||||
libzstd1 (= 1.4.4+dfsg-3),
|
||||
linux-libc-dev (= 5.4.0-60.67),
|
||||
login (= 1:4.8.1-1ubuntu5.20.04),
|
||||
lsb-base (= 11.1.0ubuntu2),
|
||||
m4 (= 1.4.18-4),
|
||||
make (= 4.2.1-1.2),
|
||||
man-db (= 2.9.1-1),
|
||||
mawk (= 1.3.4.20200120-2),
|
||||
ncurses-base (= 6.2-0ubuntu2),
|
||||
ncurses-bin (= 6.2-0ubuntu2),
|
||||
patch (= 2.7.6-6),
|
||||
perl (= 5.30.0-9ubuntu0.2),
|
||||
perl-base (= 5.30.0-9ubuntu0.2),
|
||||
perl-modules-5.30 (= 5.30.0-9ubuntu0.2),
|
||||
po-debconf (= 1.0.21),
|
||||
readline-common (= 8.0-4),
|
||||
sed (= 4.7-1),
|
||||
sensible-utils (= 0.0.12+nmu1),
|
||||
sysvinit-utils (= 2.96-2.1ubuntu1),
|
||||
tar (= 1.30+dfsg-7),
|
||||
tzdata (= 2020f-0ubuntu0.20.04),
|
||||
util-linux (= 2.34-0.1ubuntu9.1),
|
||||
xz-utils (= 5.2.4-1ubuntu1),
|
||||
zlib1g (= 1:1.2.11.dfsg-2ubuntu1.2)
|
||||
Environment:
|
||||
DEB_BUILD_OPTIONS="parallel=4"
|
||||
LANG="th_TH.UTF-8"
|
||||
SOURCE_DATE_EPOCH="1610111766"
|
||||
34
deb/testdata/dbgsym-with-source-version/dbgsym-with-source-version_2021.01_amd64.changes
vendored
Normal file
34
deb/testdata/dbgsym-with-source-version/dbgsym-with-source-version_2021.01_amd64.changes
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
Format: 1.8
|
||||
Date: Fri, 08 Jan 2021 20:16:06 +0700
|
||||
Source: dbgsym-with-source-version
|
||||
Binary: dbgsym-with-source-version
|
||||
Architecture: source amd64
|
||||
Version: 2021.01
|
||||
Distribution: unstable
|
||||
Urgency: medium
|
||||
Maintainer: Ratchanan Srirattanamet <ratchanan@ubports.com>
|
||||
Changed-By: Ratchanan Srirattanamet <ratchanan@ubports.com>
|
||||
Description:
|
||||
dbgsym-with-source-version - Test Aptly importing dbgsym with versioned Source field
|
||||
Changes:
|
||||
dbgsym-with-source-version (2021.01) unstable; urgency=medium
|
||||
.
|
||||
* Initial Release.
|
||||
Checksums-Sha1:
|
||||
07b21e2cf16c966695455a56343f653b0322d00c 646 dbgsym-with-source-version_2021.01.dsc
|
||||
626c500200d9837b475f61a2563a647e785a9ccf 1664 dbgsym-with-source-version_2021.01.tar.xz
|
||||
c8b0e5ef412749c60ada84f07b9a9abeb8a9b58f 2668 dbgsym-with-source-version-dbgsym_0.1+aptly2021.01_amd64.ddeb
|
||||
e46bb74e4ca1a8b6013b145d95db90264b873225 3520 dbgsym-with-source-version_0.1+aptly2021.01_amd64.deb
|
||||
d95a8d9cf1e7c0e68a99ad901ed88e8ac2f22fc0 6155 dbgsym-with-source-version_2021.01_amd64.buildinfo
|
||||
Checksums-Sha256:
|
||||
f1d6a9ab1b73d8ed798ebac79b472433712cc964fa73c60fc4b82e828a279070 646 dbgsym-with-source-version_2021.01.dsc
|
||||
00e1915300d0996056867b66d2cfc608e3839febb9feb596fe940f99ced632b0 1664 dbgsym-with-source-version_2021.01.tar.xz
|
||||
afba2bf24c4978de82d49dc196ee26ed678ef54386fa4f1982f70aec985ccc02 2668 dbgsym-with-source-version-dbgsym_0.1+aptly2021.01_amd64.ddeb
|
||||
7834699e4f3f27ed7cb8776e6846e8367d6e18d0c589bb283900841a2a5bbcd5 3520 dbgsym-with-source-version_0.1+aptly2021.01_amd64.deb
|
||||
763abc57edbe79e2a7cfc6665bcf63b2c58d8a3d04fb27d7247f0272e21032e1 6155 dbgsym-with-source-version_2021.01_amd64.buildinfo
|
||||
Files:
|
||||
d411f22d5ae7a68256faa2d02276da33 646 unknown optional dbgsym-with-source-version_2021.01.dsc
|
||||
5f50d8d87421226d33536471d294140e 1664 unknown optional dbgsym-with-source-version_2021.01.tar.xz
|
||||
91adadcd5b04c89a6775e6be20d03705 2668 debug optional dbgsym-with-source-version-dbgsym_0.1+aptly2021.01_amd64.ddeb
|
||||
1e3c04499395851894fda69903b1c6ff 3520 unknown optional dbgsym-with-source-version_0.1+aptly2021.01_amd64.deb
|
||||
62d96c0271d499d9c848ec66fc888f6d 6155 unknown optional dbgsym-with-source-version_2021.01_amd64.buildinfo
|
||||
Reference in New Issue
Block a user