Bug 17365

Summary: mgarepo fails during putsrpm (import) of src.rpm which does not contain a SOURCES folder
Product: Mageia Reporter: Florian Hubold <doktor5000>
Component: RPM PackagesAssignee: papoteur <yvesbrungard>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Normal CC: doktor5000
Version: Cauldron   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Source RPM: mgarepo CVE:
Status comment:

Description Florian Hubold 2015-12-19 13:57:40 CET
Description of problem:


As mentioned already on -dev ml https://ml.mageia.org/wwsympa-wrapper.fcgi/arc/dev/2015-12/msg00308.html
mgarepo currently fails during putsrpm (import) of an src.rpm, if that does not contain a SOURCES folder (example is a task- metapackage which usually contains no files at all)


Tried with the latest version in cauldron, and also with latest git, same result:


[user@localhost]â[09:27:13]â[~/MGA/gitweb/mgarepo] ./mgarepo --version                                                                                                                                                                       
mgarepo 1.11.3

[user@localhost]â[09:28:00]â[~/MGA/gitweb/mgarepo] ./mgarepo putsrpm -l '- inital import' ~/MGA/task-mageia-packaging/SRPMS/task-mageia-packaging-0.1-1.mga6.src.rpm
Importing package to svn+ssh://svn.mageia.org/svn/packages/cauldron/task-mageia-packaging
Traceback (most recent call last):
  File "./mgarepo", line 93, in <module>
    do_command(parse_options, dispatch_command)
  File "/home/user/MGA/gitweb/mgarepo/MgaRepo/command.py", line 39, in do_command
    main_func(**opt.__dict__)
  File "./mgarepo", line 84, in dispatch_command
    command_module.main()
  File "/home/user/MGA/gitweb/mgarepo/MgaRepo/commands/putsrpm.py", line 54, in main
    do_command(parse_options, put_srpm_cmd)
  File "/home/user/MGA/gitweb/mgarepo/MgaRepo/command.py", line 39, in do_command
    main_func(**opt.__dict__)
  File "/home/user/MGA/gitweb/mgarepo/MgaRepo/commands/putsrpm.py", line 51, in put_srpm_cmd
    logmsg, rename)
  File "/home/user/MGA/gitweb/mgarepo/MgaRepo/rpmutil.py", line 226, in put_srpm
    usourcesentries = os.listdir(usourcesdir)
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmptbps0hkh/SOURCES'
[â]â[user@localhost]â[09:28:31]â[~/MGA/gitweb/mgarepo]



FWIW, my last import of such a task-package went just fine, and the SOURCES folder was created in SVN and also an empty sha1.lst was created inside:

http://svnweb.mageia.org/packages?view=revision&revision=626527

Reproducible: 

Steps to Reproduce:
Comment 1 Florian Hubold 2015-12-19 14:22:59 CET
Tested again with 1.11.4 from today:


[user@localhost]â[08:06:38]â[~/MGA/gitweb/mgarepo] ./mgarepo --version
mgarepo 1.11.4

[user@localhost]â[08:07:04]â[~/MGA/gitweb/mgarepo] ./mgarepo putsrpm -l '- inital import' ~/MGA/task-mageia-packaging/SRPMS/task-mageia-packaging-0.1-1.mga6.src.rpm
Importing package to svn+ssh://svn.mageia.org/svn/packages/cauldron/task-mageia-packaging
error: command failed: cp -rlf /tmp/tmp3ml9ilx3/SOURCES /tmp/tmpngx5ax9r/current
cp: cannot stat '/tmp/tmp3ml9ilx3/SOURCES': No such file or directory

CC: (none) => doktor5000

Comment 2 papoteur 2015-12-19 16:31:18 CET
I have pushed another test.
Can you try again, Please?
Thanks for your cooperation.
Comment 3 Florian Hubold 2015-12-19 21:38:29 CET
Sure, tried again after git pull, no more errors anymore.

[user@localhost]â[15:26:46]â[~/MGA/gitweb/mgarepo] ./mgarepo putsrpm -l '- inital import' ~/MGA/task-mageia-packaging/SRPMS/task-mageia-packaging-0.1-1.mga6.src.rpm
Importing package to svn+ssh://svn.mageia.org/svn/packages/cauldron/task-mageia-packaging
[user@localhost]â[15:27:05]â[~/MGA/gitweb/mgarepo] echo $?
0

Seems to have worked just fine, should be good now:
http://svnweb.mageia.org/packages?view=revision&revision=912284

But doesn't it display the revision it commited, same as for "mgarepo ci" or at least something like "import succeeded" or similar? I cannot really remember, as my last import was quite some time ago and I don't have any logs anymore :)


If you tell me how I can also push this to cauldron and submit it ...
Comment 4 Mageia Robot 2015-12-20 09:08:12 CET
commit e3ddfccab05554cc0b185d34d1f13b716d874c5d
Author: Papoteur <papoteur@...>
Date:   Sun Dec 20 09:07:40 2015 +0100

    - Push 1.11.5 (fix mga#17365)
---
 Commit Link:
   http://gitweb.mageia.org/software/build-system/mgarepo/commit/?id=e3ddfccab05554cc0b185d34d1f13b716d874c5d
Comment 5 Florian Hubold 2015-12-20 14:35:56 CET
Submitted mgarepo-1.11.5-1.mga6 to cauldron.
Thanks to Yves for the quick fix :)

Status: NEW => RESOLVED
Resolution: (none) => FIXED