Skip to content

Find files wil now replace system paths with rpm macros (fix #351) - #352

Open
onionka wants to merge 12 commits into
rh-lab-q:masterfrom
onionka:FindFile
Open

Find files wil now replace system paths with rpm macros (fix #351)#352
onionka wants to merge 12 commits into
rh-lab-q:masterfrom
onionka:FindFile

Conversation

@onionka

@onionka onionka commented Nov 5, 2015

Copy link
Copy Markdown
Member

No description provided.

@onionka

onionka commented Nov 5, 2015

Copy link
Copy Markdown
Member Author

Could you restart Travis? This error shown up:

11.08s$ docker exec -i test_fedora bash -c "dnf builddep -y hawkey"
enabling fedora-source repository
enabling updates-source repository
Last metadata expiration check performed 0:00:01 ago on Thu Nov  5 20:06:32 2015.
Traceback (most recent call last):
  File "/usr/bin/dnf", line 36, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 198, in user_main
    errcode = main(args)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 84, in main
    return _main(base, args)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 136, in _main
    cli.run()
  File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 1091, in run
    return self.command.run(self.base.extcmds)
  File "/usr/lib/python2.7/site-packages/dnf-plugins/builddep.py", line 76, in inner
    return func(*args, **kwds)
  File "/usr/lib/python2.7/site-packages/dnf-plugins/builddep.py", line 142, in run
    self._remote_deps(pkgspec)
  File "/usr/lib/python2.7/site-packages/dnf-plugins/builddep.py", line 213, in _remote_deps
    package).get_best_query(self.base.sack)})
  File "/usr/lib/python2.7/site-packages/dnf-plugins/builddep.py", line 212, in <setcomp>
    for pkg in dnf.subject.Subject(
  File "/usr/lib/python2.7/site-packages/dnfpluginscore/lib.py", line 170, in package_source_name
    srcname = package.sourcerpm.rstrip(".src.rpm")
AttributeError: 'NoneType' object has no attribute 'rstrip'

@jsilhan

jsilhan commented Nov 6, 2015

Copy link
Copy Markdown
Member

The travis will be when new dnf-plugins-core package is in the repositories. (the bug is fixed in the upstream but no new version has been released)

Comment thread rpg/plugins/misc/find_file.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be tuples (prefixes, macros)

@onionka
onionka force-pushed the FindFile branch 2 times, most recently from 63452c5 to f91873a Compare November 6, 2015 18:59
Comment thread rpg/plugins/misc/find_file.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lkardos, can you answer, please, if these tuples are accessible from rpm?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use rpm.expandMacro() but there is no easy way how to get names of all defined macros. Probably you have to hardcode them. So you can use something like this:

MACROS = { rpm.expandMacro(x): x for x in ["%{_javadocdir}", "%{_javadocdir}", "%{_javadir}", ... ] }

One way how to avoid harcoded names of macros is to parse them from string returned by rpm.expandMacro("%dump") but I don't recommend that.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok I have done it with %dump ... there is a problem only with duplicities like this:

-  ('%{_kde4_libdir}/libl.so', None, None),
?      -----

+  ('%{_libdir}/libl.so', None, None),

where %{_kde4_libdir} == '/usr/lib64'
and %{_libdir} == '/usr/lib64'

should I just ignore it?

@onionka

onionka commented Feb 7, 2016

Copy link
Copy Markdown
Member Author

Now this should be all OK and non-hardcoded

@onionka
onionka force-pushed the FindFile branch 4 times, most recently from 9bf95dd to cc573ef Compare February 7, 2016 16:38
@onionka

onionka commented Feb 7, 2016

Copy link
Copy Markdown
Member Author

this error is issued #373 but everything else is OK. please restart travis

@onionka

onionka commented Feb 24, 2016

Copy link
Copy Markdown
Member Author

depends on #358 heavily but all done - I hope tests will pass now

@onionka

onionka commented Feb 24, 2016

Copy link
Copy Markdown
Member Author

It is failing because of missing macro definition

see #374

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants