Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
 def test_skip_function(self):
     pkgbuild = StringIO("""
         pkgname=foo
         build() {
             pkgname=bar
         }
     """)
     target = acumen.PKGBUILD(fileobj=pkgbuild)
     self.assertEquals("foo", target.name)
Exemplo n.º 3
0
 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)
Exemplo n.º 4
0
 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)
Exemplo n.º 5
0
 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)