| |
@@ -32,7 +32,14 @@
|
| |
# Might be solvable, see
|
| |
# https://bugs.launchpad.net/ubuntu/+source/packagekit/+bug/1008106
|
| |
try:
|
| |
- check_output(['dnf', 'makecache'])
|
| |
+ check_output(['mock', '-r', Settings.mock_config, '-qn', 'install',
|
| |
+ 'dnf'])
|
| |
+ except subprocess.CalledProcessError:
|
| |
+ Settings.get_logger().warning(
|
| |
+ "Cannot install dnf, trouble ahead")
|
| |
+ try:
|
| |
+ check_output(['mock', '-r', Settings.mock_config, '-qn',
|
| |
+ '--enable-network', 'shell', 'dnf makecache'])
|
| |
except subprocess.CalledProcessError:
|
| |
Settings.get_logger().warning(
|
| |
"Cannot run dnf makecache, trouble ahead")
|
| |
@@ -46,8 +53,9 @@
|
| |
if not pkgs:
|
| |
return []
|
| |
|
| |
- cmd = ['dnf', 'repoquery', '-q', '-C', '--requires', '--resolve']
|
| |
- cmd.extend(list(set(pkgs)))
|
| |
+ cmd = ['mock', '-r', Settings.mock_config, '-qn', '--enable-network',
|
| |
+ 'shell', 'dnf repoquery -q -C --requires --resolve ' +
|
| |
+ ' '.join(list(set(pkgs)))]
|
| |
Settings.get_logger().debug("Running: %s", ' '.join(cmd))
|
| |
try:
|
| |
dnf = subprocess.Popen(cmd, stdout=subprocess.PIPE)
|
| |
@@ -72,8 +80,9 @@
|
| |
if not pkgs:
|
| |
return []
|
| |
|
| |
- cmd = ['dnf', 'repoquery', '-q', '-C', '--provides']
|
| |
- cmd.extend(list(set(pkgs)))
|
| |
+ cmd = ['mock', '-r', Settings.mock_config, '-qn', '--enable-network',
|
| |
+ 'shell', 'dnf repoquery -q -C --provides '
|
| |
+ + ' '.join(list(set(pkgs)))]
|
| |
Settings.get_logger().debug("Running: %s", ' '.join(cmd))
|
| |
try:
|
| |
dnf = subprocess.Popen(cmd, stdout=subprocess.PIPE)
|
| |
@@ -107,7 +116,8 @@
|
| |
|
| |
def resolve_one(req):
|
| |
''' Return the packages providing the req symbol. '''
|
| |
- cmd = ['dnf', 'repoquery', '-C', '--whatprovides', req]
|
| |
+ cmd = ['mock', '-r', Settings.mock_config, '-qn', '--enable-network',
|
| |
+ 'shell', 'dnf repoquery -C --whatprovides "' + req + '"']
|
| |
Settings.get_logger().debug("Running: %s", ' '.join(cmd))
|
| |
|
| |
try:
|
| |
@@ -166,7 +176,9 @@
|
| |
owners = []
|
| |
paths_to_exam = list(paths)
|
| |
for path in paths:
|
| |
- p = subprocess.Popen(['rpm', '--qf', '%{NAME}\n', '-qf', path],
|
| |
+ p = subprocess.Popen(['mock', '-r', Settings.mock_config, '-qn',
|
| |
+ '--enable-network', 'shell',
|
| |
+ 'rpm --qf %{NAME}\n -qf ' + path],
|
| |
stdout=subprocess.PIPE,
|
| |
stderr=subprocess.PIPE)
|
| |
path_owners = p.communicate()[0].split()
|
| |
@@ -181,7 +193,8 @@
|
| |
paths_to_exam.remove(path)
|
| |
owners.extend(path_owners)
|
| |
for path in paths_to_exam:
|
| |
- cmd = ['dnf', 'repoquery', '-C', '--quiet', '--file', path]
|
| |
+ cmd = ['mock', '-r', Settings.mock_config, '-qn', '--enable-network',
|
| |
+ 'shell', 'dnf repoquery -C --quiet --file ' + path]
|
| |
Settings.get_logger().debug("Running: %s", ' '.join(cmd))
|
| |
try:
|
| |
lines = check_output(cmd).split()
|
| |
@@ -204,8 +217,8 @@
|
| |
if not isinstance(pkgs, list):
|
| |
pkgs = [pkgs]
|
| |
|
| |
- cmd = ['dnf', 'repoquery', '-C', '-l']
|
| |
- cmd.extend(list(set(pkgs)))
|
| |
+ cmd = ['mock', '-r', Settings.mock_config, '-qn', '--enable-network',
|
| |
+ 'shell', 'dnf repoquery -C -l ' + ' '.join(list(set(pkgs)))]
|
| |
|
| |
Settings.get_logger().debug("Running: %s", ' '.join(cmd))
|
| |
try:
|
| |
This solves the problems mentioned in https://pagure.io/FedoraReview/pull-request/330#comment-79184