[vim] 10/10: Import initial gbp-pq patches
James McCoy
jamessan at debian.org
Mon Aug 8 04:49:34 UTC 2016
This is an automated email from the git hooks/post-receive script.
jamessan pushed a commit to branch debian/sid
in repository vim.
commit 312a44c5e8102b6f5b5b0ae44c803d9c508aba1f
Author: James McCoy <jamessan at debian.org>
Date: Mon Aug 8 00:43:52 2016 -0400
Import initial gbp-pq patches
Signed-off-by: James McCoy <jamessan at debian.org>
---
...of-more-LaTeX-commands-for-tex-filetype-d.patch | 27 ++++++++
...t-filetype-using-the-contents-of-the-file.patch | 28 ++++++++
...s-decision-to-disable-modelines-by-defaul.patch | 29 ++++++++
...ng-a-vimrc.tiny-when-Vim-is-invoked-as-vi.patch | 75 ++++++++++++++++++++
debian/patches/series | 5 ++
...ing-compilation-date-in-SOURCE_DATE_EPOCH.patch | 81 ++++++++++++++++++++++
6 files changed, 245 insertions(+)
diff --git a/debian/patches/debian/Add-recognition-of-more-LaTeX-commands-for-tex-filetype-d.patch b/debian/patches/debian/Add-recognition-of-more-LaTeX-commands-for-tex-filetype-d.patch
new file mode 100644
index 0000000..9eeeef1
--- /dev/null
+++ b/debian/patches/debian/Add-recognition-of-more-LaTeX-commands-for-tex-filetype-d.patch
@@ -0,0 +1,27 @@
+From: Stefano Zacchiroli <zack at debian.org>
+Date: Fri, 25 Aug 2006 13:33:04 +0200
+Subject: Add recognition of more LaTeX commands for tex filetype detection
+
+Since filetype detection of TeX files defaults to plaintex, we've added
+detection of some additional LaTeX commands to help sway the detection
+to LaTeX.
+
+Closes: #384479
+Signed-off-by: James McCoy <jamessan at debian.org>
+---
+ runtime/filetype.vim | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/runtime/filetype.vim b/runtime/filetype.vim
+index f96c6ad..3802d79 100644
+--- a/runtime/filetype.vim
++++ b/runtime/filetype.vim
+@@ -2212,7 +2212,7 @@ func! s:FTtex()
+ call cursor(1,1)
+ let firstNC = search('^\s*[^[:space:]%]', 'c', 1000)
+ if firstNC " Check the next thousand lines for a LaTeX or ConTeXt keyword.
+- let lpat = 'documentclass\>\|usepackage\>\|begin{\|newcommand\>\|renewcommand\>'
++ let lpat = 'documentclass\>\|usepackage\>\|begin{\|newcommand\>\|renewcommand\>\|part\>\|chapter\>\|section\>\|subsection\>\|subsubsection\>\|paragraph\>\|subparagraph\>\|subsubparagraph'
+ let cpat = 'start\a\+\|setup\a\+\|usemodule\|enablemode\|enableregime\|setvariables\|useencoding\|usesymbols\|stelle\a\+\|verwende\a\+\|stel\a\+\|gebruik\a\+\|usa\a\+\|imposta\a\+\|regle\a\+\|utilisemodule\>'
+ let kwline = search('^\s*\\\%(' . lpat . '\)\|^\s*\\\(' . cpat . '\)',
+ \ 'cnp', firstNC + 1000)
diff --git a/debian/patches/debian/Detect-the-rst-filetype-using-the-contents-of-the-file.patch b/debian/patches/debian/Detect-the-rst-filetype-using-the-contents-of-the-file.patch
new file mode 100644
index 0000000..db591e4
--- /dev/null
+++ b/debian/patches/debian/Detect-the-rst-filetype-using-the-contents-of-the-file.patch
@@ -0,0 +1,28 @@
+From: James Vega <jamessan at debian.org>
+Date: Fri, 18 Aug 2006 09:06:20 -0400
+Subject: Detect the rst filetype using the contents of the file
+
+Closes: #382541
+---
+ runtime/scripts.vim | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/runtime/scripts.vim b/runtime/scripts.vim
+index 2763828..d3101c6 100644
+--- a/runtime/scripts.vim
++++ b/runtime/scripts.vim
+@@ -332,6 +332,14 @@ else
+ elseif s:line1 =~ 'exec\s\+\S*scheme' || s:line2 =~ 'exec\s\+\S*scheme'
+ set ft=scheme
+
++ " rst files
++ elseif s:line1 =~ '^\.\.\s\|^\s*restindex\s*$'
++ \ || s:line2 =~ '^\.\.\s\|^\s*restindex\s*$'
++ \ || s:line3 =~ '^\.\.\s\|^\s*restindex\s*$'
++ \ || s:line4 =~ '^\.\.\s\|^\s*restindex\s*$'
++ \ || s:line5 =~ '^\.\.\s\|^\s*restindex\s*$'
++ set ft=rst
++
+ " Git output
+ elseif s:line1 =~ '^\(commit\|tree\|object\) \x\{40\}\>\|^tag \S\+$'
+ set ft=git
diff --git a/debian/patches/debian/Document-Debian-s-decision-to-disable-modelines-by-defaul.patch b/debian/patches/debian/Document-Debian-s-decision-to-disable-modelines-by-defaul.patch
new file mode 100644
index 0000000..6316077
--- /dev/null
+++ b/debian/patches/debian/Document-Debian-s-decision-to-disable-modelines-by-defaul.patch
@@ -0,0 +1,29 @@
+From: James Vega <jamessan at debian.org>
+Date: Thu, 27 Mar 2008 03:42:02 +0000
+Subject: Document Debian's decision to disable modelines by default
+
+Modelines have historically been a source of vulnerabilities in Vim.
+As long as it remains a "blacklist suspected/proven dangerous options"
+instead of a "whitelist allowed options" piece of functionality,
+Debian's system-wide vimrc will maintain this setting. As such, the
+documentation needs to be updated to reflect the induced behavior.
+
+Closes: #472522
+Signed-off-by: James McCoy <jamessan at debian.org>
+---
+ runtime/doc/options.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
+index 16002dd..03b9e70 100644
+--- a/runtime/doc/options.txt
++++ b/runtime/doc/options.txt
+@@ -5101,7 +5101,7 @@ A jump table for the options with a short description can be found at |Q_op|.
+
+ *'modeline'* *'ml'* *'nomodeline'* *'noml'*
+ 'modeline' 'ml' boolean (Vim default: on (off for root),
+- Vi default: off)
++ Debian: off, Vi default: off)
+ local to buffer
+ *'modelines'* *'mls'*
+ 'modelines' 'mls' number (default 5)
diff --git a/debian/patches/debian/Support-sourcing-a-vimrc.tiny-when-Vim-is-invoked-as-vi.patch b/debian/patches/debian/Support-sourcing-a-vimrc.tiny-when-Vim-is-invoked-as-vi.patch
new file mode 100644
index 0000000..ce4a50a
--- /dev/null
+++ b/debian/patches/debian/Support-sourcing-a-vimrc.tiny-when-Vim-is-invoked-as-vi.patch
@@ -0,0 +1,75 @@
+From: James McCoy <jamessan at debian.org>
+Date: Tue, 6 Oct 2015 23:46:30 -0400
+Subject: Support sourcing a vimrc.tiny when Vim is invoked as vi
+
+This is used only in the vim-tiny package to allow a specific
+configuration for vim-tiny's vi. The vim-tiny package is substantially
+different from other Vim packages, so it does not make sense to
+share the same config.
+
+Closes: #222138
+Signed-off-by: Stefano Zacchiroli <zack at debian.org>
+Signed-off-by: James Vega <jamessan at debian.org>
+---
+ src/main.c | 11 ++++++++++-
+ src/os_unix.h | 3 +++
+ src/structs.h | 3 +++
+ 3 files changed, 16 insertions(+), 1 deletion(-)
+
+diff --git a/src/main.c b/src/main.c
+index c694532..d518f46 100644
+--- a/src/main.c
++++ b/src/main.c
+@@ -1729,6 +1729,10 @@ parse_command_name(mparm_T *parmp)
+ }
+ else if (STRNICMP(initstr, "vim", 3) == 0)
+ initstr += 3;
++#ifdef SYS_TINYRC_FILE
++ else if (STRNICMP(initstr, "vi", 2) == 0)
++ parmp->vi_mode = TRUE;
++#endif
+
+ /* Catch "[r][g]vimdiff" and "[r][g]viewdiff". */
+ if (STRICMP(initstr, "diff") == 0)
+@@ -2967,7 +2971,12 @@ source_startup_scripts(mparm_T *parmp)
+ * Get system wide defaults, if the file name is defined.
+ */
+ #ifdef SYS_VIMRC_FILE
+- (void)do_source((char_u *)SYS_VIMRC_FILE, FALSE, DOSO_NONE);
++# if defined(SYS_TINYRC_FILE) && defined(TINY_VIMRC)
++ if (parmp->vi_mode)
++ (void)do_source((char_u *)SYS_TINYRC_FILE, FALSE, DOSO_NONE);
++ else
++# endif
++ (void)do_source((char_u *)SYS_VIMRC_FILE, FALSE, DOSO_NONE);
+ #endif
+ #ifdef MACOS_X
+ (void)do_source((char_u *)"$VIMRUNTIME/macmap.vim", FALSE, DOSO_NONE);
+diff --git a/src/os_unix.h b/src/os_unix.h
+index 4b3a3f1..36d14fd 100644
+--- a/src/os_unix.h
++++ b/src/os_unix.h
+@@ -217,6 +217,9 @@ typedef struct dsc$descriptor DESC;
+ /*
+ * Unix system-dependent file names
+ */
++#ifndef SYS_TINYRC_FILE
++# define SYS_TINYRC_FILE "$VIM/vimrc.tiny"
++#endif
+ #ifndef SYS_VIMRC_FILE
+ # define SYS_VIMRC_FILE "$VIM/vimrc"
+ #endif
+diff --git a/src/structs.h b/src/structs.h
+index b56282f..b8f790f 100644
+--- a/src/structs.h
++++ b/src/structs.h
+@@ -3231,6 +3231,9 @@ typedef struct
+ #ifdef FEAT_DIFF
+ int diff_mode; /* start with 'diff' set */
+ #endif
++#ifdef SYS_TINYRC_FILE
++ int vi_mode; /* started as "vi" */
++#endif
+ } mparm_T;
+
+ /*
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..600d04b
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,5 @@
+upstream/Support-defining-compilation-date-in-SOURCE_DATE_EPOCH.patch
+debian/Support-sourcing-a-vimrc.tiny-when-Vim-is-invoked-as-vi.patch
+debian/Detect-the-rst-filetype-using-the-contents-of-the-file.patch
+debian/Add-recognition-of-more-LaTeX-commands-for-tex-filetype-d.patch
+debian/Document-Debian-s-decision-to-disable-modelines-by-defaul.patch
diff --git a/debian/patches/upstream/Support-defining-compilation-date-in-SOURCE_DATE_EPOCH.patch b/debian/patches/upstream/Support-defining-compilation-date-in-SOURCE_DATE_EPOCH.patch
new file mode 100644
index 0000000..4cb57fa
--- /dev/null
+++ b/debian/patches/upstream/Support-defining-compilation-date-in-SOURCE_DATE_EPOCH.patch
@@ -0,0 +1,81 @@
+From: James McCoy <jamessan at jamessan.com>
+Date: Thu, 28 Jan 2016 10:55:11 -0500
+Subject: Support defining compilation date in $SOURCE_DATE_EPOCH
+
+There is an ongoing effort[0] to make FOSS software reproducibly
+buildable. In order to make Vim build reproducibly, it is necessary to
+allow defining the date/time that is part of VIM_VERSION_LONG as part of
+the build process.
+
+This commit enables that by adding support for the SOURCE_DATE_EPOCH
+spec[1]. When the $SOURCE_DATE_EPOCH environment variable is defined,
+it will be used to populate the BUILD_DATE preprocessor define.
+
+If BUILD_DATE is not defined, the existing behavior of relying on the
+preprocessor's __DATE__/__TIME__ symbols will be used.
+
+[0]: https://reproducible-builds.org/
+[1]: https://reproducible-builds.org/specs/source-date-epoch/
+---
+ src/config.h.in | 3 +++
+ src/configure.in | 10 ++++++++++
+ src/version.c | 6 ++++++
+ 3 files changed, 19 insertions(+)
+
+diff --git a/src/config.h.in b/src/config.h.in
+index 9d35e48..86ee967 100644
+--- a/src/config.h.in
++++ b/src/config.h.in
+@@ -30,6 +30,9 @@
+ /* Define when __DATE__ " " __TIME__ can be used */
+ #undef HAVE_DATE_TIME
+
++/* Defined as the date of last modification */
++#undef BUILD_DATE
++
+ /* Define when __attribute__((unused)) can be used */
+ #undef HAVE_ATTRIBUTE_UNUSED
+
+diff --git a/src/configure.in b/src/configure.in
+index 504aca6..7c09064 100644
+--- a/src/configure.in
++++ b/src/configure.in
+@@ -29,6 +29,16 @@ dnl in autoconf needs it, where it uses STDC_HEADERS.
+ AC_HEADER_STDC
+ AC_HEADER_SYS_WAIT
+
++dnl If $SOURCE_DATE_EPOCH is present in the environment, use that as the
++dnl "compiled" timestamp in :version's output. Attempt to get the formatted
++dnl date using GNU date syntax, BSD date syntax, and finally falling back to
++dnl just using the current time.
++if test -n "$SOURCE_DATE_EPOCH"; then
++ DATE_FMT="%b %d %Y %H:%M:%S"
++ BUILD_DATE=$(LC_ALL=C date -u -d "@$SOURCE_DATE_EPOCH" "+$DATE_FMT" 2>/dev/null || LC_ALL=C date -u -r "$SOURCE_DATE_EPOCH" "+$DATE_FMT" 2>/dev/null || LC_ALL=C date -u "+$DATE_FMT")
++ AC_DEFINE_UNQUOTED(BUILD_DATE, ["$BUILD_DATE"])
++fi
++
+ dnl Check for the flag that fails if stuff are missing.
+
+ AC_MSG_CHECKING(--enable-fail-if-missing argument)
+diff --git a/src/version.c b/src/version.c
+index 21f6932..5173a7e 100644
+--- a/src/version.c
++++ b/src/version.c
+@@ -43,11 +43,17 @@ make_version(void)
+ * VAX C can't catenate strings in the preprocessor.
+ */
+ strcpy(longVersion, VIM_VERSION_LONG_DATE);
++#ifdef BUILD_DATE
++ strcat(longVersion, BUILD_DATE);
++#else
+ strcat(longVersion, __DATE__);
+ strcat(longVersion, " ");
+ strcat(longVersion, __TIME__);
++#endif
+ strcat(longVersion, ")");
+ }
++# elif defined(BUILD_DATE)
++char *longVersion = VIM_VERSION_LONG_DATE BUILD_DATE ")";
+ # else
+ char *longVersion = VIM_VERSION_LONG_DATE __DATE__ " " __TIME__ ")";
+ # endif
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-vim/vim.git
More information about the pkg-vim-maintainers
mailing list