summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2007-04-25 08:21:12 +0200
committerDan McGee <dan@archlinux.org>2007-04-25 17:07:47 +0200
commit5e1419c0b5cf717e57959bc27eeab1cfa4bea5dc (patch)
tree446f884852a55db94bc50bbfe7ef42a1b45a152a
parent339caa61ef4b52a450bf0ce785fd68c38b546be1 (diff)
downloadpacman-5e1419c0b5cf717e57959bc27eeab1cfa4bea5dc.tar.gz
pacman-5e1419c0b5cf717e57959bc27eeab1cfa4bea5dc.tar.xz
Merge single-function header files on pacman side
Having a seperate header file for add, remove, query, etc. seemed overkill. Merge them all into a common pacman.h and fix the necessary #includes. Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--src/pacman/Makefile.am14
-rw-r--r--src/pacman/add.c2
-rw-r--r--src/pacman/add.h30
-rw-r--r--src/pacman/conf.c2
-rw-r--r--src/pacman/deptest.c3
-rw-r--r--src/pacman/deptest.h30
-rw-r--r--src/pacman/pacman.c10
-rw-r--r--src/pacman/pacman.h (renamed from src/pacman/upgrade.h)28
-rw-r--r--src/pacman/query.c3
-rw-r--r--src/pacman/query.h30
-rw-r--r--src/pacman/remove.c2
-rw-r--r--src/pacman/remove.h30
-rw-r--r--src/pacman/sync.c2
-rw-r--r--src/pacman/sync.h30
-rw-r--r--src/pacman/upgrade.c3
15 files changed, 37 insertions, 182 deletions
diff --git a/src/pacman/Makefile.am b/src/pacman/Makefile.am
index 82ec4d6b..91912991 100644
--- a/src/pacman/Makefile.am
+++ b/src/pacman/Makefile.am
@@ -13,18 +13,18 @@ INCLUDES = -I$(top_srcdir)/lib/libalpm
AM_CFLAGS = -D_GNU_SOURCE
pacman_SOURCES = \
- add.h add.c \
+ add.c \
conf.h conf.c \
- deptest.h deptest.c \
+ deptest.c \
downloadprog.h downloadprog.c \
log.h log.c \
package.h package.c \
- pacman.c \
- query.h query.c \
- remove.h remove.c \
- sync.h sync.c \
+ pacman.h pacman.c \
+ query.c \
+ remove.c \
+ sync.c \
trans.h trans.c \
- upgrade.h upgrade.c \
+ upgrade.c \
util.h util.c
pacman_LDADD = $(top_builddir)/lib/libalpm/.libs/libalpm.la \
diff --git a/src/pacman/add.c b/src/pacman/add.c
index 2adf8681..632366c6 100644
--- a/src/pacman/add.c
+++ b/src/pacman/add.c
@@ -30,7 +30,7 @@
#include <alpm_list.h>
/* pacman */
-#include "add.h"
+#include "pacman.h"
#include "log.h"
#include "downloadprog.h"
#include "trans.h"
diff --git a/src/pacman/add.h b/src/pacman/add.h
deleted file mode 100644
index 61a956c5..00000000
--- a/src/pacman/add.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * add.h
- *
- * Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.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.
- */
-#ifndef _PM_ADD_H
-#define _PM_ADD_H
-
-#include <alpm_list.h>
-
-int pacman_add(alpm_list_t *targets);
-
-#endif /* _PM_ADD_H */
-
-/* vim: set ts=2 sw=2 noet: */
diff --git a/src/pacman/conf.c b/src/pacman/conf.c
index 045bdcf6..18146ca1 100644
--- a/src/pacman/conf.c
+++ b/src/pacman/conf.c
@@ -31,9 +31,9 @@
/* pacman */
#include "conf.h"
+#include "pacman.h"
#include "util.h"
#include "log.h"
-#include "sync.h"
#include "downloadprog.h"
config_t *config_new(void)
diff --git a/src/pacman/deptest.c b/src/pacman/deptest.c
index 1ae7ceb5..bce5641d 100644
--- a/src/pacman/deptest.c
+++ b/src/pacman/deptest.c
@@ -30,11 +30,10 @@
#include <alpm_list.h>
/* pacman */
-#include "deptest.h"
+#include "pacman.h"
#include "util.h"
#include "conf.h"
#include "log.h"
-#include "sync.h"
extern config_t *config;
diff --git a/src/pacman/deptest.h b/src/pacman/deptest.h
deleted file mode 100644
index ee30e437..00000000
--- a/src/pacman/deptest.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * deptest.h
- *
- * Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.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.
- */
-#ifndef _PM_DEPTEST_H
-#define _PM_DEPTEST_H
-
-#include <alpm_list.h>
-
-int pacman_deptest(alpm_list_t *targets);
-
-#endif /* _PM_DEPTEST_H */
-
-/* vim: set ts=2 sw=2 noet: */
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index 483a7bbf..5fd32ba7 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -28,9 +28,9 @@
#include <getopt.h>
#include <string.h>
#include <signal.h>
+#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <unistd.h>
#include <libintl.h>
#include <locale.h>
#if defined(__APPLE__)
@@ -44,21 +44,17 @@
#endif
#include <time.h>
+/* alpm */
#include <alpm.h>
#include <alpm_list.h>
/* pacman */
+#include "pacman.h"
#include "util.h"
#include "log.h"
#include "downloadprog.h"
#include "conf.h"
#include "package.h"
-#include "add.h"
-#include "remove.h"
-#include "upgrade.h"
-#include "query.h"
-#include "sync.h"
-#include "deptest.h"
#if defined(__OpenBSD__) || defined(__APPLE__)
#define BSD
diff --git a/src/pacman/upgrade.h b/src/pacman/pacman.h
index d26930f0..38c89fb3 100644
--- a/src/pacman/upgrade.h
+++ b/src/pacman/pacman.h
@@ -1,8 +1,8 @@
/*
- * upgrade.h
- *
- * Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
- *
+ * pacman.h
+ *
+ * Copyright (c) 2002-2007 by Judd Vinet <jvinet@zeroflux.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
@@ -15,16 +15,28 @@
*
* 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,
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
-#ifndef _PM_UPGRADE_H
-#define _PM_UPGRADE_H
+#ifndef _PM_PACMAN_H
+#define _PM_PACMAN_H
#include <alpm_list.h>
+/* add.c, this should merge with upgrade.c */
+int pacman_add(alpm_list_t *targets);
+/* sync.c */
+int pacman_sync(alpm_list_t *targets);
+/* query.c */
+int pacman_query(alpm_list_t *targets);
+/* remove.c */
+int pacman_remove(alpm_list_t *targets);
+/* upgrade.c */
int pacman_upgrade(alpm_list_t *targets);
-#endif /* _PM_UPGRADE_H */
+/* deptest.c */
+int pacman_deptest(alpm_list_t *targets);
+
+#endif /* _PM_PACMAN_H */
/* vim: set ts=2 sw=2 noet: */
diff --git a/src/pacman/query.c b/src/pacman/query.c
index a6ebddb0..6997a7a7 100644
--- a/src/pacman/query.c
+++ b/src/pacman/query.c
@@ -34,11 +34,10 @@
#include <alpm_list.h>
/* pacman */
-#include "query.h"
+#include "pacman.h"
#include "package.h"
#include "log.h"
#include "conf.h"
-#include "sync.h"
#include "util.h"
extern config_t *config;
diff --git a/src/pacman/query.h b/src/pacman/query.h
deleted file mode 100644
index fa55c732..00000000
--- a/src/pacman/query.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * query.h
- *
- * Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.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.
- */
-#ifndef _PM_QUERY_H
-#define _PM_QUERY_H
-
-#include <alpm_list.h>
-
-int pacman_query(alpm_list_t *targets);
-
-#endif /* _PM_QUERY_H */
-
-/* vim: set ts=2 sw=2 noet: */
diff --git a/src/pacman/remove.c b/src/pacman/remove.c
index 9989f8e5..cf9b6293 100644
--- a/src/pacman/remove.c
+++ b/src/pacman/remove.c
@@ -30,7 +30,7 @@
#include <alpm_list.h>
/* pacman */
-#include "remove.h"
+#include "pacman.h"
#include "util.h"
#include "log.h"
#include "trans.h"
diff --git a/src/pacman/remove.h b/src/pacman/remove.h
deleted file mode 100644
index 33a2d20d..00000000
--- a/src/pacman/remove.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * remove.h
- *
- * Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.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.
- */
-#ifndef _PM_REMOVE_H
-#define _PM_REMOVE_H
-
-#include <alpm_list.h>
-
-int pacman_remove(alpm_list_t *targets);
-
-#endif /* _PM_REMOVE_H */
-
-/* vim: set ts=2 sw=2 noet: */
diff --git a/src/pacman/sync.c b/src/pacman/sync.c
index ca95fe63..9bf970f6 100644
--- a/src/pacman/sync.c
+++ b/src/pacman/sync.c
@@ -42,7 +42,7 @@
* remove it from Makefile.am on the pacman side */
/* pacman */
-#include "sync.h"
+#include "pacman.h"
#include "util.h"
#include "log.h"
#include "downloadprog.h"
diff --git a/src/pacman/sync.h b/src/pacman/sync.h
deleted file mode 100644
index 7175577f..00000000
--- a/src/pacman/sync.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * sync.h
- *
- * Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.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.
- */
-#ifndef _PM_SYNC_H
-#define _PM_SYNC_H
-
-#include <alpm_list.h>
-
-int pacman_sync(alpm_list_t *targets);
-
-#endif /* _PM_SYNC_H */
-
-/* vim: set ts=2 sw=2 noet: */
diff --git a/src/pacman/upgrade.c b/src/pacman/upgrade.c
index a4c94bb7..177484f5 100644
--- a/src/pacman/upgrade.c
+++ b/src/pacman/upgrade.c
@@ -27,8 +27,7 @@
#include <alpm_list.h>
/* pacman */
-#include "upgrade.h"
-#include "add.h"
+#include "pacman.h"
#include "conf.h"
extern config_t *config;