;;;; ;;;; pkgball.stk -- Pkgball management ;;;; ;;;; Copyright © 2006-2007 Erick Gallesio - I3S-CNRS/ESSI ;;;; ;;;; ;;;; This program is free software; you can redistribute it and/or modify ;;;; it under the terms of the GNU General Public License as published by ;;;; the Free Software Foundation; either version 2 of the License, or ;;;; (at your option) any later version. ;;;; ;;;; This program is distributed in the hope that it will be useful, ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;;; GNU General Public License for more details. ;;;; ;;;; You should have received a copy of the GNU General Public License ;;;; along with this program; if not, write to the Free Software ;;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, ;;;; USA. ;;;; ;;;; Author: Erick Gallesio [eg@essi.fr] ;;;; Creation date: 26-Dec-2006 17:44 (eg) ;;;; Last file update: 24-Mar-2007 16:18 (eg) ;;;; ;; ---------------------------------------------------------------------- ;; pkgball-sans-suffix ... ;; ---------------------------------------------------------------------- (define (pkgball-sans-suffix path) (substring path 0 (- (string-length path) (string-length (pkgball-suffix))))) ;; ---------------------------------------------------------------------- ;; pkgball? ... ;; ---------------------------------------------------------------------- (define (pkgball? path) (let ((len-path (string-length path)) (len-suffix (string-length (pkgball-suffix)))) (and (> len-path len-suffix) (string=? (substring path (- len-path len-suffix) len-path) (pkgball-suffix))))) ;*---------------------------------------------------------------------*/ ;* parse-pkgball-name ... */ ;*---------------------------------------------------------------------*/ (define (parse-pkgball-name name) (let ((res (regexp-match "(_*[^_]+)_*([a-z]+)*-([0-9]+.[0-9]+.[0-9]+).tar.gz" (basename name)))) (if res (values (cadr res) (caddr res) (cadddr res)) (values #f #f #f))))