0

I have a debian package that already has been released but I'm trying to apply a post installation step to it and it's not being performed. My package's upstream repo and release repo are in the links below, respectively: https://github.com/shadow-robot/sr_hand_detector/blob/melodic-devel/scripts/postinst https://github.com/shadow-robot/sr_hand_detector-release

As you can see in the first link, I have a postinst file in the scripts folder. At the release time, I have just had it there, which as I understand now, would not have inserted the script into my debian release. Therefore, just today I made additional changes, i.e. I manually commited and pushed the postinst file to the debian/melodic/sr_hand_detector branch of the release repo, as seen here: https://github.com/shadow-robot/sr_hand_detector-release/tree/debian/melodic/sr_hand_detector/debian

However, I can see that the script is still not applied when I do sudo apt install step. My question therefore is - what additional steps do I have to perform to cleanly make the post installation step work for my debian release. Do I just need to create another version release and make a PR to the rosdistro, do I only need to wait until next sync, or both, or some other step that I am missing here?

Thanks in advance for any advice!

Mike_k
  • 11
  • 1

1 Answers1

0

You can find, if the system installed your script. Check in /var/lib/dpkg/info/<package_name>.postinst. I assume apt/dpkg installed it.

So the problem is in postinst:

<HERE THE ERROR: A EMPTY LINE>
#!/bin/sh
set -e
(...)

the first line is empty. Kernel just check the first bytes: # + ! + ev. a space (which was required on olden times) + a path which should start with /.

Because you had an empty line, kernel fails the check, so he try to execute directly the program (without passing it to /bin/sh), but it is not a valid binary program, so it fail to execute the script.

Giacomo Catenazzi
  • 8,519
  • 2
  • 24
  • 32
  • Thanks for your answer Giacomo! So, the underlying issue I think is that the script is not installed in the first place. in /var/lib/dpkg/info there is no postinst. Also, when running sudo dpkg -D2 -i ros-melodic-sr-hand-detector_0.0.2-1bionic.20201017.081752_amd64.deb I get D000002: vmaintscript_installed nonexistent postinst After adding postinst files (after fixing that empty line) to /debian/melodic/sr-hand-detector branch, do I need to preform full new release or wait for the sync until the change starts existing in the debian file? – Mike_k Dec 08 '20 at 13:47
  • I do not get your question (or what do you mean for "sync"). Usually in Debian we release a new version if we change something (but for test, but so we install them manually, not without apt [I think in apt you can force reinstall, but not re-download). – Giacomo Catenazzi Dec 08 '20 at 13:51
  • By sync I meant this (from blood documentation): "Packages built are periodically synchronized over to the shadow-fixed and public repositories, so it might take as long as a month before your package is available on the public ROS debian repositories (i.e. available via apt-get). To get updates on when the next synchronization (sync) is coming, check the ROS discussion forums." – Mike_k Dec 08 '20 at 14:04