support git repositories debian-0.4.0-1 v0.4.0
authorKevin Rosenberg <kevin@rosenberg.net>
Thu, 20 Aug 2009 22:50:36 +0000 (16:50 -0600)
committerKevin Rosenberg <kevin@rosenberg.net>
Thu, 20 Aug 2009 22:50:36 +0000 (16:50 -0600)
debian/changelog
debian/compat
debian/control
debian/rules
main.lisp

index 49abb2f6013e96f9690bdbce4b2585b6673108e7..9e5c38f03bb237943f7d866b6092d560513b746d 100644 (file)
@@ -1,3 +1,11 @@
+vcs-tree (0.4.0-1) unstable; urgency=low
+
+  * New upstream: support git
+  * Convert to Debhelper 7
+  * Simplify debian/rules
+
+ -- Kevin M. Rosenberg <kmr@debian.org>  Thu, 20 Aug 2009 16:47:28 -0600
+
 vcs-tree (0.3.2-4) unstable; urgency=low
 
   * Add Vcs-Browser field
index 7ed6ff82de6bcc2a78243fc9c54d3ef5ac14da69..7f8f011eb73d6043d2e6db9d2c101195ae2801f2 100644 (file)
@@ -1 +1 @@
-5
+7
index ad2420204bf3fd2edc2f78618f108def774101a7..30678c0e7a0942fb58e4979ebb8eda32b2df530a 100644 (file)
@@ -2,14 +2,14 @@ Source: vcs-tree
 Section: vcs
 Priority: optional
 Maintainer: Kevin M. Rosenberg <kmr@debian.org>
-Build-Depends: debhelper (>> 5.0.0), sbcl (>= 0.9.4)
-Standards-Version: 3.8.2.0
+Build-Depends: debhelper (>> 7.0.0), sbcl (>= 0.9.4)
+Standards-Version: 3.8.3.0
 Vcs-Git: git://git.b9.com/vcs-tree.git
 Vcs-Browser: http://git.b9.com/?p=vcs-tree.git
 
 Package: vcs-tree
 Architecture: any
-Depends: ${shlibs:Depends}
+Depends: ${shlibs:Depends}, ${misc:Depends}
 Description: Version Control System Tree Walker
  vcs-tree walks through a directory tree and performs actions on CVS
  or Subversion directories. vcs-tree works differently than just using
index 0b220c5d926466b49d6b0c2333af2a5b27d2f8db..3585ac80dbbcf279d28d671b2e3fc31fc5950dda 100755 (executable)
@@ -2,23 +2,12 @@
 
 pkg    := vcs-tree
 debpkg  := vcs-tree
-
-
-bin-dir                := usr/bin
-doc-dir                := usr/share/doc/$(debpkg)
-
-configure: configure-stamp
-configure-stamp:
-       dh_testdir
-       # Add here commands to configure the package.
-       touch configure-stamp
-
+bin-dir        := usr/bin
 
 build: build-stamp
 
-build-stamp: configure-stamp 
+build-stamp:
        dh_testdir
-       # Add here commands to compile the package.
        $(MAKE) _${pkg}
        touch build-stamp
 
@@ -26,7 +15,6 @@ clean:
        dh_testdir
        dh_testroot
        rm -f build-stamp configure-stamp
-       # Add here commands to clean up after the build process.
        $(MAKE) clean
        rm -f debian/${debpkg}.postinst.* debian/${debpkg}.prerm.*
        dh_clean
@@ -34,47 +22,32 @@ clean:
 install: build
        dh_testdir
        dh_testroot
-       dh_clean -k
-       # Add here commands to install the package into debian/xlunit.
+       dh_prep
        dh_installdirs $(bin-dir)
        dh_install $(pkg) $(bin-dir)
        dh_install _$(pkg) $(bin-dir)
 
-# Build architecture-independent files here.
-binary-indep: build install
-
+binary-indep:
 
-# Build architecture-dependent files here.
-binary-arch: build install
+binary-arch: install
        dh_testdir
        dh_testroot
-#      dh_installdebconf       
        dh_installdocs 
        dh_installexamples
