guix package: '-s' displays different packages that have the same location.
Before that, 'guix package -s foobarbaz' would display only one package when several match but they have the same location (which is common when using 'inherit'.) The original rationale was given at <http://lists.gnu.org/archive/html/bug-guix/2013-01/msg00280.html> but it was arguably misguided because it led to "real" packages being hidden. Reported by Tomáš Čech <sleep_walker@gnu.org>. * guix/scripts/package.scm (find-packages-by-description)[same-location?]: Remove. Remove call to 'delete-duplicates'.
This commit is contained in:
		
							parent
							
								
									ac85b51521
								
							
						
					
					
						commit
						9eeb3d8c28
					
				
					 1 changed files with 15 additions and 21 deletions
				
			
		|  | @ -240,28 +240,22 @@ DURATION-RELATION with the current time." | ||||||
| (define (find-packages-by-description rx) | (define (find-packages-by-description rx) | ||||||
|   "Return the list of packages whose name, synopsis, or description matches |   "Return the list of packages whose name, synopsis, or description matches | ||||||
| RX." | RX." | ||||||
|   (define (same-location? p1 p2) |   (sort | ||||||
|     ;; Compare locations of two packages. |    (fold-packages (lambda (package result) | ||||||
|     (equal? (package-location p1) (package-location p2))) |                     (define matches? | ||||||
|  |                       (cut regexp-exec rx <>)) | ||||||
| 
 | 
 | ||||||
|   (delete-duplicates |                     (if (or (matches? (package-name package)) | ||||||
|    (sort |                             (and=> (package-synopsis package) | ||||||
|     (fold-packages (lambda (package result) |                                    (compose matches? P_)) | ||||||
|                      (define matches? |                             (and=> (package-description package) | ||||||
|                        (cut regexp-exec rx <>)) |                                    (compose matches? P_))) | ||||||
| 
 |                         (cons package result) | ||||||
|                      (if (or (matches? (package-name package)) |                         result)) | ||||||
|                              (and=> (package-synopsis package) |                   '()) | ||||||
|                                     (compose matches? P_)) |    (lambda (p1 p2) | ||||||
|                              (and=> (package-description package) |      (string<? (package-name p1) | ||||||
|                                     (compose matches? P_))) |                (package-name p2))))) | ||||||
|                          (cons package result) |  | ||||||
|                          result)) |  | ||||||
|                    '()) |  | ||||||
|     (lambda (p1 p2) |  | ||||||
|       (string<? (package-name p1) |  | ||||||
|                 (package-name p2)))) |  | ||||||
|    same-location?)) |  | ||||||
| 
 | 
 | ||||||
| (define-syntax-rule (leave-on-EPIPE exp ...) | (define-syntax-rule (leave-on-EPIPE exp ...) | ||||||
|   "Run EXP... in a context when EPIPE errors are caught and lead to 'exit' |   "Run EXP... in a context when EPIPE errors are caught and lead to 'exit' | ||||||
|  |  | ||||||
		Reference in a new issue