From f22d4de92f2a02a399c54f3a00bce0cf7d9172f4 Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Fri, 8 Jan 2016 15:41:21 +0100 Subject: [PATCH] Add quotes around strings which may contain spaces --- mpi.prov | 4 ++-- mpi.req | 6 +++--- rpm-mpi-hooks.spec | 5 ++++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/mpi.prov b/mpi.prov index 5b3ac69..4cadb50 100755 --- a/mpi.prov +++ b/mpi.prov @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright (c) 2015 Sandro Mani +# Copyright (c) 2015-2016 Sandro Mani # # 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 diff --git a/mpi.req b/mpi.req index e790090..1992903 100755 --- a/mpi.req +++ b/mpi.req @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright (c) 2015 Sandro Mani +# Copyright (c) 2015-2016 Sandro Mani # # 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" diff --git a/rpm-mpi-hooks.spec b/rpm-mpi-hooks.spec index 1e9d38a..59b7e92 100644 --- a/rpm-mpi-hooks.spec +++ b/rpm-mpi-hooks.spec @@ -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 3-5 +- Add quotes around strings which may contain spaces + * Tue Dec 22 2015 Orion Poplawski - 3-4 - Require environment(modules)