def test_non_standard_variable_substitution(self): pkgbuild = StringIO(""" _pkgname=Foobar sources=($_pkgname.tar.gz) """) target = acumen.PKGBUILD(fileobj=pkgbuild) self.assertEquals(["Foobar.tar.gz"], target.sources)
def test_skip_function(self): pkgbuild = StringIO(""" pkgname=foo build() { pkgname=bar } """) target = acumen.PKGBUILD(fileobj=pkgbuild) self.assertEquals("foo", target.name)
def test_substitution(self): self.package.sources = [ '$url/files/$pkgname-$pkgver.tar.gz', '${url}/files/${pkgname}_doc-$pkgver.tar.gz' ] target = acumen.PKGBUILD(fileobj=self.package.as_file()) values = (self.package.url, self.package.name, self.package.version) parsed_sources = [ '%s/files/%s-%s.tar.gz' % values, '%s/files/%s_doc-%s.tar.gz' % values, ] self.assertEquals(parsed_sources, target.sources)
def test_multiline(self): pkgbuild = StringIO() pkgbuild.write(""" source=(foo \\ baz) depends=(eggs \\ spam\\ pancakes) makedepends(funky_town # got to get funky! pan) """) target = acumen.PKGBUILD(fileobj=pkgbuild) self.assertEquals(['foo', 'baz'], target.sources) self.assertEquals(['eggs', 'spam', 'pancakes'], target.depends)
def test_sane_package(self): target = acumen.PKGBUILD(fileobj=self.package.as_file()) self.assertEquals(self.package.name, target.name) self.assertEquals(self.package.version, target.version) self.assertEquals(self.package.release, target.release) self.assertEquals(self.package.description, target.description) self.assertEquals(self.package.url, target.url) self.assertEquals(self.package.groups, target.groups) self.assertEquals(self.package.licenses, target.licenses) self.assertEquals(self.package.architectures, target.architectures) self.assertEquals(self.package.replaces, target.replaces) self.assertEquals(self.package.conflicts, target.conflicts) self.assertEquals(self.package.provides, target.provides) self.assertEquals(self.package.backup, target.backup) self.assertEquals(self.package.options, target.options) self.assertEquals(self.package.noextract, target.noextract) self.assertEquals(self.package.makedepends, target.makedepends) self.assertEquals(self.package.sources, target.sources) self.assertEquals(self.package.optdepends, target.optdepends) self.assertEquals(self.package.checksums, target.checksums) self.assertEquals(self.package.install, target.install)