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

Dan McGee dan at archlinux.org
Mon Mar 5 17:13:35 EST 2007


    Date: Monday, March 5, 2007 @ 17:13:35
  Author: dan
    Path: /home/cvs-pacman/pacman-lib

Modified: HACKING (1.2 -> 1.3) lib/libalpm/add.c (1.124 -> 1.125)
          lib/libalpm/alpm.c (1.124 -> 1.125)
          lib/libalpm/alpm_list.c (1.9 -> 1.10)
          lib/libalpm/backup.c (1.11 -> 1.12)
          lib/libalpm/be_files.c (1.35 -> 1.36)
          lib/libalpm/cache.c (1.37 -> 1.38)
          lib/libalpm/conflict.c (1.45 -> 1.46)
          lib/libalpm/conflict.h (1.12 -> 1.13)
          lib/libalpm/db.c (1.65 -> 1.66) lib/libalpm/deps.c (1.75 -> 1.76)
          lib/libalpm/error.c (1.18 -> 1.19)
          lib/libalpm/group.c (1.15 -> 1.16)
          lib/libalpm/handle.c (1.36 -> 1.37)
          lib/libalpm/handle.h (1.16 -> 1.17) lib/libalpm/log.c (1.9 -> 1.10)
          lib/libalpm/md5.c (1.3 -> 1.4) lib/libalpm/md5driver.c (1.6 -> 1.7)
          lib/libalpm/package.c (1.83 -> 1.84)
          lib/libalpm/provide.c (1.13 -> 1.14)
          lib/libalpm/remove.c (1.73 -> 1.74)
          lib/libalpm/server.c (1.22 -> 1.23) lib/libalpm/sha1.c (1.5 -> 1.6)
          lib/libalpm/sync.c (1.109 -> 1.110)
          lib/libalpm/trans.c (1.41 -> 1.42)
          lib/libalpm/util.c (1.48 -> 1.49)
          lib/libalpm/versioncmp.c (1.16 -> 1.17)
          pactest/util.py (1.5 -> 1.6) src/pacman/add.c (1.33 -> 1.34)
          src/pacman/conf.c (1.22 -> 1.23)
          src/pacman/deptest.c (1.15 -> 1.16)
          src/pacman/downloadprog.c (1.15 -> 1.16)
          src/pacman/log.c (1.31 -> 1.32) src/pacman/package.c (1.32 -> 1.33)
          src/pacman/pacman.c (1.103 -> 1.104)
          src/pacman/query.c (1.26 -> 1.27)
          src/pacman/remove.c (1.29 -> 1.30)
          src/pacman/sync.c (1.115 -> 1.116)
          src/pacman/trans.c (1.41 -> 1.42) src/pacman/upgrade.c (1.6 -> 1.7)
          src/pacman/util.c (1.30 -> 1.31) src/util/testpkg.c (1.1 -> 1.2)
          src/util/vercmp.c (1.7 -> 1.8)

This commit looks much more monumental than it is. Almost all just #include
reordering and adding ones that were forgotten (noticed when trying to
compile after reordering).

* Updated the HACKING file to include information on #include usage.
* print -> vprint in "making dir" function in pactest.


---------------------------+
 HACKING                   |   34 ++++++++++++++++++++++++++++++++--
 lib/libalpm/add.c         |    6 ++++--
 lib/libalpm/alpm.c        |   10 ++++++----
 lib/libalpm/alpm_list.c   |    3 ++-
 lib/libalpm/backup.c      |    7 +++++--
 lib/libalpm/be_files.c    |    7 +++++--
 lib/libalpm/cache.c       |    8 +++++---
 lib/libalpm/conflict.c    |   15 ++++++++-------
 lib/libalpm/conflict.h    |    3 ++-
 lib/libalpm/db.c          |   16 +++++++++-------
 lib/libalpm/deps.c        |    9 ++++++---
 lib/libalpm/error.c       |    6 ++++++
 lib/libalpm/group.c       |    8 +++++---
 lib/libalpm/handle.c      |    8 +++++---
 lib/libalpm/handle.h      |    4 +++-
 lib/libalpm/log.c         |    6 ++++--
 lib/libalpm/md5.c         |    1 +
 lib/libalpm/md5driver.c   |    4 ++++
 lib/libalpm/package.c     |    6 ++++--
 lib/libalpm/provide.c     |    8 +++++---
 lib/libalpm/remove.c      |   19 ++++++++++---------
 lib/libalpm/server.c      |    5 ++++-
 lib/libalpm/sha1.c        |   16 +++++++---------
 lib/libalpm/sync.c        |    8 +++++---
 lib/libalpm/trans.c       |    7 +++++--
 lib/libalpm/util.c        |   18 +++++++++---------
 lib/libalpm/versioncmp.c  |    8 +++++---
 pactest/util.py           |    2 +-
 src/pacman/add.c          |    5 ++++-
 src/pacman/conf.c         |    5 ++++-
 src/pacman/deptest.c      |    4 +++-
 src/pacman/downloadprog.c |    4 +++-
 src/pacman/log.c          |    2 ++
 src/pacman/package.c      |    5 ++++-
 src/pacman/pacman.c       |    2 ++
 src/pacman/query.c        |    5 ++++-
 src/pacman/remove.c       |    5 ++++-
 src/pacman/sync.c         |   12 ++++++------
 src/pacman/trans.c        |    4 +++-
 src/pacman/upgrade.c      |    7 ++++---
 src/pacman/util.c         |    5 +++--
 src/util/testpkg.c        |    2 ++
 src/util/vercmp.c         |    4 ++++
 43 files changed, 219 insertions(+), 104 deletions(-)


