Ejemplo n.º 1
0
def checkout(package):
    with tdir() as path:
        with cd(path):
            if package['type'] == "source":
                safe_run(["dget", "-u", "-d", package['source']['dsc_url']])
                yield package['source']['dsc_filename']
            elif package['type'] == "binary":
                files = []
                for deb in package['binary']['debs']:
                    files += [deb['filename']]
                    safe_run(["dget", "-u", "-d", deb['url']])
                yield files
            else:
                raise Exception
Ejemplo n.º 2
0
def checkout(package):
    with tdir() as path:
        with cd(path):
            if package['type'] == "source":
                safe_run(["dget", "-u", "-d", package['source']['dsc_url']])
                yield package['source']['dsc_filename']
            elif package['type'] == "binary":
                files = []
                for deb in package['binary']['debs']:
                    files += [deb['filename']]
                    safe_run(["dget", "-u", "-d", deb['url']])
                yield files
            else:
                raise Exception
Ejemplo n.º 3
0
 def test_safe_run_without_tuple(self):
     (output, output_stderr, exit_status) = safe_run("ls")
     self.assertEqual(exit_status, 0)
Ejemplo n.º 4
0
 def test_safe_run_with_expected_wrong_exit_code(self):
     (output, output_stderr, exit_status) = safe_run("ls2", expected=-1)
     self.assertEqual(exit_status, -1)
Ejemplo n.º 5
0
 def test_safe_run_simple(self):
     (output, output_stderr, exit_status) = safe_run("ls", expected=0)
     self.assertEqual(exit_status, 0)
Ejemplo n.º 6
0
def sign(changes, gpg):
    if changes.endswith(".dud"):
        safe_run(['gpg', '-u', gpg, '--clearsign', changes])
        os.rename("%s.asc" % (changes), changes)
    else:
        safe_run(['debsign', '-k', gpg, changes])
Ejemplo n.º 7
0
 def test_safe_run_without_tuple(self):
     (output, output_stderr, exit_status) = safe_run("ls")
     self.assertEqual(exit_status, 0)
Ejemplo n.º 8
0
 def test_safe_run_with_expected_wrong_exit_code(self):
     (output, output_stderr, exit_status) = safe_run("ls2", expected=-1)
     self.assertEqual(exit_status, -1)
Ejemplo n.º 9
0
 def test_safe_run_simple(self):
     (output, output_stderr, exit_status) = safe_run("ls", expected=0)
     self.assertEqual(exit_status, 0)
Ejemplo n.º 10
0
def test_safe_run():
    safe_run("ls",expected=0)
    safe_run("ls",expected=0)
    safe_run("cat","foo")
    (output, output_stderr, exit_status) = safe_run("ls2",expected=-1)
    assert exit_status != 0