[Pkg-octave-commit] [octave-pkg-dev] 01/07: check-pkg: Use heredoc constructs when creating Octave code
Rafael Laboissiere
rafael at debian.org
Wed Aug 30 14:10:51 UTC 2017
This is an automated email from the git hooks/post-receive script.
rafael pushed a commit to branch master
in repository octave-pkg-dev.
commit e903a65ecd2141156584bdd0602f7f3056c60982
Author: Rafael Laboissiere <rafael at debian.org>
Date: Wed Aug 30 07:36:30 2017 -0300
check-pkg: Use heredoc constructs when creating Octave code
---
check-pkg | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/check-pkg b/check-pkg
index 03549f5..f7bb035 100755
--- a/check-pkg
+++ b/check-pkg
@@ -9,8 +9,13 @@ unit_test_regex='^%!\(assert\|test\|error\|fail\|xtest\|warning\)'
# Extract tests from installed m files
echo Checking m files ...
tmp=$(tempfile)
-echo "addpath (genpath ([pwd(),'/debian']));" > $tmp
-echo "[usr_pkg,sys_pkg]=pkg('list'); for i = 1:length(sys_pkg); pkg('load',sys_pkg{1,i}.name); endfor;" >> $tmp
+cat >$tmp <<EOF
+addpath (genpath (sprintf ('%s/debian', pwd ())));
+[usr_pkg, sys_pkg] = pkg ('list');
+for i = 1 : length (sys_pkg)
+ pkg ('load', sys_pkg {1, i}.name);
+endfor
+EOF
for f in $(find inst/ -name \*.m $excluded_files_expr | grep -v /private/) ; do
if grep -q "$unit_test_regex" $f ; then
stem=$(echo $f | sed 's:[^@]*/::;s/\.m$//')
@@ -31,9 +36,14 @@ rm -f $tmp
# We deactivate the warning about relative paths used for the PKG_ADD file.
echo Checking CC files ...
tmp=$(tempfile)
-echo "addpath (genpath ([pwd()], '.pc'));" >> $tmp
-echo "[usr_pkg,sys_pkg]=pkg('list'); for i = 1:length(sys_pkg); pkg('load',sys_pkg{1,i}.name); endfor;" >> $tmp
-echo "warning ('off', 'Octave:autoload-relative-file-name');" >> $tmp
+cat >$tmp <<EOF
+addpath (genpath (pwd (), '.pc'));
+[usr_pkg, sys_pkg] = pkg ('list');
+for i = 1 : length (sys_pkg);
+ pkg ('load', sys_pkg {1, i}.name);
+endfor
+warning ('off', 'Octave:autoload-relative-file-name');
+EOF
if [ -f PKG_ADD ] ; then
echo "source('PKG_ADD');" >> $tmp
fi
--
Alioth's /home/groups/pkg-octave/bin/git-commit-notice on /srv/git.debian.org/git/pkg-octave/octave-pkg-dev.git
More information about the Pkg-octave-commit
mailing list