[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa-admin 9731033 204/439: Use symbolic links for core package
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa-admin 9731033 204/439: Use symbolic links for core packages |
Date: |
Sun, 17 Oct 2021 15:48:02 -0400 (EDT) |
branch: elpa-admin
commit 97310334e317dfe992241e1f6667704f5341c28b
Author: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Commit: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Use symbolic links for core packages
* admin/archive-contents.el (archive--process-simple-package):
Copy file if it is a symlink to prevent deletion of target source
file.
(archive--core-package-link-file): Rename from
archive--core-package-copy-file. Create symbolic links for core
files.
(archive--core-package-link-directory): Rename from
archive--core-package-copy-directory. Call
archive--core-package-link-file.
(archive--core-package-sync): Change message to indicate linking.
Call archive--core-package-link-file.
---
admin/archive-contents.el | 29 +++++++++++++++++------------
1 file changed, 17 insertions(+), 12 deletions(-)
diff --git a/admin/archive-contents.el b/admin/archive-contents.el
index 74e473e..feb646a 100755
--- a/admin/archive-contents.el
+++ b/admin/archive-contents.el
@@ -207,8 +207,9 @@ PKG is the name of the package and DIR is the directory
where it is."
"Deploy the contents of DIR into the archive as a simple package.
Rename DIR/PKG.el to PKG-VERS.el, delete DIR, and return the descriptor."
;; Write DIR/foo.el to foo-VERS.el and delete DIR
- (rename-file (expand-file-name (concat pkg ".el") dir)
- (concat pkg "-" vers ".el"))
+ (let ((src (expand-file-name (concat pkg ".el") dir)))
+ (funcall (if (file-symlink-p src) #'copy-file #'rename-file)
+ src (concat pkg "-" vers ".el")))
;; Add the content of the ChangeLog.
(let ((cl (expand-file-name "ChangeLog" dir)))
(with-current-buffer (find-file-noselect (concat pkg "-" vers ".el"))
@@ -645,9 +646,9 @@ version control nor listed in EXTERNALS-LIST."
"Return non-nil if DEST is an empty variant."
(member dest (list "" "." nil)))
-(defun archive--core-package-copy-file
+(defun archive--core-package-link-file
(source dest emacs-repo-root package-root exclude-regexp)
- "Copy file from SOURCE to DEST ensuring subdirectories."
+ "Link file from SOURCE to DEST ensuring subdirectories."
(unless (string-match-p exclude-regexp source)
(let* ((absolute-package-file-name
(expand-file-name dest package-root))
@@ -656,14 +657,18 @@ version control nor listed in EXTERNALS-LIST."
(directory (file-name-directory absolute-package-file-name)))
(unless (file-directory-p directory)
(make-directory directory t))
- (copy-file absolute-core-file-name absolute-package-file-name))
+ (condition-case nil
+ (make-symbolic-link absolute-core-file-name
+ absolute-package-file-name t)
+ (file-error
+ (copy-file absolute-core-file-name absolute-package-file-name))))
(message " %s -> %s" source (if (archive--core-package-empty-dest-p dest)
(file-name-nondirectory source)
dest))))
-(defun archive--core-package-copy-directory
+(defun archive--core-package-link-directory
(source dest emacs-repo-root package-root exclude-regexp)
- "Copy directory files from SOURCE to DEST ensuring subdirectories."
+ "Link directory files from SOURCE to DEST ensuring subdirectories."
(let ((stack (list source))
(base source)
(absolute-source))
@@ -678,12 +683,12 @@ version control nor listed in EXTERNALS-LIST."
(source-sans-base (substring source (length base)))
(package-file-name
(if (archive--core-package-empty-dest-p dest)
- ;; Copy to root with it's original filename.
+ ;; Link to root with its original filename.
source-sans-base
(concat
;; Prepend the destination, allowing for directory rename.
(file-name-as-directory dest) source-sans-base))))
- (archive--core-package-copy-file
+ (archive--core-package-link-file
source package-file-name
emacs-repo-root package-root exclude-regexp))))))
@@ -711,16 +716,16 @@ version control nor listed in EXTERNALS-LIST."
;; Files may be just a string, normalize.
(list file-patterns)
file-patterns))))
- (message "Copying files for package: %s" name)
+ (message "Linking files for package: %s" name)
(when (file-directory-p package-root)
(delete-directory package-root t))
(make-directory package-root t)
(dolist (file-pattern file-patterns)
(pcase-let* ((`(,file . ,dest) file-pattern))
(if (file-directory-p (expand-file-name file emacs-repo-root))
- (archive--core-package-copy-directory
+ (archive--core-package-link-directory
file dest emacs-repo-root package-root exclude-regexp)
- (archive--core-package-copy-file
+ (archive--core-package-link-file
file dest emacs-repo-root package-root exclude-regexp))))))
(defun archive-add/remove/update-externals ()
- [nongnu] elpa-admin 788c439 170/439: Merge commit 'fea2a8b1c10f9f29ba6924b17892de670b650756', (continued)
- [nongnu] elpa-admin 788c439 170/439: Merge commit 'fea2a8b1c10f9f29ba6924b17892de670b650756', Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 5a1a2bc 184/439: Merge commit '32b1944d5f0a65aa10c6768f4865f7ed1de8eb49' as 'packages/pinentry', Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 4d58120 179/439: * GNUmakefile: Fix autoloads generation for aggressive-indent, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin aec5d97 172/439: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs/elpa, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 28819e8 192/439: Skip uninteresting elements, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin cb8a04b 195/439: * admin/archive-contents.el: Improve docstrings, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin ac1e1e9 198/439: README: Fix typos., Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin f936e1e 180/439: Merge dummy commit to add the gnorb subtree metadata., Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 3a394c3 188/439: Merge commit 'd76bcd7c0dcecb33e6955e25963028600c371588', Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 5e9fdd4 197/439: * README: Revert change about package.el headers, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 9731033 204/439: Use symbolic links for core packages,
Philip Kaludercic <=
- [nongnu] elpa-admin 7edd6ff 205/439: Dereference symlinks when creating tarballs, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin df09582 201/439: * README: Add submission guideline, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 7fa1dbd 214/439: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs/elpa, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 5571ea8 211/439: Add symlink to README, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 60ab286 213/439: Squashed 'packages/gnome-c-style/' content from commit e84487c, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 9ab6e7e 217/439: Update packages/yasnippet by subtree-merging from its external upstream, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin f1c2e2f 210/439: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs/elpa: transcribe.el update, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin cc33931 222/439: Add test capability to ELPA, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 968d870 212/439: Merge commit 'cce1d8b50b1ceccb80c20398cd659db3a6348aac' as 'packages/gnome-c-style', Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 2ba4dc8 215/439: Merge commit '6bf96861b98e91ca9c3bd146697580b42d30f5d9', Philip Kaludercic, 2021/10/17