Skip to content

Commit fde6b88

Browse files
authored
Fix "you must first set a package to build it" error (#131)
Fix an issue introduced in #130 where all builds fail due to the package
1 parent 4a5ad18 commit fde6b88

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION := 1.8.0
1+
VERSION := 1.8.1
22
BINNAME := solbuild
33

44
.PHONY: build

builder/manager.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -405,15 +405,10 @@ func (m *Manager) Chroot() error {
405405
return ErrInterrupted
406406
}
407407

408-
m.lock.Lock()
409-
410-
if m.pkg == nil {
411-
m.lock.Unlock()
412-
return ErrNoPackage
408+
if err := m.checkPackage(); err != nil {
409+
return err
413410
}
414411

415-
m.lock.Unlock()
416-
417412
// Now get on with the real work!
418413
defer m.Cleanup()
419414

@@ -512,5 +507,9 @@ func (m *Manager) checkPackage() error {
512507
m.lock.Lock()
513508
defer m.lock.Unlock()
514509

515-
return ErrNoPackage
510+
if m.pkg == nil {
511+
return ErrNoPackage
512+
}
513+
514+
return nil
516515
}

0 commit comments

Comments
 (0)