From a3d2ea68e381f75e063d4752891b6199458f13f1 Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Thu, 28 Mar 2013 11:07:46 +0000 Subject: [PATCH] Generate hard build errors when single-file packages are invalid --- package-build.el | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/package-build.el b/package-build.el index 30e2a2e3..3d3ca4af 100644 --- a/package-build.el +++ b/package-build.el @@ -718,11 +718,14 @@ FILES is a list of (SOURCE . DEST) relative filepath pairs." (with-current-buffer (find-file pkg-target) (pb/update-or-insert-version version) (write-file pkg-target nil) - (condition-case err - (package-buffer-info) - ('error - (message "Warning: package is uninstallable - package-buffer-info reports:\n%S" err))) - (kill-buffer)) + (let ((valid-package)) + (unwind-protect + (progn + (package-buffer-info) + (setq valid-package t)) + (kill-buffer) + (unless valid-package + (delete-file pkg-target))))) (pb/write-pkg-readme (and (> (length pkg-info) 4) (aref pkg-info 4)) file-name)