Bug 14513 - %post(avrdude-6.1-5.mga5.i586) scriptlet failed, exit status 2
Summary: %post(avrdude-6.1-5.mga5.i586) scriptlet failed, exit status 2
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: i586 Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Shlomi Fish
QA Contact:
URL:
Whiteboard:
Keywords: Triaged
Depends on:
Blocks:
 
Reported: 2014-11-12 19:08 CET by Alex Loginov
Modified: 2014-12-21 15:04 CET (History)
1 user (show)

See Also:
Source RPM: avrdude
CVE:
Status comment:


Attachments

Description Alex Loginov 2014-11-12 19:08:51 CET
Description of problem: %post(avrdude-6.1-5.mga5.i586) scriptlet failed, exit status 2


Version-Release number of selected component (if applicable): avrdude-6.1-5.mga5.i586.rpm


How reproducible: always


Steps to Reproduce:
1.  install avrdude


Reproducible: 

Steps to Reproduce:
Alex Loginov 2014-11-12 19:09:07 CET

Keywords: (none) => Triaged
Assignee: bugsquad => shlomif

Comment 1 David Walser 2014-11-15 00:52:45 CET
It looks like Requires(post) should also have systemd, but systemd is unlikely to be missing.

CC: (none) => juergen.harms

Comment 2 Juergen Harms 2014-11-18 22:24:16 CET
I did some experimenting to better understand this bug:

1.
urpme avrdude ( which does also remove the file /usr/lib/udev/rules.d/70-avrdude_usbprog.rules )

2.
udevadm control --reload ( in order to make usb forget the interfaces to the programmers which some old avrdude might have defined - although earlier versions of avrdude did not install the file 70-avrdude_usbprog.rules)

3. urpmi (i.e fetch the stock avrdude-6.1.5 from the repository )

4. with the newly installed avrdude, open a session on a programmer to check whether the usb interface has become defined by the %post rule ( for my programmer and my target device the command is "avrdude -p AT90CAN128 -c jtag3 -P usb" ).


All that runs smoothly, no error messages on the console, and does what it is supposed to do.

So, for me the avrdude package in Beta1 works without flaw - I cannot reproduce the %post bug as it is defined.

However, I guess that avrdude does not build any more on cauldron, i.e. the Mageia build systems (it still worked when I did a local build on Alpha - maybe 2? a couple of weeks ago): the local build on my fully updated Beta1 system fails with "pkgconfig(libusb) is needed by avrdude-6.1-5.mga5.x86_64". Manually installing the lib64usb-compat0.1-devel package before the build makes the problem go away (and rpmlint is happy). Probably the package on the repositories had been built some time ago.

So, either the BuildRequire on pkgconfig(libusb) in the spec file is incorrect, or the Buildrequire for pkgconfig(libusb) does not manage to find the correct package (libusb...). I do not know enough to fix this problem - I am sure that explicitely making lib64usb-compat0.1-devel the target of the buildrequire would be wrong.

One more question: the udevadm documentation says udevadm control --reload. But googling, I also found --reload-rules. Both work on Mageia - which one is correct?

Juergen
Comment 3 Juergen Harms 2014-11-19 07:59:03 CET
I have now changed the build-require to libusb0.1-devel. That is at least not entirely wrong and it make avrdude build correctly

With this change, I have created and submitted avrdude-6.1.6: it builds on the build system without problem. So far, I have not asked for a freeze push: maybe the %post problem can be reproduced and clarified - that might produce the need for further modifications.

@Alex: can you make a local build of this avrdude-6.1.6 and see whether that is OK for you?
Comment 4 Alex Loginov 2014-11-19 08:14:01 CET
Juergen, hello,

see  Comment 1 from David Walser.
There are udevadm from systemd pkg in %post and in %preun, but no
Requires(post): systemd
Requires(postun): systemd
Comment 5 Juergen Harms 2014-11-19 08:35:41 CET
I see. But I am not competent with this kind of problem. To me it seems kind of an overkill to require systemd, I had thought that systemd necessarily comes with the installation - why have a require ? - what are the consequences / error messages due to not having this require? 

But again, not something for me to play around with.
Comment 6 Alex Loginov 2014-11-19 09:05:27 CET
You tested in ready distro with systemd, but issue if to install avrdude in clean chroot environment with basesystem-minimal. In this case avrdude should be installed after systemd. And all errors from udevadm to /dev/null.
Comment 7 Juergen Harms 2014-11-19 09:32:55 CET
Yes, I wondered about this kind of scenario. Does the minimal basesystem not at all contain systemd, or is there just the problem in which sequence systemd and an application package like avrdude are installed?

I agree, creating a minimal system with chroot should wherever possible not produce errors that do not appear when creating a production install on real hardware.

But: if you start with a minimal system - do you immediately install applications like avrdude, or if you go from a minimum system to a system with applications isnt there a certain sequence to be respected? Does usb come with the minimal system, or is there a similar problem?

With other words: is this a question of dependencies in a package like avrdude, or a question of system installation procedures? is this a real problem, or something the French call "une discussion sur le sexe des anges"? (-
Comment 8 Alex Loginov 2014-11-19 12:45:26 CET
If you use udevadm, then systemd requires are missing (basesystem-minimal+avrdude and you'll see issue).
If udevadm finished with an error, then to move output to /dev/null (basesystem+avrdude and you'll see issue)
Comment 9 Juergen Harms 2014-11-19 13:53:40 CET
Sure, you made that issue clear in comment #4. But what is the logic of wanting to install an application like avrdude on a minimal system, why is that needed? in my eyes that does not make sense. For me, it is a question of distinguishing between a bug, and a problem of improper usage.

Piping the message into /dev/null is a workaround, it hides the fact that something went wrong, but it does not fix the bug - if it is considered a bug.

Let us stay formally correct: I am not the maintainer of udev (but I did maintenance on avrdude while there was no maintainer). Yesterday I fixed the urgent problem that avrdude does not build any more - that was necessary without question. But it is not my role to apply fixes for which I personally do not see an important reason, and where I lack knowledge to precisely assess what I would be doing.

Formally, the bug is assigned to Shlomi - who has much better knowledge on packaging policy and techniques. I think it is up to him to decide how to proceed.
Comment 10 Shlomi Fish 2014-12-21 12:45:20 CET
Alex Loginov: can I close this bug?

Status: NEW => ASSIGNED

Comment 11 Alex Loginov 2014-12-21 14:39:07 CET
Requires(post): systemd
Requires(postun): systemd
?
Comment 12 Shlomi Fish 2014-12-21 15:04:45 CET
(In reply to Alex Loginov from comment #11)
> Requires(post): systemd
> Requires(postun): systemd
> ?

I applied this fix in rel 7. Hope it helps, and I hereby RESOLVEing it.

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


Note You need to log in before you can comment on or make changes to this bug.