gnu-maintenance: Really find the latest GNOME releases.
Reported by Efraim Flashner <efraim@flashner.co.il> at <https://lists.gnu.org/archive/html/guix-devel/2015-12/msg00202.html>. * guix/gnu-maintenance.scm (latest-ftp-release): Call KEEP-FILE? on directories too. (latest-gnome-release)[even-minor-version?]: Protect again MINOR being false; change pattern to match VERSION with two or more numbers. Remove use of 'version-major+minor'. [even-numbered-tarball?]: Rename to... [even-numbered?]: ... this. Use 'package-name->name+version'. When VERSION is #f, check NAME.
This commit is contained in:
		
							parent
							
								
									cd48eae560
								
							
						
					
					
						commit
						873d0ff2cd
					
				
					 1 changed files with 13 additions and 12 deletions
				
			
		| 
						 | 
					@ -328,8 +328,8 @@ pairs.  Example: (\"mit-scheme-9.0.1\" . \"/gnu/mit-scheme/stable.pkg/9.0.1\").
 | 
				
			||||||
under DIRECTORY, or #f.  Use FTP-OPEN and FTP-CLOSE to open (resp. close) FTP
 | 
					under DIRECTORY, or #f.  Use FTP-OPEN and FTP-CLOSE to open (resp. close) FTP
 | 
				
			||||||
connections; this can be useful to reuse connections.
 | 
					connections; this can be useful to reuse connections.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
KEEP-FILE? is a predicate to decide whether to consider a given file (source
 | 
					KEEP-FILE? is a predicate to decide whether to enter a directory and to
 | 
				
			||||||
tarball) as a valid candidate based on its name.
 | 
					consider a given file (source tarball) as a valid candidate based on its name.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
FILE->SIGNATURE must be a procedure; it is passed a source file URL and must
 | 
					FILE->SIGNATURE must be a procedure; it is passed a source file URL and must
 | 
				
			||||||
return the corresponding signature URL, or #f it signatures are unavailable."
 | 
					return the corresponding signature URL, or #f it signatures are unavailable."
 | 
				
			||||||
| 
						 | 
					@ -376,7 +376,7 @@ return the corresponding signature URL, or #f it signatures are unavailable."
 | 
				
			||||||
                                  (("w32" 'directory . _)
 | 
					                                  (("w32" 'directory . _)
 | 
				
			||||||
                                   #f)
 | 
					                                   #f)
 | 
				
			||||||
                                  (((? contains-digit? dir) 'directory . _)
 | 
					                                  (((? contains-digit? dir) 'directory . _)
 | 
				
			||||||
                                   dir)
 | 
					                                   (and (keep-file? dir) dir))
 | 
				
			||||||
                                  (_ #f))
 | 
					                                  (_ #f))
 | 
				
			||||||
                                entries))
 | 
					                                entries))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -477,17 +477,18 @@ elpa.gnu.org, and all the GNOME packages."
 | 
				
			||||||
    (char-set-complement (char-set #\.)))
 | 
					    (char-set-complement (char-set #\.)))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  (define (even-minor-version? version)
 | 
					  (define (even-minor-version? version)
 | 
				
			||||||
    (match (string-tokenize (version-major+minor version)
 | 
					    (match (string-tokenize version %not-dot)
 | 
				
			||||||
                            %not-dot)
 | 
					      (((= string->number major) (= string->number minor) . rest)
 | 
				
			||||||
      (((= string->number major) (= string->number minor))
 | 
					       (and minor (even? minor)))
 | 
				
			||||||
       (even? minor))
 | 
					 | 
				
			||||||
      (_
 | 
					      (_
 | 
				
			||||||
       #t)))                                      ;cross fingers
 | 
					       #t)))                                      ;cross fingers
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  (define (even-numbered-tarball? file)
 | 
					  (define (even-numbered? file)
 | 
				
			||||||
    (let-values (((name version) (gnu-package-name->name+version file)))
 | 
					    ;; Return true if FILE somehow denotes an even-numbered file name.  The
 | 
				
			||||||
      (and version
 | 
					    ;; trick here is that we want this to match both directories such as
 | 
				
			||||||
           (even-minor-version? version))))
 | 
					    ;; "3.18.6" and actual file names such as "gtk+-3.18.6.tar.bz2".
 | 
				
			||||||
 | 
					    (let-values (((name version) (package-name->name+version file)))
 | 
				
			||||||
 | 
					      (even-minor-version? (or version name))))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  (false-if-ftp-error
 | 
					  (false-if-ftp-error
 | 
				
			||||||
   (latest-ftp-release package
 | 
					   (latest-ftp-release package
 | 
				
			||||||
| 
						 | 
					@ -501,7 +502,7 @@ elpa.gnu.org, and all the GNOME packages."
 | 
				
			||||||
                       ;; <https://www.gnome.org/gnome-3/source/> explains
 | 
					                       ;; <https://www.gnome.org/gnome-3/source/> explains
 | 
				
			||||||
                       ;; that odd minor version numbers represent development
 | 
					                       ;; that odd minor version numbers represent development
 | 
				
			||||||
                       ;; releases, which we are usually not interested in.
 | 
					                       ;; releases, which we are usually not interested in.
 | 
				
			||||||
                       #:keep-file? even-numbered-tarball?
 | 
					                       #:keep-file? even-numbered?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                       ;; ftp.gnome.org provides no signatures, only
 | 
					                       ;; ftp.gnome.org provides no signatures, only
 | 
				
			||||||
                       ;; checksums.
 | 
					                       ;; checksums.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue