@@ -45304,10 +45304,10 @@ function populateMaps (extensions, types) {
45304
45304
module.exports = minimatch
45305
45305
minimatch.Minimatch = Minimatch
45306
45306
45307
- var path = (function () { try { return __nccwpck_require__(1017) } catch (e) {}}()) || {
45308
- sep: '/'
45309
- }
45310
- minimatch.sep = path.sep
45307
+ var path = { sep: '/' }
45308
+ try {
45309
+ path = __nccwpck_require__(1017)
45310
+ } catch (er) {}
45311
45311
45312
45312
var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}
45313
45313
var expand = __nccwpck_require__(3717)
@@ -45359,64 +45359,43 @@ function filter (pattern, options) {
45359
45359
}
45360
45360
45361
45361
function ext (a, b) {
45362
+ a = a || {}
45362
45363
b = b || {}
45363
45364
var t = {}
45364
- Object.keys(a).forEach(function (k) {
45365
- t[k] = a[k]
45366
- })
45367
45365
Object.keys(b).forEach(function (k) {
45368
45366
t[k] = b[k]
45369
45367
})
45368
+ Object.keys(a).forEach(function (k) {
45369
+ t[k] = a[k]
45370
+ })
45370
45371
return t
45371
45372
}
45372
45373
45373
45374
minimatch.defaults = function (def) {
45374
- if (!def || typeof def !== 'object' || !Object.keys(def).length) {
45375
- return minimatch
45376
- }
45375
+ if (!def || !Object.keys(def).length) return minimatch
45377
45376
45378
45377
var orig = minimatch
45379
45378
45380
45379
var m = function minimatch (p, pattern, options) {
45381
- return orig(p, pattern, ext(def, options))
45380
+ return orig.minimatch (p, pattern, ext(def, options))
45382
45381
}
45383
45382
45384
45383
m.Minimatch = function Minimatch (pattern, options) {
45385
45384
return new orig.Minimatch(pattern, ext(def, options))
45386
45385
}
45387
- m.Minimatch.defaults = function defaults (options) {
45388
- return orig.defaults(ext(def, options)).Minimatch
45389
- }
45390
-
45391
- m.filter = function filter (pattern, options) {
45392
- return orig.filter(pattern, ext(def, options))
45393
- }
45394
-
45395
- m.defaults = function defaults (options) {
45396
- return orig.defaults(ext(def, options))
45397
- }
45398
-
45399
- m.makeRe = function makeRe (pattern, options) {
45400
- return orig.makeRe(pattern, ext(def, options))
45401
- }
45402
-
45403
- m.braceExpand = function braceExpand (pattern, options) {
45404
- return orig.braceExpand(pattern, ext(def, options))
45405
- }
45406
-
45407
- m.match = function (list, pattern, options) {
45408
- return orig.match(list, pattern, ext(def, options))
45409
- }
45410
45386
45411
45387
return m
45412
45388
}
45413
45389
45414
45390
Minimatch.defaults = function (def) {
45391
+ if (!def || !Object.keys(def).length) return Minimatch
45415
45392
return minimatch.defaults(def).Minimatch
45416
45393
}
45417
45394
45418
45395
function minimatch (p, pattern, options) {
45419
- assertValidPattern(pattern)
45396
+ if (typeof pattern !== 'string') {
45397
+ throw new TypeError('glob pattern string required')
45398
+ }
45420
45399
45421
45400
if (!options) options = {}
45422
45401
@@ -45425,6 +45404,9 @@ function minimatch (p, pattern, options) {
45425
45404
return false
45426
45405
}
45427
45406
45407
+ // "" only matches ""
45408
+ if (pattern.trim() === '') return p === ''
45409
+
45428
45410
return new Minimatch(pattern, options).match(p)
45429
45411
}
45430
45412
@@ -45433,14 +45415,15 @@ function Minimatch (pattern, options) {
45433
45415
return new Minimatch(pattern, options)
45434
45416
}
45435
45417
45436
- assertValidPattern(pattern)
45418
+ if (typeof pattern !== 'string') {
45419
+ throw new TypeError('glob pattern string required')
45420
+ }
45437
45421
45438
45422
if (!options) options = {}
45439
-
45440
45423
pattern = pattern.trim()
45441
45424
45442
45425
// windows support: need to use /, not \
45443
- if (!options.allowWindowsEscape && path.sep !== '/') {
45426
+ if (path.sep !== '/') {
45444
45427
pattern = pattern.split(path.sep).join('/')
45445
45428
}
45446
45429
@@ -45451,7 +45434,6 @@ function Minimatch (pattern, options) {
45451
45434
this.negate = false
45452
45435
this.comment = false
45453
45436
this.empty = false
45454
- this.partial = !!options.partial
45455
45437
45456
45438
// make the set of regexps etc.
45457
45439
this.make()
@@ -45461,6 +45443,9 @@ Minimatch.prototype.debug = function () {}
45461
45443
45462
45444
Minimatch.prototype.make = make
45463
45445
function make () {
45446
+ // don't do it more than once.
45447
+ if (this._made) return
45448
+
45464
45449
var pattern = this.pattern
45465
45450
var options = this.options
45466
45451
@@ -45480,7 +45465,7 @@ function make () {
45480
45465
// step 2: expand braces
45481
45466
var set = this.globSet = this.braceExpand()
45482
45467
45483
- if (options.debug) this.debug = function debug() { console.error.apply(console, arguments) }
45468
+ if (options.debug) this.debug = console.error
45484
45469
45485
45470
this.debug(this.pattern, set)
45486
45471
@@ -45560,29 +45545,19 @@ function braceExpand (pattern, options) {
45560
45545
pattern = typeof pattern === 'undefined'
45561
45546
? this.pattern : pattern
45562
45547
45563
- assertValidPattern(pattern)
45548
+ if (typeof pattern === 'undefined') {
45549
+ throw new TypeError('undefined pattern')
45550
+ }
45564
45551
45565
- // Thanks to Yeting Li <https://github.com/yetingli> for
45566
- // improving this regexp to avoid a ReDOS vulnerability.
45567
- if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
45552
+ if (options.nobrace ||
45553
+ !pattern.match(/\{.*\}/)) {
45568
45554
// shortcut. no need to expand.
45569
45555
return [pattern]
45570
45556
}
45571
45557
45572
45558
return expand(pattern)
45573
45559
}
45574
45560
45575
- var MAX_PATTERN_LENGTH = 1024 * 64
45576
- var assertValidPattern = function (pattern) {
45577
- if (typeof pattern !== 'string') {
45578
- throw new TypeError('invalid pattern')
45579
- }
45580
-
45581
- if (pattern.length > MAX_PATTERN_LENGTH) {
45582
- throw new TypeError('pattern is too long')
45583
- }
45584
- }
45585
-
45586
45561
// parse a component of the expanded set.
45587
45562
// At this point, no pattern may contain "/" in it
45588
45563
// so we're going to return a 2d array, where each entry is the full
@@ -45597,17 +45572,14 @@ var assertValidPattern = function (pattern) {
45597
45572
Minimatch.prototype.parse = parse
45598
45573
var SUBPARSE = {}
45599
45574
function parse (pattern, isSub) {
45600
- assertValidPattern(pattern)
45575
+ if (pattern.length > 1024 * 64) {
45576
+ throw new TypeError('pattern is too long')
45577
+ }
45601
45578
45602
45579
var options = this.options
45603
45580
45604
45581
// shortcuts
45605
- if (pattern === '**') {
45606
- if (!options.noglobstar)
45607
- return GLOBSTAR
45608
- else
45609
- pattern = '*'
45610
- }
45582
+ if (!options.noglobstar && pattern === '**') return GLOBSTAR
45611
45583
if (pattern === '') return ''
45612
45584
45613
45585
var re = ''
@@ -45663,12 +45635,10 @@ function parse (pattern, isSub) {
45663
45635
}
45664
45636
45665
45637
switch (c) {
45666
- /* istanbul ignore next */
45667
- case '/': {
45638
+ case '/':
45668
45639
// completely not allowed, even escaped.
45669
45640
// Should already be path-split by now.
45670
45641
return false
45671
- }
45672
45642
45673
45643
case '\\':
45674
45644
clearStateChar()
@@ -45787,23 +45757,25 @@ function parse (pattern, isSub) {
45787
45757
45788
45758
// handle the case where we left a class open.
45789
45759
// "[z-a]" is valid, equivalent to "\[z-a\]"
45790
- // split where the last [ was, make sure we don't have
45791
- // an invalid re. if so, re-walk the contents of the
45792
- // would-be class to re-translate any characters that
45793
- // were passed through as-is
45794
- // TODO: It would probably be faster to determine this
45795
- // without a try/catch and a new RegExp, but it's tricky
45796
- // to do safely. For now, this is safe and works.
45797
- var cs = pattern.substring(classStart + 1, i)
45798
- try {
45799
- RegExp('[' + cs + ']')
45800
- } catch (er) {
45801
- // not a valid class!
45802
- var sp = this.parse(cs, SUBPARSE)
45803
- re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]'
45804
- hasMagic = hasMagic || sp[1]
45805
- inClass = false
45806
- continue
45760
+ if (inClass) {
45761
+ // split where the last [ was, make sure we don't have
45762
+ // an invalid re. if so, re-walk the contents of the
45763
+ // would-be class to re-translate any characters that
45764
+ // were passed through as-is
45765
+ // TODO: It would probably be faster to determine this
45766
+ // without a try/catch and a new RegExp, but it's tricky
45767
+ // to do safely. For now, this is safe and works.
45768
+ var cs = pattern.substring(classStart + 1, i)
45769
+ try {
45770
+ RegExp('[' + cs + ']')
45771
+ } catch (er) {
45772
+ // not a valid class!
45773
+ var sp = this.parse(cs, SUBPARSE)
45774
+ re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]'
45775
+ hasMagic = hasMagic || sp[1]
45776
+ inClass = false
45777
+ continue
45778
+ }
45807
45779
}
45808
45780
45809
45781
// finish up the class.
@@ -45887,7 +45859,9 @@ function parse (pattern, isSub) {
45887
45859
// something that could conceivably capture a dot
45888
45860
var addPatternStart = false
45889
45861
switch (re.charAt(0)) {
45890
- case '[': case '.': case '(': addPatternStart = true
45862
+ case '.':
45863
+ case '[':
45864
+ case '(': addPatternStart = true
45891
45865
}
45892
45866
45893
45867
// Hack to work around lack of negative lookbehind in JS
@@ -45949,7 +45923,7 @@ function parse (pattern, isSub) {
45949
45923
var flags = options.nocase ? 'i' : ''
45950
45924
try {
45951
45925
var regExp = new RegExp('^' + re + '$', flags)
45952
- } catch (er) /* istanbul ignore next - should be impossible */ {
45926
+ } catch (er) {
45953
45927
// If it was an invalid regular expression, then it can't match
45954
45928
// anything. This trick looks for a character after the end of
45955
45929
// the string, which is of course impossible, except in multi-line
@@ -46007,7 +45981,7 @@ function makeRe () {
46007
45981
46008
45982
try {
46009
45983
this.regexp = new RegExp(re, flags)
46010
- } catch (ex) /* istanbul ignore next - should be impossible */ {
45984
+ } catch (ex) {
46011
45985
this.regexp = false
46012
45986
}
46013
45987
return this.regexp
@@ -46025,8 +45999,8 @@ minimatch.match = function (list, pattern, options) {
46025
45999
return list
46026
46000
}
46027
46001
46028
- Minimatch.prototype.match = function match (f, partial) {
46029
- if (typeof partial === 'undefined') partial = this.partial
46002
+ Minimatch.prototype.match = match
46003
+ function match (f, partial) {
46030
46004
this.debug('match', f, this.pattern)
46031
46005
// short-circuit in the case of busted things.
46032
46006
// comments, etc.
@@ -46108,7 +46082,6 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) {
46108
46082
46109
46083
// should be impossible.
46110
46084
// some invalid regexp stuff in the set.
46111
- /* istanbul ignore if */
46112
46085
if (p === false) return false
46113
46086
46114
46087
if (p === GLOBSTAR) {
@@ -46182,7 +46155,6 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) {
46182
46155
// no match was found.
46183
46156
// However, in partial mode, we can't say this is necessarily over.
46184
46157
// If there's more *pattern* left, then
46185
- /* istanbul ignore if */
46186
46158
if (partial) {
46187
46159
// ran out of file
46188
46160
this.debug('\n>>> no match, partial?', file, fr, pattern, pr)
@@ -46196,7 +46168,11 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) {
46196
46168
// patterns with magic have been turned into regexps.
46197
46169
var hit
46198
46170
if (typeof p === 'string') {
46199
- hit = f === p
46171
+ if (options.nocase) {
46172
+ hit = f.toLowerCase() === p.toLowerCase()
46173
+ } else {
46174
+ hit = f === p
46175
+ }
46200
46176
this.debug('string match', p, f, hit)
46201
46177
} else {
46202
46178
hit = f.match(p)
@@ -46227,16 +46203,16 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) {
46227
46203
// this is ok if we're doing the match as part of
46228
46204
// a glob fs traversal.
46229
46205
return partial
46230
- } else /* istanbul ignore else */ if (pi === pl) {
46206
+ } else if (pi === pl) {
46231
46207
// ran out of pattern, still have file left.
46232
46208
// this is only acceptable if we're on the very last
46233
46209
// empty segment of a file with a trailing slash.
46234
46210
// a/* should match a/b/
46235
- return (fi === fl - 1) && (file[fi] === '')
46211
+ var emptyFileEnd = (fi === fl - 1) && (file[fi] === '')
46212
+ return emptyFileEnd
46236
46213
}
46237
46214
46238
46215
// should be unreachable.
46239
- /* istanbul ignore next */
46240
46216
throw new Error('wtf?')
46241
46217
}
46242
46218
@@ -59711,6 +59687,9 @@ class CacheDistributor {
59711
59687
this.cacheDependencyPath = cacheDependencyPath;
59712
59688
this.CACHE_KEY_PREFIX = 'setup-python';
59713
59689
}
59690
+ handleLoadedCache() {
59691
+ return __awaiter(this, void 0, void 0, function* () { });
59692
+ }
59714
59693
restoreCache() {
59715
59694
return __awaiter(this, void 0, void 0, function* () {
59716
59695
const { primaryKey, restoreKey } = yield this.computeKeys();
@@ -59723,6 +59702,7 @@ class CacheDistributor {
59723
59702
core.saveState(State.CACHE_PATHS, cachePath);
59724
59703
core.saveState(State.STATE_CACHE_PRIMARY_KEY, primaryKey);
59725
59704
const matchedKey = yield cache.restoreCache(cachePath, primaryKey, restoreKey);
59705
+ yield this.handleLoadedCache();
59726
59706
this.handleMatchResult(matchedKey, primaryKey);
59727
59707
});
59728
59708
}
0 commit comments