Index: pacman-lib/HACKING
diff -u pacman-lib/HACKING:1.2 pacman-lib/HACKING:1.3
--- pacman-lib/HACKING:1.2	Mon Feb 26 04:19:33 2007
+++ pacman-lib/HACKING	Mon Mar  5 17:13:33 2007
@@ -1,8 +1,8 @@
 Contributing to pacman
 ======================
 
-Please read 'submitting-patches' and 'translation-help' in the same directory as
-this file.
+Please read 'submitting-patches' and 'translation-help' in the same directory
+as this file.
 
 Coding style
 ------------
@@ -62,4 +62,34 @@
        NOT
     sizeof(*mylist);
 
+Other Concerns
+--------------
+
+Currently our #include usage is in messy shape, but this is no reason to
+continue down this messy path. When adding an include to a file, follow this
+general pattern, including blank lines:
+
+#include "config.h"
+
+#include <standardheader.h>
+#include <another.h>
+#include <...>
+
+Follow this with some more headers, depending on whether the file is in libalpm
+or pacman proper. For libalpm:
+
+/* libalpm */
+#include "yourfile.h"
+#include "alpm_list.h"
+#include "anythingelse.h"
+
+For pacman:
+
+#include <alpm.h>
+#include <alpm_list.h>
+
+/* pacman */
+#include "yourfile.h"
+#include "anythingelse.h"
+
 vim: set ts=2 sw=2 et:
Index: pacman-lib/lib/libalpm/add.c
diff -u pacman-lib/lib/libalpm/add.c:1.124 pacman-lib/lib/libalpm/add.c:1.125
--- pacman-lib/lib/libalpm/add.c:1.124	Sun Mar  4 04:08:54 2007
+++ pacman-lib/lib/libalpm/add.c	Mon Mar  5 17:13:33 2007
@@ -31,6 +31,7 @@
 #endif
 
 #include "config.h"
+
 #include <stdlib.h>
 #include <errno.h>
 #include <time.h>
@@ -38,7 +39,9 @@
 #include <string.h>
 #include <limits.h>
 #include <libintl.h>
-/* pacman */
+
+/* libalpm */
+#include "add.h"
 #include "alpm_list.h"
 #include "trans.h"
 #include "util.h"
@@ -54,7 +57,6 @@
 #include "provide.h"
 #include "conflict.h"
 #include "deps.h"
-#include "add.h"
 #include "remove.h"
 #include "handle.h"
 
Index: pacman-lib/lib/libalpm/alpm.c
diff -u pacman-lib/lib/libalpm/alpm.c:1.124 pacman-lib/lib/libalpm/alpm.c:1.125
--- pacman-lib/lib/libalpm/alpm.c:1.124	Mon Mar  5 14:21:33 2007
+++ pacman-lib/lib/libalpm/alpm.c	Mon Mar  5 17:13:33 2007
@@ -22,6 +22,8 @@
  *  USA.
  */
 
+#include "config.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <errno.h>
@@ -36,14 +38,15 @@
 #include <limits.h> /* PATH_MAX */
 #include <stdarg.h>
 #include <libintl.h>
-/* pacman */
-#include "config.h"
+
+/* libalpm */
+#include "alpm.h"
+#include "alpm_list.h"
 #include "log.h"
 #include "error.h"
 #include "versioncmp.h"
 #include "md5.h"
 #include "sha1.h"
-#include "alpm_list.h"
 #include "package.h"
 #include "group.h"
 #include "util.h"
@@ -58,7 +61,6 @@
 #include "handle.h"
 #include "provide.h"
 #include "server.h"
-#include "alpm.h"
 
 #define min(X, Y)  ((X) < (Y) ? (X) : (Y))
 
Index: pacman-lib/lib/libalpm/alpm_list.c
diff -u pacman-lib/lib/libalpm/alpm_list.c:1.9 pacman-lib/lib/libalpm/alpm_list.c:1.10
--- pacman-lib/lib/libalpm/alpm_list.c:1.9	Sat Mar  3 03:13:59 2007
+++ pacman-lib/lib/libalpm/alpm_list.c	Mon Mar  5 17:13:33 2007
@@ -20,11 +20,12 @@
  */
 
 #include "config.h"
+
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
-#include <assert.h>
 
+/* libalpm */
 #include "alpm_list.h"
 #include "util.h"
 
Index: pacman-lib/lib/libalpm/backup.c
diff -u pacman-lib/lib/libalpm/backup.c:1.11 pacman-lib/lib/libalpm/backup.c:1.12
--- pacman-lib/lib/libalpm/backup.c:1.11	Sat Feb 17 03:55:06 2007
+++ pacman-lib/lib/libalpm/backup.c	Mon Mar  5 17:13:33 2007
@@ -23,11 +23,14 @@
  */
 
 #include "config.h"
+
 #include <stdlib.h>
 #include <string.h>
-/* pacman */
-#include "log.h"
+
+/* libalpm */
 #include "backup.h"
+#include "alpm_list.h"
+#include "log.h"
 #include "util.h"
 
 /* Look for a filename in a pmpkg_t.backup list.  If we find it,
Index: pacman-lib/lib/libalpm/be_files.c
diff -u pacman-lib/lib/libalpm/be_files.c:1.35 pacman-lib/lib/libalpm/be_files.c:1.36
--- pacman-lib/lib/libalpm/be_files.c:1.35	Sun Mar  4 04:08:54 2007
+++ pacman-lib/lib/libalpm/be_files.c	Mon Mar  5 17:13:33 2007
@@ -21,6 +21,7 @@
  */
 
 #include "config.h"
