Initial Commit
[packages] / xemacs-packages / tramp / lisp / trampver.el
1 ;;; trampver.el --- Transparent Remote Access, Multiple Protocol
2 ;;; lisp/trampver.el.  Generated from trampver.el.in by configure.
3
4 ;; Copyright (C) 2003-2015 Free Software Foundation, Inc.
5
6 ;; Author: Kai Großjohann <kai.grossjohann@gmx.net>
7 ;; Keywords: comm, processes
8 ;; Package: tramp
9 ;; Version: 2.2.13
10
11 ;; This file is part of GNU Emacs.
12
13 ;; GNU Emacs is free software: you can redistribute it and/or modify
14 ;; it under the terms of the GNU General Public License as published by
15 ;; the Free Software Foundation, either version 3 of the License, or
16 ;; (at your option) any later version.
17
18 ;; GNU Emacs is distributed in the hope that it will be useful,
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 ;; GNU General Public License for more details.
22
23 ;; You should have received a copy of the GNU General Public License
24 ;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
25
26 ;;; Code:
27
28 ;; In the Tramp GIT repository, the version number and the bug report
29 ;; address are auto-frobbed from configure.ac, so you should edit that
30 ;; file and run "autoconf && ./configure" to change them.  (X)Emacs
31 ;; version check is defined in macro AC_EMACS_INFO of aclocal.m4;
32 ;; should be changed only there.
33
34 ;;;###tramp-autoload
35 (defconst tramp-version "2.2.13"
36   "This version of Tramp.")
37
38 ;;;###tramp-autoload
39 (defconst tramp-bug-report-address "tramp-devel@gnu.org"
40   "Email address to send bug reports to.")
41
42 ;; `locate-dominating-file' does not exist in XEmacs. But it is not used here.
43 (autoload 'locate-dominating-file "files")
44 (autoload 'tramp-compat-replace-regexp-in-string "tramp-compat")
45
46 (defun tramp-repository-get-version ()
47   "Try to return as a string the repository revision of the Tramp sources."
48   (unless (featurep 'xemacs)
49     (let ((dir (locate-dominating-file (locate-library "tramp") ".git")))
50       (when dir
51         (with-temp-buffer
52           (let ((default-directory (file-name-as-directory dir)))
53             (and (zerop
54                   (ignore-errors
55                     (call-process "git" nil '(t nil) nil "rev-parse" "HEAD")))
56                  (not (zerop (buffer-size)))
57                  (tramp-compat-replace-regexp-in-string
58                   "\n" "" (buffer-string)))))))))
59
60 ;; Check for (X)Emacs version.
61 (let ((x (if (or (>= emacs-major-version 22)
62                  (and (featurep 'xemacs)
63                       (= emacs-major-version 21)
64                       (>= emacs-minor-version 4)))
65              "ok"
66            (format "Tramp 2.2.13 is not fit for %s"
67                    (when (string-match "^.*$" (emacs-version))
68                      (match-string 0 (emacs-version)))))))
69   (unless (string-match "\\`ok\\'" x) (error "%s" x)))
70
71 (add-hook 'tramp-unload-hook
72           (lambda ()
73             (unload-feature 'trampver 'force)))
74
75 (provide 'trampver)
76
77 ;;; trampver.el ends here
78
79 ;; Local Variables:
80 ;; mode: Emacs-Lisp
81 ;; coding: utf-8
82 ;; End: