Parcourir la source

added debian build files

fixed indentation

added bug note to manpage about db file format not being architecture
independent
Michael Elkins il y a 23 ans
Parent
commit
d6fe5a92bd
8 fichiers modifiés avec 183 ajouts et 34 suppressions
  1. 6 0
      debian/changelog
  2. 23 0
      debian/control
  3. 26 0
      debian/copyright
  4. 4 0
      debian/docs
  5. 85 0
      debian/rules
  6. 3 0
      isync.1
  7. 30 30
      maildir.c
  8. 6 4
      sync.c

+ 6 - 0
debian/changelog

@@ -0,0 +1,6 @@
+isync (0.8-1) unstable; urgency=low
+
+  * Initial Release.
+
+ -- Michael Elkins <melkins@debian>  Wed, 16 Jan 2002 13:36:52 -0800
+

+ 23 - 0
debian/control

@@ -0,0 +1,23 @@
+Source: isync
+Section: unknown
+Priority: optional
+Maintainer: Michael Elkins <me@mutt.org>
+Build-Depends: debhelper (>> 3.0.0)
+Standards-Version: 3.5.2
+
+Package: isync
+Architecture: any
+Depends: ${shlibs:Depends}
+Description: Synchronize a local maildir with a remote IMAP4 mailbox
+ A command line application which synchronizes a local maildir-style
+ mailbox with a remote IMAP4 mailbox, suitable for use in
+ IMAP-disconnected mode. Multiple copies of the remote IMAP4 mailbox
+ can be maintained, and all flags are synchronized.
+ .
+ Features:
+  * Fast mode for fetching new mail only
+  * Supports imaps: (port 993) TLS/SSL connections
+  * Supports STARTTLS (RFC2595) for confidentiality
+  * Supports NAMESPACE (RFC2342)
+  * Supports CRAM-MD5 (RFC2095) for authentication
+

+ 26 - 0
debian/copyright

@@ -0,0 +1,26 @@
+This package was debianized by Michael Elkins <melkins@debian> on
+Wed, 16 Jan 2002 13:36:52 -0800.
+
+It was downloaded from http://www.sigpipe.org:8080/isync/
+
+Upstream Author(s): Michael Elkins <me@mutt.org>
+
+Copyright:
+
+ * isync - IMAP4 to maildir mailbox synchronizer
+ * Copyright (C) 2000-2 Michael R. Elkins <me@mutt.org>
+ *
+ *  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
+

+ 4 - 0
debian/docs

@@ -0,0 +1,4 @@
+NEWS
+README
+TODO
+sample.isyncrc

+ 85 - 0
debian/rules

@@ -0,0 +1,85 @@
+#!/usr/bin/make -f
+# Sample debian/rules that uses debhelper.
+# GNU copyright 1997 to 1999 by Joey Hess.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# This is the debhelper compatability version to use.
+export DH_COMPAT=3
+
+configure: configure-stamp
+configure-stamp:
+	dh_testdir
+	# Add here commands to configure the package.
+	./configure --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info
+
+	touch configure-stamp
+
+build: build-stamp
+
+build-stamp: configure-stamp 
+	dh_testdir
+
+	# Add here commands to compile the package.
+	$(MAKE)
+	#/usr/bin/docbook-to-man debian/isync.sgml > isync.1
+
+	touch build-stamp
+
+clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp configure-stamp
+
+	# Add here commands to clean up after the build process.
+	-$(MAKE) distclean
+
+	dh_clean
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	dh_installdirs
+
+	# Add here commands to install the package into debian/isync.
+	$(MAKE) install prefix=$(CURDIR)/debian/isync
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build 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 isync.1
+#	dh_installinfo
+#	dh_undocumented
+	dh_installchangelogs ChangeLog
+	dh_link
+	dh_strip
+	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

+ 3 - 0
isync.1

@@ -323,6 +323,9 @@ It is currently impossible to unset the \\Flagged attribute of a message
 once it is set.  It has to be manually unset everywhere since isync
 doesn't have enough information to know which was the last status of the
 message.
+.P
+The ndbm database created for each mailbox is not portable across different
+architectures.  It currently stores the UID in host byte order.
 .SH SEE ALSO
 mutt(1), maildir(5)
 .P

+ 30 - 30
maildir.c