-#      dh_installmenu
-#      dh_installlogrotate
-#      dh_installemacsen
-#      dh_installpam
-#      dh_installmime
-#      dh_installinit
-#      dh_installcron
        dh_installman $(pkg).1
        dh_link usr/share/man/man1/$(pkg).1 usr/share/man/man1/_$(pkg).1
-#      dh_installinfo
-#      dh_undocumented
        dh_installchangelogs 
        # don't strip sbcl binary or will remove vcs-tree code
        dh_strip -X_$(pkg)
        dh_compress
        dh_fixperms
-#      dh_makeshlibs
        dh_installdeb
-#      dh_perl
        dh_shlibdeps
        dh_gencontrol
        dh_md5sums
        dh_builddeb
 
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install configure
+binary: binary-arch
+
 
+.PHONY: build clean binary-indep binary-arch binary install
index 1490525d7f7665f689ace5d01c1a83874ae40c33..861fcd280b9044fa9fd7d9cdafb897bade2cae06 100644 (file)
--- a/main.lisp
+++ b/main.lisp
@@ -21,6 +21,8 @@
         (string= "CVS"
                  (car (last (pathname-directory x))))
         (string= ".svn"
+                 (car (last (pathname-directory x))))
+        (string= ".git"
                  (car (last (pathname-directory x)))))))
 
 (defun is-cvs-managed (dir)
                     (make-pathname :directory '(:relative ".svn"))
                     dir)))
 
+(defun is-git-managed (dir)
+  (probe-directory (merge-pathnames
+                    (make-pathname :directory '(:relative ".git"))
+                    dir)))
+
 (defun filter-tree (tree)
   "Called for a directory tree. First argument is name of current tree.
-Returns a list of directories managed by CVS or SVN."
+Returns a list of directories managed by CVS, SVN, or GIT."
   (when (and (listp tree) (not (is-vcs-directory (car tree))))
     (let* ((managed-pair
             (cond
@@ -44,6 +51,11 @@ Returns a list of directories managed by CVS or SVN."
                                        (car (last (pathname-directory (car x))))))
                     :test 'equal)
               (cons (car tree) :svn))
+             ((find ".git" (cdr tree)
+                    :key (lambda (x) (when (pathnamep (car x))
+                                       (car (last (pathname-directory (car x))))))
+                    :test 'equal)
+              (cons (car tree) :git))
              ((find "CVS" (cdr tree)
                     :key (lambda (x) (when (pathnamep (car x))
                                        (car (last (pathname-directory (car x))))))
@@ -76,6 +88,9 @@ Returns a list of directories managed by CVS or SVN."
              (:svn
               (make-pathname :name "entries" :type nil
                              :directory '(:relative ".svn")))
+             (:git
+              (make-pathname :name "HEAD" :type nil
+                             :directory '(:relative ".git")))
              (:cvs
               (make-pathname :name "Entries" :type nil
                              :directory '(:relative "CVS"))))
@@ -83,12 +98,12 @@ Returns a list of directories managed by CVS or SVN."
          (entries (read-file-to-strings entries-path))
          (dir-name (car (last (pathname-directory subdir))))
          (match (case type
-                  (:svn
+                  ((:svn :git)
                    (concatenate 'string "name=\"" dir-name "\""))
                   (:cvs
                    (concatenate 'string "D/" dir-name "////")))))
     (case type
-      (:svn
+      ((:svn :git)
        (some (lambda (line) (string= match (string-trim-whitespace line)))
              entries))
       (:cvs
@@ -103,7 +118,11 @@ Returns a list of directories managed by CVS or SVN."
            (let* ((vcs-cmd
                    (ecase action
                      (:update
-                      (format nil "~A update" type-name))
+                      (cond
+                        ((equal type-name "git")
+                         (format nil "~A pull" type-name))
+                        (t
+                         (format nil "~A update" type-name))))
                      (:status
                       (format nil "~A status" type-name))
                      (:commit
@@ -123,6 +142,8 @@ Returns a list of directories managed by CVS or SVN."
        (process dir "cvs"))
      ((is-svn-managed dir)
       (process dir "svn"))
+     ((is-git-managed dir)
+      (process dir "git"))
      (t
       (format *error-output*
               "INTERAL ERROR: not a version control system directory ~A" dir)