File: 0002-Remove-kew.patch

package info (click to toggle)
node-gulp-newer 1.4.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 156 kB
  • sloc: javascript: 1,093; makefile: 2
file content (126 lines) | stat: -rw-r--r-- 4,075 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
From: =?utf-8?q?Bastien_Roucari=C3=A8s?= <rouca@debian.org>
Date: Mon, 1 Dec 2025 13:56:32 +0100
Subject: Remove kew

forwarded: not-needed
---
 index.js     | 29 ++++++++++++++---------------
 package.json |  1 -
 2 files changed, 14 insertions(+), 16 deletions(-)

Index: node-gulp-newer/index.js
===================================================================
--- node-gulp-newer.orig/index.js	2025-12-01 16:11:37.000000000 +0100
+++ node-gulp-newer/index.js	2025-12-01 17:03:22.593173872 +0100
@@ -4,7 +4,6 @@
 var util = require('util');
 const { glob } = require('glob');
 
-var Q = require('kew');
 var PluginError = require('plugin-error');
 
 var PLUGIN_NAME = 'gulp-newer';
@@ -74,8 +73,8 @@
    * @type {[type]}
    */
   this._destStats = this._dest
-    ? Q.nfcall(fs.stat, this._dest)
-    : Q.resolve(null);
+    ? fs.promises.stat(this._dest)
+    : Promise.resolve(null);
 
   /**
    * If the provided dest is a file, we want to pass through all files if any
@@ -107,7 +106,7 @@
     for (var i = 0; i < options.extra.length; ++i) {
       extraFiles.push(glob(options.extra[i]));
     }
-    this._extraStats = Q.all(extraFiles)
+    this._extraStats = Promise.all(extraFiles)
       .then(function(fileArrays) {
         // First collect all the files in all the glob result arrays
         var allFiles = [];
@@ -117,9 +116,9 @@
         }
         var extraStats = [];
         for (i = 0; i < allFiles.length; ++i) {
-          extraStats.push(Q.nfcall(fs.stat, allFiles[i]));
+          extraStats.push(fs.promises.stat(allFiles[i]));
         }
-        return Q.all(extraStats);
+        return Promise.all(extraStats);
       })
       .then(function(resolvedStats) {
         // We get all the file stats here; find the *latest* modification.
@@ -131,7 +130,7 @@
         }
         return latestStat;
       })
-      .fail(function(error) {
+      .catch((error) => {
         if (error && error.path) {
           throw new PluginError(
             PLUGIN_NAME,
@@ -160,8 +159,8 @@
     return;
   }
   var self = this;
-  Q.resolve([this._destStats, this._extraStats])
-    .spread(function(destStats, extraStats) {
+  Promise.all([this._destStats, this._extraStats])
+    .then(([destStats, extraStats]) => {
       if ((destStats && destStats.isDirectory()) || self._ext || self._map) {
         // stat dest/relative file
         var relative = srcFile.relative;
@@ -175,7 +174,7 @@
         var destFileJoined = self._dest
           ? path.join(self._dest, destFileRelative)
           : destFileRelative;
-        return Q.all([Q.nfcall(fs.stat, destFileJoined), extraStats]);
+        return Promise.all([fs.promises.stat(destFileJoined), extraStats]);
       } else {
         // wait to see if any are newer, then pass through all
         if (!self._bufferedFiles) {
@@ -184,16 +183,16 @@
         return [destStats, extraStats];
       }
     })
-    .fail(function(err) {
+    .catch((err) => {
       if (err.code === 'ENOENT') {
         // dest file or directory doesn't exist, pass through all
-        return Q.resolve([null, this._extraStats]);
+        return Promise.resolve([null, this._extraStats]);
       } else {
         // unexpected error
-        return Q.reject(err);
+        return Promise.reject(err);
       }
     })
-    .spread(function(destFileStats, extraFileStats) {
+    .then(([destFileStats, extraFileStats]) => {
       var newer = !destFileStats || srcFile.stat.mtime > destFileStats.mtime;
       // If *any* extra file is newer than a destination file, then ALL
       // are newer.
@@ -220,8 +219,7 @@
       }
       done();
     })
-    .fail(done)
-    .end();
+    .catch(done)
 };
 
 /**
Index: node-gulp-newer/package.json
===================================================================
--- node-gulp-newer.orig/package.json	2025-12-01 16:11:37.000000000 +0100
+++ node-gulp-newer/package.json	2025-12-01 16:11:37.000000000 +0100
@@ -38,7 +38,6 @@
   },
   "dependencies": {
     "glob": ">=10.0.0",
-    "kew": "^0.7.0",
     "plugin-error": "^0.1.2"
   },
   "eslintConfig": {