[pacman-dev] CVS update of pacman-lib (19 files)

Dan McGee dan at archlinux.org
Mon Mar 5 20:21:42 EST 2007


    Date: Monday, March 5, 2007 @ 20:21:42
  Author: dan
    Path: /home/cvs-pacman/pacman-lib

Modified: lib/libalpm/alpm.c (1.125 -> 1.126)
          lib/libalpm/alpm.h (1.79 -> 1.80) lib/libalpm/md5.h (1.3 -> 1.4)
          lib/libalpm/server.c (1.23 -> 1.24) lib/libalpm/sha1.h (1.3 -> 1.4)
          lib/libalpm/trans.c (1.42 -> 1.43)
          lib/libalpm/trans.h (1.24 -> 1.25)
          lib/libalpm/versioncmp.h (1.8 -> 1.9) src/pacman/add.h (1.3 -> 1.4)
          src/pacman/conf.h (1.16 -> 1.17) src/pacman/deptest.h (1.2 -> 1.3)
          src/pacman/log.h (1.7 -> 1.8) src/pacman/package.h (1.6 -> 1.7)
          src/pacman/query.h (1.3 -> 1.4) src/pacman/remove.h (1.3 -> 1.4)
          src/pacman/sync.h (1.5 -> 1.6) src/pacman/trans.h (1.9 -> 1.10)
          src/pacman/upgrade.h (1.3 -> 1.4) src/pacman/util.h (1.16 -> 1.17)

* Added missing header include guards in md5.h and sha1.h.
* Some header cleanup on the pacman side of things - we had alpm.h instead
  alpm_list.h in a few headers.
* removed an extra slash in path-building snprintf in server.c.


--------------------------+
 lib/libalpm/alpm.c       |    2 +-
 lib/libalpm/alpm.h       |    2 +-
 lib/libalpm/md5.h        |    7 +++++--
 lib/libalpm/server.c     |    4 ++--
 lib/libalpm/sha1.h       |    4 ++++
 lib/libalpm/trans.c      |    2 +-
 lib/libalpm/trans.h      |    4 ++--
 lib/libalpm/versioncmp.h |    6 +++---
 src/pacman/add.h         |    2 +-
 src/pacman/conf.h        |    2 +-
 src/pacman/deptest.h     |    2 +-
 src/pacman/log.h         |    2 ++
 src/pacman/package.h     |    2 ++
 src/pacman/query.h       |    2 +-
 src/pacman/remove.h      |    2 +-
 src/pacman/sync.h        |    2 +-
 src/pacman/trans.h       |    2 ++
 src/pacman/upgrade.h     |    2 +-
 src/pacman/util.h        |    1 -
 19 files changed, 32 insertions(+), 20 deletions(-)


Index: pacman-lib/lib/libalpm/alpm.c
diff -u pacman-lib/lib/libalpm/alpm.c:1.125 pacman-lib/lib/libalpm/alpm.c:1.126
--- pacman-lib/lib/libalpm/alpm.c:1.125	Mon Mar  5 17:13:33 2007
+++ pacman-lib/lib/libalpm/alpm.c	Mon Mar  5 20:21:41 2007
@@ -634,7 +634,7 @@
  * @param progress progress callback function pointer
  * @return 0 on success, -1 on error (pm_errno is set accordingly)
  */
