Add quotes around strings which may contain spaces

This commit is contained in:
Sandro Mani 2016-01-08 15:41:21 +01:00
parent b3d7787ad4
commit f22d4de92f
3 changed files with 9 additions and 6 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash
# Copyright (c) 2015 Sandro Mani <manisandro@gmail.com>
# Copyright (c) 2015-2016 Sandro Mani <manisandro@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@ -65,7 +65,7 @@ if [ -x /usr/lib/rpm/elfdeps -a -n "$filelist" ]; then
# Get the default provides string from elfdeps
prov=$(echo $file | /usr/lib/rpm/elfdeps --provides $elfdepsargs)
if [ -z $prov ]; then
if [ -z "$prov" ]; then
continue
fi

View File

@ -1,6 +1,6 @@
#!/bin/bash
# Copyright (c) 2015 Sandro Mani <manisandro@gmail.com>
# Copyright (c) 2015-2016 Sandro Mani <manisandro@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@ -91,11 +91,11 @@ if [ -x /usr/lib/rpm/elfdeps -a -n "$filelist" ]; then
# If the scanned binary is inside an mpi dir, for each dependency, check
# whether the library exists in $MPI_LIB, and if yes, append
# ($MPI_COMPILER) to each requires string
if [ ! -z $mpi_comp ]; then
if [ ! -z "$mpi_comp" ]; then
mpi_lib=${mpi_lib_for_compiler[$mpi_comp]}
for req in $reqs; do
lib=$(echo $req | grep -Eo '^.*\.so[^(]*')
if [ ! -z $lib ] && ( [ -e $mpi_lib/$lib ] || [ -e $buildroot$mpi_lib/$lib ] ); then
if [ ! -z "$lib" ] && ( [ -e "$mpi_lib/$lib" ] || [ -e "$buildroot$mpi_lib/$lib" ] ); then
req="${req}($mpi_comp)"
fi
echo "$req"

View File

@ -1,6 +1,6 @@
Name: rpm-mpi-hooks
Version: 3
Release: 4%{?dist}
Release: 5%{?dist}
Summary: RPM dependency generator hooks for MPI packages
License: MIT
@ -46,6 +46,9 @@ install -Dpm 0755 %{SOURCE3} %{buildroot}%{_rpmconfigdir}/mpi.req
%changelog
* Fri Jan 08 2016 Sandro Mani <manisandro@gmail.com> 3-5
- Add quotes around strings which may contain spaces
* Tue Dec 22 2015 Orion Poplawski <orion@cora.nwra.com> - 3-4
- Require environment(modules)