From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 10 20:42:29 2018 Received: (at submit) by debbugs.gnu.org; 11 Jul 2018 00:42:29 +0000 Received: from localhost ([127.0.0.1]:54495 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fd3DA-0000e5-TH for submit@debbugs.gnu.org; Tue, 10 Jul 2018 20:42:29 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40327) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fd3D8-0000do-R4 for submit@debbugs.gnu.org; Tue, 10 Jul 2018 20:42:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fd3D2-0003Ug-0h for submit@debbugs.gnu.org; Tue, 10 Jul 2018 20:42:21 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:49156) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fd3D1-0003Ub-UZ for submit@debbugs.gnu.org; Tue, 10 Jul 2018 20:42:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59530) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fd3D0-0006wG-BM for guix-patches@gnu.org; Tue, 10 Jul 2018 20:42:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fd3Cx-0003Sv-4G for guix-patches@gnu.org; Tue, 10 Jul 2018 20:42:18 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:37620) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fd3Cw-0003SK-Pr for guix-patches@gnu.org; Tue, 10 Jul 2018 20:42:15 -0400 Received: from dayas.netconsulting.co.at (80-108-65-216.cable.dynamic.surfer.at [80.108.65.216]) by dd26836.kasserver.com (Postfix) with ESMTPSA id 61C07336029B; Wed, 11 Jul 2018 02:42:12 +0200 (CEST) From: Danny Milosavljevic To: guix-patches@gnu.org Subject: [PATCH] import: hackage: Support "custom-setup" field. Date: Wed, 11 Jul 2018 02:42:11 +0200 Message-Id: <20180711004211.12490-1-dannym@scratchpost.org> X-Mailer: git-send-email 2.16.2 Tags: patch X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit Cc: Danny Milosavljevic X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) * guix/import/cabal.scm (make-cabal-parser): Modify. (is-custom-setup): New variable. (lex-custom-setup): New procedure. (is-id): Modify. (lex-version): Modify. (): New record type. (eval-cabal): Modify. (dependencies): Add parameter. --- guix/import/cabal.scm | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/guix/import/cabal.scm b/guix/import/cabal.scm index 09130e449..1775c3879 100644 --- a/guix/import/cabal.scm +++ b/guix/import/cabal.scm @@ -140,7 +140,7 @@ to the stack." (lalr-parser ;; --- token definitions (CCURLY VCCURLY OPAREN CPAREN TEST ID VERSION RELATION TRUE FALSE - (right: IF FLAG EXEC TEST-SUITE SOURCE-REPO BENCHMARK LIB OCURLY) + (right: IF FLAG EXEC TEST-SUITE CUSTOM-SETUP SOURCE-REPO BENCHMARK LIB OCURLY) (left: OR) (left: PROPERTY AND) (right: ELSE NOT)) @@ -150,6 +150,7 @@ to the stack." (sections source-repo) : (append $1 (list $2)) (sections executables) : (append $1 $2) (sections test-suites) : (append $1 $2) + (sections custom-setup) : (append $1 $2) (sections benchmarks) : (append $1 $2) (sections lib-sec) : (append $1 (list $2)) () : '()) @@ -172,6 +173,7 @@ to the stack." (ts-sec) : (list $1)) (ts-sec (TEST-SUITE OCURLY exprs CCURLY) : `(section test-suite ,$1 ,$3) (TEST-SUITE open exprs close) : `(section test-suite ,$1 ,$3)) + (custom-setup (CUSTOM-SETUP exprs) : (list `(section custom-setup ,$1 ,$2))) (benchmarks (benchmarks bm-sec) : (append $1 (list $2)) (bm-sec) : (list $1)) (bm-sec (BENCHMARK OCURLY exprs CCURLY) : `(section benchmark ,$1 ,$3) @@ -349,6 +351,9 @@ matching a string against the created regexp." (define is-test-suite (make-rx-matcher "^test-suite +([a-z0-9_-]+)" regexp/icase)) +(define is-custom-setup (make-rx-matcher "^(custom-setup)" + regexp/icase)) + (define is-benchmark (make-rx-matcher "^benchmark +([a-z0-9_-]+)" regexp/icase)) @@ -368,7 +373,7 @@ matching a string against the created regexp." (define (is-id s port) (let ((cabal-reserved-words - '("if" "else" "library" "flag" "executable" "test-suite" + '("if" "else" "library" "flag" "executable" "test-suite" "custom-setup" "source-repository" "benchmark")) (spaces (read-while (cut char-set-contains? char-set:blank <>) port)) (c (peek-char port))) @@ -392,8 +397,11 @@ matching a string against the created regexp." (define (lex-version loc port) (make-lexical-token 'VERSION loc - (read-while char-numeric? port - (cut char=? #\. <>) char-numeric?))) + (read-while (lambda (x) + (or (char-numeric? x) + (char=? x #\*) + (char=? x #\.))) + port))) (define* (read-while is? port #:optional (is-if-followed-by? (lambda (c) #f)) @@ -435,6 +443,8 @@ string with the read characters." (define (lex-test-suite ts-rx-res loc) (lex-rx-res ts-rx-res 'TEST-SUITE loc)) +(define (lex-custom-setup ts-rx-res loc) (lex-rx-res ts-rx-res 'CUSTOM-SETUP loc)) + (define (lex-benchmark bm-rx-res loc) (lex-rx-res bm-rx-res 'BENCHMARK loc)) (define (lex-lib loc) (make-lexical-token 'LIB loc #f)) @@ -529,6 +539,7 @@ the current port location." ((is-src-repo s) => (cut lex-src-repo <> loc)) ((is-exec s) => (cut lex-exec <> loc)) ((is-test-suite s) => (cut lex-test-suite <> loc)) + ((is-custom-setup s) => (cut lex-custom-setup <> loc)) ((is-benchmark s) => (cut lex-benchmark <> loc)) ((is-lib s) (lex-lib loc)) ((is-else s) (lex-else loc)) @@ -658,6 +669,12 @@ If #f use the function 'port-filename' to obtain it." (name cabal-test-suite-name) (dependencies cabal-test-suite-dependencies)) ; list of +(define-record-type + (make-cabal-custom-setup name dependencies) + cabal-custom-setup? + (name cabal-custom-setuo-name) + (dependencies cabal-custom-setup-dependencies)) ; list of + (define (cabal-flags->alist flag-list) "Retrun an alist associating the flag name to its default value from a list of objects." @@ -728,7 +745,6 @@ the ordering operation and the version." (let ((value (or (assoc-ref env name) (assoc-ref (cabal-flags->alist (cabal-flags)) name)))) (if (eq? value 'false) #f #t))) - (define (eval sexp) (match sexp (() '()) @@ -755,6 +771,8 @@ the ordering operation and the version." ;; no need to evaluate flag parameters (('section 'flag name parameters) (list 'section 'flag name parameters)) + (('section 'custom-setup parameters) + (list 'section 'custom-setup parameters)) ;; library does not have a name parameter (('section 'library parameters) (list 'section 'library (eval parameters))) @@ -795,12 +813,15 @@ See the manual for limitations."))))))) (define (make-cabal-section sexp section-type) "Given an SEXP as produced by 'read-cabal', produce a list of objects pertaining to SECTION-TYPE sections. SECTION-TYPE must be one of: -'executable, 'flag, 'test-suite, 'source-repository or 'library." +'executable, 'flag, 'test-suite, 'custom-setup, 'source-repository or +'library." (filter-map (cut match <> (('section (? (cut equal? <> section-type)) name parameters) (case section-type ((test-suite) (make-cabal-test-suite name (dependencies parameters))) + ((custom-setup) (make-cabal-custom-setup + name (dependencies parameters "setup-depends"))) ((executable) (make-cabal-executable name (dependencies parameters))) ((source-repository) (make-cabal-source-repository @@ -843,10 +864,10 @@ to be added between the values found in different key/value pairs." (define dependency-name-version-rx (make-regexp "([a-zA-Z0-9_-]+) *(.*)")) -(define (dependencies key-values-list) +(define* (dependencies key-values-list #:optional (key "build-depends")) "Return a list of 'cabal-dependency' objects for the dependencies found in KEY-VALUES-LIST." - (let ((deps (string-tokenize (lookup-join key-values-list "build-depends" ",") + (let ((deps (string-tokenize (lookup-join key-values-list key ",") (char-set-complement (char-set #\,))))) (map (lambda (d) (let ((rx-result (regexp-exec dependency-name-version-rx d))) From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 11 16:28:20 2018 Received: (at 32123) by debbugs.gnu.org; 11 Jul 2018 20:28:20 +0000 Received: from localhost ([127.0.0.1]:55951 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fdLik-00018Y-VU for submit@debbugs.gnu.org; Wed, 11 Jul 2018 16:28:20 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:41728) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fdLij-00018I-5h for 32123@debbugs.gnu.org; Wed, 11 Jul 2018 16:28:17 -0400 Received: from dayas.netconsulting.co.at (80-108-65-216.cable.dynamic.surfer.at [80.108.65.216]) by dd26836.kasserver.com (Postfix) with ESMTPSA id E5931336006A; Wed, 11 Jul 2018 22:28:15 +0200 (CEST) From: Danny Milosavljevic To: 32123@debbugs.gnu.org Subject: [PATCH v2 0/2] Improve Cabal importer. Date: Wed, 11 Jul 2018 22:28:12 +0200 Message-Id: <20180711202814.29178-1-dannym@scratchpost.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180711004211.12490-1-dannym@scratchpost.org> References: <20180711004211.12490-1-dannym@scratchpost.org> Tags: patch X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 32123 Cc: Danny Milosavljevic X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Danny Milosavljevic (2): import: hackage: Support "custom-setup" field. import: hackage: Support "-any" and "-none" version comparison operators. guix/import/cabal.scm | 68 +++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 55 insertions(+), 13 deletions(-) From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 11 16:28:20 2018 Received: (at 32123) by debbugs.gnu.org; 11 Jul 2018 20:28:20 +0000 Received: from localhost ([127.0.0.1]:55954 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fdLim-00018c-8c for submit@debbugs.gnu.org; Wed, 11 Jul 2018 16:28:20 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:41730) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fdLij-00018J-Ce for 32123@debbugs.gnu.org; Wed, 11 Jul 2018 16:28:17 -0400 Received: from dayas.netconsulting.co.at (80-108-65-216.cable.dynamic.surfer.at [80.108.65.216]) by dd26836.kasserver.com (Postfix) with ESMTPSA id A11F13360421; Wed, 11 Jul 2018 22:28:16 +0200 (CEST) From: Danny Milosavljevic To: 32123@debbugs.gnu.org Subject: [PATCH v2 1/2] import: hackage: Support "custom-setup" field. Date: Wed, 11 Jul 2018 22:28:13 +0200 Message-Id: <20180711202814.29178-2-dannym@scratchpost.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180711202814.29178-1-dannym@scratchpost.org> References: <20180711004211.12490-1-dannym@scratchpost.org> <20180711202814.29178-1-dannym@scratchpost.org> Tags: patch X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 32123 Cc: Danny Milosavljevic X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) * guix/import/cabal.scm (make-cabal-parser): Modify. (is-custom-setup): New variable. (lex-custom-setup): New procedure. (is-id): Modify. (lex-version): Modify. (): New record type. (eval-cabal): Modify. (dependencies): Add parameter. --- guix/import/cabal.scm | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/guix/import/cabal.scm b/guix/import/cabal.scm index 09130e449..1775c3879 100644 --- a/guix/import/cabal.scm +++ b/guix/import/cabal.scm @@ -140,7 +140,7 @@ to the stack." (lalr-parser ;; --- token definitions (CCURLY VCCURLY OPAREN CPAREN TEST ID VERSION RELATION TRUE FALSE - (right: IF FLAG EXEC TEST-SUITE SOURCE-REPO BENCHMARK LIB OCURLY) + (right: IF FLAG EXEC TEST-SUITE CUSTOM-SETUP SOURCE-REPO BENCHMARK LIB OCURLY) (left: OR) (left: PROPERTY AND) (right: ELSE NOT)) @@ -150,6 +150,7 @@ to the stack." (sections source-repo) : (append $1 (list $2)) (sections executables) : (append $1 $2) (sections test-suites) : (append $1 $2) + (sections custom-setup) : (append $1 $2) (sections benchmarks) : (append $1 $2) (sections lib-sec) : (append $1 (list $2)) () : '()) @@ -172,6 +173,7 @@ to the stack." (ts-sec) : (list $1)) (ts-sec (TEST-SUITE OCURLY exprs CCURLY) : `(section test-suite ,$1 ,$3) (TEST-SUITE open exprs close) : `(section test-suite ,$1 ,$3)) + (custom-setup (CUSTOM-SETUP exprs) : (list `(section custom-setup ,$1 ,$2))) (benchmarks (benchmarks bm-sec) : (append $1 (list $2)) (bm-sec) : (list $1)) (bm-sec (BENCHMARK OCURLY exprs CCURLY) : `(section benchmark ,$1 ,$3) @@ -349,6 +351,9 @@ matching a string against the created regexp." (define is-test-suite (make-rx-matcher "^test-suite +([a-z0-9_-]+)" regexp/icase)) +(define is-custom-setup (make-rx-matcher "^(custom-setup)" + regexp/icase)) + (define is-benchmark (make-rx-matcher "^benchmark +([a-z0-9_-]+)" regexp/icase)) @@ -368,7 +373,7 @@ matching a string against the created regexp." (define (is-id s port) (let ((cabal-reserved-words - '("if" "else" "library" "flag" "executable" "test-suite" + '("if" "else" "library" "flag" "executable" "test-suite" "custom-setup" "source-repository" "benchmark")) (spaces (read-while (cut char-set-contains? char-set:blank <>) port)) (c (peek-char port))) @@ -392,8 +397,11 @@ matching a string against the created regexp." (define (lex-version loc port) (make-lexical-token 'VERSION loc - (read-while char-numeric? port - (cut char=? #\. <>) char-numeric?))) + (read-while (lambda (x) + (or (char-numeric? x) + (char=? x #\*) + (char=? x #\.))) + port))) (define* (read-while is? port #:optional (is-if-followed-by? (lambda (c) #f)) @@ -435,6 +443,8 @@ string with the read characters." (define (lex-test-suite ts-rx-res loc) (lex-rx-res ts-rx-res 'TEST-SUITE loc)) +(define (lex-custom-setup ts-rx-res loc) (lex-rx-res ts-rx-res 'CUSTOM-SETUP loc)) + (define (lex-benchmark bm-rx-res loc) (lex-rx-res bm-rx-res 'BENCHMARK loc)) (define (lex-lib loc) (make-lexical-token 'LIB loc #f)) @@ -529,6 +539,7 @@ the current port location." ((is-src-repo s) => (cut lex-src-repo <> loc)) ((is-exec s) => (cut lex-exec <> loc)) ((is-test-suite s) => (cut lex-test-suite <> loc)) + ((is-custom-setup s) => (cut lex-custom-setup <> loc)) ((is-benchmark s) => (cut lex-benchmark <> loc)) ((is-lib s) (lex-lib loc)) ((is-else s) (lex-else loc)) @@ -658,6 +669,12 @@ If #f use the function 'port-filename' to obtain it." (name cabal-test-suite-name) (dependencies cabal-test-suite-dependencies)) ; list of +(define-record-type + (make-cabal-custom-setup name dependencies) + cabal-custom-setup? + (name cabal-custom-setuo-name) + (dependencies cabal-custom-setup-dependencies)) ; list of + (define (cabal-flags->alist flag-list) "Retrun an alist associating the flag name to its default value from a list of objects." @@ -728,7 +745,6 @@ the ordering operation and the version." (let ((value (or (assoc-ref env name) (assoc-ref (cabal-flags->alist (cabal-flags)) name)))) (if (eq? value 'false) #f #t))) - (define (eval sexp) (match sexp (() '()) @@ -755,6 +771,8 @@ the ordering operation and the version." ;; no need to evaluate flag parameters (('section 'flag name parameters) (list 'section 'flag name parameters)) + (('section 'custom-setup parameters) + (list 'section 'custom-setup parameters)) ;; library does not have a name parameter (('section 'library parameters) (list 'section 'library (eval parameters))) @@ -795,12 +813,15 @@ See the manual for limitations."))))))) (define (make-cabal-section sexp section-type) "Given an SEXP as produced by 'read-cabal', produce a list of objects pertaining to SECTION-TYPE sections. SECTION-TYPE must be one of: -'executable, 'flag, 'test-suite, 'source-repository or 'library." +'executable, 'flag, 'test-suite, 'custom-setup, 'source-repository or +'library." (filter-map (cut match <> (('section (? (cut equal? <> section-type)) name parameters) (case section-type ((test-suite) (make-cabal-test-suite name (dependencies parameters))) + ((custom-setup) (make-cabal-custom-setup + name (dependencies parameters "setup-depends"))) ((executable) (make-cabal-executable name (dependencies parameters))) ((source-repository) (make-cabal-source-repository @@ -843,10 +864,10 @@ to be added between the values found in different key/value pairs." (define dependency-name-version-rx (make-regexp "([a-zA-Z0-9_-]+) *(.*)")) -(define (dependencies key-values-list) +(define* (dependencies key-values-list #:optional (key "build-depends")) "Return a list of 'cabal-dependency' objects for the dependencies found in KEY-VALUES-LIST." - (let ((deps (string-tokenize (lookup-join key-values-list "build-depends" ",") + (let ((deps (string-tokenize (lookup-join key-values-list key ",") (char-set-complement (char-set #\,))))) (map (lambda (d) (let ((rx-result (regexp-exec dependency-name-version-rx d))) From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 11 16:28:21 2018 Received: (at 32123) by debbugs.gnu.org; 11 Jul 2018 20:28:21 +0000 Received: from localhost ([127.0.0.1]:55956 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fdLin-00018t-KG for submit@debbugs.gnu.org; Wed, 11 Jul 2018 16:28:21 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:41738) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fdLik-00018W-KE for 32123@debbugs.gnu.org; Wed, 11 Jul 2018 16:28:20 -0400 Received: from dayas.netconsulting.co.at (80-108-65-216.cable.dynamic.surfer.at [80.108.65.216]) by dd26836.kasserver.com (Postfix) with ESMTPSA id E07A1336006A; Wed, 11 Jul 2018 22:28:17 +0200 (CEST) From: Danny Milosavljevic To: 32123@debbugs.gnu.org Subject: [PATCH v2 2/2] import: hackage: Support "-any" and "-none" version comparison operators. Date: Wed, 11 Jul 2018 22:28:14 +0200 Message-Id: <20180711202814.29178-3-dannym@scratchpost.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180711202814.29178-1-dannym@scratchpost.org> References: <20180711004211.12490-1-dannym@scratchpost.org> <20180711202814.29178-1-dannym@scratchpost.org> Tags: patch X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 32123 Cc: Danny Milosavljevic X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) * guix/import/cabal.scm (make-cabal-parser): Modify. (is-any): New variable. (is-none): New variable. (lex-any): New procedure. (lex-none): New procedure. (lex-word): Modify. (eval-cabal): Modify. --- guix/import/cabal.scm | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/guix/import/cabal.scm b/guix/import/cabal.scm index 1775c3879..cd0a2953c 100644 --- a/guix/import/cabal.scm +++ b/guix/import/cabal.scm @@ -139,7 +139,7 @@ to the stack." "Generate a parser for Cabal files." (lalr-parser ;; --- token definitions - (CCURLY VCCURLY OPAREN CPAREN TEST ID VERSION RELATION TRUE FALSE + (CCURLY VCCURLY OPAREN CPAREN TEST ID VERSION RELATION TRUE FALSE -ANY -NONE (right: IF FLAG EXEC TEST-SUITE CUSTOM-SETUP SOURCE-REPO BENCHMARK LIB OCURLY) (left: OR) (left: PROPERTY AND) @@ -213,6 +213,10 @@ to the stack." (FALSE) : 'false (TEST OPAREN ID RELATION VERSION CPAREN) : `(,$1 ,(string-append $3 " " $4 " " $5)) + (TEST OPAREN ID -ANY CPAREN) + : `(,$1 ,(string-append $3 " -any")) + (TEST OPAREN ID -NONE CPAREN) + : `(,$1 ,(string-append $3 " -none")) (TEST OPAREN ID RELATION VERSION AND RELATION VERSION CPAREN) : `(and (,$1 ,(string-append $3 " " $4 " " $5)) (,$1 ,(string-append $3 " " $7 " " $8))) @@ -367,6 +371,10 @@ matching a string against the created regexp." (define (is-false s) (string-ci=? s "false")) +(define (is-any s) (string-ci=? s "-any")) + +(define (is-none s) (string-ci=? s "-none")) + (define (is-and s) (string=? s "&&")) (define (is-or s) (string=? s "||")) @@ -457,6 +465,10 @@ string with the read characters." (define (lex-false loc) (make-lexical-token 'FALSE loc #f)) +(define (lex-any loc) (make-lexical-token '-ANY loc #f)) + +(define (lex-none loc) (make-lexical-token '-NONE loc #f)) + (define (lex-and loc) (make-lexical-token 'AND loc #f)) (define (lex-or loc) (make-lexical-token 'OR loc #f)) @@ -524,6 +536,8 @@ LOC is the current port location." ((is-test w port) (lex-test w loc)) ((is-true w) (lex-true loc)) ((is-false w) (lex-false loc)) + ((is-any w) (lex-any loc)) + ((is-none w) (lex-none loc)) ((is-and w) (lex-and loc)) ((is-or w) (lex-or loc)) ((is-id w port) (lex-id w loc)) @@ -711,13 +725,20 @@ the ordering operation and the version." (let* ((with-ver-matcher-fn (make-rx-matcher "([a-zA-Z0-9_-]+) *([<>=]+) *([0-9.]+) *")) (without-ver-matcher-fn (make-rx-matcher "([a-zA-Z0-9_-]+)")) + (without-ver-matcher-fn-2 (make-rx-matcher "([a-zA-Z0-9_-]+) (-any|-none)")) (name (or (and=> (with-ver-matcher-fn spec) (cut match:substring <> 1)) + (and=> (without-ver-matcher-fn-2 spec) + (cut match:substring <> 1)) (match:substring (without-ver-matcher-fn spec) 1))) - (operator (and=> (with-ver-matcher-fn spec) - (cut match:substring <> 2))) - (version (and=> (with-ver-matcher-fn spec) - (cut match:substring <> 3)))) + (operator (or (and=> (with-ver-matcher-fn spec) + (cut match:substring <> 2)) + (and=> (without-ver-matcher-fn-2 spec) + (cut match:substring <> 2)))) + (version (or (and=> (with-ver-matcher-fn spec) + (cut match:substring <> 3)) + (and=> (without-ver-matcher-fn-2 spec) + (cut match:substring <> 2))))) (values name operator version))) (define (impl haskell) From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 11 18:04:04 2018 Received: (at 32123) by debbugs.gnu.org; 11 Jul 2018 22:04:04 +0000 Received: from localhost ([127.0.0.1]:56021 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fdNDQ-0007O4-1B for submit@debbugs.gnu.org; Wed, 11 Jul 2018 18:04:04 -0400 Received: from eggs.gnu.org ([208.118.235.92]:59457) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fdNDN-0007NZ-O5 for 32123@debbugs.gnu.org; Wed, 11 Jul 2018 18:04:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fdNDH-0007OO-SX for 32123@debbugs.gnu.org; Wed, 11 Jul 2018 18:03:56 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59341) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fdNDH-0007OJ-Pt; Wed, 11 Jul 2018 18:03:55 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=59752 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fdNDH-0002Ll-ER; Wed, 11 Jul 2018 18:03:55 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Danny Milosavljevic Subject: Re: [bug#32123] [PATCH v2 0/2] Improve Cabal importer. References: <20180711004211.12490-1-dannym@scratchpost.org> <20180711202814.29178-1-dannym@scratchpost.org> Date: Thu, 12 Jul 2018 00:03:54 +0200 In-Reply-To: <20180711202814.29178-1-dannym@scratchpost.org> (Danny Milosavljevic's message of "Wed, 11 Jul 2018 22:28:12 +0200") Message-ID: <877em1ig51.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 32123 Cc: 32123@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) Hello Danny, Danny Milosavljevic skribis: > Danny Milosavljevic (2): > import: hackage: Support "custom-setup" field. > import: hackage: Support "-any" and "-none" version comparison > operators. Really great you=E2=80=99re working on this! This piece of code needs love. Could you add a test to tests/hackage.scm? If it fixes some of the =E2=80=98guix import hackage=E2=80=99 limitations reported have on bugs.gnu= .org/guix, please mention it in the commit log. Thank you! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 12 03:07:55 2018 Received: (at 32123-done) by debbugs.gnu.org; 12 Jul 2018 07:07:56 +0000 Received: from localhost ([127.0.0.1]:56261 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fdVhj-0005NR-PX for submit@debbugs.gnu.org; Thu, 12 Jul 2018 03:07:55 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:57788) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fdVhh-0005NI-C4 for 32123-done@debbugs.gnu.org; Thu, 12 Jul 2018 03:07:53 -0400 Received: from localhost (80-108-65-216.cable.dynamic.surfer.at [80.108.65.216]) by dd26836.kasserver.com (Postfix) with ESMTPSA id 13A9B3360421 for <32123-done@debbugs.gnu.org>; Thu, 12 Jul 2018 09:07:52 +0200 (CEST) Date: Thu, 12 Jul 2018 09:07:50 +0200 From: Danny Milosavljevic To: 32123-done@debbugs.gnu.org Subject: Re: [PATCH v2 0/2] Improve Cabal importer. Message-ID: <20180712090750.6f6b7e06@scratchpost.org> In-Reply-To: <20180711202814.29178-1-dannym@scratchpost.org> References: <20180711004211.12490-1-dannym@scratchpost.org> <20180711202814.29178-1-dannym@scratchpost.org> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.31; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/gZC=4SN_HxlGxnFFCck_j0C"; protocol="application/pgp-signature" X-Spam-Score: 0.4 (/) X-Debbugs-Envelope-To: 32123-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) --Sig_/gZC=4SN_HxlGxnFFCck_j0C Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Edited commit message to mention bug# and pushed to master as 314b63e0b4372681aec165113ae2a0349eaaa357 and ecba50bb79a49b317c4b1e718f4732b36438227f. --Sig_/gZC=4SN_HxlGxnFFCck_j0C Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAltG/kYACgkQ5xo1VCww uqUpfQf/bl79ndiyUc4JWuQvciNSNXtJDYrkCSvCmGTrdEAPfBWUZLxf0rXxRkrr h6bcbL+yPajKCrT1/D7q3j0U/PlMT7/QSY6KqN5QnxPGcdwr9QYYESFQ4aHuVHXi rv9qW3mQV3mnOTNjzjlA33QDJt9gkZO4BJ7ePWl4Y2ik0Z/M9SIolbSkn+lO9Q8A Dj/Ce1DJk277cCupeWbbUPiA9gaBQuCTk0YKSfA0vpL1iLSQFipgG3XKwzYAuboA nIYmNTtdZ+GDhO5xVGCzIndyddtuB1cOs+BPzWDifc3xBmcvIWwRyG6Klsd327af pQk1ABKnt1iuV/7SbA6DicRjeaFPDA== =vOQk -----END PGP SIGNATURE----- --Sig_/gZC=4SN_HxlGxnFFCck_j0C-- From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 12 04:42:43 2018 Received: (at 32123) by debbugs.gnu.org; 12 Jul 2018 08:42:43 +0000 Received: from localhost ([127.0.0.1]:56295 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fdXBT-0007kl-3q for submit@debbugs.gnu.org; Thu, 12 Jul 2018 04:42:43 -0400 Received: from eggs.gnu.org ([208.118.235.92]:47492) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fdXBR-0007kY-V9 for 32123@debbugs.gnu.org; Thu, 12 Jul 2018 04:42:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fdXBM-0004JM-6f for 32123@debbugs.gnu.org; Thu, 12 Jul 2018 04:42:36 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38823) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fdXBE-0004Dh-Fh; Thu, 12 Jul 2018 04:42:28 -0400 Received: from [193.50.110.117] (port=38538 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fdXBE-0004tV-1w; Thu, 12 Jul 2018 04:42:28 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: 32123@debbugs.gnu.org Subject: Re: bug#32123: [PATCH v2 0/2] Improve Cabal importer. References: <20180711004211.12490-1-dannym@scratchpost.org> <20180711202814.29178-1-dannym@scratchpost.org> <20180712090750.6f6b7e06@scratchpost.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 24 Messidor an 226 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Thu, 12 Jul 2018 10:42:26 +0200 In-Reply-To: <20180712090750.6f6b7e06@scratchpost.org> (Danny Milosavljevic's message of "Thu, 12 Jul 2018 09:07:50 +0200") Message-ID: <87r2k8x2tp.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 32123 Cc: dannym@scratchpost.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) Danny Milosavljevic skribis: > Edited commit message to mention bug# and pushed to master as > > 314b63e0b4372681aec165113ae2a0349eaaa357 > > and > > ecba50bb79a49b317c4b1e718f4732b36438227f. What about the test? :-) Or is it already covered by the existing tests? Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 12 04:50:52 2018 Received: (at 32123) by debbugs.gnu.org; 12 Jul 2018 08:50:52 +0000 Received: from localhost ([127.0.0.1]:56299 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fdXJL-0007xv-Ty for submit@debbugs.gnu.org; Thu, 12 Jul 2018 04:50:52 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:38500) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fdXJJ-0007xm-Kk for 32123@debbugs.gnu.org; Thu, 12 Jul 2018 04:50:50 -0400 Received: from localhost (77.117.220.192.wireless.dyn.drei.com [77.117.220.192]) by dd26836.kasserver.com (Postfix) with ESMTPSA id C40A233601B6; Thu, 12 Jul 2018 10:50:47 +0200 (CEST) Date: Thu, 12 Jul 2018 10:50:42 +0200 From: Danny Milosavljevic To: ludo@gnu.org (Ludovic =?ISO-8859-1?Q?Court=E8s?=) Subject: Re: bug#32123: [PATCH v2 0/2] Improve Cabal importer. Message-ID: <20180712105042.52f56480@scratchpost.org> In-Reply-To: <87r2k8x2tp.fsf@gnu.org> References: <20180711004211.12490-1-dannym@scratchpost.org> <20180711202814.29178-1-dannym@scratchpost.org> <20180712090750.6f6b7e06@scratchpost.org> <87r2k8x2tp.fsf@gnu.org> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.31; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/8kf5cRyvJNZFN_8jGPwIwn6"; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 32123 Cc: 32123@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --Sig_/8kf5cRyvJNZFN_8jGPwIwn6 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable I'm at it. Some complications ;) --Sig_/8kf5cRyvJNZFN_8jGPwIwn6 Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAltHFmIACgkQ5xo1VCww uqUC8ggAl6Slzn7OAB+T5zkgeBEWkvN9W0v9vOtCHIemFXD+rytPq23FhTg4i0GD N6G/ony5DX4Q8yTB+FLfeWVGkyVCZhpWZi4P/BWNBqeT1+LCcnLnBzvcXzmm6Wwy zU1e7M+qc8b4qMBrPdKMlvKGR2vFI632QRkgs3ReaqQ/oZu6DyCSnijBmW6l2VwA h53iynU5shV60lMTLwPwyPc/E0Qxo18tVrQaRTNtjyvEQzegE/pgRGIoE2rI3eEe iN+JbWbWwq1mgVWkW5rS1SDhx20Ch43C8K/vDyOj8p0UJeiuFskz8SwzpFfG5MlF J2Dz8mTyOE02+iUj/GyukkbgVIfiYw== =PjqJ -----END PGP SIGNATURE----- --Sig_/8kf5cRyvJNZFN_8jGPwIwn6-- From unknown Tue Aug 19 05:29:01 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 09 Aug 2018 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator