Skip to content

Commit b4880ac

Browse files
authored
Merge pull request #45 from infosiftr/single-line
Finally deprecate the legacy line-based format
2 parents 017573e + 69f4323 commit b4880ac

File tree

5 files changed

+6
-166
lines changed

5 files changed

+6
-166
lines changed

cmd/bashbrew/git.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -209,21 +209,16 @@ func (r Repo) fetchGitRepo(arch string, entry *manifest.Manifest2822Entry) (stri
209209
}
210210
defer os.RemoveAll(tempRefDir)
211211

212-
tempRef := path.Join(refBase, filepath.Base(tempRefDir))
213-
if entry.ArchGitFetch(arch) == manifest.DefaultLineBasedFetch {
214-
// backwards compat (see manifest/line-based.go in go-dockerlibrary)
215-
fetchStrings[0] += tempRef + "/*"
216-
} else {
217-
fetchStrings[0] += tempRef + "/temp"
218-
}
212+
tempRef := path.Join(refBase, filepath.Base(tempRefDir)) + "/temp"
213+
fetchStrings[0] += tempRef
219214

220215
fetchStrings = append([]string{
221216
// Git (and more recently, GitHub) support "git fetch"ing a specific commit directly!
222217
// (The "actions/checkout@v2" GitHub action uses this to fetch commits for running workflows even after branches are deleted!)
223218
// https://github.com/git/git/commit/f8edeaa05d8623a9f6dad408237496c51101aad8
224219
// https://github.com/go-git/go-git/pull/58
225220
// If that works, we want to prefer it (since it'll be much more efficient at getting us the commit we care about), so we prepend it to our list of "things to try fetching"
226-
entryArchGitCommit + ":" + tempRef + "/temp",
221+
entryArchGitCommit + ":" + tempRef,
227222
}, fetchStrings...)
228223
}
229224

manifest/example_test.go

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -83,23 +83,6 @@ s390x-File: Dockerfile
8383
}
8484
fmt.Printf("\n")
8585

86-
man, err = manifest.Parse(bufio.NewReader(strings.NewReader(`
87-
# maintainer: InfoSiftr <[email protected]> (@infosiftr)
88-
# maintainer: John Smith <[email protected]> (@example-jsmith)
89-
90-
# first set
91-
a: b@c d
92-
e: b@c d
93-
94-
# second set
95-
f: g@h
96-
i: g@h j
97-
`)))
98-
if err != nil {
99-
panic(err)
100-
}
101-
fmt.Printf("-------------\nline-based:\n%v\n", man)
102-
10386
// Output:
10487
// -------------
10588
// 2822:
@@ -145,27 +128,6 @@ i: g@h j
145128
//
146129
// - raspbian
147130
// - raspbian-s390x
148-
//
149-
// -------------
150-
// line-based:
151-
// Maintainers: InfoSiftr <[email protected]> (@infosiftr), John Smith <[email protected]> (@example-jsmith)
152-
// GitFetch: refs/heads/*
153-
//
154-
// Tags: a, e
155-
// GitRepo: b
156-
// GitCommit: c
157-
// Directory: d
158-
//
159-
// Tags: f
160-
// GitRepo: g
161-
// GitFetch: refs/tags/h
162-
// GitCommit: FETCH_HEAD
163-
//
164-
// Tags: i
165-
// GitRepo: g
166-
// GitFetch: refs/tags/h
167-
// GitCommit: FETCH_HEAD
168-
// Directory: j
169131
}
170132

171133
func ExampleFetch_local() {

manifest/line-based.go

Lines changed: 0 additions & 95 deletions
This file was deleted.

manifest/parse.go

Lines changed: 0 additions & 25 deletions
This file was deleted.

manifest/rfc2822.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,9 @@ func (decoder *decoderWrapper) Decode(entry *Manifest2822Entry) error {
581581
}
582582
}
583583

584+
// https://github.com/docker-library/bashbrew/issues/16
585+
var Parse = Parse2822
586+
584587
func Parse2822(readerIn io.Reader) (*Manifest2822, error) {
585588
reader := stripper.NewCommentStripper(readerIn)
586589

0 commit comments

Comments
 (0)