anchor.diff:  (defun cache-library-version (library-version)
     (ensure-directories-exist *repositories-directory*)
     (let ((repository-name (format nil "~A-~A"
  -				 (library-name (library library-version))
  -				 (version library-version))))
  +                                 (library-name (library library-version))
  +                                 (version library-version))))
       (let ((repository-directory (merge-pathnames
  -				 (pathname (format nil "~A/" repository-name))
  -				 *repositories-directory*)))
  -      (format t "Repository directory: ~A~%" repository-directory)
  +                                 (pathname (format nil "~A/" repository-name))
  +                                 *repositories-directory*)))
  +      (verbose-msg "Repository directory: ~A~%" repository-directory)
         (if (probe-file repository-directory)
  -	  (format t "Repository for ~A already exists in ~A~%"
  -		  library-version
  -		  repository-directory)
  -					;else
  -	  (progn
  -	    (format t "Repository does not exist for ~A. Caching...~%" library-version)
  -	    (let ((done nil))
  -	      (loop for repository in (repositories library-version)
  -		 while (not done)
  -		 do (progn
  -		      (format t "Trying with ~A..." repository)
  -		      (setf done (cache-repository repository repository-directory))
  -		      (if (not done)
  -			  (format t "Failed.~%")
  -			  (format t "Success.~%"))))
  -	      (when (not done)
  -		(error "Couldn't cache repository from ~{~A~}~%"
  -		       (repositories library-version))))))
  +          (verbose-msg "Repository for ~A already exists in ~A~%"
  +                       library-version
  +                       repository-directory)
  +                                        ;else
  +          (progn
  +            (verbose-msg "Repository does not exist for ~A. Caching...~%" library-version)
  +            (let ((done nil))
  +              (loop for repository in (repositories library-version)
  +                 while (not done)
  +                 do (progn
  +                      (verbose-msg "Trying with ~A...~%" repository)
  +                      (setf done (cache-repository repository repository-directory))
  +                      (if (not done)
  +                          (verbose-msg "Failed.~%")
  +                          (verbose-msg "Success.~%"))))
  +              (when (not done)
  +                (error "Couldn't cache repository from ~{~A~}~%"
  +                       (repositories library-version))))))
         repository-directory)))
   
   (defmethod cache-repository (repository directory)
     (cache-repository-from-address (repository-address repository)
  -				 repository directory))
  +                                 repository directory))
   
   (defun symlink (target linkname)
     (trivial-shell:shell-command
      (format nil "ln -s ~A ~A"
  -	   (princ-to-string target) ;; target directory
  -	   (princ-to-string linkname))))
  +           (princ-to-string target) ;; target directory
  +           (princ-to-string linkname))))
   
   (defun copy-directory (from to)
     (trivial-shell:shell-command
      (format nil "cp -r ~A ~A"
  -	   (princ-to-string from)
  -	   (princ-to-string to))))
  +           (princ-to-string from)
  +           (princ-to-string to))))
   
   (defgeneric cache-repository-from-address (repository-address repository target-directory)
     (:documentation "Cache the given repository from repository-address to target-directory.
  -                   Methods of this generic function should return T on success, or NIL on failure."))  
  +                   Methods of this generic function should return T on success, or NIL on failure."))
   
   (defmethod cache-repository-from-address ((repository-address directory-repository-address)
  -					  repository target-directory)
  +                                          repository target-directory)
     (multiple-value-bind (result code status)
         (ecase *address-cache-operation*
  -	(:symlink
  -	 (let ((linkname (subseq (princ-to-string target-directory)
  -				 0
  -				 (1- (length (princ-to-string target-directory))))))
  -	   (format t "Symlinking ~A to ~A~%"
  -		   (repository-directory repository-address)
  -		   linkname)
  -	   (symlink (repository-directory repository-address)
  -		    linkname)))
  -	(:copy
  -	 (format t "Copying directory ~A to ~A~%"
  -		 (repository-directory repository-address)
  -		 target-directory)
  -	 (copy-directory (repository-directory repository-address)
  -			 target-directory)))
  +        (:symlink
  +         (let ((linkname (subseq (princ-to-string target-directory)
  +                                 0
  +                                 (1- (length (princ-to-string target-directory))))))
  +           (verbose-msg "Symlinking ~A to ~A~%"
  +                        (repository-directory repository-address)
  +                        linkname)
  +           (symlink (repository-directory repository-address)
  +                    linkname)))
  +        (:copy
  +         (verbose-msg "Copying directory ~A to ~A~%"
  +                      (repository-directory repository-address)
  +                      target-directory)
  +         (copy-directory (repository-directory repository-address)
  +                         target-directory)))
       (declare (ignore result))
       (zerop status)))
   
   (defmethod cache-repository-from-address ((repository-address url-repository-address)
  -					  repository target-directory)
  +                                          repository target-directory)
     (flet ((run-or-fail (&rest args)
  -	   (multiple-value-bind (result code status)
  -	       (apply #'trivial-shell:shell-command args)
  -	     (when (not (zerop status))
  -	       (return-from cache-repository-from-address nil)))))
  +           (multiple-value-bind (result code status)
  +               (apply #'trivial-shell:shell-command args)
  +             (when (not (zerop status))
  +               (return-from cache-repository-from-address nil)))))
       (let ((temporal-file
  -	   (merge-pathnames
  -	    (file-namestring (url repository-address))
  -	    #p"/tmp/")))
  -      (format t "Downloading ~A...~%" (url repository-address))
  +           (merge-pathnames
  +            (file-namestring (url repository-address))
  +            #p"/tmp/")))
  +      (verbose-msg "Downloading ~A...~%" (url repository-address))
         (run-or-fail (format nil "wget -O ~A ~A" temporal-file (url repository-address)))
  -      (format t "Extracting...~%")
  +      (verbose-msg "Extracting...~%")
         (run-or-fail (format nil "mkdir ~A" (princ-to-string target-directory)))
         (run-or-fail (format nil "tar zxf ~A --strip=1 -C ~A"
  -			   temporal-file
  -			   (princ-to-string target-directory))))
  +                           temporal-file
  +                           (princ-to-string target-directory))))
       t))
   
   (defmethod cache-repository-from-address ((repository-address git-repository-address)
  -					  repository target-directory)
  +                                          repository target-directory)
     (flet ((run-or-fail (command)
  -	   (multiple-value-bind (result code status)
  -	       (trivial-shell:shell-command command)
  -	     (declare (ignore result code))
  -	     (when (not (zerop status))
  -	       (return-from cache-repository-from-address nil)))))
  -    (format t "Cloning repository: ~A...~%" (url repository-address))
  +           (multiple-value-bind (result code status)
  +               (trivial-shell:shell-command command)
  +             (declare (ignore result code))
  +             (when (not (zerop status))
  +               (return-from cache-repository-from-address nil)))))
  +    (verbose-msg "Cloning repository: ~A...~%" (url repository-address))
       (run-or-fail (format nil "git clone ~A ~A"
  -			 (url repository-address)
  -			 (princ-to-string target-directory)))
  +                         (url repository-address)
  +                         (princ-to-string target-directory)))
       (when (commit repository-address)
  -      (format t "Checking out commit ~A~%" (commit repository-address))
  +      (verbose-msg "Checking out commit ~A~%" (commit repository-address))
         (let ((command  (format nil "cd ~A; git checkout ~A"
  -			   (princ-to-string target-directory)
  -			   (commit repository-address))))
  -	(format t "~A~%" command)
  -	(run-or-fail command)))
  +                              (princ-to-string target-directory)
  +                              (commit repository-address))))
  +        (verbose-msg "~A~%" command)
  +        (run-or-fail command)))
       t))
   
   (defclass cld-repository ()
     ((name :initarg :name
  -	 :accessor name
  -	 :initform nil
  -	 :documentation "The cld repository name"))
  +         :accessor name
  +         :initform nil
  +         :documentation "The cld repository name"))
     (:documentation "A .cld files repository"))
   
   (defclass directory-cld-repository (cld-repository)
     ((directory :initarg :directory
  -	     :initform (error "Provide the cld repository directory")
  -	     :accessor repository-directory
  -	     :documentation "The cld repository directory"))
  +              :initform (error "Provide the cld repository directory")
  +              :accessor repository-directory
  +              :documentation "The cld repository directory"))
     (:documentation "A local (directory) cld repository"))
   
   (defmethod print-object ((cld-repository directory-cld-repository) stream)
     (print-unreadable-object (cld-repository stream :type t :identity t)
       (format stream "~A : ~A"
  -	    (name cld-repository)
  -	    (repository-directory cld-repository))))
  +            (name cld-repository)
  +            (repository-directory cld-repository))))
   
   (defclass http-cld-repository (cld-repository)
     ((url :initarg :url
  -	:initform (error "Provide the cld repository url address")
  -	:accessor repository-url
  -	:documentation "The cld repository url address"))
  +        :initform (error "Provide the cld repository url address")
  +        :accessor repository-url
  +        :documentation "The cld repository url address"))
     (:documentation "A cld repository on http"))
   
   (defmethod print-object ((cld-repository http-cld-repository) stream)
     (print-unreadable-object (cld-repository stream :type t :identity t)
       (format stream "~A : ~A"
  -	    (name cld-repository)
  -	    (repository-url cld-repository))))
  +            (name cld-repository)
  +            (repository-url cld-repository))))
   
   (defclass cached-http-cld-repository (http-cld-repository)
     ((cache-directory :initarg :cache-directory
  -		    :initform (error "Provide the cache directory")
  -		    :accessor cache-directory
  -		    :documentation "The cache directory"))
  +                    :initform (error "Provide the cache directory")
  +                    :accessor cache-directory
  +                    :documentation "The cache directory"))
     (:documentation "A cld repository in which a cache is maintained in a local directory"))
   
   (defmethod find-cld ((cld-repository directory-cld-repository) library-name)
     (let ((cld-file (merge-pathnames (pathname (format nil "~A.cld" library-name))
  -				   (repository-directory cld-repository))))
  -    (format t "Checking if ~A exists~%" cld-file)
  +                                   (repository-directory cld-repository))))
  +    (verbose-msg "Checking if ~A exists~%" cld-file)
       (probe-file cld-file)))
   
   (defmethod find-cld ((cld-repository http-cld-repository) library-name)
     (let* ((cld-url-address (format nil "~A/~A.cld"
  -				 (repository-url cld-repository)
  -				 library-name))
  -	 (temporal-directory #p"/tmp/")
  -	 (temporal-file (merge-pathnames (pathname (format nil "~A.cld" library-name))
  -					 temporal-directory)))
  -    (format t "Trying to fetch ~A~%" cld-url-address)
  +                                  (repository-url cld-repository)
  +                                  library-name))
  +         (temporal-directory #p"/tmp/")
  +         (temporal-file (merge-pathnames (pathname (format nil "~A.cld" library-name))
  +                                         temporal-directory)))
  +    (verbose-msg "Trying to fetch ~A~%" cld-url-address)
       (let ((command (format nil "wget -O ~A ~A"
  -			   temporal-file
  -			   cld-url-address)))
  -      (format t "~A~%" command)
  +                           temporal-file
  +                           cld-url-address)))
  +      (verbose-msg "~A~%" command)
         (multiple-value-bind (result error status)
  -	  (trivial-shell:shell-command command)
  -	(declare (ignore result error))
  -	(if (equalp status 0)
  -	    (progn
  -	      (format t "~A downloaded.~%" cld-url-address)
  -	      temporal-file)
  -	    ; else
  -	    (format t "Failed.~%"))))))
  +          (trivial-shell:shell-command command)
  +        (declare (ignore result error))
  +        (if (equalp status 0)
  +            (progn
  +              (verbose-msg "~A downloaded.~%" cld-url-address)
  +              temporal-file)
  +                                        ; else
  +            (verbose-msg "Failed.~%"))))))
   
   (defclass cld-address ()
     ()
  
positive.code: 
  (defclass directory-repository-address (repository-address)
    ((directory :initarg :directory
  	     :initform (error "Provide the filesystem directory")
  	     :accessor repository-directory
  	     :documentation "The repository filesystem directory"))
    (:documentation "A repository in a file system directory"))
  
  (defclass git-repository-address (repository-address)
    ((url :initarg :url
  	:initform (error "Provide the git url")
  	:accessor url
  	:documentation "The git url")
     (branch :initarg :branch
  	   :initform "master"
  	   :accessor branch
  	   :documentation "Git repository branch")
     (commit :initarg :commit
  	   :initform nil
  	   :accessor commit
  	   :documentation "Commit to fetch"))
    (:documentation "A git repository"))
  
  (defclass url-repository-address (repository-address)
    ((url :initarg :url
  	:initform (error "Provide the repository package url")
  	:accessor url
  	:documentation "The repository url"))
    (:documentation "A remote repository package"))
  
  (defun parse-version-repository-address (address)
    (cond
      ((pathnamep address)
       `(make-instance 'directory-repository-address
  		     :directory ,address))
      ((and (listp address)
  	  (equalp (first address) :directory))
       `(make-instance 'directory-repository-address
  		     :directory ,(second address)))
      ((and (listp address)
  	  (equalp (first address) :git))
       (destructuring-bind (url &rest args)
  	 (rest address)
         `(make-instance 'git-repository-address
  		       :url ,url
  		       ,@args)))
      ((and (listp address)
  	  (equalp (first address)
  		  :url))
       `(make-instance 'url-repository-address
  		     :url ,(second address)))
      (t (error "Invalid repository ~A" address))))
  
  (defun setup (library-name &optional version)
    "Setup an already loaded (cld) library and its dependencies"
    (let ((library (find-cld-library library-name)))
      (format t "Loading ~A.~%" library)
      (let ((library-version (if version
  			       (find-cld-library-version library version)
  			       (first (library-versions library)))))
        ;; Load libraries metadata
        (load-library-version library-version)
  
        ;; Calculate list of library-versions to load
        (let ((library-versions
  	     (calculate-library-versions library-version)))
  	(format t "Libraries to load: ~A~%" library-versions)
  
  	;; Validate the library versions list
  	(validate-library-versions-list library-versions)
  
  	;; Remove duplicates in depdency list
  	(setf library-versions
  	      (clean-library-versions-list library-versions))
  
  	;; Check the version existance and download if not
  	;; After that, push to asdf:*central-registry*
  	(loop for version in (cons library-version library-versions)
  	   do
  	     (let ((pathname (cache-library-version version)))
  	       (push pathname asdf:*central-registry*))))))
    (format t "Done.~%"))
  
  (defun load-library (library-name &key version cld)
    "Tries to find a cld for the library and load it.
     Then setup the library and its dependencies"
    
    (if cld
        (progn
  	(load-cld cld)
  	(setup library-name version))
        ;; else
        (if (find-cld-library library-name nil)
  	  (setup library-name version)
  	  ;; else
  	  (progn
  	    (loop 
  	       for cld-repository in *cld-repositories*
  	       while (not cld)
  	       do (let ((cld-repository (eval cld-repository)))
  		    (setf cld (find-cld cld-repository
  					library-name))
  		    (when cld
  		      (format t "~A cld found in ~A~%"
  			      library-name
  			      cld-repository))))
  	    (if cld
  		(progn
  		  (load-cld cld)
  		  (setup library-name version))
  		(error "Couldn't find a cld for ~S library~%" library-name))))))
  
  (defun load-library-version (library-version &key reload)
    (format t "Loading ~A.~%" library-version)
    (labels ((load-dependency-cld (dependency cld)
  	     (format t "Loading cld: ~A~%" cld)
  	     (load-cld cld)
  	     (let ((library (find-cld-library (library-name dependency))))
  	       (let ((library-version
  		      (if (not (library-version dependency))
  			  ;; No library version specified in the dependency
  			  ;; Use the latest version
  			  (first (library-versions library))
  			  ;; else, use the library version specified
  			  (find-cld-library-version
  			   library
  			   (library-version dependency)))))
  		 (load-library-version library-version :reload reload))))
  	   (load-dependency (dependency)
  	     (let ((cld (cld dependency)))
  	       (if (not cld)
  		   (progn
  		     (format t "No cld specified.~%")
  		     (loop 
  			for cld-repository in *cld-repositories*
  			while (not cld)
  			do (let ((cld-repository (eval cld-repository)))
  			     (setf cld (find-cld cld-repository
  						 (library-name dependency)))
  			     (when cld
  			       (format t "~A cld found in ~A~%"
  				       (library-name dependency)
  				       cld-repository))))
  		     (when cld
  		       (load-dependency-cld dependency cld)))
  					;else
  		   (load-dependency-cld dependency cld)))))
      (loop for dependency in (dependencies library-version)
         do (progn
  	    (format t "Handling ~A.~%" dependency)
  	    (if (find-cld-library (library-name dependency) nil)
  		(progn
  		  (format t "Metadata for ~A is already loaded~%" (library-name dependency))
  		  (when reload
  		    (format t "Reloading...")
  		    (load-dependency dependency)))
  		;; else
  		(load-dependency dependency))))))
  
  (defun calculate-library-versions (library-version &optional visited)
    (loop for dependency in (dependencies library-version)
         appending
         (if (find (library-name dependency) visited
  		 :key #'library-name
  		 :test #'equalp)
  	   (error "Cyclic dependency on ~A" dependency)
  					;else
  	   (let ((library (find-cld-library (library-name dependency) nil)))
  	     (if library
  		 (let ((library-version
  			(if (library-version dependency)
  			    (find-cld-library-version
  			     library
  			     (library-version dependency))
  			    ; else, use the latest version
  			    (first (library-versions library)))))
  		       (cons library-version
  			     (calculate-library-versions library-version (cons dependency visited))))
  					;else
  		 (format t "WARNING: no ASDF system is being loaded by CLDM for ~A~%"
  			 dependency))))))
  
  (defun validate-library-versions-list (versions-list)
    (loop for i from 0 to (1- (length versions-list))
         for vi = (elt versions-list i)
         do
         (loop for j from 1 to (1- (length versions-list))
  	    for vj = (elt versions-list j)
  	    when (and (not (equalp i j))
  		      (and (equalp (library-name (library vi))
  				   (library-name (library vj)))
  			   (and (version vi)
  				(version vj)
  				(not (equalp (version vi)
  					     (version vj))))))
  	    do (error "Cannot load ~A and ~A" vi vj))))
  
  (defun clean-library-versions-list (versions-list)
    ;; TODO
  
negative.code: 
    ;; Validate the version has a repository at least
    (assert (plusp (length (repositories library-version)))
            nil
            "~A version needs to define a repository at least" (version library-version))
  
    ;; Assign the version to the repositories
    (loop for repository in (repositories library-version)
       do (setf (library-version repository) library-version)))
  
  (defun print-library-version (library-version stream)
    (format stream "~A-~A~@[ (~A)~]"
            (library-name (library library-version))
            (version library-version)
            (stability library-version)))
  
  (defmethod print-object ((library-version cld-library-version) stream)
    (print-unreadable-object (library-version stream :type t :identity t)
  