+
 #include <unistd.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -36,10 +37,12 @@
 #ifdef CYGWIN
 #include <limits.h> /* PATH_MAX */
 #endif
-/* pacman */
+
+/* libalpm */
+#include "db.h"
+#include "alpm_list.h"
 #include "log.h"
 #include "util.h"
-#include "db.h"
 #include "alpm.h"
 #include "error.h"
 #include "handle.h"
Index: pacman-lib/lib/libalpm/cache.c
diff -u pacman-lib/lib/libalpm/cache.c:1.37 pacman-lib/lib/libalpm/cache.c:1.38
--- pacman-lib/lib/libalpm/cache.c:1.37	Sat Mar  3 03:13:59 2007
+++ pacman-lib/lib/libalpm/cache.c	Mon Mar  5 17:13:33 2007
@@ -20,6 +20,7 @@
  */
 
 #include "config.h"
+
 #include <unistd.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -27,16 +28,17 @@
 #include <string.h>
 #include <sys/stat.h>
 #include <libintl.h>
-/* pacman */
+
+/* libalpm */
+#include "cache.h"
+#include "alpm_list.h"
 #include "log.h"
 #include "alpm.h"
-#include "alpm_list.h"
 #include "util.h"
 #include "error.h"
 #include "package.h"
 #include "group.h"
 #include "db.h"
-#include "cache.h"
 
 /* Returns a new package cache from db.
  * It frees the cache if it already exists.
Index: pacman-lib/lib/libalpm/conflict.c
diff -u pacman-lib/lib/libalpm/conflict.c:1.45 pacman-lib/lib/libalpm/conflict.c:1.46
--- pacman-lib/lib/libalpm/conflict.c:1.45	Sat Mar  3 15:22:48 2007
+++ pacman-lib/lib/libalpm/conflict.c	Mon Mar  5 17:13:33 2007
@@ -23,28 +23,29 @@
  *  USA.
  */
 
-#if defined(__APPLE__) || defined(__OpenBSD__)
-#include <sys/syslimits.h>
-#endif
-
 #include "config.h"
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <unistd.h>
 #include <string.h>
 #include <limits.h>
+#if defined(__APPLE__) || defined(__OpenBSD__)
+#include <sys/syslimits.h>
+#endif
 #include <sys/stat.h>
 #include <libintl.h>
-/* pacman */
-#include "handle.h"
+
+/* libalpm */
+#include "conflict.h"
 #include "alpm_list.h"
+#include "handle.h"
 #include "trans.h"
 #include "util.h"
 #include "error.h"
 #include "log.h"
 #include "cache.h"
 #include "deps.h"
-#include "conflict.h"
 
 
 /** See if potential conflict 'name' matches package 'pkg'.
Index: pacman-lib/lib/libalpm/conflict.h
diff -u pacman-lib/lib/libalpm/conflict.h:1.12 pacman-lib/lib/libalpm/conflict.h:1.13
--- pacman-lib/lib/libalpm/conflict.h:1.12	Mon Feb 19 21:14:27 2007
+++ pacman-lib/lib/libalpm/conflict.h	Mon Mar  5 17:13:33 2007
@@ -21,8 +21,9 @@
 #ifndef _ALPM_CONFLICT_H
 #define _ALPM_CONFLICT_H
 
-#include "db.h"
 #include "alpm.h"
+#include "db.h"
+#include "package.h"
 
 #define CONFLICT_FILE_LEN 512
 
Index: pacman-lib/lib/libalpm/db.c
diff -u pacman-lib/lib/libalpm/db.c:1.65 pacman-lib/lib/libalpm/db.c:1.66
--- pacman-lib/lib/libalpm/db.c:1.65	Sun Mar  4 04:08:54 2007
+++ pacman-lib/lib/libalpm/db.c	Mon Mar  5 17:13:34 2007
@@ -23,30 +23,32 @@
  *  USA.
  */
 
-#if defined(__APPLE__) || defined(__OpenBSD__)
-#include <sys/syslimits.h>
-#include <sys/stat.h>
-#endif
-
 #include "config.h"
+
 #include <unistd.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <errno.h>
 #include <string.h>
 #include <sys/stat.h>
+#if defined(__APPLE__) || defined(__OpenBSD__)
+#include <sys/syslimits.h>
+#include <sys/stat.h>
+#endif
 #include <dirent.h>
 #include <libintl.h>
 #include <regex.h>
 #ifdef CYGWIN
 #include <limits.h> /* PATH_MAX */
 #endif
-/* pacman */
+
+/* libalpm */
+#include "db.h"
+#include "alpm_list.h"
 #include "log.h"
 #include "util.h"
 #include "error.h"
 #include "server.h"
-#include "db.h"
 #include "handle.h"
 #include "cache.h"
 #include "alpm.h"
Index: pacman-lib/lib/libalpm/deps.c
diff -u pacman-lib/lib/libalpm/deps.c:1.75 pacman-lib/lib/libalpm/deps.c:1.76
--- pacman-lib/lib/libalpm/deps.c:1.75	Sat Mar  3 04:43:16 2007
+++ pacman-lib/lib/libalpm/deps.c	Mon Mar  5 17:13:34 2007
@@ -21,6 +21,8 @@
  *  USA.
  */
 
