diff --git a/lib/rbpkg.rb b/lib/rbpkg.rb
index 1519690..9a9d433 100644
--- a/lib/rbpkg.rb
+++ b/lib/rbpkg.rb
@@ -171,7 +171,8 @@ EOF
d_name = "#{d}/#{name}"
file = "#{name}.status"
if ! File.exist?(file) || File.mtime(file) <= File.mtime(subdir_file)
- cmd! "cp -a #{sh_quote(subdir_file)} #{sh_quote(file)}"
+ c = "cp -a #{sh_quote(subdir_file)} #{sh_quote(file)}"
+ raise "command failed: #{c}" unless system(c)
if ! status[name]
status[name] = {}
end