Skip to content

Commit

Permalink
Fix buildorder recursion when there are no dependencies
Browse files Browse the repository at this point in the history
This is a major problem since the AUR returns an error when the deplist
is empty.

Fixes #106.
  • Loading branch information
JAicewizard authored and falconindy committed Sep 3, 2024
1 parent 6131e35 commit 29fa98f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/auracle/auracle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,10 @@ void Auracle::IteratePackages(std::vector<std::string> args,
}
}

if (alldeps.empty()) {
return 0;
}

IteratePackages(std::move(alldeps), state);
}
}
Expand Down
1 change: 1 addition & 0 deletions tests/fakeaur/db/info/mingw-w64-environment
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"resultcount":1,"results":[{"Description":"Script providing common environment variables and functions for MinGW (mingw-w64)","FirstSubmitted":1575319559,"ID":1504025,"Keywords":[],"LastModified":1720940851,"License":["BSD"],"Maintainer":"xantares","Name":"mingw-w64-environment","NumVotes":9,"OutOfDate":null,"PackageBase":"mingw-w64-environment","PackageBaseID":147146,"Popularity":0.490759,"Submitter":"xantares","URL":"http://fedoraproject.org/wiki/MinGW","URLPath":"/cgit/aur.git/snapshot/mingw-w64-environment.tar.gz","Version":"1-6"}],"type":"multiinfo","version":5}
6 changes: 6 additions & 0 deletions tests/test_buildorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ def testDependencyCycle(self):
'warning: found dependency cycle: [ python-fontpens -> python-fontparts -> python-fontpens ]',
r.process.stderr.decode().strip().splitlines())

def testNoDependencies(self):
r = self.Auracle(['buildorder', 'mingw-w64-environment'])
self.assertEqual(0, r.process.returncode)
self.assertIn('TARGETAUR mingw-w64-environment mingw-w64-environment',
r.process.stdout.decode().strip().splitlines())


if __name__ == '__main__':
auracle_test.main()

0 comments on commit 29fa98f

Please sign in to comment.