-
-
Save TomyLobo/23d3fb65295e00b1abf8bcc4307f6b7e to your computer and use it in GitHub Desktop.
Recent RPM considers non-zero %post exit status a warning and return a non-zero exit status
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./test.sh | |
Created package {:path=>"falsepackage-1.0-1.x86_64.rpm"} | |
postinstall scriptlet (using /bin/sh): | |
false | |
(contains no files) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
rm -f falsepackage-1.0-1.x86_64.rpm | |
echo false > postinst | |
args=( | |
--name falsepackage | |
--input-type dir | |
--output-type rpm | |
--after-install postinst | |
--chdir src | |
. | |
) | |
bundle install --path=.bundle/ | |
bundle exec fpm "${args[@]}" | |
rpm -qpl --scripts falsepackage-1.0-1.x86_64.rpm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[root@centos6-box ~]# rpm --version | |
RPM version 4.8.0 | |
[root@centos6-box ~]# rpm -i falsepackage-1.0-1.x86_64.rpm; echo $? | |
warning: %post(falsepackage-1.0-1.x86_64) scriptlet failed, exit status 1 | |
0 | |
[root@otrs32 ~]# yum install falsepackage-1.0-1.x86_64.rpm; echo $? | |
Loaded plugins: fastestmirror, security | |
Setting up Install Process | |
Examining falsepackage-1.0-1.x86_64.rpm: falsepackage-1.0-1.x86_64 | |
Marking falsepackage-1.0-1.x86_64.rpm to be installed | |
Determining fastest mirrors | |
epel/metalink | 28 kB 00:00 | |
* base: mirror1.hs-esslingen.de | |
* epel: ftp.uni-bayreuth.de | |
* extras: ftp.uni-bayreuth.de | |
* updates: centos.mirror.iphh.net | |
base | 3.7 kB 00:00 | |
epel | 4.7 kB 00:00 | |
epel/primary_db | 6.0 MB 00:01 | |
extras | 3.4 kB 00:00 | |
updates | 3.4 kB 00:00 | |
Resolving Dependencies | |
--> Running transaction check | |
---> Package falsepackage.x86_64 0:1.0-1 will be installed | |
--> Finished Dependency Resolution | |
Dependencies Resolved | |
============================================================================================================================================================================ | |
Package Arch Version Repository Size | |
============================================================================================================================================================================ | |
Installing: | |
falsepackage x86_64 1.0-1 /falsepackage-1.0-1.x86_64 0.0 | |
Transaction Summary | |
============================================================================================================================================================================ | |
Install 1 Package(s) | |
Installed size: 0 | |
Is this ok [y/N]: y | |
Downloading Packages: | |
Running rpm_check_debug | |
Running Transaction Test | |
Transaction Test Succeeded | |
Running Transaction | |
Installing : falsepackage-1.0-1.x86_64 1/1 | |
warning: %post(falsepackage-1.0-1.x86_64) scriptlet failed, exit status 1 | |
Non-fatal POSTIN scriptlet failure in rpm package falsepackage-1.0-1.x86_64 | |
Verifying : falsepackage-1.0-1.x86_64 1/1 | |
Installed: | |
falsepackage.x86_64 0:1.0-1 | |
Complete! | |
0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[root@centos7-box ~]# rpm --version | |
RPM version 4.11.3 | |
[root@centos7-box ~]# rpm -i falsepackage-1.0-1.x86_64.rpm; echo $? | |
warning: %post(falsepackage-1.0-1.x86_64) scriptlet failed, exit status 1 | |
0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source "https://rubygems.org" | |
gem "fpm" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vagrant@sles11-box:~> rpm --version | |
RPM version 4.4.2.3 | |
vagrant@sles11-box:~> sudo rpm -i /vagrant/falsepackage-1.0-1.x86_64.rpm; echo $? | |
error: %post(falsepackage-1.0-1.x86_64) scriptlet failed, exit status 1 | |
1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vagrant@sles12-box:~> rpm --version | |
RPM version 4.11.2 | |
vagrant@sles12-box:~> sudo rpm -i /vagrant/falsepackage-1.0-1.x86_64.rpm; echo $? | |
warning: %post(falsepackage-1.0-1.x86_64) scriptlet failed, exit status 1 | |
0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment