From aeb85a1b3c556804218568b35babc430d0e34c95 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Fri, 17 Oct 2014 13:36:58 -0700 Subject: [PATCH] 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. --- deb/deb.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deb/deb.go b/deb/deb.go index 6d749f3c..c4985558 100644 --- a/deb/deb.go +++ b/deb/deb.go @@ -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 {