@@ -281,7 +281,7 @@ maildir_open (const char *path, int flags)
 	    strfcpy (buf, p->file, sizeof (buf));
 	    key.dptr = p->file;
 	    s = strchr (key.dptr, ':');
-	    key.dsize = s ? s - key.dptr : strlen (key.dptr);
+	    key.dsize = s ? (size_t) (s - key.dptr) : strlen (key.dptr);
 	    key = dbm_fetch (m->db, key);
 	    if (key.dptr)
 	    {
@@ -318,35 +318,35 @@ maildir_open (const char *path, int flags)
 int
 maildir_expunge (mailbox_t * mbox, int dead)
 {
-	message_t **cur = &mbox->msgs;
-	message_t *tmp;
-	char *s;
-	datum key;
-	char path[_POSIX_PATH_MAX];
+    message_t **cur = &mbox->msgs;
+    message_t *tmp;
+    char *s;
+    datum key;
+    char path[_POSIX_PATH_MAX];
 
-	while (*cur)
+    while (*cur)
+    {
+	if ((dead == 0 && (*cur)->flags & D_DELETED) ||
+	    (dead && (*cur)->dead))
 	{
-		if ((dead == 0 && (*cur)->flags & D_DELETED) ||
-				(dead && (*cur)->dead))
-		{
-			tmp = *cur;
-			snprintf (path, sizeof (path), "%s/%s/%s",
-					mbox->path, tmp->new ? "new" : "cur", tmp->file);
-			if (unlink (path))
-				perror (path);
-			/* remove the message from the UID map */
-			key.dptr = tmp->file;
-			s = strchr (key.dptr, ':');
-			key.dsize = s ? s - key.dptr : strlen (key.dptr);
-			dbm_delete (mbox->db, key);
-			*cur = (*cur)->next;
-			free (tmp->file);
-			free (tmp);
-		}
-		else
-			cur = &(*cur)->next;
+	    tmp = *cur;
+	    snprintf (path, sizeof (path), "%s/%s/%s",
+		      mbox->path, tmp->new ? "new" : "cur", tmp->file);
+	    if (unlink (path))
+		perror (path);
+	    /* remove the message from the UID map */
+	    key.dptr = tmp->file;
+	    s = strchr (key.dptr, ':');
+	    key.dsize = s ? (size_t) (s - key.dptr) : strlen (key.dptr);
+	    dbm_delete (mbox->db, key);
+	    *cur = (*cur)->next;
+	    free (tmp->file);
+	    free (tmp);
 	}
-	return 0;
+	else
+	    cur = &(*cur)->next;
+    }
+    return 0;
 }
 
 int
@@ -371,12 +371,12 @@ maildir_update_maxuid (mailbox_t * mbox)
     len = write (fd, buf, strlen (buf));
     if (len == (size_t) - 1)
     {
-	    perror ("write");
-	    ret = -1;
+	perror ("write");
+	ret = -1;
     }
 
     if (close (fd))
-	    ret = -1;
+	ret = -1;
 
     return ret;
 }

+ 6 - 4
sync.c

@@ -40,7 +40,8 @@ find_msg (message_t * list, unsigned int uid)
     return 0;
 }
 
-static int set_uid (DBM *db, const char *f, unsigned int uid)
+static int
+set_uid (DBM * db, const char *f, unsigned int uid)
 {
     char *s;
     datum key, val;
@@ -48,7 +49,7 @@ static int set_uid (DBM *db, const char *f, unsigned int uid)
     key.dptr = (void *) f;
     s = strchr (f, ':');
     key.dsize = s ? (size_t) (s - key.dptr) : strlen (f);
-    val.dptr = (void*) &uid;
+    val.dptr = (void *) &uid;
     val.dsize = sizeof (uid);
     dbm_store (db, key, val, DBM_REPLACE);
     return 0;
@@ -176,8 +177,9 @@ sync_mailbox (mailbox_t * mbox, imap_t * imap, int flags,
 	    if (imap_copy_message (imap, cur->uid,
 				   imap->box->copy_deleted_to))
 	    {
-		fprintf (stderr, "ERROR: unable to copy deleted message to \"%s\"\n",
-			imap->box->copy_deleted_to);
+		fprintf (stderr,
+			 "ERROR: unable to copy deleted message to \"%s\"\n",
+			 imap->box->copy_deleted_to);
 		return -1;
 	    }
 	}