mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-04-20 19:38:39 +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
@@ -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))))))")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user