Search
j0ke.net Open Build Service
>
Projects
>
home:jg
:
http-testing
>
npm
> npm-use-system-doc-paths.patch
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File npm-use-system-doc-paths.patch of Package npm
diff --git a/lib/help.js b/lib/help.js index f522763..5cbce88 100644 --- a/lib/help.js +++ b/lib/help.js @@ -53,8 +53,8 @@ function help (args, cb) { })) // npm help <section>: Try to find the path - var manroot = path.resolve(__dirname, "..", "man") - var htmlroot = path.resolve(__dirname, "..", "html", "doc") + var manroot = path.resolve("/usr/share/man") + var htmlroot = path.resolve("/usr/share/doc/", "npm" + npm.version, "html", "doc") // legacy if (section === "global") @@ -63,7 +63,7 @@ function help (args, cb) { section = "package.json" // find either /section.n or /npm-section.n - var f = "+(npm-" + section + "|" + section + ").[0-9]" + var f = "+(npm-" + section + "|" + section + ").[0-9].gz" return glob(manroot + "/*/" + f, function (er, mans) { if (er) return cb(er) @@ -76,7 +76,7 @@ function help (args, cb) { } function pickMan (mans, pref_) { - var nre = /([0-9]+)$/ + var nre = /([0-9]+)/ var pref = {} pref_.forEach(function (sect, i) { pref[sect] = i @@ -92,9 +92,9 @@ function pickMan (mans, pref_) { } function viewMan (man, cb) { - var nre = /([0-9]+)$/ + var nre = /([0-9]+)/ var num = man.match(nre)[1] - var section = path.basename(man, "." + num) + var section = man // at this point, we know that the specified man page exists var manpath = path.join(__dirname, "..", "man") @@ -102,7 +102,7 @@ function viewMan (man, cb) { Object.keys(process.env).forEach(function (i) { env[i] = process.env[i] }) - env.MANPATH = manpath + //env.MANPATH = manpath var viewer = npm.config.get("viewer") switch (viewer) { @@ -144,7 +144,7 @@ function htmlMan (man) { default: throw new Error("invalid man section: " + sect) } - return path.resolve(__dirname, "..", "html", "doc", sect, f) + return path.resolve("/usr/share/", "npm" + npm.version, "html", "doc", sect, f) } function npmUsage (cb) { @@ -217,7 +217,7 @@ function wrap (arr) { } function getSections (cb) { - var g = path.resolve(__dirname, "../man/man[0-9]/*.[0-9]") + var g = path.resolve("/usr/share/man/man[0-9]/*.[0-9].gz") glob(g, function (er, files) { if (er) return cb(er)