Package: mock
Version: 1.3.2-2
Severity: normal

Dear Maintainer,

The mock package ships two commands:
* mock
* mockchain

The mockchain command is not working because it tries to call
/usr/bin/createrepo_c which is not available in any Debian package.

(line 59 and 61 of /usr/bin/mockchain)


sudo mockchain --localrepo /tmp -r epel-7-x86_64 -m --rebuild /tmp/nothing.rpm

starting logfile: None
results dir: /var/tmp/mock-chain-kakwa-10886-26_7_a7f/results/epel-7-x86_64
config dir: /var/tmp/mock-chain-kakwa-10886-26_7_a7f/configs/epel-7-x86_64
Traceback (most recent call last):
  File "/usr/bin/mockchain", line 414, in <module>
  File "/usr/bin/mockchain", line 314, in main
    err = createrepo(opts.local_repo_dir)[1]
  File "/usr/bin/mockchain", line 63, in createrepo
    comm, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  File "/usr/lib/python3.5/", line 676, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.5/", line 1289, in _execute_child
    raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/bin/createrepo_c'

Test I've done:

Replacing /usr/bin/createrepo_c by /usr/bin/createrepo (python implementation) 
seems to
work fine, I've been enable to build rpms, including rpms depending on
other rpms present in the local repo.


diff --git a/mock/py/ b/mock/py/
index e783bd0..74746cd 100755
--- a/mock/py/
+++ b/mock/py/
@@ -56,9 +56,9 @@ mockconfig_path = '/etc/mock'

 def createrepo(path):
     if os.path.exists(path + '/repodata/repomd.xml'):
-        comm = ['/usr/bin/createrepo_c', '--update', path]
+        comm = ['/usr/bin/createrepo', '--update', path]
-        comm = ['/usr/bin/createrepo_c', path]
+        comm = ['/usr/bin/createrepo', path]
     cmd = subprocess.Popen(
         comm, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
     out, err = cmd.communicate()

I see two possibilities:

* packaging createrepo_c 
( in Debian.
  I've done a quick test, it builds ok and all the necessary dependencies are 
already available.
* patching mockchain to use createrepo.

In both cases, I think the corresponding createrepo(_c) package should
be added as a dependency of the mock package.

-- System Information:
Debian Release: buster/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.12.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages mock depends on:
ii  python       2.7.13-2
ii  python3      3.5.3-3
ii  python3-rpm
ii  python3-six  1.10.0-4
ii  usermode     1.109-1+b2
ii  yum          3.4.3-3
ii  yum-utils    1.1.31-2

mock recommends no packages.

Versions of packages mock suggests:
pn  pigz  <none>

-- Configuration Files:
/etc/mock/epel-6-x86_64.cfg changed [not included]
/etc/mock/fedora-25-x86_64.cfg changed [not included]

-- no debconf information

Reply via email to