[Pkg-javascript-commits] [node-mime-types] 01/01: taking care of FTBFS

Thorsten Alteholz alteholz at moszumanska.debian.org
Sun Feb 28 17:50:23 UTC 2016


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

alteholz pushed a commit to branch master
in repository node-mime-types.

commit bf1e4001375b226d419cf8f71048dea46e2eb169
Author: Thorsten Alteholz <debian at alteholz.de>
Date:   Sun Feb 28 18:43:46 2016 +0100

    taking care of FTBFS
---
 debian/changelog                       | 10 +++++
 debian/control                         |  6 +--
 debian/install                         |  2 +-
 debian/patches/0004-build-own-db.patch | 78 ++++++++++++++++++++++++++++++++++
 debian/patches/series                  |  1 +
 debian/rules                           |  8 +++-
 6 files changed, 100 insertions(+), 5 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 091f71f..0f11b38 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+node-mime-types (2.0.2-2) unstable; urgency=medium
+
+  * debian/control: add myself to Uploaders: 
+  * debian/control: remove "XS-Testsuite: autopkgtest" no longer needed
+  * debian/control: use secure VCS-URLs
+  * debian/rules: do not remove files created by patch 0000
+  * add 0004-build-own-db.patch to avoid FTBFS (Closes: #796407)
+
+ -- Thorsten Alteholz <debian at alteholz.de>  Sun, 28 Feb 2016 18:27:51 +0100
+
 node-mime-types (2.0.2-1) unstable; urgency=medium
 
   * New upstream version.
diff --git a/debian/control b/debian/control
index 0c7ac55..136d5cf 100644
--- a/debian/control
+++ b/debian/control
@@ -3,6 +3,7 @@ Section: web
 Priority: extra
 Maintainer: Debian Javascript Maintainers <pkg-javascript-devel at lists.alioth.debian.org>
 Uploaders: Leo Iannacone <l3on at ubuntu.com>
+           , Thorsten Alteholz <debian at alteholz.de>
 Build-Depends:
  debhelper (>= 8)
  , dh-buildinfo
@@ -12,9 +13,8 @@ Build-Depends:
  , node-mocha
 Standards-Version: 3.9.6
 Homepage: https://github.com/jshttp/mime-types
-Vcs-Git: git://anonscm.debian.org/pkg-javascript/node-mime-types.git
-Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-javascript/node-mime-types.git
-XS-Testsuite: autopkgtest
+Vcs-Git: https://anonscm.debian.org/git/pkg-javascript/node-mime-types.git
+Vcs-Browser: https://anonscm.debian.org/gitweb/?p=pkg-javascript/node-mime-types.git
 
 Package: node-mime-types
 Architecture: all
diff --git a/debian/install b/debian/install
index aee42b4..f749de6 100644
--- a/debian/install
+++ b/debian/install
@@ -3,4 +3,4 @@ index.js usr/lib/nodejs/mime-types/
 
 node_modules/mime-db/package.json usr/lib/nodejs/mime-types/node_modules/mime-db
 node_modules/mime-db/index.js usr/lib/nodejs/mime-types/node_modules/mime-db
-node_modules/mime-db/db.json usr/lib/nodejs/mime-types/node_modules/mime-db
+node_modules/mime-db/deb-db.json usr/lib/nodejs/mime-types/node_modules/mime-db
diff --git a/debian/patches/0004-build-own-db.patch b/debian/patches/0004-build-own-db.patch
new file mode 100644
index 0000000..b718298
--- /dev/null
+++ b/debian/patches/0004-build-own-db.patch
@@ -0,0 +1,78 @@
+Description: don't touch module files and create Debian stuff separately
+Author: Thorsten Alteholz <debian at alteholz.de>
+Forwarded: not-needed
+Index: node-mime-types/node_modules/mime-db/scripts/extensions.js
+===================================================================
+--- node-mime-types.orig/node_modules/mime-db/scripts/extensions.js	2016-02-28 18:30:54.000000000 +0100
++++ node-mime-types/node_modules/mime-db/scripts/extensions.js	2016-02-28 18:31:21.000000000 +0100
+@@ -7,7 +7,8 @@
+ var path = require('path')
+ 
+ get('/etc/mime.types');
+-get('/usr/share/node-mime/node.types');
++// node-mime now already provides a json file
++//get('/usr/share/node-mime/node.types');
+ 
+ function get(url) {
+ 
+@@ -37,5 +38,5 @@
+       .split(/\s+/)
+       .filter(Boolean)
+   })
+-  fs.writeFileSync('src/' + path.basename(url).split('.')[0] + '.json', JSON.stringify(json))
++  fs.writeFileSync('src/deb.' + path.basename(url).split('.')[0] + '.json', JSON.stringify(json))
+ }
+Index: node-mime-types/node_modules/mime-db/scripts/build.js
+===================================================================
+--- node-mime-types.orig/node_modules/mime-db/scripts/build.js	2016-02-28 18:30:54.000000000 +0100
++++ node-mime-types/node_modules/mime-db/scripts/build.js	2016-02-28 18:30:54.000000000 +0100
+@@ -1,8 +1,10 @@
+ 
+ var db = {}
+ 
++// only do debian stuff here
++//
+ // add the mime extensions from Apache
+-var mime = require('../src/mime.json')
++var mime = require('../src/deb.mime.json')
+ Object.keys(mime).forEach(function (type) {
+   var e = mime[type]
+   var t = type.toLowerCase()
+@@ -12,7 +14,7 @@
+ 
+ // add all of node mime's mime extensions
+ // though i think we should just put this in `types.json`
+-var mime = require('../src/node.json')
++var mime = require('../src/deb.types.json')
+ Object.keys(mime).forEach(function (type) {
+   var e = mime[type]
+   var t = type.toLowerCase()
+@@ -55,4 +57,4 @@
+ })
+ 
+ // write db
+-require('./lib/write-db')('db.json', db)
++require('./lib/write-db')('deb-db.json', db)
+Index: node-mime-types/node_modules/mime-db/index.js
+===================================================================
+--- node-mime-types.orig/node_modules/mime-db/index.js	2016-02-28 18:30:54.000000000 +0100
++++ node-mime-types/node_modules/mime-db/index.js	2016-02-28 18:30:54.000000000 +0100
+@@ -8,4 +8,4 @@
+  * Module exports.
+  */
+ 
+-module.exports = require('./db.json')
++module.exports = require('./deb-db.json')
+Index: node-mime-types/node_modules/mime-db/package.json
+===================================================================
+--- node-mime-types.orig/node_modules/mime-db/package.json	2016-02-28 18:30:54.000000000 +0100
++++ node-mime-types/node_modules/mime-db/package.json	2016-02-28 18:30:54.000000000 +0100
+@@ -24,7 +24,7 @@
+   },
+   "files": [
+     "LICENSE",
+-    "db.json",
++    "deb-db.json",
+     "index.js"
+   ],
+   "scripts": {
diff --git a/debian/patches/series b/debian/patches/series
index bf0df5d..ad929e3 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@
 0001-use-system-mime-types.patch
 0002-update-tests-with-new-mimes.patch
 0003-exports-mime.db.patch
+0004-build-own-db.patch
diff --git a/debian/rules b/debian/rules
index ceec446..b624255 100755
--- a/debian/rules
+++ b/debian/rules
@@ -8,11 +8,17 @@
 	dh $@
 
 
+# do not remove foreign files from node_modules here 
+# as patch could not be reverted
 override_dh_auto_clean:
-	cd node_modules/mime-db/ && rm db.json src/*.json || true
+	dh_auto_clean
+	cd node_modules/mime-db/ && rm deb-db.json src/deb.*.json || true
+#	cd node_modules/mime-db/ && rm db.json src/*.json || true
 
 override_dh_auto_build:
 	cd node_modules/mime-db/ && nodejs scripts/extensions
+	# just copy the file from node-mime
+	cp /usr/share/node-mime/types.json node_modules/mime-db/src/deb.types.json
 	cd node_modules/mime-db/ && nodejs scripts/build
 
 override_dh_auto_test:

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



More information about the Pkg-javascript-commits mailing list