comparison scripts/miscellaneous/zip.m @ 20117:d6e523825abc

zip.m: fix XFAIL on Windows; fix test (bug #44811). * zip.m: Don't use multiple commands in one system call since shell cmd separator is different between Windows and UNIX. Correct "extension" to "ext" to match real variable name in BIST test.
author Philip Nienhuis <prnienhuis@users.sf.net>
date Fri, 17 Apr 2015 08:34:25 -0700
parents 0cc365dada52
children
comparison
equal deleted inserted replaced
20116:8bfadb26afcd 20117:d6e523825abc
53 53
54 rootdir = tilde_expand (rootdir); 54 rootdir = tilde_expand (rootdir);
55 55
56 zipfile = make_absolute_filename (zipfile); 56 zipfile = make_absolute_filename (zipfile);
57 57
58 cmd = sprintf ("cd %s; zip -r %s %s", 58 cmd = sprintf ("zip -r %s %s", zipfile, sprintf (" %s", files{:}));
59 rootdir, zipfile, sprintf (" %s", files{:}));
60 59
60 origdir = pwd ();
61 cd (rootdir);
61 [status, output] = system (cmd); 62 [status, output] = system (cmd);
63 cd (origdir);
62 64
63 if (status) 65 if (status)
64 error ("zip: zip failed with exit status = %d", status); 66 error ("zip: zip failed with exit status = %d", status);
65 endif 67 endif
66 68
106 %! if (orig_data != new_data) 108 %! if (orig_data != new_data)
107 %! error ("unzipped file not equal to original file!"); 109 %! error ("unzipped file not equal to original file!");
108 %! endif 110 %! endif
109 %! unwind_protect_cleanup 111 %! unwind_protect_cleanup
110 %! unlink (filename); 112 %! unlink (filename);
111 %! unlink ([dirname, filesep, basename, extension]); 113 %! unlink ([dirname, filesep, basename, ext]);
112 %! rmdir (dirname); 114 %! rmdir (dirname);
113 %! end_unwind_protect 115 %! end_unwind_protect
114 116
115 ## Test input validation 117 ## Test input validation
116 %!error zip () 118 %!error zip ()