-int SYMEXPORT alpm_trans_init(pmtranstype_t type, unsigned int flags,
+int SYMEXPORT alpm_trans_init(pmtranstype_t type, pmtransflag_t flags,
                     alpm_trans_cb_event event, alpm_trans_cb_conv conv,
                     alpm_trans_cb_progress progress)
 {
Index: pacman-lib/lib/libalpm/alpm.h
diff -u pacman-lib/lib/libalpm/alpm.h:1.79 pacman-lib/lib/libalpm/alpm.h:1.80
--- pacman-lib/lib/libalpm/alpm.h:1.79	Sat Mar  3 03:13:59 2007
+++ pacman-lib/lib/libalpm/alpm.h	Mon Mar  5 20:21:41 2007
@@ -349,7 +349,7 @@
 unsigned int alpm_trans_get_flags();
 alpm_list_t * alpm_trans_get_targets();
 alpm_list_t * alpm_trans_get_pkgs();
-int alpm_trans_init(pmtranstype_t type, unsigned int flags,
+int alpm_trans_init(pmtranstype_t type, pmtransflag_t flags,
                     alpm_trans_cb_event cb_event, alpm_trans_cb_conv conv,
                     alpm_trans_cb_progress cb_progress);
 int alpm_trans_sysupgrade(void);
Index: pacman-lib/lib/libalpm/md5.h
diff -u pacman-lib/lib/libalpm/md5.h:1.3 pacman-lib/lib/libalpm/md5.h:1.4
--- pacman-lib/lib/libalpm/md5.h:1.3	Sun Oct 15 15:31:05 2006
+++ pacman-lib/lib/libalpm/md5.h	Mon Mar  5 20:21:41 2007
@@ -20,8 +20,9 @@
 without express or implied warranty of any kind.
 
 These notices must be retained in any copies of any part of this
-documentation and/or software.
- */
+documentation and/or software. */
+#ifndef _ALPM_MD5_H
+#define _ALPM_MD5_H
 
 /* POINTER defines a generic pointer type */
 typedef unsigned char *POINTER;
@@ -47,4 +48,6 @@
 char* _alpm_MDFile(char *);
 void  _alpm_MDPrint(unsigned char [16]);
 
+#endif /* _ALPM_MD5_H */
+
 /* vim: set ts=2 sw=2 noet: */
Index: pacman-lib/lib/libalpm/server.c
diff -u pacman-lib/lib/libalpm/server.c:1.23 pacman-lib/lib/libalpm/server.c:1.24
--- pacman-lib/lib/libalpm/server.c:1.23	Mon Mar  5 17:13:34 2007
+++ pacman-lib/lib/libalpm/server.c	Mon Mar  5 20:21:41 2007
@@ -203,8 +203,8 @@
 			}
 			_alpm_log(PM_LOG_DEBUG, _("using '%s' for download progress"), pkgname);
 
-			snprintf(realfile, PATH_MAX, "%s/%s", localpath, fn);
-			snprintf(output, PATH_MAX, "%s/%s.part", localpath, fn);
+			snprintf(realfile, PATH_MAX, "%s%s", localpath, fn);
+			snprintf(output, PATH_MAX, "%s%s.part", localpath, fn);
 
 			if(alpm_list_find_str(complete, fn)) {
 				continue;
Index: pacman-lib/lib/libalpm/sha1.h
diff -u pacman-lib/lib/libalpm/sha1.h:1.3 pacman-lib/lib/libalpm/sha1.h:1.4
--- pacman-lib/lib/libalpm/sha1.h:1.3	Thu Jan 18 11:53:01 2007
+++ pacman-lib/lib/libalpm/sha1.h	Mon Mar  5 20:21:41 2007
@@ -15,6 +15,8 @@
    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.  */
+#ifndef _ALPM_SHA1_H
+#define _ALPM_SHA1_H
 
 #include <stdio.h>
 #include <limits.h>
@@ -65,4 +67,6 @@
 /* Needed for pacman */
 char *_alpm_SHAFile (char *);
 
+#endif /* _ALPM_SHA1_H */
+
 /* vim: set ts=2 sw=2 noet: */
Index: pacman-lib/lib/libalpm/trans.c
diff -u pacman-lib/lib/libalpm/trans.c:1.42 pacman-lib/lib/libalpm/trans.c:1.43
--- pacman-lib/lib/libalpm/trans.c:1.42	Mon Mar  5 17:13:34 2007
+++ pacman-lib/lib/libalpm/trans.c	Mon Mar  5 20:21:42 2007
@@ -97,7 +97,7 @@
 	FREE(trans);
 }
 
-int _alpm_trans_init(pmtrans_t *trans, pmtranstype_t type, unsigned int flags,
+int _alpm_trans_init(pmtrans_t *trans, pmtranstype_t type, pmtransflag_t flags,
                      alpm_trans_cb_event event, alpm_trans_cb_conv conv,
                      alpm_trans_cb_progress progress)
 {
Index: pacman-lib/lib/libalpm/trans.h
diff -u pacman-lib/lib/libalpm/trans.h:1.24 pacman-lib/lib/libalpm/trans.h:1.25
--- pacman-lib/lib/libalpm/trans.h:1.24	Mon Feb 19 21:14:27 2007
+++ pacman-lib/lib/libalpm/trans.h	Mon Mar  5 20:21:42 2007
@@ -39,7 +39,7 @@
 /* Transaction */
 struct __pmtrans_t {
 	pmtranstype_t type;
-	unsigned int flags;
+	pmtransflag_t flags;
 	pmtransstate_t state;
 	alpm_list_t *targets;       /* list of (char *) */
 	alpm_list_t *packages;      /* list of (pmpkg_t *) or (pmsyncpkg_t *) */
@@ -78,7 +78,7 @@
 
 pmtrans_t *_alpm_trans_new(void);
 void _alpm_trans_free(void *data);
-int _alpm_trans_init(pmtrans_t *trans, pmtranstype_t type, unsigned int flags,
+int _alpm_trans_init(pmtrans_t *trans, pmtranstype_t type, pmtransflag_t flags,
                      alpm_trans_cb_event event, alpm_trans_cb_conv conv,
                      alpm_trans_cb_progress progress);
 int _alpm_trans_sysupgrade(pmtrans_t *trans);
Index: pacman-lib/lib/libalpm/versioncmp.h
diff -u pacman-lib/lib/libalpm/versioncmp.h:1.8 pacman-lib/lib/libalpm/versioncmp.h:1.9
--- pacman-lib/lib/libalpm/versioncmp.h:1.8	Fri Feb  9 16:54:57 2007
+++ pacman-lib/lib/libalpm/versioncmp.h	Mon Mar  5 20:21:42 2007
@@ -20,8 +20,8 @@
  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 
  *  USA.
  */
-#ifndef _PM_RPMVERCMP_H
-#define _PM_RPMVERCMP_H
+#ifndef _ALPM_VERSIONCMP_H
+#define _ALPM_VERSIONCMP_H
 
 #include "deps.h"
 #include "package.h"
@@ -30,6 +30,6 @@
 int _alpm_versioncmp(const char *a, const char *b);
 
 
-#endif
+#endif /* _ALPM_VERSIONCMP_H */
 
 /* vim: set ts=2 sw=2 noet: */
Index: pacman-lib/src/pacman/add.h
diff -u pacman-lib/src/pacman/add.h:1.3 pacman-lib/src/pacman/add.h:1.4
--- pacman-lib/src/pacman/add.h:1.3	Fri Jan 19 04:28:46 2007
+++ pacman-lib/src/pacman/add.h	Mon Mar  5 20:21:42 2007
@@ -21,7 +21,7 @@
 #ifndef _PM_ADD_H
 #define _PM_ADD_H
 
-#include <alpm.h>
+#include <alpm_list.h>
 
 int pacman_add(alpm_list_t *targets);
 
Index: pacman-lib/src/pacman/conf.h
diff -u pacman-lib/src/pacman/conf.h:1.16 pacman-lib/src/pacman/conf.h:1.17
--- pacman-lib/src/pacman/conf.h:1.16	Mon Feb 12 01:44:00 2007
+++ pacman-lib/src/pacman/conf.h	Mon Mar  5 20:21:42 2007
@@ -51,7 +51,7 @@
 	unsigned short op_s_search;
 	unsigned short op_s_upgrade;
 	unsigned short group;
-	unsigned int flags;
+	pmtransflag_t flags;
 	unsigned short noask;
 	unsigned int ask;
 } config_t;
Index: pacman-lib/src/pacman/deptest.h
diff -u pacman-lib/src/pacman/deptest.h:1.2 pacman-lib/src/pacman/deptest.h:1.3
--- pacman-lib/src/pacman/deptest.h:1.2	Fri Jan 19 04:28:46 2007
+++ pacman-lib/src/pacman/deptest.h	Mon Mar  5 20:21:42 2007
@@ -21,7 +21,7 @@
 #ifndef _PM_DEPTEST_H
 #define _PM_DEPTEST_H
 
-#include <alpm.h>
+#include <alpm_list.h>
 
 int pacman_deptest(alpm_list_t *targets);
 
Index: pacman-lib/src/pacman/log.h
diff -u pacman-lib/src/pacman/log.h:1.7 pacman-lib/src/pacman/log.h:1.8
--- pacman-lib/src/pacman/log.h:1.7	Wed Feb 21 23:36:03 2007
+++ pacman-lib/src/pacman/log.h	Mon Mar  5 20:21:42 2007
@@ -21,6 +21,8 @@
 #ifndef _PM_LOG_H
 #define _PM_LOG_H
 
+#include <stdio.h>
+
 /* TODO these are illegal in ISO C, thus the reason -pedantic was never used
  * as a compile flag for the pacman side of things (named variadic macros) */
 #define MSG(line, fmt, args...) pm_fprintf(stdout, line, fmt, ##args)
Index: pacman-lib/src/pacman/package.h
diff -u pacman-lib/src/pacman/package.h:1.6 pacman-lib/src/pacman/package.h:1.7
--- pacman-lib/src/pacman/package.h:1.6	Fri Jan 19 04:28:46 2007
+++ pacman-lib/src/pacman/package.h	Mon Mar  5 20:21:42 2007
@@ -21,6 +21,8 @@
 #ifndef _PM_PACKAGE_H
 #define _PM_PACKAGE_H
 
+#include <alpm.h>
+
 void dump_pkg_full(pmpkg_t *pkg, int level);
 void dump_pkg_sync(pmpkg_t *pkg, const char *treename);
 
Index: pacman-lib/src/pacman/query.h
diff -u pacman-lib/src/pacman/query.h:1.3 pacman-lib/src/pacman/query.h:1.4
--- pacman-lib/src/pacman/query.h:1.3	Fri Jan 19 04:28:46 2007
+++ pacman-lib/src/pacman/query.h	Mon Mar  5 20:21:42 2007
@@ -21,7 +21,7 @@
 #ifndef _PM_QUERY_H
 #define _PM_QUERY_H
 
-#include <alpm.h>
+#include <alpm_list.h>
 
 int pacman_query(alpm_list_t *targets);
 
Index: pacman-lib/src/pacman/remove.h
diff -u pacman-lib/src/pacman/remove.h:1.3 pacman-lib/src/pacman/remove.h:1.4
--- pacman-lib/src/pacman/remove.h:1.3	Fri Jan 19 04:28:46 2007
+++ pacman-lib/src/pacman/remove.h	Mon Mar  5 20:21:42 2007
@@ -21,7 +21,7 @@
 #ifndef _PM_REMOVE_H
 #define _PM_REMOVE_H
 
-#include <alpm.h>
+#include <alpm_list.h>
 
 int pacman_remove(alpm_list_t *targets);
 
Index: pacman-lib/src/pacman/sync.h
diff -u pacman-lib/src/pacman/sync.h:1.5 pacman-lib/src/pacman/sync.h:1.6
--- pacman-lib/src/pacman/sync.h:1.5	Fri Jan 19 04:28:46 2007
+++ pacman-lib/src/pacman/sync.h	Mon Mar  5 20:21:42 2007
@@ -21,7 +21,7 @@
 #ifndef _PM_SYNC_H
 #define _PM_SYNC_H
 
-#include <alpm.h>
+#include <alpm_list.h>
 
 int pacman_sync(alpm_list_t *targets);
 
Index: pacman-lib/src/pacman/trans.h
diff -u pacman-lib/src/pacman/trans.h:1.9 pacman-lib/src/pacman/trans.h:1.10
--- pacman-lib/src/pacman/trans.h:1.9	Sat Mar  3 03:14:00 2007
+++ pacman-lib/src/pacman/trans.h	Mon Mar  5 20:21:42 2007
@@ -21,6 +21,8 @@
 #ifndef _PM_TRANS_H
 #define _PM_TRANS_H
 
+#include <alpm.h>
+
 /* callback to handle messages/notifications from pacman transactions */
 void cb_trans_evt(pmtransevt_t event, void *data1, void *data2);
 
Index: pacman-lib/src/pacman/upgrade.h
diff -u pacman-lib/src/pacman/upgrade.h:1.3 pacman-lib/src/pacman/upgrade.h:1.4
--- pacman-lib/src/pacman/upgrade.h:1.3	Fri Jan 19 04:28:47 2007
+++ pacman-lib/src/pacman/upgrade.h	Mon Mar  5 20:21:42 2007
@@ -21,7 +21,7 @@
 #ifndef _PM_UPGRADE_H
 #define _PM_UPGRADE_H
 
-#include <alpm.h>
+#include <alpm_list.h>
 
 int pacman_upgrade(alpm_list_t *targets);
 
Index: pacman-lib/src/pacman/util.h
diff -u pacman-lib/src/pacman/util.h:1.16 pacman-lib/src/pacman/util.h:1.17
--- pacman-lib/src/pacman/util.h:1.16	Sun Feb  4 03:26:53 2007
+++ pacman-lib/src/pacman/util.h	Mon Mar  5 20:21:42 2007
@@ -25,7 +25,6 @@
 #include <string.h>
 #include <libintl.h>
 
-#include <alpm.h>
 #include <alpm_list.h>
 
 #define MALLOC(p, b) do { \




More information about the pacman-dev mailing list