Skip to content
This repository was archived by the owner on Aug 7, 2025. It is now read-only.

Commit d62e67b

Browse files
author
William Douglas
committed
wip
1 parent 1c5c452 commit d62e67b

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

builder/bundleset.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
)
1616

1717
var (
18-
validBundleNameRegex = regexp.MustCompile(`^[A-Za-z0-9-_]+$`)
18+
validBundleNameRegex = regexp.MustCompile(`^[A-Za-z0-9-_+.]+$`)
1919
validPackageNameRegex = regexp.MustCompile(`^[A-Za-z0-9-_+.]+$`)
2020
bundleHeaderFieldRegex = regexp.MustCompile(`^# \[([A-Z]+)\]:\s*(.*)$`)
2121
)
@@ -90,7 +90,7 @@ func sortBundles(bundles bundleSet) ([]*bundle, error) {
9090
visit = func(b *bundle) error {
9191
switch mark[b] {
9292
case Visiting:
93-
return fmt.Errorf("cycle found in bundles: %s -> %s", strings.Join(visiting, " -> "), b.Name)
93+
return nil
9494
case NotVisited:
9595
mark[b] = Visiting
9696
visiting = append(visiting, b.Name)

swupd/manifest.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,18 +187,18 @@ func readManifestFileEntry(fields []string, m *Manifest) error {
187187
// CheckHeaderIsValid verifies that all header fields in the manifest are valid.
188188
func (m *Manifest) CheckHeaderIsValid() error {
189189
if m.Header.Format == 0 {
190-
return errors.New("manifest format not set")
190+
return errors.Errorf("manifest format not set (%s)", m.Name)
191191
}
192192

193193
if m.Header.Version == 0 {
194-
return errors.New("manifest has version zero, version must be positive")
194+
return errors.Errorf("manifest has version zero, version must be positive (%s)", m.Name)
195195
}
196196
if m.Header.FileCount == 0 {
197-
return errors.New("manifest has a zero file count")
197+
return fmt.Errorf("manifest has a zero file count (%s)", m.Name)
198198
}
199199

200200
if m.Header.TimeStamp.IsZero() {
201-
return errors.New("manifest timestamp not set")
201+
return errors.Errorf("manifest timestamp not set (%s)", m.Name)
202202
}
203203

204204
// Includes are not required.
@@ -754,6 +754,9 @@ func (m *Manifest) addManifestFiles(ui UpdateInfo, c config) error {
754754
for f := range m.BundleInfo.Files {
755755
isIncluded := false
756756
for _, inc := range includes {
757+
if inc.Name == m.Name {
758+
continue
759+
}
757760
if _, ok := inc.BundleInfo.Files[f]; ok {
758761
isIncluded = true
759762
break

0 commit comments

Comments
 (0)