[Pkg-javascript-commits] [npm] 01/14: Use system marked to generate documentation. Refresh patch.

Jérémy Lal kapouer at moszumanska.debian.org
Mon Jul 28 23:28:45 UTC 2014


This is an automated email from the git hooks/post-receive script.

kapouer pushed a commit to branch master
in repository npm.

commit 40ee0995bc53b77c1061cdf07fd58d462b710b34
Author: Jérémy Lal <kapouer at melix.org>
Date:   Tue Jul 29 00:55:08 2014 +0200

    Use system marked to generate documentation. Refresh patch.
---
 debian/control.in                       |  3 ++-
 debian/patches/2002_use_ruby_ronn.patch | 48 ++++++++++++++++++++++++++-------
 2 files changed, 40 insertions(+), 11 deletions(-)

diff --git a/debian/control.in b/debian/control.in
index d6af137..9bf8af6 100644
--- a/debian/control.in
+++ b/debian/control.in
@@ -8,7 +8,8 @@ Build-Depends: @cdbs@,
  bash-completion,
  nodejs,
  node-glob,
- ruby-ronn
+ ruby-ronn,
+ marked
 Standards-Version: 3.9.5
 Homepage: http://github.com/isaacs/npm
 Vcs-Git: git://anonscm.debian.org/pkg-javascript/npm.git
diff --git a/debian/patches/2002_use_ruby_ronn.patch b/debian/patches/2002_use_ruby_ronn.patch
index 81405e6..8a8de0d 100644
--- a/debian/patches/2002_use_ruby_ronn.patch
+++ b/debian/patches/2002_use_ruby_ronn.patch
@@ -1,11 +1,11 @@
-Description: Use ruby-ronn to generate documentation
+Description: Use ruby-ronn and marked to generate documentation
  Command-line options are different. Perl doesn't need -i switch.
 Forwarded: not-needed
 Author: Jérémy Lal <kapouer at melix.org>
-Last-Update: 2013-09-7
+Last-Update: 2014-07-29
 --- a/scripts/doc-build.sh
 +++ b/scripts/doc-build.sh
-@@ -1,37 +1,5 @@
+@@ -1,63 +1,5 @@
  #!/usr/bin/env bash
  
 -if [[ $DEBUG != "" ]]; then
@@ -40,10 +40,36 @@ Last-Update: 2013-09-7
 -  fi
 -fi
 -
+-if ! [ -x node_modules/.bin/marked ]; then
+-  ps=0
+-  if [ -f .building_marked ]; then
+-    pid=$(cat .building_marked)
+-    ps=$(ps -p $pid | grep $pid | wc -l) || true
+-  fi
+-
+-  if [ -f .building_marked ] && [ $ps != 0 ]; then
+-    while [ -f .building_marked ]; do
+-      sleep 1
+-    done
+-  else
+-    # a race to see which make process will be the one to install marked
+-    echo $$ > .building_marked
+-    sleep 1
+-    if [ $(cat .building_marked) == $$ ]; then
+-      make node_modules/.bin/marked
+-      rm .building_marked
+-    else
+-      while [ -f .building_marked ]; do
+-        sleep 1
+-      done
+-    fi
+-  fi
+-fi
+-
  src=$1
  dest=$2
  name=$(basename ${src%.*})
-@@ -42,34 +10,34 @@
+@@ -68,36 +10,36 @@
  
  case $dest in
    *.[1357])
@@ -64,25 +90,27 @@ Last-Update: 2013-09-7
      exit $?
      ;;
    *.html)
+     url=${dest/html\//}
      (cat html/dochead.html && \
--     ./node_modules/.bin/ronn -f $src &&
-+     cat $src | ronn --fragment && \
+-     cat $src | ./node_modules/.bin/marked &&
++     cat $src | marked &&
       cat html/docfoot.html)\
      | sed "s|@NAME@|$name|g" \
      | sed "s|@DATE@|$date|g" \
+     | sed "s|@URL@|$url|g" \
      | sed "s|@VERSION@|$version|g" \
--    | perl -pi -e 's/<h1>([^\(]*\([0-9]\)) -- (.*?)<\/h1>/<h1>\1<\/h1> <p>\2<\/p>/g' \
+-    | perl -pi -e 's/<h1([^>]*)>([^\(]*\([0-9]\)) -- (.*?)<\/h1>/<h1>\2<\/h1> <p>\3<\/p>/g' \
 -    | perl -pi -e 's/npm-npm/npm/g' \
--    | perl -pi -e 's/([^"-])(npm-)?README(\(1\))?/\1<a href="..\/..\/doc\/README.html">README<\/a>/g' \
+-    | perl -pi -e 's/([^"-])(npm-)?README(?!\.html)(\(1\))?/\1<a href="..\/..\/doc\/README.html">README<\/a>/g' \
 -    | perl -pi -e 's/<title><a href="[^"]+README.html">README<\/a><\/title>/<title>README<\/title>/g' \
 -    | perl -pi -e 's/([^"-])([^\(> ]+)(\(1\))/\1<a href="..\/cli\/\2.html">\2\3<\/a>/g' \
 -    | perl -pi -e 's/([^"-])([^\(> ]+)(\(3\))/\1<a href="..\/api\/\2.html">\2\3<\/a>/g' \
 -    | perl -pi -e 's/([^"-])([^\(> ]+)(\(5\))/\1<a href="..\/files\/\2.html">\2\3<\/a>/g' \
 -    | perl -pi -e 's/([^"-])([^\(> ]+)(\(7\))/\1<a href="..\/misc\/\2.html">\2\3<\/a>/g' \
 -    | perl -pi -e 's/\([1357]\)<\/a><\/h1>/<\/a><\/h1>/g' \
-+    | perl -p -e 's/<h1>([^\(]*\([0-9]\)) -- (.*?)<\/h1>/<h1>\1<\/h1> <p>\2<\/p>/g' \
++    | perl -p -e 's/<h1([^>]*)>([^\(]*\([0-9]\)) -- (.*?)<\/h1>/<h1>\2<\/h1> <p>\3<\/p>/g' \
 +    | perl -p -e 's/npm-npm/npm/g' \
-+    | perl -p -e 's/([^"-])(npm-)?README(\(1\))?/\1<a href="..\/..\/doc\/README.html">README<\/a>/g' \
++    | perl -p -e 's/([^"-])(npm-)?README(?!\.html)(\(1\))?/\1<a href="..\/..\/doc\/README.html">README<\/a>/g' \
 +    | perl -p -e 's/<title><a href="[^"]+README.html">README<\/a><\/title>/<title>README<\/title>/g' \
 +    | perl -p -e 's/([^"-])([^\(> ]+)(\(1\))/\1<a href="..\/cli\/\2.html">\2\3<\/a>/g' \
 +    | perl -p -e 's/([^"-])([^\(> ]+)(\(3\))/\1<a href="..\/api\/\2.html">\2\3<\/a>/g' \

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/npm.git



More information about the Pkg-javascript-commits mailing list