fix(scripts/rpm): substitute underscores with dashes for RPM version

Co-authored-by: Lorenzo Fontana <lo@linux.com>
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
This commit is contained in:
Leonardo Di Donato 2020-01-21 11:26:45 +00:00 committed by poiana
parent a44ae907fe
commit 29847df168
2 changed files with 8 additions and 6 deletions

View File

@ -14,11 +14,12 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# #
rpm_v=%{version}
dkms add -m falco -v %{version} --rpm_safe_upgrade mod_version=${rpm_v//_/-}
dkms add -m falco -v $mod_version --rpm_safe_upgrade
if [ `uname -r | grep -c "BOOT"` -eq 0 ] && [ -e /lib/modules/`uname -r`/build/include ]; then if [ `uname -r | grep -c "BOOT"` -eq 0 ] && [ -e /lib/modules/`uname -r`/build/include ]; then
dkms build -m falco -v %{version} dkms build -m falco -v $mod_version
dkms install --force -m falco -v %{version} dkms install --force -m falco -v $mod_version
elif [ `uname -r | grep -c "BOOT"` -gt 0 ]; then elif [ `uname -r | grep -c "BOOT"` -gt 0 ]; then
echo -e "" echo -e ""
echo -e "Module build for the currently running kernel was skipped since you" echo -e "Module build for the currently running kernel was skipped since you"

View File

@ -19,5 +19,6 @@ if [ $1 = 0 ]; then
/sbin/service falco stop > /dev/null 2>&1 /sbin/service falco stop > /dev/null 2>&1
/sbin/chkconfig --del falco /sbin/chkconfig --del falco
fi fi
rpm_v=%{version}
dkms remove -m falco -v %{version} --all --rpm_safe_upgrade mod_version=${rpm_v//_/-}
dkms remove -m falco -v $mod_version --all --rpm_safe_upgrade