Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libalpm')
-rw-r--r--lib/libalpm/add.c6
-rw-r--r--lib/libalpm/alpm.c10
-rw-r--r--lib/libalpm/alpm_list.c3
-rw-r--r--lib/libalpm/backup.c7
-rw-r--r--lib/libalpm/be_files.c7
-rw-r--r--lib/libalpm/cache.c8
-rw-r--r--lib/libalpm/conflict.c15
-rw-r--r--lib/libalpm/conflict.h3
-rw-r--r--lib/libalpm/db.c16
-rw-r--r--lib/libalpm/deps.c9
-rw-r--r--lib/libalpm/error.c6
-rw-r--r--lib/libalpm/group.c8
-rw-r--r--lib/libalpm/handle.c8
-rw-r--r--lib/libalpm/handle.h4
-rw-r--r--lib/libalpm/log.c6
-rw-r--r--lib/libalpm/md5.c1
-rw-r--r--lib/libalpm/md5driver.c4
-rw-r--r--lib/libalpm/package.c6
-rw-r--r--lib/libalpm/provide.c8
-rw-r--r--lib/libalpm/remove.c19
-rw-r--r--lib/libalpm/server.c5
-rw-r--r--lib/libalpm/sha1.c16
-rw-r--r--lib/libalpm/sync.c8
-rw-r--r--lib/libalpm/trans.c7
-rw-r--r--lib/libalpm/util.c18
-rw-r--r--lib/libalpm/versioncmp.c8
26 files changed, 134 insertions, 82 deletions
diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c
index 97d1ea72..450b9c16 100644
--- a/lib/libalpm/add.c
+++ b/lib/libalpm/add.c
@@ -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"
diff --git a/lib/libalpm/alpm.c b/lib/libalpm/alpm.c
index 8553c558..d4833199 100644
--- a/lib/libalpm/alpm.c
+++ b/lib/libalpm/alpm.c
@@ -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))
diff --git a/lib/libalpm/alpm_list.c b/lib/libalpm/alpm_list.c
index 0737fc89..324c7d08 100644
--- a/lib/libalpm/alpm_list.c
+++ b/lib/libalpm/alpm_list.c
@@ -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"
diff --git a/lib/libalpm/backup.c b/lib/libalpm/backup.c
index 751d0937..aeb0dea7 100644
--- a/lib/libalpm/backup.c
+++ b/lib/libalpm/backup.c
@@ -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,
diff --git a/lib/libalpm/be_files.c b/lib/libalpm/be_files.c
index f8e73fbb..6e2f4c4f 100644
--- a/lib/libalpm/be_files.c
+++ b/lib/libalpm/be_files.c
@@ -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"
diff --git a/lib/libalpm/cache.c b/lib/libalpm/cache.c
index 75100283..f441af31 100644
--- a/lib/libalpm/cache.c
+++ b/lib/libalpm/cache.c
@@ -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.
diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c
index 76e76901..80490233 100644
--- a/lib/libalpm/conflict.c
+++ b/lib/libalpm/conflict.c
@@ -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'.
diff --git a/lib/libalpm/conflict.h b/lib/libalpm/conflict.h
index 44507f72..8928de86 100644
--- a/lib/libalpm/conflict.h
+++ b/lib/libalpm/conflict.h
@@ -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
diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c
index a6ef0528..451f40d6 100644
--- a/lib/libalpm/db.c
+++ b/lib/libalpm/db.c
@@ -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"
diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c
index a84d8b2a..247d9ff3 100644
--- a/lib/libalpm/deps.c
+++ b/lib/libalpm/deps.c
@@ -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"
diff --git a/lib/libalpm/error.c b/lib/libalpm/error.c
index 8befd560..ece8a521 100644
--- a/lib/libalpm/error.c
+++ b/lib/libalpm/error.c
@@ -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) {
diff --git a/lib/libalpm/group.c b/lib/libalpm/group.c
index 98b331f3..cce05213 100644
--- a/lib/libalpm/group.c
+++ b/lib/libalpm/group.c
@@ -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()
diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c
index b044adcb..417339dc 100644
--- a/lib/libalpm/handle.c
+++ b/lib/libalpm/handle.c
@@ -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()
{
diff --git a/lib/libalpm/handle.h b/lib/libalpm/handle.h
index bd75a370..35e5eb23 100644
--- a/lib/libalpm/handle.h
+++ b/lib/libalpm/handle.h
@@ -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"
diff --git a/lib/libalpm/log.c b/lib/libalpm/log.c
index c1d2aa6a..b59ec64e 100644
--- a/lib/libalpm/log.c
+++ b/lib/libalpm/log.c
@@ -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, ...)
{
diff --git a/lib/libalpm/md5.c b/lib/libalpm/md5.c
index 7e4fd677..6d5aa6a3 100644
--- a/lib/libalpm/md5.c
+++ b/lib/libalpm/md5.c
@@ -24,6 +24,7 @@ documentation and/or software.
*/
#include <string.h>
+
#include "md5.h"
/* Constants for MD5Transform routine.
diff --git a/lib/libalpm/md5driver.c b/lib/libalpm/md5driver.c
index 968caed8..60144fee 100644
--- a/lib/libalpm/md5driver.c
+++ b/lib/libalpm/md5driver.c
@@ -19,10 +19,14 @@ documentation and/or software.
*/
#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"
diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c
index 1faf2f2d..340dc525 100644
--- a/lib/libalpm/package.c
+++ b/lib/libalpm/package.c
@@ -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"
diff --git a/lib/libalpm/provide.c b/lib/libalpm/provide.c
index 3b563365..df600be7 100644
--- a/lib/libalpm/provide.c
+++ b/lib/libalpm/provide.c
@@ -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"
*/
diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c
index 9c57334b..fed86b0c 100644
--- a/lib/libalpm/remove.c
+++ b/lib/libalpm/remove.c
@@ -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"
diff --git a/lib/libalpm/server.c b/lib/libalpm/server.c
index b426ccb5..fb3c4147 100644
--- a/lib/libalpm/server.c
+++ b/lib/libalpm/server.c
@@ -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"
diff --git a/lib/libalpm/sha1.c b/lib/libalpm/sha1.c
index 956e87a9..d9a9118d 100644
--- a/lib/libalpm/sha1.c
+++ b/lib/libalpm/sha1.c
@@ -22,20 +22,18 @@
Robert Klep <robert@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
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index 337e350a..f3a0ee06 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -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"
diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c
index b4677079..f22697dd 100644
--- a/lib/libalpm/trans.c
+++ b/lib/libalpm/trans.c
@@ -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"
diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c
index c526ed8e..be9eeb31 100644
--- a/lib/libalpm/util.c
+++ b/lib/libalpm/util.c
@@ -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"
diff --git a/lib/libalpm/versioncmp.c b/lib/libalpm/versioncmp.c
index ad628866..67fe5ba4 100644
--- a/lib/libalpm/versioncmp.c
+++ b/lib/libalpm/versioncmp.c
@@ -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