From af39894ab4b8a68eef14b39c030577b419a582a8 Mon Sep 17 00:00:00 2001 From: Matt Fidler Date: Sat, 29 Dec 2012 18:26:14 +0800 Subject: [PATCH] * emacs-lisp/package.el (package-untar-buffer): Handle problematic tarfile content listings. Fixes: debbugs:13136 --- lisp/ChangeLog | 5 +++++ lisp/emacs-lisp/package.el | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 43af9904859..4ed7103270e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-12-29 Matt Fidler (tiny change) + + * emacs-lisp/package.el (package-untar-buffer): Handle problematic + tarfile content listings (Bug#13136). + 2012-12-29 Mark Lillibridge * mail/rmailmm.el (rmail-insert-mime-forwarded-message): Insert diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 6629410a1f1..54d133b166c 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -604,7 +604,11 @@ untar into a directory named DIR; otherwise, signal an error." (require 'tar-mode) (tar-mode) ;; Make sure everything extracts into DIR. - (let ((regexp (concat "\\`" (regexp-quote dir) "/"))) + (let ((regexp (concat "\\`" (regexp-quote dir) + ;; Tarballs created by some utilities don't + ;; list directories with a trailing slash + ;; (Bug#13136). + "\\(/\\|\\'\\)"))) (dolist (tar-data tar-parse-info) (unless (string-match regexp (aref tar-data 2)) (error "Package does not untar cleanly into directory %s/" dir)))) -- 2.11.4.GIT