Permalink
Browse files

+Added support for *.tar.xz and *.apk archives.

  • Loading branch information...
1 parent 8f3ef70 commit 2b974b4cd057d8e03615fce987cfe1ee72c1abf5 @escherdragon escherdragon committed Dec 18, 2011
Showing with 15 additions and 11 deletions.
  1. +5 −3 sunrise-commander.el
  2. +10 −8 sunrise-x-mirror.el
View
@@ -7,7 +7,7 @@
;; Maintainer: José Alfredo Romero L. <escherdragon@gmail.com>
;; Created: 24 Sep 2007
;; Version: 5
-;; RCS Version: $Rev: 394 $
+;; RCS Version: $Rev: 395 $
;; Keywords: files, dired, midnight commander, norton, orthodox
;; URL: http://www.emacswiki.org/emacs/sunrise-commander.el
;; Compatibility: GNU Emacs 22+
@@ -274,8 +274,10 @@ Setting this value activates AVFS support."
(defcustom sr-avfs-handlers-alist '(("\\.[jwesh]ar$" . "#uzip/")
("\\.xpi$" . "#uzip/")
+ ("\\.apk$" . "#uzip/")
("\\.iso$" . "#iso9660/")
("\\.patch$" . "#/")
+ ("\\.tar.xz$" . "#uxze#utar/")
("." . "#/"))
"List of AVFS handlers to manage specific file extensions."
:group 'sunrise
@@ -4028,6 +4030,7 @@ when any of the options -p or -F is used with ls."
;;; ============================================================================
;;; Advice
+
(defun sr-ad-enable (regexp &optional function)
"Put all or FUNCTION-specific advice matching REGEXP into effect.
If provided, only update FUNCTION itself, otherwise all functions
@@ -4048,7 +4051,6 @@ with advice matching REGEXP."
(ad-disable-regexp regexp)
(ad-update-regexp regexp)))
-
(defun sunrise-commander-unload-function ()
(sr-ad-disable "^sr-advice-"))
@@ -4065,7 +4067,7 @@ with advice matching REGEXP."
(sr-rainbow sr-html-face (:foreground "DarkOliveGreen") "\\(^..[^d].*\\.x?html?$\\)")
(sr-rainbow sr-xml-face (:foreground "DarkGreen") "\\(^..[^d].*\\.\\(xml\\|xsd\\|xslt?\\|wsdl\\)$\\)")
(sr-rainbow sr-log-face (:foreground "brown") "\\(^..[^d].*\\.log$\\)")
-(sr-rainbow sr-compressed-face (:foreground "magenta") "\\(^..[^d].*\\.\\(zip\\|bz2\\|t?gz\\|[zZ]\\|[jwers]?ar\\|xpi\\)$\\)")
+(sr-rainbow sr-compressed-face (:foreground "magenta") "\\(^..[^d].*\\.\\(zip\\|bz2\\|t?gz\\|[zZ]\\|[jwers]?ar\\|xpi\\|apk\\|xz\\)$\\)")
(sr-rainbow sr-packaged-face (:foreground "DarkMagenta") "\\(^..[^d].*\\.\\(deb\\|rpm\\)$\\)")
(sr-rainbow sr-encrypted-face (:foreground "DarkOrange1") "\\(^..[^d].*\\.\\(gpg\\|pgp\\)$\\)")
View
@@ -7,7 +7,7 @@
;; Maintainer: José Alfredo Romero L. <escherdragon@gmail.com>
;; Created: 4 May 2008
;; Version: 2
-;; RCS Version: $Rev: 394 $
+;; RCS Version: $Rev: 395 $
;; Keywords: sunrise commander, archives read/write
;; URL: http://www.emacswiki.org/emacs/sunrise-x-mirror.el
;; Compatibility: GNU Emacs 22+
@@ -127,10 +127,12 @@
(defcustom sr-mirror-pack-commands-alist
'(
- ("\\.zip$" . "zip -r %f *")
- ("\\.[jwesh]ar$" . "zip -r %f *")
- ("\\.\\(?:tar\\.gz\\|tgz\\)$" . "tar cvzf %f *")
- ("\\.tar\\.bz2$" . "tar cvjf %f *")
+ ("\\.\\(?:zip\\|xpi\\|apk\\)$" . "zip -r %f *")
+ ("\\.[jwesh]ar$" . "zip -r %f *")
+ ("\\.tar$" . "tar cvf %f *")
+ ("\\.\\(?:tar\\.gz\\|tgz\\)$" . "tar cvzf %f *")
+ ("\\.tar\\.bz2$" . "tar cvjf %f *")
+ ("\\.tar\\.xz$" . "tar cvJf %f *")
)
"List of shell commands to repack particular archive contents.
Used when repacking contents from a mirror area into a compressed
@@ -365,7 +367,7 @@ On success, returns a string containing the full path to the newly
packed archive, otherwise throws an error."
(message "Sunrise: repacking mirror, please wait...")
(let* ((target-home (concat sr-mirror-home ".repacked/"))
- (archive (replace-regexp-in-string "#[a-z0-9]*$" "" mirror))
+ (archive (replace-regexp-in-string "#[a-z0-9#]*$" "" mirror))
(target (replace-regexp-in-string
"/?$" ""
(car (last (split-string archive "+")))))
@@ -399,7 +401,7 @@ Opposite of `sr-mirror-mangle'."
(replace-regexp-in-string
"{\\+}" "+" (replace-regexp-in-string
"\\+\\([^}]\\)" "/\\1" (replace-regexp-in-string
- "#[a-z0-9]*$" "" path)))))
+ "#[a-z0-9#]*$" "" path)))))
(defun sr-mirror-full-demangle (path)
"Demangle PATH recursively to obtain the current path of the original archive.
@@ -558,7 +560,7 @@ so they are always writeable by default."
(let* ((orig (buffer-file-name))
(target (sr-mirror-overlay-redir orig)))
(if (> (length target) (length orig))
- (toggle-read-only -1)))))
+ (setq buffer-read-only nil)))))
(add-hook 'find-file-hook 'sr-mirror-toggle-read-only)
(defun sunrise-x-mirror-unload-function ()

0 comments on commit 2b974b4

Please sign in to comment.