+#include "config.h"
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -29,16 +31,17 @@
 #endif
 #include <libintl.h>
 #include <math.h>
-/* pacman */
+
+/* libalpm */
+#include "deps.h"
+#include "alpm_list.h"
 #include "util.h"
 #include "log.h"
 #include "error.h"
-#include "alpm_list.h"
 #include "package.h"
 #include "db.h"
 #include "cache.h"
 #include "provide.h"
-#include "deps.h"
 #include "versioncmp.h"
 #include "handle.h"
 
Index: pacman-lib/lib/libalpm/error.c
diff -u pacman-lib/lib/libalpm/error.c:1.18 pacman-lib/lib/libalpm/error.c:1.19
--- pacman-lib/lib/libalpm/error.c:1.18	Fri Feb  9 05:10:49 2007
+++ pacman-lib/lib/libalpm/error.c	Mon Mar  5 17:13:34 2007
@@ -22,10 +22,16 @@
  *  USA.
  */
 
+#include "config.h"
+
 #include <libintl.h>
+
+/* libalpm */
+#include "error.h"
 #include "util.h"
 #include "alpm.h"
 
+/* TODO does this really need a file all on its own? */
 char SYMEXPORT *alpm_strerror(int err)
 {
 	switch(err) {
Index: pacman-lib/lib/libalpm/group.c
diff -u pacman-lib/lib/libalpm/group.c:1.15 pacman-lib/lib/libalpm/group.c:1.16
--- pacman-lib/lib/libalpm/group.c:1.15	Mon Feb 26 03:38:48 2007
+++ pacman-lib/lib/libalpm/group.c	Mon Mar  5 17:13:34 2007
@@ -20,16 +20,18 @@
  */
 
 #include "config.h"
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
 #include <libintl.h>
-/* pacman */
+
+/* libalpm */
+#include "group.h"
+#include "alpm_list.h"
 #include "util.h"
 #include "error.h"
 #include "log.h"
-#include "group.h"
-#include "alpm_list.h"
 #include "alpm.h"
 
 pmgrp_t *_alpm_grp_new()
Index: pacman-lib/lib/libalpm/handle.c
diff -u pacman-lib/lib/libalpm/handle.c:1.36 pacman-lib/lib/libalpm/handle.c:1.37
--- pacman-lib/lib/libalpm/handle.c:1.36	Sun Mar  4 04:16:28 2007
+++ pacman-lib/lib/libalpm/handle.c	Mon Mar  5 17:13:34 2007
@@ -22,6 +22,7 @@
  */
 
 #include "config.h"
+
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
@@ -30,15 +31,16 @@
 #include <syslog.h>
 #include <libintl.h>
 #include <time.h>
-/* pacman */
+
+/* libalpm */
+#include "handle.h"
+#include "alpm_list.h"
 #include "util.h"
 #include "log.h"
-#include "alpm_list.h"
 #include "error.h"
 #include "trans.h"
 #include "alpm.h"
 #include "server.h"
-#include "handle.h"
 
 pmhandle_t *_alpm_handle_new()
 {
Index: pacman-lib/lib/libalpm/handle.h
diff -u pacman-lib/lib/libalpm/handle.h:1.16 pacman-lib/lib/libalpm/handle.h:1.17
--- pacman-lib/lib/libalpm/handle.h:1.16	Wed Feb 21 01:44:15 2007
+++ pacman-lib/lib/libalpm/handle.h	Mon Mar  5 17:13:34 2007
@@ -21,9 +21,11 @@
 #ifndef _ALPM_HANDLE_H
 #define _ALPM_HANDLE_H
 
+#include <stdio.h> 
+
+#include "alpm_list.h"
 #include "db.h"
 #include "log.h"
-#include "alpm_list.h"
 #include "alpm.h"
 #include "trans.h"
 
Index: pacman-lib/lib/libalpm/log.c
diff -u pacman-lib/lib/libalpm/log.c:1.9 pacman-lib/lib/libalpm/log.c:1.10
--- pacman-lib/lib/libalpm/log.c:1.9	Tue Jan 23 22:02:54 2007
+++ pacman-lib/lib/libalpm/log.c	Mon Mar  5 17:13:34 2007
@@ -20,12 +20,14 @@
  */
 
 #include "config.h"
+
 #include <stdio.h>
 #include <stdarg.h>
 #include <time.h>
-/* pacman */
-#include "alpm.h"
+
+/* libalpm */
 #include "log.h"
+#include "alpm.h"
 
 void _alpm_log(pmloglevel_t flag, char *fmt, ...)
 {
Index: pacman-lib/lib/libalpm/md5.c
diff -u pacman-lib/lib/libalpm/md5.c:1.3 pacman-lib/lib/libalpm/md5.c:1.4
--- pacman-lib/lib/libalpm/md5.c:1.3	Sun Oct 15 15:31:05 2006
+++ pacman-lib/lib/libalpm/md5.c	Mon Mar  5 17:13:34 2007
@@ -24,6 +24,7 @@
  */
 
 #include <string.h>
+
 #include "md5.h"
 
 /* Constants for MD5Transform routine.
Index: pacman-lib/lib/libalpm/md5driver.c
diff -u pacman-lib/lib/libalpm/md5driver.c:1.6 pacman-lib/lib/libalpm/md5driver.c:1.7
--- pacman-lib/lib/libalpm/md5driver.c:1.6	Sun Mar  4 04:08:55 2007
+++ pacman-lib/lib/libalpm/md5driver.c	Mon Mar  5 17:13:34 2007
@@ -19,10 +19,14 @@
  */
 #define MD MD5
 
+#include "config.h"
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
 #include <libintl.h>
+
+/* libalpm */
 #include "alpm.h"
 #include "log.h"
 #include "util.h"
Index: pacman-lib/lib/libalpm/package.c
diff -u pacman-lib/lib/libalpm/package.c:1.83 pacman-lib/lib/libalpm/package.c:1.84
--- pacman-lib/lib/libalpm/package.c:1.83	Sat Mar  3 04:43:16 2007
+++ pacman-lib/lib/libalpm/package.c	Mon Mar  5 17:13:34 2007
@@ -23,6 +23,7 @@
  */
 
 #include "config.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <limits.h>
@@ -33,12 +34,13 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
-/* pacman */
+
+/* libalpm */
 #include "package.h"
+#include "alpm_list.h"
 #include "log.h"
 #include "util.h"
 #include "error.h"
-#include "alpm_list.h"
 #include "db.h"
 #include "cache.h"
 #include "provide.h"
Index: pacman-lib/lib/libalpm/provide.c
diff -u pacman-lib/lib/libalpm/provide.c:1.13 pacman-lib/lib/libalpm/provide.c:1.14
--- pacman-lib/lib/libalpm/provide.c:1.13	Sat Mar  3 03:14:00 2007
+++ pacman-lib/lib/libalpm/provide.c	Mon Mar  5 17:13:34 2007
@@ -20,14 +20,16 @@
  */
 
 #include "config.h"
+
 #include <stdlib.h>
 #include <string.h>
-/* pacman */
-#include "cache.h"
+
+/* libalpm */
+#include "provide.h"
 #include "alpm_list.h"
+#include "cache.h"
 #include "db.h"
 #include "log.h"
-#include "provide.h"
 
 /* return a alpm_list_t of packages in "db" that provide "package"
  */
Index: pacman-lib/lib/libalpm/remove.c
diff -u pacman-lib/lib/libalpm/remove.c:1.73 pacman-lib/lib/libalpm/remove.c:1.74
--- pacman-lib/lib/libalpm/remove.c:1.73	Sat Mar  3 20:22:57 2007
+++ pacman-lib/lib/libalpm/remove.c	Mon Mar  5 17:13:34 2007
@@ -23,24 +23,26 @@
  *  USA.
  */
 
-#if defined(__APPLE__) || defined(__OpenBSD__)
-#include <sys/syslimits.h>
-#endif
-#if defined(__APPLE__) || defined(__OpenBSD__) || defined(__sun__)
-#include <sys/stat.h>
-#endif
-
 #include "config.h"
+
 #include <stdlib.h>
 #include <errno.h>
 #include <time.h>
 #include <fcntl.h>
 #include <string.h>
 #include <limits.h>
+#if defined(__APPLE__) || defined(__OpenBSD__)
+#include <sys/syslimits.h>
+#endif
+#if defined(__APPLE__) || defined(__OpenBSD__) || defined(__sun__)
+#include <sys/stat.h>
+#endif
 #include <unistd.h>
 #include <errno.h>
 #include <libintl.h>
-/* pacman */
+
+/* libalpm */
+#include "remove.h"
 #include "alpm_list.h"
 #include "trans.h"
 #include "util.h"
@@ -55,7 +57,6 @@
 #include "cache.h"
 #include "deps.h"
 #include "provide.h"
-#include "remove.h"
 #include "handle.h"
 #include "alpm.h"
 
Index: pacman-lib/lib/libalpm/server.c
diff -u pacman-lib/lib/libalpm/server.c:1.22 pacman-lib/lib/libalpm/server.c:1.23
--- pacman-lib/lib/libalpm/server.c:1.22	Mon Feb 12 01:31:39 2007
+++ pacman-lib/lib/libalpm/server.c	Mon Mar  5 17:13:34 2007
@@ -19,6 +19,8 @@
  *  USA.
  */
 
+#include "config.h"
+
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
@@ -29,8 +31,9 @@
 #include <time.h>
 #include <download.h>
 
-/* pacman */
+/* libalpm */
 #include "server.h"
+#include "alpm_list.h"
 #include "error.h"
 #include "log.h"
 #include "alpm.h"
Index: pacman-lib/lib/libalpm/sha1.c
diff -u pacman-lib/lib/libalpm/sha1.c:1.5 pacman-lib/lib/libalpm/sha1.c:1.6
--- pacman-lib/lib/libalpm/sha1.c:1.5	Sun Mar  4 04:08:55 2007
+++ pacman-lib/lib/libalpm/sha1.c	Mon Mar  5 17:13:34 2007
@@ -22,20 +22,18 @@
       Robert Klep <robert at ilse.nl>  -- Expansion function fix
 */
 
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include "config.h"
+
+#include <sys/types.h>
+#include <stdlib.h>
+#include <string.h>
 #include <libintl.h>
 
+/* libalpm */
+#include "sha1.h"
 #include "alpm.h"
 #include "log.h"
 #include "util.h"
-#include "sha1.h"
-
-#include <sys/types.h>
-
-#include <stdlib.h>
-#include <string.h>
 
 /*
   Not-swap is a macro that does an endian swap on architectures that are
Index: pacman-lib/lib/libalpm/sync.c
diff -u pacman-lib/lib/libalpm/sync.c:1.109 pacman-lib/lib/libalpm/sync.c:1.110
--- pacman-lib/lib/libalpm/sync.c:1.109	Sun Mar  4 04:08:55 2007
+++ pacman-lib/lib/libalpm/sync.c	Mon Mar  5 17:13:34 2007
@@ -23,6 +23,7 @@
  */
 
 #include "config.h"
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <fcntl.h>
@@ -33,10 +34,12 @@
 #endif
 #include <dirent.h>
 #include <libintl.h>
-/* pacman */
+
+/* libalpm */
+#include "sync.h"
+#include "alpm_list.h"
 #include "log.h"
 #include "error.h"
-#include "alpm_list.h"
 #include "package.h"
 #include "db.h"
 #include "cache.h"
@@ -45,7 +48,6 @@
 #include "provide.h"
 #include "trans.h"
 #include "util.h"
-#include "sync.h"
 #include "versioncmp.h"
 #include "handle.h"
 #include "util.h"
Index: pacman-lib/lib/libalpm/trans.c
diff -u pacman-lib/lib/libalpm/trans.c:1.41 pacman-lib/lib/libalpm/trans.c:1.42
--- pacman-lib/lib/libalpm/trans.c:1.41	Sat Mar  3 04:43:16 2007
+++ pacman-lib/lib/libalpm/trans.c	Mon Mar  5 17:13:34 2007
@@ -23,16 +23,19 @@
  */
 
 #include "config.h"
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
 #include <libintl.h>
-/* pacman */
+
+/* libalpm */
+#include "trans.h"
+#include "alpm_list.h"
 #include "error.h"
 #include "package.h"
 #include "util.h"
 #include "log.h"
-#include "alpm_list.h"
 #include "handle.h"
 #include "add.h"
 #include "remove.h"
Index: pacman-lib/lib/libalpm/util.c
diff -u pacman-lib/lib/libalpm/util.c:1.48 pacman-lib/lib/libalpm/util.c:1.49
--- pacman-lib/lib/libalpm/util.c:1.48	Sun Mar  4 04:08:55 2007
+++ pacman-lib/lib/libalpm/util.c	Mon Mar  5 17:13:34 2007
@@ -23,14 +23,8 @@
  *  USA.
  */
 
-#if defined(__APPLE__) || defined(__OpenBSD__)
-#include <sys/syslimits.h>
-#endif
-#if defined(__APPLE__) || defined(__OpenBSD__) || defined(__sun__)
-#include <sys/stat.h>
-#endif
-
 #include "config.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 #ifdef __sun__
@@ -45,6 +39,12 @@
 #include <time.h>
 #include <syslog.h>
 #include <sys/wait.h>
+#if defined(__APPLE__) || defined(__OpenBSD__)
+#include <sys/syslimits.h>
+#endif
+#if defined(__APPLE__) || defined(__OpenBSD__) || defined(__sun__)
+#include <sys/stat.h>
+#endif
 #include <libintl.h>
 #ifdef CYGWIN
 #include <limits.h> /* PATH_MAX */
@@ -54,12 +54,12 @@
 #include <mntent.h>
 #endif
 
-/* pacman */
+/* libalpm */
+#include "util.h"
 #include "alpm_list.h"
 #include "log.h"
 #include "trans.h"
 #include "sync.h"
-#include "util.h"
 #include "error.h"
 #include "package.h"
 #include "alpm.h"
Index: pacman-lib/lib/libalpm/versioncmp.c
diff -u pacman-lib/lib/libalpm/versioncmp.c:1.16 pacman-lib/lib/libalpm/versioncmp.c:1.17
--- pacman-lib/lib/libalpm/versioncmp.c:1.16	Sat Mar  3 03:14:00 2007
+++ pacman-lib/lib/libalpm/versioncmp.c	Mon Mar  5 17:13:34 2007
@@ -22,17 +22,19 @@
  */
 
 #include "config.h"
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <ctype.h>
 #include <string.h>
 #include <libintl.h>
-/* pacman */
+
+/* libalpm */
+#include "versioncmp.h"
+#include "alpm_list.h"
 #include "alpm.h"
 #include "log.h"
 #include "util.h"
-#include "alpm_list.h"
-#include "versioncmp.h"
 
 #ifndef HAVE_STRVERSCMP
 /* GNU's strverscmp() function, taken from glibc 2.3.2 sources
Index: pacman-lib/pactest/util.py
diff -u pacman-lib/pactest/util.py:1.5 pacman-lib/pactest/util.py:1.6
--- pacman-lib/pactest/util.py:1.5	Mon Mar  5 13:06:12 2007
+++ pacman-lib/pactest/util.py	Mon Mar  5 17:13:34 2007
@@ -255,7 +255,7 @@
     else:
         parent, thisdir = os.path.split(dir)
         if parent: mkdir(parent) #recurse to make all parents
-        print "making dir %s" % thisdir
+        vprint("making dir %s" % thisdir)
         if thisdir: os.mkdir(dir)
 
 if __name__ == "__main__":
Index: pacman-lib/src/pacman/add.c
diff -u pacman-lib/src/pacman/add.c:1.33 pacman-lib/src/pacman/add.c:1.34
--- pacman-lib/src/pacman/add.c:1.33	Wed Feb 28 23:51:33 2007
+++ pacman-lib/src/pacman/add.c	Mon Mar  5 17:13:35 2007
@@ -19,6 +19,8 @@
  *  USA.
  */
 
+#include "config.h"
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -26,11 +28,12 @@
 
 #include <alpm.h>
 #include <alpm_list.h>
+
 /* pacman */
+#include "add.h"
 #include "log.h"
 #include "downloadprog.h"
 #include "trans.h"
-#include "add.h"
 #include "conf.h"
 #include "util.h"
 
Index: pacman-lib/src/pacman/conf.c
diff -u pacman-lib/src/pacman/conf.c:1.22 pacman-lib/src/pacman/conf.c:1.23
--- pacman-lib/src/pacman/conf.c:1.22	Wed Jan 31 01:10:22 2007
+++ pacman-lib/src/pacman/conf.c	Mon Mar  5 17:13:35 2007
@@ -19,6 +19,8 @@
  *  USA.
  */
 
+#include "config.h"
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -26,12 +28,13 @@
 #include <libintl.h>
 
 #include <alpm.h>
+
 /* pacman */
+#include "conf.h"
 #include "util.h"
 #include "log.h"
 #include "sync.h"
 #include "downloadprog.h"
-#include "conf.h"
 
 config_t *config_new()
 {
Index: pacman-lib/src/pacman/deptest.c
diff -u pacman-lib/src/pacman/deptest.c:1.15 pacman-lib/src/pacman/deptest.c:1.16
--- pacman-lib/src/pacman/deptest.c:1.15	Mon Feb 26 03:43:02 2007
+++ pacman-lib/src/pacman/deptest.c	Mon Mar  5 17:13:35 2007
@@ -25,14 +25,16 @@
 #include <stdio.h>
 #include <string.h>
 #include <libintl.h>
+
 #include <alpm.h>
 #include <alpm_list.h>
+
 /* pacman */
+#include "deptest.h"
 #include "util.h"
 #include "conf.h"
 #include "log.h"
 #include "sync.h"
-#include "deptest.h"
 
 extern config_t *config;
 
Index: pacman-lib/src/pacman/downloadprog.c
diff -u pacman-lib/src/pacman/downloadprog.c:1.15 pacman-lib/src/pacman/downloadprog.c:1.16
--- pacman-lib/src/pacman/downloadprog.c:1.15	Sat Feb 17 03:55:06 2007
+++ pacman-lib/src/pacman/downloadprog.c	Mon Mar  5 17:13:35 2007
@@ -20,6 +20,7 @@
  */
 
 #include "config.h"
+
 #include <limits.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -32,10 +33,11 @@
 #include <math.h>
 
 #include <alpm.h>
+
 /* pacman */
+#include "downloadprog.h"
 #include "util.h"
 #include "log.h"
-#include "downloadprog.h"
 #include "conf.h"
 
 /* progress bar */
Index: pacman-lib/src/pacman/log.c
diff -u pacman-lib/src/pacman/log.c:1.31 pacman-lib/src/pacman/log.c:1.32
--- pacman-lib/src/pacman/log.c:1.31	Sat Feb 17 03:55:06 2007
+++ pacman-lib/src/pacman/log.c	Mon Mar  5 17:13:35 2007
@@ -20,6 +20,7 @@
  */
 
 #include "config.h"
+
 #include <stdio.h>
 #include <string.h>
 #include <stdarg.h>
@@ -28,6 +29,7 @@
 #include <libintl.h>
 
 #include <alpm.h>
+
 /* pacman */
 #include "log.h"
 #include "conf.h"
Index: pacman-lib/src/pacman/package.c
diff -u pacman-lib/src/pacman/package.c:1.32 pacman-lib/src/pacman/package.c:1.33
--- pacman-lib/src/pacman/package.c:1.32	Wed Feb 28 23:51:24 2007
+++ pacman-lib/src/pacman/package.c	Mon Mar  5 17:13:35 2007
@@ -19,6 +19,8 @@
  *  USA.
  */
 
+#include "config.h"
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -28,10 +30,11 @@
 
 #include <alpm.h>
 #include <alpm_list.h>
+
 /* pacman */
+#include "package.h"
 #include "log.h"
 #include "util.h"
-#include "package.h"
 
 /* Display the content of an installed package
  *
Index: pacman-lib/src/pacman/pacman.c
diff -u pacman-lib/src/pacman/pacman.c:1.103 pacman-lib/src/pacman/pacman.c:1.104
--- pacman-lib/src/pacman/pacman.c:1.103	Sun Mar  4 04:16:28 2007
+++ pacman-lib/src/pacman/pacman.c	Mon Mar  5 17:13:35 2007
@@ -20,6 +20,7 @@
  */
 
 #include "config.h"
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <limits.h>
@@ -44,6 +45,7 @@
 
 #include <alpm.h>
 #include <alpm_list.h>
+
 /* pacman */
 #include "util.h"
 #include "log.h"
Index: pacman-lib/src/pacman/query.c
diff -u pacman-lib/src/pacman/query.c:1.26 pacman-lib/src/pacman/query.c:1.27
--- pacman-lib/src/pacman/query.c:1.26	Mon Feb 26 03:43:02 2007
+++ pacman-lib/src/pacman/query.c	Mon Mar  5 17:13:35 2007
@@ -19,6 +19,8 @@
  *  USA.
  */
 
+#include "config.h"
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <limits.h>
@@ -28,9 +30,10 @@
 
 #include <alpm.h>
 #include <alpm_list.h>
+
 /* pacman */
-#include "package.h"
 #include "query.h"
+#include "package.h"
 #include "log.h"
 #include "conf.h"
 #include "sync.h"
Index: pacman-lib/src/pacman/remove.c
diff -u pacman-lib/src/pacman/remove.c:1.29 pacman-lib/src/pacman/remove.c:1.30
--- pacman-lib/src/pacman/remove.c:1.29	Mon Feb 26 03:43:02 2007
+++ pacman-lib/src/pacman/remove.c	Mon Mar  5 17:13:35 2007
@@ -19,6 +19,8 @@
  *  USA.
  */
 
+#include "config.h"
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -26,11 +28,12 @@
 
 #include <alpm.h>
 #include <alpm_list.h>
+
 /* pacman */
+#include "remove.h"
 #include "util.h"
 #include "log.h"
 #include "trans.h"
-#include "remove.h"
 #include "conf.h"
 
 extern config_t *config;
Index: pacman-lib/src/pacman/sync.c
diff -u pacman-lib/src/pacman/sync.c:1.115 pacman-lib/src/pacman/sync.c:1.116
--- pacman-lib/src/pacman/sync.c:1.115	Mon Feb 26 03:43:02 2007
+++ pacman-lib/src/pacman/sync.c	Mon Mar  5 17:13:35 2007
@@ -19,16 +19,15 @@
  *  USA.
  */
 
-#if defined(__APPLE__) || defined(__OpenBSD__)
-#include <sys/syslimits.h>
-#include <sys/stat.h>
-#endif
-
 #include "config.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <sys/stat.h>
+#if defined(__APPLE__) || defined(__OpenBSD__)
+#include <sys/syslimits.h>
+#endif
 #include <unistd.h>
 #include <dirent.h>
 #include <libintl.h>
@@ -41,13 +40,14 @@
 #include <download.h> /* downloadLastErrString */
 /* TODO remove above download.h inclusion once we abstract more, and also
  * remove it from Makefile.am on the pacman side */
+
 /* pacman */
+#include "sync.h"
 #include "util.h"
 #include "log.h"
 #include "downloadprog.h"
 #include "package.h"
 #include "trans.h"
-#include "sync.h"
 #include "conf.h"
 
 extern config_t *config;
Index: pacman-lib/src/pacman/trans.c
diff -u pacman-lib/src/pacman/trans.c:1.41 pacman-lib/src/pacman/trans.c:1.42
--- pacman-lib/src/pacman/trans.c:1.41	Sat Mar  3 04:43:16 2007
+++ pacman-lib/src/pacman/trans.c	Mon Mar  5 17:13:35 2007
@@ -20,6 +20,7 @@
  */
 
 #include "config.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -30,10 +31,11 @@
 #include <wchar.h>
 
 #include <alpm.h>
+
 /* pacman */
+#include "trans.h"
 #include "util.h"
 #include "log.h"
-#include "trans.h"
 #include "conf.h"
 
 #define LOG_STR_LEN 256
Index: pacman-lib/src/pacman/upgrade.c
diff -u pacman-lib/src/pacman/upgrade.c:1.6 pacman-lib/src/pacman/upgrade.c:1.7
--- pacman-lib/src/pacman/upgrade.c:1.6	Fri Jan 19 04:28:46 2007
+++ pacman-lib/src/pacman/upgrade.c	Mon Mar  5 17:13:35 2007
@@ -19,15 +19,16 @@
  *  USA.
  */
 
+#include "config.h"
+
 #include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
 
 #include <alpm.h>
 #include <alpm_list.h>
+
 /* pacman */
-#include "add.h"
 #include "upgrade.h"
+#include "add.h"
 #include "conf.h"
 
 extern config_t *config;
Index: pacman-lib/src/pacman/util.c
diff -u pacman-lib/src/pacman/util.c:1.30 pacman-lib/src/pacman/util.c:1.31
--- pacman-lib/src/pacman/util.c:1.30	Mon Feb 26 03:43:02 2007
+++ pacman-lib/src/pacman/util.c	Mon Mar  5 17:13:35 2007
@@ -19,16 +19,16 @@
  *  USA.
  */
 
+#include "config.h"
+
 #if defined(__APPLE__) || defined(__OpenBSD__)
 #include <sys/syslimits.h>
 #include <sys/stat.h>
 #endif
-
 #include <sys/types.h>
 #include <sys/ioctl.h>
 #include <sys/time.h>
 
-#include "config.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -44,6 +44,7 @@
 
 #include <alpm.h>
 #include <alpm_list.h>
+
 /* pacman */
 #include "util.h"
 #include "conf.h"
Index: pacman-lib/src/util/testpkg.c
diff -u pacman-lib/src/util/testpkg.c:1.1 pacman-lib/src/util/testpkg.c:1.2
--- pacman-lib/src/util/testpkg.c:1.1	Sun Feb 11 20:30:03 2007
+++ pacman-lib/src/util/testpkg.c	Mon Mar  5 17:13:35 2007
@@ -19,6 +19,8 @@
  *  USA.
  */
 
+#include "config.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
Index: pacman-lib/src/util/vercmp.c
diff -u pacman-lib/src/util/vercmp.c:1.7 pacman-lib/src/util/vercmp.c:1.8
--- pacman-lib/src/util/vercmp.c:1.7	Fri Feb  9 16:08:12 2007
+++ pacman-lib/src/util/vercmp.c	Mon Mar  5 17:13:35 2007
@@ -19,14 +19,18 @@
  *  USA.
  */
 
+#include "config.h"
+
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
 #include <unistd.h>
 #include <limits.h>
+/* TODO this is probably not the best way to do this */
 #ifndef PATH_MAX
 #define PATH_MAX 1024
 #endif
+
 #include <alpm.h>
 
 int main(int argc, char *argv[])




More information about the pacman-dev mailing list