npm-pkgbuild 10.16.2 → 10.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -246,7 +246,7 @@ export async function* extractFromPackage(options = {}) {
|
|
|
246
246
|
sources,
|
|
247
247
|
dependencies,
|
|
248
248
|
output,
|
|
249
|
-
variant,
|
|
249
|
+
variant: { name: variant, arch, type: Object.keys(output) },
|
|
250
250
|
context
|
|
251
251
|
};
|
|
252
252
|
}
|
|
@@ -266,7 +266,7 @@ export async function* extractFromPackage(options = {}) {
|
|
|
266
266
|
sources,
|
|
267
267
|
dependencies,
|
|
268
268
|
output,
|
|
269
|
-
variant,
|
|
269
|
+
variant: { name: variant, type: Object.keys(output) },
|
|
270
270
|
context
|
|
271
271
|
};
|
|
272
272
|
}
|
package/src/npm-pkgbuild-cli.mjs
CHANGED
|
@@ -126,9 +126,12 @@ program
|
|
|
126
126
|
];
|
|
127
127
|
|
|
128
128
|
if (options.verbose) {
|
|
129
|
-
console.log("variant
|
|
130
|
-
console.log(
|
|
131
|
-
console.log(
|
|
129
|
+
console.log("variant:");
|
|
130
|
+
console.log(kv(variant," "));
|
|
131
|
+
console.log("sources:");
|
|
132
|
+
console.log(" " + sources.join("\n "));
|
|
133
|
+
console.log("dependencies:");
|
|
134
|
+
console.log(kv(dependencies," "));
|
|
132
135
|
console.log(kv(output.properties));
|
|
133
136
|
}
|
|
134
137
|
|
|
@@ -163,8 +166,8 @@ function handleError(e, options) {
|
|
|
163
166
|
}
|
|
164
167
|
}
|
|
165
168
|
|
|
166
|
-
function kv(object) {
|
|
169
|
+
function kv(object, prefix="") {
|
|
167
170
|
return object ? Object.entries(object)
|
|
168
|
-
.map(([k, v]) => `${k}: ${v}`)
|
|
171
|
+
.map(([k, v]) => `${prefix}${k}: ${v}`)
|
|
169
172
|
.join("\n"): "";
|
|
170
173
|
}
|
package/src/output/arch.mjs
CHANGED
|
@@ -54,6 +54,8 @@ function keyPrefix(key) {
|
|
|
54
54
|
|
|
55
55
|
const PKGBUILD = "PKGBUILD";
|
|
56
56
|
|
|
57
|
+
let ext = ".pkg.tar.xz";
|
|
58
|
+
|
|
57
59
|
export class ARCH extends Packager {
|
|
58
60
|
static get name() {
|
|
59
61
|
return "arch";
|
|
@@ -64,7 +66,7 @@ export class ARCH extends Packager {
|
|
|
64
66
|
}
|
|
65
67
|
|
|
66
68
|
static get fileNameExtension() {
|
|
67
|
-
return
|
|
69
|
+
return ext;
|
|
68
70
|
}
|
|
69
71
|
|
|
70
72
|
static get fields() {
|
|
@@ -74,6 +76,16 @@ export class ARCH extends Packager {
|
|
|
74
76
|
static async available() {
|
|
75
77
|
try {
|
|
76
78
|
await execa("makepkg", ["-V"]);
|
|
79
|
+
|
|
80
|
+
const cfg = await readFile("/etc/makepkg.conf", { encoding: "utf8" });
|
|
81
|
+
const i = cfg.indexOf("PKGEXT='");
|
|
82
|
+
if (i > 0) {
|
|
83
|
+
const m = cfg
|
|
84
|
+
.substring(i)
|
|
85
|
+
.split(/\n/)[0]
|
|
86
|
+
.match(/='([^']+)'/);
|
|
87
|
+
ext = m[1];
|
|
88
|
+
}
|
|
77
89
|
return true;
|
|
78
90
|
} catch {}
|
|
79
91
|
|