Allow variation of formatting of Debian control.tar.gz

While all the normal Debian package building tools create a
control.tar.gz archive member that contains files with a leading
"./" path element, such as "./control", dpkg and other archive tools
like reprepro are happy with omitting the "./" path element and
having files like "control".  Allow for either for compatibility
with weird packages that people may want to import into aptly.
This commit is contained in:
Russ Allbery
2014-10-17 13:36:58 -07:00
parent 0a6d57ea1a
commit aeb85a1b3c

View File

@@ -47,7 +47,7 @@ func GetControlFileFromDeb(packageFile string) (Stanza, error) {
return nil, fmt.Errorf("unable to read .tar archive: %s", err)
}
if tarHeader.Name == "./control" {
if tarHeader.Name == "./control" || tarHeader.Name == "control" {
reader := NewControlFileReader(untar)
stanza, err := reader.ReadStanza()
if err != nil {