aboutsummaryrefslogtreecommitdiffstats
path: root/tests/regress/issue58.py
blob: 97e356a31792103c489a432b1bd94c420f4591bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/python3
#
# Reporter: Graham Gower
#
# What steps will reproduce the problem?
# ======================================
#
# 1. Create package A which recommends B.
# 2. Create package B.
# 3. Install A.
# 4. Remove A with --autoremove
#
#
# What is the expected output? What do you see instead?
# =====================================================
#
# Expect B to be removed with A. Instead only A is removed.
#
#
# Status
# ======
#
# Fixed with r555/r556.

import os
import opk, cfg, opkgcl

opk.regress_init()

o = opk.OpkGroup()
o.add(Package="a", Recommends="b")
o.add(Package="b")
o.write_opk()
o.write_list()

opkgcl.update()

opkgcl.install("a")

opkgcl.remove("a", "--autoremove")
if opkgcl.is_installed("b"):
	opk.fail("Recommended package 'b' not autoremoved.")