Skip to content

Commit

Permalink
Merge pull request #1091 from am97/fix/rmp_update
Browse files Browse the repository at this point in the history
Fix: preserve /usr/bin/pulsar and /usr/bin/ppm on RPM updates
  • Loading branch information
DeeDeeG authored Oct 15, 2024
2 parents 12d169d + a47da8e commit 7340f4e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion script/electron-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ let options = {
},
rpm: {
afterInstall: "script/post-install.sh",
afterRemove: "script/post-uninstall.sh",
afterRemove: "script/post-uninstall-rpm.sh",
compression: 'xz',
fpm: ['--rpm-rpmbuild-define=_build_id_links none']
},
Expand Down
22 changes: 22 additions & 0 deletions script/post-uninstall-rpm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh

# https://github.com/pulsar-edit/pulsar/issues/544
# This check works only for RPMs
if [ $1 -ge 1 ]; then
# Package upgrade, do not uninstall
exit 0
fi

PULSAR_SCRIPT_PATH='/usr/bin/pulsar'

if [ -f "$PULSAR_SCRIPT_PATH" ]
then
rm "$PULSAR_SCRIPT_PATH"
fi

PPM_SYMLINK_PATH='/usr/bin/ppm'

if [ -L "$PPM_SYMLINK_PATH" ]
then
rm "$PPM_SYMLINK_PATH"
fi

0 comments on commit 7340f4e

Please sign in to comment.