diff --git a/emacs.spec b/emacs.spec index d9bf0fd..c9779fc 100644 --- a/emacs.spec +++ b/emacs.spec @@ -3,7 +3,7 @@ Summary: GNU Emacs text editor Name: emacs Version: 22.1 -Release: 4%{?dist} +Release: 5%{?dist} License: GPL URL: http://www.gnu.org/software/emacs/ Group: Applications/Editors @@ -17,7 +17,6 @@ Source7: http://download.sourceforge.net/php-mode/php-mode-1.2.0.tgz Source8: php-mode-init.el Source9: ssl.el Source11: rpm-spec-mode-init.el -Source12: rpm-spec-mode.el-0.14-xemacs-compat.patch Source13: focus-init.el Source14: po-mode.el Source15: po-mode-init.el @@ -26,6 +25,7 @@ Source18: default.el Source19: wrapper Source20: igrep.el Source21: igrep-init.el +Patch1: files-el.patch Buildroot: %{_tmppath}/%{name}-%{version}-root BuildRequires: atk-devel, cairo-devel, freetype-devel, fontconfig-devel, giflib-devel, glibc-devel, gtk2-devel, libpng-devel BuildRequires: libjpeg-devel, libtiff-devel, libX11-devel, libXau-devel, libXdmcp-devel, libXrender-devel, libXt-devel @@ -98,13 +98,12 @@ Emacs packages or see some elisp examples. %prep %setup -q +%patch1 -p0 -b .files-el # install rest of site-lisp files ( cd site-lisp cp %SOURCE6 %SOURCE9 %SOURCE14 %SOURCE20 . tar xfz %SOURCE7 # php-mode - # xemacs compat patch for rpm-spec-mode - patch < %SOURCE12 # fix po-auto-replace-revision-date nil patch < %SOURCE16 ) @@ -297,6 +296,10 @@ fi %dir %{_datadir}/emacs/%{version} %changelog +* Tue Nov 6 2007 Chip Coldwell - 22.1-5 +- fix insufficient safe-mode checks (Resolves: bz367581) +- Update rpm-spec-mode to the current upstream, drop compat patch (bz306841) + * Wed Sep 12 2007 Chip Coldwell - 22.1-4 - require xorg-x11-fonts-ISO8859-1-100dpi instead of 75dpi (Resolves: bz281861) - drop broken python mode (Resolves: bz262801) diff --git a/files-el.patch b/files-el.patch new file mode 100644 index 0000000..4a650f3 --- /dev/null +++ b/files-el.patch @@ -0,0 +1,30 @@ +description: +;;; files.el --- file input and output commands for Emacs +---------------------------- +revision 1.938 +date: 2007-11-02 11:03:42 +0000; author: rfrancoise; state: Exp; lines: +2 -2; commitid: wgxFxIhiWr3NtZDs; +2007-11-02 Drake Wilson (tiny change) + + * files.el (hack-local-variables): Fix membership tests to avoid + treating all variables as safe if `enable-local-variables' is + set to :safe. +============================================================================= +Index: lisp/files.el +=================================================================== +RCS file: /sources/emacs/emacs/lisp/files.el,v +retrieving revision 1.937 +retrieving revision 1.938 +diff -u -r1.937 -r1.938 +--- lisp/files.el 26 Oct 2007 14:25:17 -0000 1.937 ++++ lisp/files.el 2 Nov 2007 11:03:42 -0000 1.938 +@@ -2821,8 +2821,8 @@ + ;; If caller wants only the safe variables, + ;; install only them. + (dolist (elt result) +- (unless (or (memq (car elt) unsafe-vars) +- (memq (car elt) risky-vars)) ++ (unless (or (member elt unsafe-vars) ++ (member elt risky-vars)) + (hack-one-local-variable (car elt) (cdr elt)))) + ;; Query, except in the case where all are known safe + ;; if the user wants no quuery in that case. diff --git a/rpm-spec-mode.el b/rpm-spec-mode.el index a0dec2a..955bace 100644 --- a/rpm-spec-mode.el +++ b/rpm-spec-mode.el @@ -4,7 +4,7 @@ ;; Author: Stig Bj�rlykke, ;; Keywords: unix, languages, rpm -;; Version: 0.12 +;; Version: 0.12x ;; This file is part of XEmacs. @@ -20,8 +20,8 @@ ;; You should have received a copy of the GNU General Public License ;; along with XEmacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -;; MA 02111-1307, USA. +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301 USA. ;;; Synched up with: not in GNU Emacs. @@ -39,7 +39,7 @@ ;; - rewrite function names. ;; - autofill changelog entries. -;; - customize rpm-tags-list and rpm-group-tags-list. +;; - customize rpm-tags-list, rpm-obsolete-tags-list and rpm-group-tags-list. ;; - get values from `rpm --showrc'. ;; - ssh/rsh for compile. ;; - finish integrating the new navigation functions in with existing stuff. @@ -63,7 +63,7 @@ ;;; Code: -(defconst rpm-spec-mode-version "0.12" "Version of `rpm-spec-mode'.") +(defconst rpm-spec-mode-version "0.12x" "Version of `rpm-spec-mode'.") (defgroup rpm-spec nil "RPM spec mode with Emacs/XEmacs enhancements." @@ -244,18 +244,19 @@ value returned by function `user-mail-address'." "Partial list of section names.") (defconst rpm-scripts '("pre" "post" "preun" "postun" - "trigger" "triggerin" "triggerun" "triggerpostun") + "trigger" "triggerin" "triggerprein" "triggerun" "triggerpostun" + "pretrans" "posttrans") "List of rpm scripts.") (defconst rpm-section-seperate "^%\\(\\w+\\)\\s-") (defconst rpm-section-regexp (eval-when-compile (concat "^%" (regexp-opt - ;; From RPM 4.4.1 sources, file build/parseSpec.c: partList[]. + ;; From RPM 4.4.9 sources, file build/parseSpec.c: partList[]. '("build" "changelog" "check" "clean" "description" "files" "install" "package" "post" "postun" "pretrans" "posttrans" "pre" "prep" "preun" "trigger" "triggerin" "triggerpostun" - "triggerun" "verifyscript") t) + "triggerprein" "triggerun" "verifyscript") t) "\\b")) "Regular expression to match beginning of a section.") @@ -267,6 +268,11 @@ value returned by function `user-mail-address'." "*Face for tags." :group 'rpm-spec-faces) +(defface rpm-spec-obsolete-tag-face + '(( ((class color)) (:foreground "white" :background "red") )) + "*Face for obsolete tags." + :group 'rpm-spec-faces) + (defface rpm-spec-macro-face '(( ((class color) (background light)) (:foreground "purple") ) ( ((class color) (background dark)) (:foreground "yellow") )) @@ -316,6 +322,8 @@ value returned by function `user-mail-address'." 'rpm-spec-var-face "*Face for environment variables.") (defvar rpm-spec-tag-face 'rpm-spec-tag-face "*Face for tags.") +(defvar rpm-spec-obsolete-tag-face + 'rpm-spec-tag-face "*Face for obsolete tags.") (defvar rpm-spec-package-face 'rpm-spec-package-face "*Face for package tag.") (defvar rpm-spec-dir-face @@ -340,7 +348,7 @@ value returned by function `user-mail-address'." (defvar rpm-spec-nobuild-option "--nobuild" "Option for no build.") (defvar rpm-tags-list - ;; From RPM 4.4.1 sources, file build/parsePreamble.c: preambleList[], and + ;; From RPM 4.4.9 sources, file build/parsePreamble.c: preambleList[], and ;; a few macros that aren't tags, but useful here. '(("AutoProv") ("AutoReq") @@ -348,16 +356,20 @@ value returned by function `user-mail-address'." ("BuildArch") ("BuildArchitectures") ("BuildConflicts") + ("BuildEnhances") + ("BuildPlatforms") ("BuildPreReq") ("BuildRequires") ("BuildRoot") + ("BuildSuggests") ("Conflicts") - ("Copyright") + ("CVSId") ("%description") ("Distribution") ("DistTag") ("DistURL") ("DocDir") + ("Enhances") ("Epoch") ("ExcludeArch") ("ExcludeOS") @@ -367,6 +379,8 @@ value returned by function `user-mail-address'." ("Group") ("Icon") ("%ifarch") + ("Keyword") + ("Keywords") ("License") ("Name") ("NoPatch") @@ -381,17 +395,40 @@ value returned by function `user-mail-address'." ("Provides") ("Release") ("Requires") - ("RHNPlatform") - ("Serial") + ("RepoTag") ("Source") + ("Suggests") ("Summary") + ("SVNId") ("URL") + ("Variant") + ("Variants") ("Vendor") - ("Version")) + ("Version") + ("XMajor") + ("XMinor") + ) "List of elements that are valid tags.") +(defvar rpm-tags-regexp + (concat "\\(\\<" (regexp-opt (mapcar 'car rpm-tags-list)) + "\\|\\(Patch\\|Source\\)[0-9]+\\>\\)") + "Regular expression for matching valid tags.") + +(defvar rpm-obsolete-tags-list + ;; From RPM sources, file build/parsePreamble.c: preambleList[]. + '(("Copyright") ;; 4.4.2 + ("RHNPlatform") ;; 4.4.2, 4.4.9 + ("Serial") ;; 4.4.2, 4.4.9 + ) + "List of elements that are obsolete tags in some versions of rpm.") + +(defvar rpm-obsolete-tags-regexp + (regexp-opt (mapcar 'car rpm-obsolete-tags-list) 'words) + "Regular expression for matching obsolete tags.") + (defvar rpm-group-tags-list - ;; From RPM 4.4.1 sources, file GROUPS. + ;; From RPM 4.4.9 sources, file GROUPS. '(("Amusements/Games") ("Amusements/Graphics") ("Applications/Archiving") @@ -553,11 +590,17 @@ value returned by function `user-mail-address'." (list (cons rpm-section-regexp rpm-spec-section-face) '("%[a-zA-Z0-9_]+" 0 rpm-spec-macro-face) - '("^\\([a-zA-Z0-9]+\\)\\(\([a-zA-Z0-9,_]+\)\\):" - (1 rpm-spec-tag-face) - (2 rpm-spec-ghost-face)) - '("^\\([a-zA-Z0-9]+\\):" 1 rpm-spec-tag-face) - '("%\\(de\\(fine\\|scription\\)\\|files\\|package\\)[ \t]+\\([^-][^ \t\n]*\\)" + (cons (concat "^" rpm-obsolete-tags-regexp "\\(\([a-zA-Z0-9,_]+\)\\)[ \t]*:") + '((1 'rpm-spec-obsolete-tag-face) + (2 'rpm-spec-ghost-face))) + (cons (concat "^" rpm-tags-regexp "\\(\([a-zA-Z0-9,_]+\)\\)[ \t]*:") + '((1 'rpm-spec-tag-face) + (3 'rpm-spec-ghost-face))) + (cons (concat "^" rpm-obsolete-tags-regexp "[ \t]*:") + '(1 'rpm-spec-obsolete-tag-face)) + (cons (concat "^" rpm-tags-regexp "[ \t]*:") + '(1 'rpm-spec-tag-face)) + '("%\\(de\\(fine\\|scription\\)\\|files\\|global\\|package\\)[ \t]+\\([^-][^ \t\n]*\\)" (3 rpm-spec-package-face)) '("%p\\(ost\\|re\\)\\(un\\)?[ \t]+\\([^-][^ \t\n]*\\)" (3 rpm-spec-package-face)) @@ -668,7 +711,7 @@ with no args, if that value is non-nil." (interactive "sChange log entry: ") (save-excursion (rpm-goto-section "changelog") - (let* ((address (or rpm-spec-user-mail-address (user-mail-address))) + (let* ((address (rpm-spec-user-mail-address)) (fullname (or rpm-spec-user-full-name (user-full-name))) (string (concat "* " (substring (current-time-string) 0 11) (substring (current-time-string) -4) " " @@ -798,7 +841,7 @@ controls whether case is significant." (replace-match (concat what ": " (read-from-minibuffer (concat "New " what ": ") (match-string 1)))) - (message (concat what " tag not found..."))))))) + (message "%s tag not found..." what)))))) (defun rpm-change-n (what &optional arg) "Change given tag with possible number." @@ -812,7 +855,7 @@ controls whether case is significant." (concat what number ": " (read-file-name (concat "New " what number " file: ") "" "" nil (match-string 1))))) - (message (concat what " number \"" number "\" not found...")))))) + (message "%s number \"%s\" not found..." what number))))) (defun rpm-insert-group (group) "Insert Group tag." @@ -849,7 +892,7 @@ controls whether case is significant." (interactive "p") (beginning-of-line) (insert "Packager: " (or rpm-spec-user-full-name (user-full-name)) - " <" (or rpm-spec-user-mail-address (user-mail-address)) ">\n")) + " <" (rpm-spec-user-mail-address) ">\n")) (defun rpm-change-packager (&optional arg) "Update Packager tag." @@ -1001,8 +1044,8 @@ leave point at previous location." "Run a `rpmbuild -bp'." (interactive "p") (if rpm-spec-short-circuit - (message (concat "Cannot run `" rpm-spec-build-command - " -bp' with --short-circuit")) + (message "Cannot run `%s -bp' with --short-circuit" + rpm-spec-build-command) (setq rpm-no-gpg t) (rpm-build "-bp"))) @@ -1010,8 +1053,8 @@ leave point at previous location." "Run a `rpmbuild -bl'." (interactive "p") (if rpm-spec-short-circuit - (message (concat "Cannot run `" rpm-spec-build-command - " -bl' with --short-circuit")) + (message "Cannot run `%s -bl' with --short-circuit" + rpm-spec-build-command) (setq rpm-no-gpg t) (rpm-build "-bl"))) @@ -1031,8 +1074,8 @@ leave point at previous location." "Run a `rpmbuild -bb'." (interactive "p") (if rpm-spec-short-circuit - (message (concat "Cannot run `" rpm-spec-build-command - " -bb' with --short-circuit")) + (message "Cannot run `%s -bb' with --short-circuit" + rpm-spec-build-command) (setq rpm-no-gpg nil) (rpm-build "-bb"))) @@ -1040,8 +1083,8 @@ leave point at previous location." "Run a `rpmbuild -bs'." (interactive "p") (if rpm-spec-short-circuit - (message (concat "Cannot run `" rpm-spec-build-command - " -bs' with --short-circuit")) + (message "Cannot run `%s -bs' with --short-circuit" + rpm-spec-build-command) (setq rpm-no-gpg nil) (rpm-build "-bs"))) @@ -1049,8 +1092,8 @@ leave point at previous location." "Run a `rpmbuild -ba'." (interactive "p") (if rpm-spec-short-circuit - (message (concat "Cannot run `" rpm-spec-build-command - " -ba' with --short-circuit")) + (message "Cannot run `%s -ba' with --short-circuit" + rpm-spec-build-command) (setq rpm-no-gpg nil) (rpm-build "-ba"))) @@ -1189,12 +1232,13 @@ command." (interactive "p") (save-excursion (goto-char (point-min)) - (if (search-forward-regexp "^Release:[ \t]*\\([0-9]+\\)\\(.*\\)" nil t) - (let ((release (1+ (string-to-int (match-string 1))))) - (setq release (concat (int-to-string release) (match-string 2))) - (replace-match (concat "Release: " release)) - (message (concat "Release tag changed to " release "."))) - (if (search-forward-regexp "^Release:[ \t]*%{?\\([^}]*\\)}?$" nil t) + (if (search-forward-regexp + "^\\(Release[ \t]*:[ \t]*\\)\\([0-9]+\\)\\(.*\\)" nil t) + (let ((release (1+ (string-to-int (match-string 2))))) + (setq release (concat (int-to-string release) (match-string 3))) + (replace-match (concat (match-string 1) release)) + (message "Release tag changed to %s." release)) + (if (search-forward-regexp "^Release[ \t]*:[ \t]*%{?\\([^}]*\\)}?$" nil t) (rpm-increase-release-with-macros) (message "No Release tag found..."))))) @@ -1204,7 +1248,7 @@ command." "Get the value of FIELD, searching up to buffer position MAX. See `search-forward-regexp'." (save-excursion - (ignore-errors + (condition-case nil (let ((str (progn (goto-char (point-min)) @@ -1228,7 +1272,8 @@ See `search-forward-regexp'." (concat start-string end-string) ;; Leave as is. str))) - str))))) + str)) + (error nil)))) (defun rpm-find-spec-version (&optional with-epoch) "Get the version string. @@ -1251,7 +1296,7 @@ if one is present in the file." (let ((str (progn (goto-char (point-min)) - (search-forward-regexp (concat "Release:[ \t]*\\(.+\\).*$") nil) + (search-forward-regexp (concat "Release[ \t]*:[ \t]*\\(.+\\).*$") nil) (match-string 1)))) (let ((inrel (if (string-match "%{?\\([^}]*\\)}?$" str) @@ -1268,7 +1313,7 @@ if one is present in the file." str))) (setq dinrel inrel) (replace-match (concat "%define " dinrel)) - (message (concat "Release tag changed to " dinrel ".")))))) + (message "Release tag changed to %s." dinrel))))) ;;------------------------------------------------------------ @@ -1338,6 +1383,18 @@ if one is present in the file." ;;------------------------------------------------------------ +(defun rpm-spec-user-mail-address () + "User mail address helper." + (cond + (rpm-spec-user-mail-address + rpm-spec-user-mail-address) + ((fboundp 'user-mail-address) + (user-mail-address)) + (t + user-mail-address))) + +;;------------------------------------------------------------ + (defun rpm-about-rpm-spec-mode (&optional arg) "About `rpm-spec-mode'." (interactive "p") diff --git a/rpm-spec-mode.el-0.14-xemacs-compat.patch b/rpm-spec-mode.el-0.14-xemacs-compat.patch deleted file mode 100644 index 49920e2..0000000 --- a/rpm-spec-mode.el-0.14-xemacs-compat.patch +++ /dev/null @@ -1,43 +0,0 @@ -diff -u rpm-spec-mode.el~ rpm-spec-mode.el ---- rpm-spec-mode.el~ 2002-12-02 12:00:38.000000000 +0900 -+++ rpm-spec-mode.el 2002-12-02 12:00:38.000000000 +0900 -@@ -105,6 +105,10 @@ - :type 'string - :group 'rpm-spec) - -+;; XEmacs compatibility function -+(unless (fboundp 'define-obsolete-variable-alias) -+ (defalias 'define-obsolete-variable-alias 'make-obsolete-variable)) -+ - (define-obsolete-variable-alias - 'rpm-completion-ignore-case 'rpm-spec-completion-ignore-case) - -@@ -597,6 +601,14 @@ - - ;;------------------------------------------------------------ - -+;; XEmacs compatibility function -+(unless (fboundp 'user-mail-address) -+ (defun user-mail-address () -+ "Return value of `user-mail-address'. -+ -+XEmacs sendmail compatibility function." -+ user-mail-address)) -+ - (defun rpm-add-change-log-entry (&optional change-log-entry) - "Find change log and add an entry for today." - (interactive "sChange log entry: ") -@@ -1117,6 +1129,13 @@ - - ;;------------------------------------------------------------ - -+;; XEmacs compatibility function -+(unless (fboundp 'ignore-errors) -+ (defmacro ignore-errors (&rest body) -+ "Execute FORMS; if an error occurs, return nil. -+Otherwise, return result of last FORM." -+ `(condition-case nil (progn ,@body) (error nil)))) -+ - (defun rpm-spec-field-value (field max) - "Get the value of FIELD, searching up to buffer position MAX. - See `search-forward-regexp'."