On mardi 12 mars 2019 08:11:47 CET Panu Matilainen wrote:
> On 3/12/19 6:07 AM, Robert-André Mauchin wrote:
> 
> > Hello,
> > 
> > I have an issue with the update of papirus-icon-theme: in the new version,
> > symlinks have replaced what was previously folders and dnf errors out on
> > this: 
> 
>  > How can I solve this?
>  >
>  >
> 
> 
> https://fedoraproject.org/wiki/Packaging:Directory_Replacement
> 
>       - Panu -


Thanks for the pointer. I have added this lua script as explained:

%pretrans -p <lua>
-- Define the path to directory being replaced below.
-- DO NOT add a trailing slash at the end.
pathlist = {"%{_datadir}/icons/Papirus-Light/16x16/devices",
            "%{_datadir}/icons/Papirus-Light/16x16/places",
            "%{_datadir}/icons/Papirus-Light/22x22/actions",
            "%{_datadir}/icons/Papirus-Light/24x24/actions"}
for key,path in ipairs(pathlist) 
do
  st = posix.stat(path)
  if st and st.type == "directory" then
    status = os.rename(path, path .. ".rpmmoved")
    if not status then
      suffix = 0
      while not status do
        suffix = suffix + 1
        status = os.rename(path .. ".rpmmoved", path .. ".rpmmoved." .. suffix)
      end
      os.rename(path, path .. ".rpmmoved")
    end
  end
end

And the ghosts:

%ghost %{_datadir}/icons/Papirus-Light/16x16/devices.rpmmoved
%ghost %{_datadir}/icons/Papirus-Light/16x16/places.rpmmoved
%ghost %{_datadir}/icons/Papirus-Light/22x22/actions.rpmmoved
%ghost %{_datadir}/icons/Papirus-Light/24x24/actions.rpmmoved

But now the package errors out on install:

Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Running scriptlet: papirus-icon-theme-20190302-2.fc29.noarch
  Preparing        :
The downloaded packages were saved in cache until the next successful 
transaction.
You can remove cached packages by executing 'dnf clean packages'.
Traceback (most recent call last):
  File "/usr/bin/dnf", line 58, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 193, in 
user_main
    errcode = main(args)
  File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 64, in main
    return _main(base, args, cli_class, option_parser_class)
  File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 99, in _main
    return cli_run(cli, base)
  File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 123, in cli_run
    ret = resolving(cli, base)
  File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 168, in 
resolving
    base.do_transaction(display=displays)
  File "/usr/lib/python3.7/site-packages/dnf/cli/cli.py", line 225, in 
do_transaction
    tid = super(BaseCli, self).do_transaction(display)
  File "/usr/lib/python3.7/site-packages/dnf/base.py", line 882, in 
do_transaction
    tid = self._run_transaction(cb=cb)
  File "/usr/lib/python3.7/site-packages/dnf/base.py", line 1009, in 
_run_transaction
    self.history.end(rpmdbv, 2, errors=herrors)
  File "/usr/lib/python3.7/site-packages/dnf/db/history.py", line 504, in end
    bool(return_code)
  File "/usr/lib64/python3.7/site-packages/libdnf/transaction.py", line 758, in 
endTransaction
    return _transaction.Swdb_endTransaction(self, dtEnd, rpmdbVersionEnd, state)
RuntimeError: TransactionItem state is not set: 
papirus-icon-theme-20190302-2.fc29.noarch

It seems the lua part executed correctly as the folders got moved to .rpmmoved 
but the rest 
of the transaction fails.

Did I miss something?

Thanks,

Robert-André

_______________________________________________
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org

Reply via email to