Skip to content

Commit 8943785

Browse files
committed
sha1: add missing hex param
and deprecate ${js} macro because of removed script engine Signed-off-by: Christoph Rueger <[email protected]>
1 parent e5d0cff commit 8943785

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

biz.aQute.bndlib/src/aQute/bnd/osgi/Analyzer.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3283,9 +3283,16 @@ public String _sha1(String args[]) throws Exception {
32833283
throw new FileNotFoundException("From sha1, not found " + args[1]);
32843284

32853285
IO.copy(r.openInputStream(), digester);
3286+
3287+
boolean hex = args.length > 2 && args[2].equals("hex");
3288+
if (hex)
3289+
return Hex.toHexString(digester.digest()
3290+
.digest());
3291+
32863292
return Base64.encodeBase64(digester.digest()
32873293
.digest());
32883294
}
3295+
32893296
}
32903297

32913298
public Descriptor getDescriptor(String descriptor) {

biz.aQute.bndlib/src/aQute/bnd/osgi/Macro.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1931,6 +1931,10 @@ public String _split(String[] args) throws Exception {
19311931

19321932
static final String _jsHelp = "${js [;<js expr>...]}";
19331933

1934+
/**
1935+
* @deprecated javascript script engine removed in Java 15
1936+
*/
1937+
@Deprecated
19341938
public Object _js(String[] args) throws Exception {
19351939
verifyCommand(args, _jsHelp, null, 2, Integer.MAX_VALUE);
19361940

0 commit comments

Comments
 (0)