File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed
Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -181,14 +181,20 @@ template pathname."
181181 while line collect line)))
182182
183183(defun tarball-prefix (file)
184+ " For a tarball that unpacks into a subdirectory (e.g. 'foo/foo.asd',
185+ 'foo/package.asd', etc), extract the subdirectory string. Errors if
186+ the subdirectory is absent or inconsistent."
184187 (let ((contents (tarball-contents file)))
185- (let ((prefix (subseq (first contents) 0
186- (1+ (position #\/ (first contents))))))
187- (dolist (entry contents prefix)
188- (unless (and (<= (length prefix) (length entry))
189- (string= prefix entry :end2 (length prefix)))
190- (error " Tarball ~A lacks consistent prefix output directory"
191- file))))))
188+ (let ((first-slash (position #\/ (first contents))))
189+ (unless first-slash
190+ (error " No slash in first entry of tarball -- ~A " (first contents)))
191+ (let ((prefix (subseq (first contents) 0
192+ (1+ first-slash))))
193+ (dolist (entry contents prefix)
194+ (unless (and (<= (length prefix) (length entry))
195+ (string= prefix entry :end2 (length prefix)))
196+ (error " Tarball ~A lacks consistent prefix output directory"
197+ file)))))))
192198
193199(defun tarball-canonical-name (file)
194200 (string-right-trim " /" (tarball-prefix file)))
You can’t perform that action at this time.
0 commit comments