Megatest

Check-in [205ca47739]
Login
Overview
Comment:Fixed patt-list-match failing on multi wild cards
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 205ca477399e6c1762f6f4a6352f921eadcc8618
User & Date: mrwellan on 2012-04-11 17:38:58
Other Links: manifest | tags
Context
2012-04-12
00:55
Added -set-state-status to enable setting state and status check-in: 29cc9e826e user: matt tags: trunk
2012-04-11
17:38
Fixed patt-list-match failing on multi wild cards check-in: 205ca47739 user: mrwellan tags: trunk
17:12
Catch case where itempatt causes zero matches check-in: a4f0cd340e user: mrwellan tags: trunk
Changes

Modified common.scm from [f5126ccab5] to [7138a29341].

72
73
74
75
76
77
78


79
80
81
82
83
84
85
86
87
88
89

(define (patt-list-match item patts)
  (debug:print 8 "INFO: patt-list-match item=" item " patts=" patts)
  (if (and item patts)  ;; here we are filtering for matches with -itempatt
      (let ((res #f))   ;; look through all the item-patts if defined, format is patt1,patt2,patt3 ... wildcard is %
	(for-each 
	 (lambda (patt)


	   (if (string-match 
		(regexp (string-substitute "%" ".*" patt)) ;;(glob->regexp (string-translate patt "%" "*"))
		item)
	       (set! res #t)))
	 (string-split patts ","))
	res)
      #t))

;;======================================================================
;; System stuff
;;======================================================================







>
>
|
<
<
|







72
73
74
75
76
77
78
79
80
81


82
83
84
85
86
87
88
89

(define (patt-list-match item patts)
  (debug:print 8 "INFO: patt-list-match item=" item " patts=" patts)
  (if (and item patts)  ;; here we are filtering for matches with -itempatt
      (let ((res #f))   ;; look through all the item-patts if defined, format is patt1,patt2,patt3 ... wildcard is %
	(for-each 
	 (lambda (patt)
	   (let ((modpatt (string-substitute "%" ".*" patt #t)))
	     (debug:print 10 "INFO: patt " patt " modpatt " modpatt)
	     (if (string-match (regexp modpatt) item)


		 (set! res #t))))
	 (string-split patts ","))
	res)
      #t))

;;======================================================================
;; System stuff
;;======================================================================