Pacman-dev
Threads by month
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- 1 participants
- 7322 discussions
Date: Tuesday, January 30, 2007 @ 03:20:15
Author: aaron
Path: /home/cvs-pacman/pacman-lib
Modified: TODO.aaron (1.11 -> 1.12)
TODO changes
------------+
TODO.aaron | 5 +++++
1 file changed, 5 insertions(+)
Index: pacman-lib/TODO.aaron
diff -u pacman-lib/TODO.aaron:1.11 pacman-lib/TODO.aaron:1.12
--- pacman-lib/TODO.aaron:1.11 Tue Jan 30 03:14:10 2007
+++ pacman-lib/TODO.aaron Tue Jan 30 03:20:15 2007
@@ -2,6 +2,11 @@
* Make sure all the alpm_list_t changes are valid (especially alpm_list_free)
+* The --debug flag should't need a silly mask.
+* PM_LOG_FLOW1 and PM_LOG_FLOW2 seem extraneous at this point. These should both
+ be moved to PM_LOG_DEBUG messages, as it's going to end up being impossible to
+ keep track of what is "flow1" and what is "flow2"
+
* src/pacman:
- There's quite a few single function headers which contain the pacman_*
functions. We should move these to a single header (pacman.h) to clean up
1
0
Date: Tuesday, January 30, 2007 @ 03:17:02
Author: aaron
Path: /home/cvs-pacman/pacman-lib
Modified: configure.ac (1.24 -> 1.25)
Turn debug off by default
--------------+
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: pacman-lib/configure.ac
diff -u pacman-lib/configure.ac:1.24 pacman-lib/configure.ac:1.25
--- pacman-lib/configure.ac:1.24 Mon Jan 29 17:18:31 2007
+++ pacman-lib/configure.ac Tue Jan 30 03:17:02 2007
@@ -148,7 +148,7 @@
dnl Help line for debug
AC_ARG_ENABLE(debug,
AC_HELP_STRING([--enable-debug], [Enable debugging support]),
- [debug=$enableval], [debug=yes])
+ [debug=$enableval], [debug=no])
dnl Help line for fakeroot
AC_ARG_ENABLE(fakeroot,
1
0
Date: Tuesday, January 30, 2007 @ 03:14:11
Author: aaron
Path: /home/cvs-pacman/pacman-lib
Modified: TODO.aaron (1.10 -> 1.11) lib/libalpm/add.c (1.106 -> 1.107)
lib/libalpm/alpm.c (1.108 -> 1.109)
lib/libalpm/backup.c (1.9 -> 1.10)
lib/libalpm/be_files.c (1.22 -> 1.23)
lib/libalpm/cache.c (1.28 -> 1.29)
lib/libalpm/conflict.c (1.33 -> 1.34)
lib/libalpm/db.c (1.57 -> 1.58) lib/libalpm/deps.c (1.62 -> 1.63)
lib/libalpm/group.c (1.13 -> 1.14)
lib/libalpm/handle.c (1.29 -> 1.30) lib/libalpm/log.h (1.8 -> 1.9)
lib/libalpm/md5driver.c (1.4 -> 1.5)
lib/libalpm/package.c (1.52 -> 1.53)
lib/libalpm/provide.c (1.9 -> 1.10)
lib/libalpm/remove.c (1.58 -> 1.59)
lib/libalpm/server.c (1.17 -> 1.18) lib/libalpm/sha1.c (1.3 -> 1.4)
lib/libalpm/sync.c (1.94 -> 1.95)
lib/libalpm/trans.c (1.33 -> 1.34)
lib/libalpm/util.c (1.42 -> 1.43)
lib/libalpm/versioncmp.c (1.11 -> 1.12)
K. Piche <kevin.piche(a)cgi.com>
* ALPM_LOG_FUNCTION macro and all the great work to add this macro everywhere
--------------------------+
TODO.aaron | 3 --
lib/libalpm/add.c | 8 ++++++
lib/libalpm/alpm.c | 52 +++++++++++++++++++++++++++++++++++++++
lib/libalpm/backup.c | 3 ++
lib/libalpm/be_files.c | 20 +++++++++++++++
lib/libalpm/cache.c | 22 ++++++++++++++++
lib/libalpm/conflict.c | 12 +++++++++
lib/libalpm/db.c | 13 +++++++++
lib/libalpm/deps.c | 22 ++++++++++++++++
lib/libalpm/group.c | 8 ++++++
lib/libalpm/handle.c | 4 +++
lib/libalpm/log.h | 7 +++++
lib/libalpm/md5driver.c | 4 +++
lib/libalpm/package.c | 60 +++++++++++++++++++++++++++++++++++++++++++++
lib/libalpm/provide.c | 3 ++
lib/libalpm/remove.c | 8 ++++++
lib/libalpm/server.c | 9 ++++++
lib/libalpm/sha1.c | 4 +++
lib/libalpm/sync.c | 19 ++++++++++++++
lib/libalpm/trans.c | 14 ++++++++++
lib/libalpm/util.c | 6 ++++
lib/libalpm/versioncmp.c | 4 +++
22 files changed, 302 insertions(+), 3 deletions(-)
Index: pacman-lib/TODO.aaron
diff -u pacman-lib/TODO.aaron:1.10 pacman-lib/TODO.aaron:1.11
--- pacman-lib/TODO.aaron:1.10 Wed Jan 24 03:51:50 2007
+++ pacman-lib/TODO.aaron Tue Jan 30 03:14:10 2007
@@ -52,9 +52,6 @@
* pacman: fixup doxygen documentation for public interface
-* pacman: use gcc visibility (static) for non-public functions (all _alpm
- functions should be static)
-
**** BUGS ****
* Removal of conflicts on -A and -U (INCOMPLETE)
* ordering of installed packages based on dependencies
Index: pacman-lib/lib/libalpm/add.c
diff -u pacman-lib/lib/libalpm/add.c:1.106 pacman-lib/lib/libalpm/add.c:1.107
--- pacman-lib/lib/libalpm/add.c:1.106 Tue Jan 30 02:47:19 2007
+++ pacman-lib/lib/libalpm/add.c Tue Jan 30 03:14:10 2007
@@ -64,6 +64,8 @@
char *str = NULL;
pmpkg_t *dummy = NULL;
+ ALPM_LOG_FUNC;
+
dummy = _alpm_pkg_new(NULL, NULL);
if(dummy == NULL) {
RET_ERR(PM_ERR_MEMORY, -1);
@@ -113,6 +115,8 @@
alpm_list_t *i;
struct stat buf;
+ ALPM_LOG_FUNC;
+
ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1));
ASSERT(db != NULL, RET_ERR(PM_ERR_DB_NULL, -1));
ASSERT(name != NULL && strlen(name) != 0, RET_ERR(PM_ERR_WRONG_ARGS, -1));
@@ -226,6 +230,8 @@
char rm_fname[PATH_MAX];
pmpkg_t *info = NULL;
+ ALPM_LOG_FUNC;
+
ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1));
ASSERT(db != NULL, RET_ERR(PM_ERR_DB_NULL, -1));
@@ -354,6 +360,8 @@
time_t t;
alpm_list_t *targ, *lp;
+ ALPM_LOG_FUNC;
+
ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1));
ASSERT(db != NULL, RET_ERR(PM_ERR_DB_NULL, -1));
Index: pacman-lib/lib/libalpm/alpm.c
diff -u pacman-lib/lib/libalpm/alpm.c:1.108 pacman-lib/lib/libalpm/alpm.c:1.109
--- pacman-lib/lib/libalpm/alpm.c:1.108 Tue Jan 30 02:47:19 2007
+++ pacman-lib/lib/libalpm/alpm.c Tue Jan 30 03:14:10 2007
@@ -103,6 +103,8 @@
{
int dbs_left = 0;
+ ALPM_LOG_FUNC;
+
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
/* free the transaction if there is any */
@@ -141,6 +143,8 @@
*/
pmdb_t SYMEXPORT *alpm_db_register(char *treename)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, NULL));
ASSERT(treename != NULL && strlen(treename) != 0, RET_ERR(PM_ERR_WRONG_ARGS, NULL));
@@ -158,6 +162,8 @@
{
int found = 0;
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
ASSERT(db != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1));
@@ -201,6 +207,8 @@
{
int found = 0;
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(db != NULL, RET_ERR(PM_ERR_DB_NULL, -1));
@@ -254,6 +262,8 @@
char lastupdate[16] = "";
int ret;
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
ASSERT(db != NULL && db != handle->db_local, RET_ERR(PM_ERR_WRONG_ARGS, -1));
@@ -332,6 +342,8 @@
*/
pmpkg_t SYMEXPORT *alpm_db_readpkg(pmdb_t *db, char *name)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
ASSERT(db != NULL, return(NULL));
@@ -346,6 +358,8 @@
*/
alpm_list_t SYMEXPORT *alpm_db_getpkgcache(pmdb_t *db)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
ASSERT(db != NULL, return(NULL));
@@ -360,6 +374,8 @@
*/
alpm_list_t SYMEXPORT *alpm_db_whatprovides(pmdb_t *db, char *name)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
ASSERT(db != NULL, return(NULL));
@@ -375,6 +391,8 @@
*/
pmgrp_t SYMEXPORT *alpm_db_readgrp(pmdb_t *db, char *name)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
ASSERT(db != NULL, return(NULL));
@@ -389,6 +407,8 @@
*/
alpm_list_t SYMEXPORT *alpm_db_getgrpcache(pmdb_t *db)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
ASSERT(db != NULL, return(NULL));
@@ -453,6 +473,8 @@
char *sha1sum = NULL;
int retval = 0;
+ ALPM_LOG_FUNC;
+
ASSERT(pkg != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1));
/* We only inspect packages from sync repositories */
ASSERT(pkg->origin == PKG_FROM_CACHE, RET_ERR(PM_ERR_PKG_INVALID, -1));
@@ -500,6 +522,8 @@
char *md5sum = NULL;
int retval = 0;
+ ALPM_LOG_FUNC;
+
ASSERT(pkg != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1));
/* We only inspect packages from sync repositories */
ASSERT(pkg->origin == PKG_FROM_CACHE, RET_ERR(PM_ERR_PKG_INVALID, -1));
@@ -545,6 +569,8 @@
*/
int SYMEXPORT alpm_pkg_vercmp(const char *ver1, const char *ver2)
{
+ ALPM_LOG_FUNC;
+
return(alpm_versioncmp(ver1, ver2));
}
@@ -569,6 +595,8 @@
size_t i = 0;
char *arch, *cmp, *p;
+ ALPM_LOG_FUNC;
+
if((p = strrchr(pkgname, '-'))) {
for(i=0; i < sizeof(_supported_archs)/sizeof(char*); ++i) {
cmp = p+1;
@@ -598,6 +626,8 @@
*/
alpm_list_t SYMEXPORT *alpm_db_search(pmdb_t *db)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
ASSERT(handle->needles != NULL, return(NULL));
@@ -628,6 +658,8 @@
{
char path[PATH_MAX];
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
@@ -655,6 +687,8 @@
{
pmtrans_t *trans;
+ ALPM_LOG_FUNC;
+
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
trans = handle->trans;
@@ -673,6 +707,8 @@
{
pmtrans_t *trans;
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
ASSERT(target != NULL && strlen(target) != 0, RET_ERR(PM_ERR_WRONG_ARGS, -1));
@@ -691,6 +727,8 @@
*/
int SYMEXPORT alpm_trans_prepare(alpm_list_t **data)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
ASSERT(data != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1));
@@ -708,6 +746,8 @@
*/
int SYMEXPORT alpm_trans_commit(alpm_list_t **data)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
@@ -731,6 +771,8 @@
pmtrans_t *trans;
char path[PATH_MAX];
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
@@ -779,6 +821,8 @@
char str[LOG_STR_LEN];
va_list args;
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
@@ -814,6 +858,8 @@
*/
char SYMEXPORT *alpm_get_md5sum(char *name)
{
+ ALPM_LOG_FUNC;
+
ASSERT(name != NULL, return(NULL));
return(_alpm_MDFile(name));
@@ -825,6 +871,8 @@
*/
char SYMEXPORT *alpm_get_sha1sum(char *name)
{
+ ALPM_LOG_FUNC;
+
ASSERT(name != NULL, return(NULL));
return(_alpm_SHAFile(name));
@@ -836,6 +884,8 @@
*/
char SYMEXPORT *alpm_fetch_pkgurl(char *url)
{
+ ALPM_LOG_FUNC;
+
ASSERT(strstr(url, "://"), return(NULL));
return(_alpm_fetch_pkgurl(url));
@@ -857,6 +907,8 @@
char section[256] = "";
pmdb_t *db = NULL;
+ ALPM_LOG_FUNC;
+
fp = fopen(file, "r");
if(fp == NULL) {
return(0);
Index: pacman-lib/lib/libalpm/backup.c
diff -u pacman-lib/lib/libalpm/backup.c:1.9 pacman-lib/lib/libalpm/backup.c:1.10
--- pacman-lib/lib/libalpm/backup.c:1.9 Fri Jan 19 04:28:44 2007
+++ pacman-lib/lib/libalpm/backup.c Tue Jan 30 03:14:10 2007
@@ -26,6 +26,7 @@
#include <stdlib.h>
#include <string.h>
/* pacman */
+#include "log.h"
#include "backup.h"
#include "util.h"
@@ -36,6 +37,8 @@
{
alpm_list_t *lp;
+ ALPM_LOG_FUNC;
+
if(file == NULL || backup == NULL) {
return(NULL);
}
Index: pacman-lib/lib/libalpm/be_files.c
diff -u pacman-lib/lib/libalpm/be_files.c:1.22 pacman-lib/lib/libalpm/be_files.c:1.23
--- pacman-lib/lib/libalpm/be_files.c:1.22 Wed Jan 24 03:51:51 2007
+++ pacman-lib/lib/libalpm/be_files.c Tue Jan 30 03:14:10 2007
@@ -51,6 +51,8 @@
*/
int _alpm_db_install(pmdb_t *db, const char *dbfile)
{
+ ALPM_LOG_FUNC;
+
/* ORE
we should not simply unpack the archive, but better parse it and
db_write each entry (see sync_load_dbarchive to get archive content) */
@@ -65,6 +67,8 @@
int _alpm_db_open(pmdb_t *db)
{
+ ALPM_LOG_FUNC;
+
if(db == NULL) {
RET_ERR(PM_ERR_DB_NULL, -1);
}
@@ -79,6 +83,8 @@
void _alpm_db_close(pmdb_t *db)
{
+ ALPM_LOG_FUNC;
+
if(db == NULL) {
return;
}
@@ -91,6 +97,8 @@
void _alpm_db_rewind(pmdb_t *db)
{
+ ALPM_LOG_FUNC;
+
if(db == NULL || db->handle == NULL) {
return;
}
@@ -108,6 +116,8 @@
int found = 0;
pmpkg_t *pkg;
+ ALPM_LOG_FUNC;
+
if(db == NULL) {
RET_ERR(PM_ERR_DB_NULL, NULL);
}
@@ -184,6 +194,8 @@
alpm_list_t *tmplist;
char *locale;
+ ALPM_LOG_FUNC;
+
if(db == NULL) {
RET_ERR(PM_ERR_DB_NULL, -1);
}
@@ -452,6 +464,8 @@
int retval = 0;
int local = 0;
+ ALPM_LOG_FUNC;
+
if(db == NULL || info == NULL) {
return(-1);
}
@@ -650,6 +664,8 @@
{
char path[PATH_MAX];
+ ALPM_LOG_FUNC;
+
if(db == NULL || info == NULL) {
RET_ERR(PM_ERR_DB_NULL, -1);
}
@@ -673,6 +689,8 @@
FILE *fp;
char file[PATH_MAX];
+ ALPM_LOG_FUNC;
+
if(db == NULL || ts == NULL) {
return(-1);
}
@@ -703,6 +721,8 @@
FILE *fp;
char file[PATH_MAX];
+ ALPM_LOG_FUNC;
+
if(db == NULL || ts == NULL || strlen(ts) == 0) {
return(-1);
}
Index: pacman-lib/lib/libalpm/cache.c
diff -u pacman-lib/lib/libalpm/cache.c:1.28 pacman-lib/lib/libalpm/cache.c:1.29
--- pacman-lib/lib/libalpm/cache.c:1.28 Mon Jan 29 22:46:33 2007
+++ pacman-lib/lib/libalpm/cache.c Tue Jan 30 03:14:10 2007
@@ -48,6 +48,8 @@
/* The group cache needs INFRQ_DESC as well */
/* pmdbinfrq_t infolevel = INFRQ_DEPENDS | INFRQ_DESC;*/
+ ALPM_LOG_FUNC;
+
if(db == NULL) {
return(-1);
}
@@ -72,6 +74,8 @@
void _alpm_db_free_pkgcache(pmdb_t *db)
{
+ ALPM_LOG_FUNC;
+
if(db == NULL || db->pkgcache == NULL) {
return;
}
@@ -88,6 +92,8 @@
alpm_list_t *_alpm_db_get_pkgcache(pmdb_t *db, pmdbinfrq_t infolevel)
{
+ ALPM_LOG_FUNC;
+
if(db == NULL) {
return(NULL);
}
@@ -108,6 +114,8 @@
* info is not already cached
*/
+ ALPM_LOG_FUNC;
+
alpm_list_t *p;
for(p = db->pkgcache; p; p = p->next) {
pmpkg_t *pkg = (pmpkg_t *)p->data;
@@ -132,6 +140,8 @@
{
pmpkg_t *newpkg;
+ ALPM_LOG_FUNC;
+
if(db == NULL || pkg == NULL) {
return(-1);
}
@@ -153,6 +163,8 @@
void *vdata;
pmpkg_t *data;
+ ALPM_LOG_FUNC;
+
if(db == NULL || pkg == NULL) {
return(-1);
}
@@ -174,6 +186,8 @@
pmpkg_t *_alpm_db_get_pkgfromcache(pmdb_t *db, char *target)
{
+ ALPM_LOG_FUNC;
+
if(db == NULL) {
return(NULL);
}
@@ -187,6 +201,8 @@
{
alpm_list_t *lp;
+ ALPM_LOG_FUNC;
+
if(db == NULL) {
return(-1);
}
@@ -231,6 +247,8 @@
{
alpm_list_t *lg;
+ ALPM_LOG_FUNC;
+
if(db == NULL || db->grpcache == NULL) {
return;
}
@@ -246,6 +264,8 @@
alpm_list_t *_alpm_db_get_grpcache(pmdb_t *db)
{
+ ALPM_LOG_FUNC;
+
if(db == NULL) {
return(NULL);
}
@@ -261,6 +281,8 @@
{
alpm_list_t *i;
+ ALPM_LOG_FUNC;
+
if(db == NULL || target == NULL || strlen(target) == 0) {
return(NULL);
}
Index: pacman-lib/lib/libalpm/conflict.c
diff -u pacman-lib/lib/libalpm/conflict.c:1.33 pacman-lib/lib/libalpm/conflict.c:1.34
--- pacman-lib/lib/libalpm/conflict.c:1.33 Tue Jan 30 02:47:20 2007
+++ pacman-lib/lib/libalpm/conflict.c Tue Jan 30 03:14:10 2007
@@ -57,6 +57,8 @@
alpm_list_t *baddeps = NULL;
pmdepmissing_t *miss = NULL;
+ ALPM_LOG_FUNC;
+
if(db == NULL) {
return(NULL);
}
@@ -220,6 +222,8 @@
alpm_list_t *targets = trans->packages;
double percent;
+ ALPM_LOG_FUNC;
+
if(db == NULL || targets == NULL || root == NULL) {
return(NULL);
}
@@ -362,6 +366,8 @@
const char SYMEXPORT *alpm_conflict_get_target(pmconflict_t *conflict)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
ASSERT(conflict != NULL, return(NULL));
@@ -371,6 +377,8 @@
pmconflicttype_t SYMEXPORT alpm_conflict_get_type(pmconflict_t *conflict)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, return(-1));
ASSERT(conflict != NULL, return(-1));
@@ -380,6 +388,8 @@
const char SYMEXPORT *alpm_conflict_get_file(pmconflict_t *conflict)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
ASSERT(conflict != NULL, return(NULL));
@@ -389,6 +399,8 @@
const char SYMEXPORT *alpm_conflict_get_ctarget(pmconflict_t *conflict)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
ASSERT(conflict != NULL, return(NULL));
Index: pacman-lib/lib/libalpm/db.c
diff -u pacman-lib/lib/libalpm/db.c:1.57 pacman-lib/lib/libalpm/db.c:1.58
--- pacman-lib/lib/libalpm/db.c:1.57 Tue Jan 30 02:47:20 2007
+++ pacman-lib/lib/libalpm/db.c Tue Jan 30 03:14:10 2007
@@ -55,6 +55,8 @@
{
pmdb_t *db;
+ ALPM_LOG_FUNC;
+
db = calloc(1, sizeof(pmdb_t));
if(db == NULL) {
_alpm_log(PM_LOG_ERROR, _("malloc failed: could not allocate %d bytes"),
@@ -80,6 +82,8 @@
{
pmdb_t *db = data;
+ ALPM_LOG_FUNC;
+
FREELISTSERVERS(db->servers);
FREE(db->path);
FREE(db);
@@ -89,6 +93,7 @@
int _alpm_db_cmp(const void *db1, const void *db2)
{
+ ALPM_LOG_FUNC;
return(strcmp(((pmdb_t *)db1)->treename, ((pmdb_t *)db2)->treename));
}
@@ -96,6 +101,8 @@
{
alpm_list_t *i, *j, *k, *ret = NULL;
+ ALPM_LOG_FUNC;
+
for(i = needles; i; i = i->next) {
char *targ;
@@ -149,6 +156,8 @@
pmdb_t *db;
char path[PATH_MAX];
+ ALPM_LOG_FUNC;
+
if(strcmp(treename, "local") == 0) {
if(handle->db_local != NULL) {
_alpm_log(PM_LOG_WARNING, _("attempt to re-register the 'local' DB"));
@@ -201,6 +210,8 @@
const char SYMEXPORT *alpm_db_get_name(pmdb_t *db)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
ASSERT(db != NULL, return(NULL));
@@ -213,6 +224,8 @@
char path[PATH_MAX];
pmserver_t *s;
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
ASSERT(db != NULL, return(NULL));
Index: pacman-lib/lib/libalpm/deps.c
diff -u pacman-lib/lib/libalpm/deps.c:1.62 pacman-lib/lib/libalpm/deps.c:1.63
--- pacman-lib/lib/libalpm/deps.c:1.62 Tue Jan 30 02:47:20 2007
+++ pacman-lib/lib/libalpm/deps.c Tue Jan 30 03:14:11 2007
@@ -50,6 +50,8 @@
{
pmdepmissing_t *miss;
+ ALPM_LOG_FUNC;
+
miss = (pmdepmissing_t *)malloc(sizeof(pmdepmissing_t));
if(miss == NULL) {
_alpm_log(PM_LOG_ERROR, _("malloc failure: could not allocate %d bytes"), sizeof(pmdepmissing_t));
@@ -73,6 +75,8 @@
{
alpm_list_t *i;
+ ALPM_LOG_FUNC;
+
for(i = haystack; i; i = i->next) {
pmdepmissing_t *miss = i->data;
if(!memcmp(needle, miss, sizeof(pmdepmissing_t))
@@ -108,6 +112,8 @@
int numtargs = 0;
int maxscans;
+ ALPM_LOG_FUNC;
+
if(targets == NULL) {
return(NULL);
}
@@ -196,6 +202,8 @@
alpm_list_t *baddeps = NULL;
pmdepmissing_t *miss = NULL;
+ ALPM_LOG_FUNC;
+
if(db == NULL) {
return(NULL);
}
@@ -439,6 +447,8 @@
alpm_list_t *i, *j, *k;
alpm_list_t *newtargs = targs;
+ ALPM_LOG_FUNC;
+
if(db == NULL) {
return(newtargs);
}
@@ -527,6 +537,8 @@
alpm_list_t *targ;
alpm_list_t *deps = NULL;
+ ALPM_LOG_FUNC;
+
if(local == NULL || dbs_sync == NULL || syncpkg == NULL) {
return(-1);
}
@@ -648,6 +660,8 @@
const char SYMEXPORT *alpm_dep_get_target(pmdepmissing_t *miss)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
ASSERT(miss != NULL, return(NULL));
@@ -657,6 +671,8 @@
pmdeptype_t SYMEXPORT alpm_dep_get_type(pmdepmissing_t *miss)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, return(-1));
ASSERT(miss != NULL, return(-1));
@@ -666,6 +682,8 @@
pmdepmod_t SYMEXPORT alpm_dep_get_mod(pmdepmissing_t *miss)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, return(-1));
ASSERT(miss != NULL, return(-1));
@@ -675,6 +693,8 @@
const char SYMEXPORT *alpm_dep_get_name(pmdepmissing_t *miss)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
ASSERT(miss != NULL, return(NULL));
@@ -684,6 +704,8 @@
const char SYMEXPORT *alpm_dep_get_version(pmdepmissing_t *miss)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
ASSERT(miss != NULL, return(NULL));
Index: pacman-lib/lib/libalpm/group.c
diff -u pacman-lib/lib/libalpm/group.c:1.13 pacman-lib/lib/libalpm/group.c:1.14
--- pacman-lib/lib/libalpm/group.c:1.13 Tue Jan 30 02:47:20 2007
+++ pacman-lib/lib/libalpm/group.c Tue Jan 30 03:14:11 2007
@@ -36,6 +36,8 @@
{
pmgrp_t* grp;
+ ALPM_LOG_FUNC;
+
grp = calloc(1, sizeof(pmgrp_t));
if(grp == NULL) {
_alpm_log(PM_LOG_ERROR, _("malloc failure: could not allocate %d bytes"),
@@ -50,6 +52,8 @@
{
pmgrp_t *grp = data;
+ ALPM_LOG_FUNC;
+
if(grp == NULL) {
return;
}
@@ -72,6 +76,8 @@
const char SYMEXPORT *alpm_grp_get_name(pmgrp_t *grp)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(grp != NULL, return(NULL));
@@ -80,6 +86,8 @@
alpm_list_t SYMEXPORT *alpm_grp_get_packages(pmgrp_t *grp)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(grp != NULL, return(NULL));
Index: pacman-lib/lib/libalpm/handle.c
diff -u pacman-lib/lib/libalpm/handle.c:1.29 pacman-lib/lib/libalpm/handle.c:1.30
--- pacman-lib/lib/libalpm/handle.c:1.29 Tue Jan 30 02:47:20 2007
+++ pacman-lib/lib/libalpm/handle.c Tue Jan 30 03:14:11 2007
@@ -85,6 +85,8 @@
int _alpm_handle_free(pmhandle_t *handle)
{
+ ALPM_LOG_FUNC;
+
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
/* close logfiles */
@@ -166,6 +168,8 @@
void alpm_option_set_logfile(const char *logfile)
{
+ ALPM_LOG_FUNC;
+
if(handle->logfile) {
FREE(handle->logfile);
if(handle->logfd) {
Index: pacman-lib/lib/libalpm/log.h
diff -u pacman-lib/lib/libalpm/log.h:1.8 pacman-lib/lib/libalpm/log.h:1.9
--- pacman-lib/lib/libalpm/log.h:1.8 Tue Jan 23 22:02:54 2007
+++ pacman-lib/lib/libalpm/log.h Tue Jan 30 03:14:11 2007
@@ -25,6 +25,13 @@
#define LOG_STR_LEN 1024
+#ifdef PACMAN_DEBUG
+/* Log funtion entry points if debugging is enabled */
+#define ALPM_LOG_FUNC _alpm_log(PM_LOG_FUNCTION, "Enter %s", __func__)
+#else
+#define ALPM_LOG_FUNC
+#endif
+
void _alpm_log(pmloglevel_t flag, char *fmt, ...);
#endif /* _ALPM_LOG_H */
Index: pacman-lib/lib/libalpm/md5driver.c
diff -u pacman-lib/lib/libalpm/md5driver.c:1.4 pacman-lib/lib/libalpm/md5driver.c:1.5
--- pacman-lib/lib/libalpm/md5driver.c:1.4 Thu Jan 18 11:53:00 2007
+++ pacman-lib/lib/libalpm/md5driver.c Tue Jan 30 03:14:11 2007
@@ -23,6 +23,8 @@
#include <stdio.h>
#include <string.h>
#include <libintl.h>
+#include "alpm.h"
+#include "log.h"
#include "util.h"
#include "md5.h"
@@ -43,6 +45,8 @@
int len;
unsigned char buffer[1024], digest[16];
+ ALPM_LOG_FUNC;
+
if((file = fopen(filename, "rb")) == NULL) {
printf (_("%s can't be opened\n"), filename);
} else {
Index: pacman-lib/lib/libalpm/package.c
diff -u pacman-lib/lib/libalpm/package.c:1.52 pacman-lib/lib/libalpm/package.c:1.53
--- pacman-lib/lib/libalpm/package.c:1.52 Tue Jan 30 02:47:20 2007
+++ pacman-lib/lib/libalpm/package.c Tue Jan 30 03:14:11 2007
@@ -44,6 +44,8 @@
{
pmpkg_t* pkg;
+ ALPM_LOG_FUNC;
+
if((pkg = calloc(1,sizeof(pmpkg_t))) == NULL) {
RET_ERR(PM_ERR_MEMORY, NULL);
}
@@ -66,6 +68,8 @@
{
pmpkg_t* newpkg;
+ ALPM_LOG_FUNC;
+
if((newpkg = calloc(1, sizeof(pmpkg_t))) == NULL) {
_alpm_log(PM_LOG_ERROR, _("malloc failure: could not allocate %d bytes"), sizeof(pmpkg_t));
RET_ERR(PM_ERR_MEMORY, NULL);
@@ -93,6 +97,8 @@
{
pmpkg_t *pkg = data;
+ ALPM_LOG_FUNC;
+
if(pkg == NULL) {
return;
}
@@ -136,6 +142,8 @@
char* key = NULL;
int linenum = 0;
+ ALPM_LOG_FUNC;
+
if((fp = fopen(descfile, "r")) == NULL) {
_alpm_log(PM_LOG_ERROR, _("could not open file %s: %s"), descfile, strerror(errno));
return(-1);
@@ -239,6 +247,8 @@
char *descfile = NULL;
int fd = -1;
+ ALPM_LOG_FUNC;
+
if(pkgfile == NULL || strlen(pkgfile) == 0) {
RET_ERR(PM_ERR_WRONG_ARGS, NULL);
}
@@ -375,6 +385,8 @@
{
alpm_list_t *lp;
+ ALPM_LOG_FUNC;
+
if(needle == NULL || haystack == NULL) {
return(NULL);
}
@@ -394,6 +406,8 @@
char tmp[PKG_FULLNAME_LEN+7];
char *p, *q;
+ ALPM_LOG_FUNC;
+
if(target == NULL) {
return(-1);
}
@@ -441,6 +455,8 @@
const char *alpm_pkg_get_filename(pmpkg_t *pkg)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
ASSERT(pkg != NULL, return(NULL));
@@ -477,6 +493,8 @@
const char SYMEXPORT *alpm_pkg_get_desc(pmpkg_t *pkg)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
ASSERT(pkg != NULL, return(NULL));
@@ -489,6 +507,8 @@
const char SYMEXPORT *alpm_pkg_get_url(pmpkg_t *pkg)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
ASSERT(pkg != NULL, return(NULL));
@@ -501,6 +521,8 @@
const char SYMEXPORT *alpm_pkg_get_builddate(pmpkg_t *pkg)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
ASSERT(pkg != NULL, return(NULL));
@@ -525,6 +547,8 @@
const char SYMEXPORT *alpm_pkg_get_installdate(pmpkg_t *pkg)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
ASSERT(pkg != NULL, return(NULL));
@@ -537,6 +561,8 @@
const char SYMEXPORT *alpm_pkg_get_packager(pmpkg_t *pkg)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
ASSERT(pkg != NULL, return(NULL));
@@ -549,6 +575,8 @@
const char SYMEXPORT *alpm_pkg_get_md5sum(pmpkg_t *pkg)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
ASSERT(pkg != NULL, return(NULL));
@@ -561,6 +589,8 @@
const char SYMEXPORT *alpm_pkg_get_sha1sum(pmpkg_t *pkg)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
ASSERT(pkg != NULL, return(NULL));
@@ -573,6 +603,8 @@
const char SYMEXPORT *alpm_pkg_get_arch(pmpkg_t *pkg)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
ASSERT(pkg != NULL, return(NULL));
@@ -585,6 +617,8 @@
unsigned long SYMEXPORT alpm_pkg_get_size(pmpkg_t *pkg)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, return(-1));
ASSERT(pkg != NULL, return(-1));
@@ -597,6 +631,8 @@
unsigned long SYMEXPORT alpm_pkg_get_isize(pmpkg_t *pkg)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, return(-1));
ASSERT(pkg != NULL, return(-1));
@@ -609,6 +645,8 @@
pmpkgreason_t SYMEXPORT alpm_pkg_get_reason(pmpkg_t *pkg)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, return(-1));
ASSERT(pkg != NULL, return(-1));
@@ -621,6 +659,8 @@
alpm_list_t SYMEXPORT *alpm_pkg_get_licenses(pmpkg_t *pkg)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
ASSERT(pkg != NULL, return(NULL));
@@ -633,6 +673,8 @@
alpm_list_t SYMEXPORT *alpm_pkg_get_groups(pmpkg_t *pkg)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
ASSERT(pkg != NULL, return(NULL));
@@ -646,6 +688,8 @@
/* depends */
alpm_list_t SYMEXPORT *alpm_pkg_get_depends(pmpkg_t *pkg)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
ASSERT(pkg != NULL, return(NULL));
@@ -658,6 +702,8 @@
alpm_list_t SYMEXPORT *alpm_pkg_get_removes(pmpkg_t *pkg)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
ASSERT(pkg != NULL, return(NULL));
@@ -670,6 +716,8 @@
alpm_list_t SYMEXPORT *alpm_pkg_get_requiredby(pmpkg_t *pkg)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
ASSERT(pkg != NULL, return(NULL));
@@ -682,6 +730,8 @@
alpm_list_t SYMEXPORT *alpm_pkg_get_conflicts(pmpkg_t *pkg)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
ASSERT(pkg != NULL, return(NULL));
@@ -694,6 +744,8 @@
alpm_list_t SYMEXPORT *alpm_pkg_get_provides(pmpkg_t *pkg)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
ASSERT(pkg != NULL, return(NULL));
@@ -706,6 +758,8 @@
alpm_list_t SYMEXPORT *alpm_pkg_get_replaces(pmpkg_t *pkg)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
ASSERT(pkg != NULL, return(NULL));
@@ -718,6 +772,8 @@
alpm_list_t SYMEXPORT *alpm_pkg_get_files(pmpkg_t *pkg)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
ASSERT(pkg != NULL, return(NULL));
@@ -731,6 +787,8 @@
alpm_list_t SYMEXPORT *alpm_pkg_get_backup(pmpkg_t *pkg)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
ASSERT(pkg != NULL, return(NULL));
@@ -744,6 +802,8 @@
unsigned short SYMEXPORT alpm_pkg_has_scriptlet(pmpkg_t *pkg)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(handle != NULL, return(-1));
ASSERT(pkg != NULL, return(-1));
Index: pacman-lib/lib/libalpm/provide.c
diff -u pacman-lib/lib/libalpm/provide.c:1.9 pacman-lib/lib/libalpm/provide.c:1.10
--- pacman-lib/lib/libalpm/provide.c:1.9 Mon Jan 29 22:46:33 2007
+++ pacman-lib/lib/libalpm/provide.c Tue Jan 30 03:14:11 2007
@@ -26,6 +26,7 @@
#include "cache.h"
#include "alpm_list.h"
#include "db.h"
+#include "log.h"
#include "provide.h"
/* return a alpm_list_t of packages in "db" that provide "package"
@@ -35,6 +36,8 @@
alpm_list_t *pkgs = NULL;
alpm_list_t *lp;
+ ALPM_LOG_FUNC;
+
if(db == NULL || package == NULL || strlen(package) == 0) {
return(NULL);
}
Index: pacman-lib/lib/libalpm/remove.c
diff -u pacman-lib/lib/libalpm/remove.c:1.58 pacman-lib/lib/libalpm/remove.c:1.59
--- pacman-lib/lib/libalpm/remove.c:1.58 Mon Jan 29 22:46:33 2007
+++ pacman-lib/lib/libalpm/remove.c Tue Jan 30 03:14:11 2007
@@ -63,6 +63,8 @@
{
pmpkg_t *info;
+ ALPM_LOG_FUNC;
+
ASSERT(db != NULL, RET_ERR(PM_ERR_DB_NULL, -1));
ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1));
ASSERT(name != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1));
@@ -97,6 +99,8 @@
{
alpm_list_t *lp;
+ ALPM_LOG_FUNC;
+
ASSERT(db != NULL, RET_ERR(PM_ERR_DB_NULL, -1));
ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1));
@@ -171,6 +175,8 @@
char line[PATH_MAX+1];
char *checksum = _alpm_needbackup(lp->data, info->backup);
+ ALPM_LOG_FUNC;
+
if ( *position != 0 ) {
percent = (double)*position / filenum;
} if ( checksum ) {
@@ -240,6 +246,8 @@
pmpkg_t *info;
alpm_list_t *targ, *lp;
+ ALPM_LOG_FUNC;
+
ASSERT(db != NULL, RET_ERR(PM_ERR_DB_NULL, -1));
ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1));
Index: pacman-lib/lib/libalpm/server.c
diff -u pacman-lib/lib/libalpm/server.c:1.17 pacman-lib/lib/libalpm/server.c:1.18
--- pacman-lib/lib/libalpm/server.c:1.17 Mon Jan 29 22:46:33 2007
+++ pacman-lib/lib/libalpm/server.c Tue Jan 30 03:14:11 2007
@@ -43,6 +43,8 @@
struct url *u;
pmserver_t *server;
+ ALPM_LOG_FUNC;
+
server = (pmserver_t *)malloc(sizeof(pmserver_t));
if(server == NULL) {
_alpm_log(PM_LOG_ERROR, _("malloc failure: could not allocate %d bytes"), sizeof(pmserver_t));
@@ -78,6 +80,8 @@
{
pmserver_t *server = data;
+ ALPM_LOG_FUNC;
+
if(server == NULL) {
return;
}
@@ -96,6 +100,7 @@
*/
int _alpm_downloadfiles(alpm_list_t *servers, const char *localpath, alpm_list_t *files)
{
+ ALPM_LOG_FUNC;
return(_alpm_downloadfiles_forreal(servers, localpath, files, NULL, NULL));
}
@@ -121,6 +126,8 @@
alpm_list_t *complete = NULL;
alpm_list_t *i;
+ ALPM_LOG_FUNC;
+
if(files == NULL) {
return(0);
}
@@ -324,6 +331,8 @@
struct stat st;
struct url *s_url;
+ ALPM_LOG_FUNC;
+
s_url = downloadParseURL(target);
if(!s_url) {
_alpm_log(PM_LOG_ERROR, _("url '%s' is invalid, ignoring"), target);
Index: pacman-lib/lib/libalpm/sha1.c
diff -u pacman-lib/lib/libalpm/sha1.c:1.3 pacman-lib/lib/libalpm/sha1.c:1.4
--- pacman-lib/lib/libalpm/sha1.c:1.3 Thu Jan 18 11:53:01 2007
+++ pacman-lib/lib/libalpm/sha1.c Tue Jan 30 03:14:11 2007
@@ -27,6 +27,8 @@
#endif
#include <libintl.h>
+#include "alpm.h"
+#include "log.h"
#include "util.h"
#include "sha1.h"
@@ -390,6 +392,8 @@
unsigned char buffer[1024], digest[20];
char *ret;
+ ALPM_LOG_FUNC;
+
if((file = fopen(filename, "rb")) == NULL) {
fprintf(stderr, _("%s can't be opened\n"), filename);
} else {
Index: pacman-lib/lib/libalpm/sync.c
diff -u pacman-lib/lib/libalpm/sync.c:1.94 pacman-lib/lib/libalpm/sync.c:1.95
--- pacman-lib/lib/libalpm/sync.c:1.94 Tue Jan 30 02:47:20 2007
+++ pacman-lib/lib/libalpm/sync.c Tue Jan 30 03:14:11 2007
@@ -59,6 +59,8 @@
{
pmsyncpkg_t *sync;
+ ALPM_LOG_FUNC;
+
if((sync = (pmsyncpkg_t *)malloc(sizeof(pmsyncpkg_t))) == NULL) {
_alpm_log(PM_LOG_ERROR, _("malloc failure: could not allocate %d bytes"), sizeof(pmsyncpkg_t));
return(NULL);
@@ -75,6 +77,8 @@
{
pmsyncpkg_t *sync = data;
+ ALPM_LOG_FUNC;
+
if(sync == NULL) {
return;
}
@@ -96,6 +100,8 @@
pmsyncpkg_t *sync = NULL;
int found = 0;
+ ALPM_LOG_FUNC;
+
for(i = haystack; i && !found; i = i->next) {
sync = i->data;
if(sync && !strcmp(sync->pkg->name, needle)) {
@@ -112,6 +118,9 @@
static int istoonew(pmpkg_t *pkg)
{
time_t t;
+
+ ALPM_LOG_FUNC;
+
if (!handle->upgradedelay)
return 0;
time(&t);
@@ -126,6 +135,8 @@
{
alpm_list_t *i, *j, *k;
+ ALPM_LOG_FUNC;
+
/* check for "recommended" package replacements */
_alpm_log(PM_LOG_FLOW1, _("checking for package replacements"));
for(i = dbs_sync; i; i = i->next) {
@@ -191,6 +202,8 @@
{
alpm_list_t *i, *j;
+ ALPM_LOG_FUNC;
+
/* check for "recommended" package replacements */
_alpm_log(PM_LOG_FLOW1, _("checking for package replacements"));
if( find_replacements(trans, db_local, dbs_sync) == 0 ) {
@@ -281,6 +294,8 @@
pmsyncpkg_t *sync;
int cmp, repo_found = 0;
+ ALPM_LOG_FUNC;
+
ASSERT(db_local != NULL, RET_ERR(PM_ERR_DB_NULL, -1));
ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1));
ASSERT(name != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1));
@@ -403,6 +418,8 @@
alpm_list_t *i, *j, *k, *l;
int ret = 0;
+ ALPM_LOG_FUNC;
+
ASSERT(db_local != NULL, RET_ERR(PM_ERR_DB_NULL, -1));
ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1));
@@ -788,6 +805,8 @@
char ldir[PATH_MAX];
int varcache = 1;
+ ALPM_LOG_FUNC;
+
ASSERT(db_local != NULL, RET_ERR(PM_ERR_DB_NULL, -1));
ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1));
Index: pacman-lib/lib/libalpm/trans.c
diff -u pacman-lib/lib/libalpm/trans.c:1.33 pacman-lib/lib/libalpm/trans.c:1.34
--- pacman-lib/lib/libalpm/trans.c:1.33 Tue Jan 30 02:47:20 2007
+++ pacman-lib/lib/libalpm/trans.c Tue Jan 30 03:14:11 2007
@@ -43,6 +43,8 @@
{
pmtrans_t *trans;
+ ALPM_LOG_FUNC;
+
if((trans = (pmtrans_t *)malloc(sizeof(pmtrans_t))) == NULL) {
_alpm_log(PM_LOG_ERROR, _("malloc failure: could not allocate %d bytes"), sizeof(pmtrans_t));
return(NULL);
@@ -65,6 +67,8 @@
{
pmtrans_t *trans = data;
+ ALPM_LOG_FUNC;
+
if(trans == NULL) {
return;
}
@@ -89,6 +93,8 @@
alpm_trans_cb_event event, alpm_trans_cb_conv conv,
alpm_trans_cb_progress progress)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1));
@@ -104,6 +110,8 @@
int _alpm_trans_sysupgrade(pmtrans_t *trans)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1));
@@ -112,6 +120,8 @@
int _alpm_trans_addtarget(pmtrans_t *trans, char *target)
{
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1));
ASSERT(target != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1));
@@ -151,6 +161,8 @@
{
*data = NULL;
+ ALPM_LOG_FUNC;
+
/* Sanity checks */
ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1));
@@ -188,6 +200,8 @@
int _alpm_trans_commit(pmtrans_t *trans, alpm_list_t **data)
{
+ ALPM_LOG_FUNC;
+
if(data!=NULL)
*data = NULL;
Index: pacman-lib/lib/libalpm/util.c
diff -u pacman-lib/lib/libalpm/util.c:1.42 pacman-lib/lib/libalpm/util.c:1.43
--- pacman-lib/lib/libalpm/util.c:1.42 Tue Jan 30 00:41:13 2007
+++ pacman-lib/lib/libalpm/util.c Tue Jan 30 03:14:11 2007
@@ -266,6 +266,8 @@
struct archive_entry *entry;
char expath[PATH_MAX];
+ ALPM_LOG_FUNC;
+
if((_archive = archive_read_new()) == NULL)
RET_ERR(PM_ERR_LIBARCHIVE_ERROR, -1);
@@ -422,6 +424,8 @@
pid_t pid;
int retval = 0;
+ ALPM_LOG_FUNC;
+
if(stat(installfn, &buf)) {
/* not found */
return(0);
@@ -569,6 +573,8 @@
alpm_list_t *i;
long long pkgsize=0, freespace;
+ ALPM_LOG_FUNC;
+
for(i = trans->packages; i; i = i->next) {
if(trans->type == PM_TRANS_TYPE_SYNC)
{
Index: pacman-lib/lib/libalpm/versioncmp.c
diff -u pacman-lib/lib/libalpm/versioncmp.c:1.11 pacman-lib/lib/libalpm/versioncmp.c:1.12
--- pacman-lib/lib/libalpm/versioncmp.c:1.11 Tue Jan 30 02:47:20 2007
+++ pacman-lib/lib/libalpm/versioncmp.c Tue Jan 30 03:14:11 2007
@@ -158,6 +158,8 @@
int is1num, is2num;
int rc;
+ ALPM_LOG_FUNC;
+
if(!strcmp(a,b)) {
return(0);
}
@@ -247,6 +249,8 @@
{
int equal = 0;
+ ALPM_LOG_FUNC;
+
if(strcmp(pkg->name, dep->name) == 0
|| alpm_list_find_str(pkg->provides, dep->name)) {
if(dep->mod == PM_DEP_MOD_ANY) {
1
0
All,
Here's a patch that implements symbol exporting/hiding for libalpm. It
takes a "hide all" approach but mark the functions and variables to be
exported. Otherwise every variable would have to be marked as hidden.
There's only one "private" function _alpm_versioncmp thatneeds to be
exported for the vercmp utility so it should probably be renamed.
k
--
K. Piche <kpiche(a)rogers.com>
2
1
Date: Tuesday, January 30, 2007 @ 02:47:20
Author: aaron
Path: /home/cvs-pacman/pacman-lib
Modified: doc/po/hu.po (1.5 -> 1.6) doc/po/pacman.pot (1.5 -> 1.6)
lib/libalpm/add.c (1.105 -> 1.106)
lib/libalpm/alpm.c (1.107 -> 1.108)
lib/libalpm/alpm.h (1.67 -> 1.68)
lib/libalpm/alpm_list.c (1.5 -> 1.6)
lib/libalpm/conflict.c (1.32 -> 1.33)
lib/libalpm/db.c (1.56 -> 1.57) lib/libalpm/deps.c (1.61 -> 1.62)
lib/libalpm/error.c (1.15 -> 1.16)
lib/libalpm/group.c (1.12 -> 1.13)
lib/libalpm/handle.c (1.28 -> 1.29)
lib/libalpm/package.c (1.51 -> 1.52)
lib/libalpm/sync.c (1.93 -> 1.94)
lib/libalpm/trans.c (1.32 -> 1.33)
lib/libalpm/util.h (1.19 -> 1.20)
lib/libalpm/versioncmp.c (1.10 -> 1.11)
lib/libalpm/versioncmp.h (1.5 -> 1.6)
src/util/vercmp.c (1.5 -> 1.6)
K. Piche <kpiche(a)rogers.com>
* gcc visiblity changes
Also modified _alpm_versioncmp -> alpm_versioncmp (public function) as per K.
Piche's suggestions
--------------------------+
doc/po/hu.po | 25 ++--
doc/po/pacman.pot | 273 ++++++++++++++++++++++-----------------------
lib/libalpm/add.c | 6
lib/libalpm/alpm.c | 54 ++++----
lib/libalpm/alpm.h | 3
lib/libalpm/alpm_list.c | 16 +-
lib/libalpm/conflict.c | 8 -
lib/libalpm/db.c | 2
lib/libalpm/deps.c | 10 -
lib/libalpm/error.c | 2
lib/libalpm/group.c | 4
lib/libalpm/handle.c | 22 +--
lib/libalpm/package.c | 50 ++++----
lib/libalpm/sync.c | 10 -
lib/libalpm/trans.c | 4
lib/libalpm/util.h | 4
lib/libalpm/versioncmp.c | 6
lib/libalpm/versioncmp.h | 1
src/util/vercmp.c | 4
19 files changed, 258 insertions(+), 246 deletions(-)
Index: pacman-lib/doc/po/hu.po
diff -u pacman-lib/doc/po/hu.po:1.5 pacman-lib/doc/po/hu.po:1.6
--- pacman-lib/doc/po/hu.po:1.5 Fri Dec 22 14:38:55 2006
+++ pacman-lib/doc/po/hu.po Tue Jan 30 02:47:19 2007
@@ -5,7 +5,7 @@
msgstr ""
"Project-Id-Version: pacman\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2006-12-23 1:35-0600\n"
+"POT-Creation-Date: 2007-01-30 13:43-0600\n"
"PO-Revision-Date: 2006-08-26 14:53+0200\n"
"Last-Translator: Hungarian <frugalware-devel(a)frugalware.org>\n"
"Language-Team: Hungarian <frugalware-devel(a)frugalware.org>\n"
@@ -872,7 +872,7 @@
msgstr ""
# type: Plain text
-#: pacman.8:308
+#: pacman.8:311
msgid ""
"Each repository section defines a section name and at least one location "
"where the packages can be found. The section name is defined by the string "
@@ -880,17 +880,20 @@
"Locations are defined with the I<Server> directive and follow a URL naming "
"structure. Currently only ftp is supported for remote servers. If you want "
"to use a local directory, you can specify the full path with a 'file://' "
-"prefix, as shown above."
+"prefix, as shown above. The order of repositories in the file matters; "
+"repositories listed first will take precidence over those listed later in "
+"the file when packages in two repositories have identical names, regardless "
+"of version number."
msgstr ""
# type: SH
-#: pacman.8:308
+#: pacman.8:311
#, no-wrap
msgid "USING YOUR OWN REPOSITORY"
msgstr ""
# type: Plain text
-#: pacman.8:312
+#: pacman.8:315
msgid ""
"Let's say you have a bunch of custom packages in I</home/pkgs> and their "
"respective PKGBUILD files are all in I</var/abs/local>. All you need to do "
@@ -899,13 +902,13 @@
msgstr ""
# type: Plain text
-#: pacman.8:316
+#: pacman.8:319
#, no-wrap
msgid "# gensync /var/abs/local /home/pkgs/custom.db.tar.gz\n"
msgstr ""
# type: Plain text
-#: pacman.8:326
+#: pacman.8:329
msgid ""
"The above command will read all PKGBUILD files in /var/abs/local and "
"generate a compressed database called /home/pkgs/custom.db.tar.gz. Note "
@@ -918,24 +921,24 @@
msgstr ""
# type: SH
-#: pacman.8:326 makepkg.8:447 PKGBUILD.8:453
+#: pacman.8:329 makepkg.8:447 PKGBUILD.8:453
#, no-wrap
msgid "SEE ALSO"
msgstr "LÁSD MÉG"
# type: Plain text
-#: pacman.8:328
+#: pacman.8:331
msgid "B<makepkg> is the package-building tool that comes with pacman."
msgstr ""
# type: SH
-#: pacman.8:328 makepkg.8:452 PKGBUILD.8:456
+#: pacman.8:331 makepkg.8:452 PKGBUILD.8:456
#, no-wrap
msgid "AUTHOR"
msgstr "SZERZÕ"
# type: Plain text
-#: pacman.8:331 makepkg.8:455
+#: pacman.8:334 makepkg.8:455
#, no-wrap
msgid "Judd Vinet E<lt>jvinet(a)zeroflux.orgE<gt>\n"
msgstr ""
Index: pacman-lib/doc/po/pacman.pot
diff -u pacman-lib/doc/po/pacman.pot:1.5 pacman-lib/doc/po/pacman.pot:1.6
--- pacman-lib/doc/po/pacman.pot:1.5 Fri Dec 22 14:38:55 2006
+++ pacman-lib/doc/po/pacman.pot Tue Jan 30 02:47:19 2007
@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2006-12-23 1:35-0600\n"
+"POT-Creation-Date: 2007-01-30 13:43-0600\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL(a)li.org>\n"
@@ -33,7 +33,7 @@
msgstr ""
# type: SH
-#: pacman.8:2 makepkg.8:2 PKGBUILD.8:2
+#: pacman.8:2 makepkg.8:2 ./PKGBUILD.8:2
#, no-wrap
msgid "NAME"
msgstr ""
@@ -55,7 +55,7 @@
msgstr ""
# type: SH
-#: pacman.8:6 makepkg.8:6 PKGBUILD.8:4
+#: pacman.8:6 makepkg.8:6 ./PKGBUILD.8:4
#, no-wrap
msgid "DESCRIPTION"
msgstr ""
@@ -873,7 +873,7 @@
msgstr ""
# type: Plain text
-#: pacman.8:308
+#: pacman.8:311
msgid ""
"Each repository section defines a section name and at least one location "
"where the packages can be found. The section name is defined by the string "
@@ -881,17 +881,20 @@
"Locations are defined with the I<Server> directive and follow a URL naming "
"structure. Currently only ftp is supported for remote servers. If you want "
"to use a local directory, you can specify the full path with a 'file://' "
-"prefix, as shown above."
+"prefix, as shown above. The order of repositories in the file matters; "
+"repositories listed first will take precidence over those listed later in "
+"the file when packages in two repositories have identical names, regardless "
+"of version number."
msgstr ""
# type: SH
-#: pacman.8:308
+#: pacman.8:311
#, no-wrap
msgid "USING YOUR OWN REPOSITORY"
msgstr ""
# type: Plain text
-#: pacman.8:312
+#: pacman.8:315
msgid ""
"Let's say you have a bunch of custom packages in I</home/pkgs> and their "
"respective PKGBUILD files are all in I</var/abs/local>. All you need to do "
@@ -900,13 +903,13 @@
msgstr ""
# type: Plain text
-#: pacman.8:316
+#: pacman.8:319
#, no-wrap
msgid "# gensync /var/abs/local /home/pkgs/custom.db.tar.gz\n"
msgstr ""
# type: Plain text
-#: pacman.8:326
+#: pacman.8:329
msgid ""
"The above command will read all PKGBUILD files in /var/abs/local and "
"generate a compressed database called /home/pkgs/custom.db.tar.gz. Note "
@@ -919,24 +922,24 @@
msgstr ""
# type: SH
-#: pacman.8:326 makepkg.8:447 PKGBUILD.8:453
+#: pacman.8:329 makepkg.8:447 ./PKGBUILD.8:453
#, no-wrap
msgid "SEE ALSO"
msgstr ""
# type: Plain text
-#: pacman.8:328
+#: pacman.8:331
msgid "B<makepkg> is the package-building tool that comes with pacman."
msgstr ""
# type: SH
-#: pacman.8:328 makepkg.8:452 PKGBUILD.8:456
+#: pacman.8:331 makepkg.8:452 ./PKGBUILD.8:456
#, no-wrap
msgid "AUTHOR"
msgstr ""
# type: Plain text
-#: pacman.8:331 makepkg.8:455
+#: pacman.8:334 makepkg.8:455
#, no-wrap
msgid "Judd Vinet E<lt>jvinet(a)zeroflux.orgE<gt>\n"
msgstr ""
@@ -1013,7 +1016,7 @@
msgstr ""
# type: SH
-#: makepkg.8:30 PKGBUILD.8:11
+#: makepkg.8:30 ./PKGBUILD.8:11
#, no-wrap
msgid "PKGBUILD Example:"
msgstr ""
@@ -1161,13 +1164,13 @@
msgstr ""
# type: SH
-#: makepkg.8:116 PKGBUILD.8:121
+#: makepkg.8:116 ./PKGBUILD.8:121
#, no-wrap
msgid "Install/Upgrade/Remove Scripting"
msgstr ""
# type: Plain text
-#: makepkg.8:120 PKGBUILD.8:125
+#: makepkg.8:120 ./PKGBUILD.8:125
msgid ""
"Pacman has the ability to store and execute a package-specific script when "
"it installs, removes, or upgrades a package. This allows a package to "
@@ -1176,73 +1179,73 @@
msgstr ""
# type: Plain text
-#: makepkg.8:122 PKGBUILD.8:127
+#: makepkg.8:122 ./PKGBUILD.8:127
msgid "The exact time the script is run varies with each operation:"
msgstr ""
# type: TP
-#: makepkg.8:122 PKGBUILD.8:127
+#: makepkg.8:122 ./PKGBUILD.8:127
#, no-wrap
msgid "B<pre_install>"
msgstr ""
# type: Plain text
-#: makepkg.8:125 makepkg.8:133 PKGBUILD.8:130 PKGBUILD.8:138
+#: makepkg.8:125 makepkg.8:133 ./PKGBUILD.8:130 ./PKGBUILD.8:138
msgid "script is run right before files are extracted."
msgstr ""
# type: TP
-#: makepkg.8:126 PKGBUILD.8:131
+#: makepkg.8:126 ./PKGBUILD.8:131
#, no-wrap
msgid "B<post_install>"
msgstr ""
# type: Plain text
-#: makepkg.8:129 PKGBUILD.8:134
+#: makepkg.8:129 ./PKGBUILD.8:134
msgid "script is run right after files are extracted."
msgstr ""
# type: TP
-#: makepkg.8:130 PKGBUILD.8:135
+#: makepkg.8:130 ./PKGBUILD.8:135
#, no-wrap
msgid "B<pre_upgrade>"
msgstr ""
# type: TP
-#: makepkg.8:134 PKGBUILD.8:139
+#: makepkg.8:134 ./PKGBUILD.8:139
#, no-wrap
msgid "B<post_upgrade>"
msgstr ""
# type: Plain text
-#: makepkg.8:137 PKGBUILD.8:142
+#: makepkg.8:137 ./PKGBUILD.8:142
msgid "script is run after files are extracted."
msgstr ""
# type: TP
-#: makepkg.8:138 PKGBUILD.8:143
+#: makepkg.8:138 ./PKGBUILD.8:143
#, no-wrap
msgid "B<pre_remove>"
msgstr ""
# type: Plain text
-#: makepkg.8:141 PKGBUILD.8:146
+#: makepkg.8:141 ./PKGBUILD.8:146
msgid "script is run right before files are removed."
msgstr ""
# type: TP
-#: makepkg.8:142 PKGBUILD.8:147
+#: makepkg.8:142 ./PKGBUILD.8:147
#, no-wrap
msgid "B<post_remove>"
msgstr ""
# type: Plain text
-#: makepkg.8:145 PKGBUILD.8:150
+#: makepkg.8:145 ./PKGBUILD.8:150
msgid "script is run right after files are removed."
msgstr ""
# type: Plain text
-#: makepkg.8:149 PKGBUILD.8:154
+#: makepkg.8:149 ./PKGBUILD.8:154
msgid ""
"To use this feature, just create a file (eg, pkgname.install) and put it in "
"the same directory as the PKGBUILD script. Then use the I<install> "
@@ -1250,7 +1253,7 @@
msgstr ""
# type: Plain text
-#: makepkg.8:152 PKGBUILD.8:157
+#: makepkg.8:152 ./PKGBUILD.8:157
#, no-wrap
msgid "install=pkgname.install\n"
msgstr ""
@@ -1361,37 +1364,37 @@
msgstr ""
# type: SH
-#: makepkg.8:220 PKGBUILD.8:179
+#: makepkg.8:220 ./PKGBUILD.8:179
#, no-wrap
msgid "PKGBUILD Directives"
msgstr ""
# type: TP
-#: makepkg.8:221 PKGBUILD.8:180
+#: makepkg.8:221 ./PKGBUILD.8:180
#, no-wrap
msgid "B<pkgname>"
msgstr ""
# type: Plain text
-#: makepkg.8:225 PKGBUILD.8:184
+#: makepkg.8:225 ./PKGBUILD.8:184
msgid ""
"The name of the package. This has be a unix-friendly name as it will be "
"used in the package filename."
msgstr ""
# type: TP
-#: makepkg.8:226 PKGBUILD.8:185
+#: makepkg.8:226 ./PKGBUILD.8:185
#, no-wrap
msgid "B<pkgver>"
msgstr ""
# type: Plain text
-#: makepkg.8:229 PKGBUILD.8:188
+#: makepkg.8:229 ./PKGBUILD.8:188
msgid "This is the version of the software as released from the author (eg, 2.7.1)."
msgstr ""
# type: TP
-#: makepkg.8:230 PKGBUILD.8:189
+#: makepkg.8:230 ./PKGBUILD.8:189
#, no-wrap
msgid "B<pkgrel>"
msgstr ""
@@ -1402,13 +1405,13 @@
msgstr ""
# type: TP
-#: makepkg.8:234 PKGBUILD.8:193
+#: makepkg.8:234 ./PKGBUILD.8:193
#, no-wrap
msgid "B<pkgdesc>"
msgstr ""
# type: Plain text
-#: makepkg.8:237 PKGBUILD.8:196
+#: makepkg.8:237 ./PKGBUILD.8:196
msgid "This should be a brief description of the package and its functionality."
msgstr ""
@@ -1467,20 +1470,20 @@
msgstr ""
# type: TP
-#: makepkg.8:260 PKGBUILD.8:204
+#: makepkg.8:260 ./PKGBUILD.8:204
#, no-wrap
msgid "B<url>"
msgstr ""
# type: Plain text
-#: makepkg.8:264 PKGBUILD.8:208
+#: makepkg.8:264 ./PKGBUILD.8:208
msgid ""
"This field contains an optional URL that is associated with the piece of "
"software being packaged. This is typically the project's website."
msgstr ""
# type: TP
-#: makepkg.8:265 PKGBUILD.8:209
+#: makepkg.8:265 ./PKGBUILD.8:209
#, no-wrap
msgid "B<license>"
msgstr ""
@@ -1507,13 +1510,13 @@
msgstr ""
# type: TP
-#: makepkg.8:279 PKGBUILD.8:214
+#: makepkg.8:279 ./PKGBUILD.8:214
#, no-wrap
msgid "B<install>"
msgstr ""
# type: Plain text
-#: makepkg.8:285 PKGBUILD.8:220
+#: makepkg.8:285 ./PKGBUILD.8:220
msgid ""
"Specifies a special install script that is to be included in the package. "
"This file should reside in the same directory as the PKGBUILD, and will be "
@@ -1522,13 +1525,13 @@
msgstr ""
# type: TP
-#: makepkg.8:286 PKGBUILD.8:227
+#: makepkg.8:286 ./PKGBUILD.8:227
#, no-wrap
msgid "B<source >I<(array)>"
msgstr ""
# type: Plain text
-#: makepkg.8:293 PKGBUILD.8:234
+#: makepkg.8:293 ./PKGBUILD.8:234
msgid ""
"The I<source> line is an array of source files required to build the "
"package. Source files must reside in the same directory as the PKGBUILD "
@@ -1537,7 +1540,7 @@
msgstr ""
# type: TP
-#: makepkg.8:294 PKGBUILD.8:235
+#: makepkg.8:294 ./PKGBUILD.8:235
#, no-wrap
msgid "B<md5sums >I<(array)>"
msgstr ""
@@ -1554,13 +1557,13 @@
msgstr ""
# type: TP
-#: makepkg.8:303 PKGBUILD.8:261
+#: makepkg.8:303 ./PKGBUILD.8:261
#, no-wrap
msgid "B<groups >I<(array)>"
msgstr ""
# type: Plain text
-#: makepkg.8:308 PKGBUILD.8:266
+#: makepkg.8:308 ./PKGBUILD.8:266
msgid ""
"This is an array of symbolic names that represent groups of packages, "
"allowing you to install multiple packages by requesting a single target. "
@@ -1569,13 +1572,13 @@
msgstr ""
# type: TP
-#: makepkg.8:309 PKGBUILD.8:273
+#: makepkg.8:309 ./PKGBUILD.8:273
#, no-wrap
msgid "B<backup >I<(array)>"
msgstr ""
# type: Plain text
-#: makepkg.8:316 PKGBUILD.8:280
+#: makepkg.8:316 ./PKGBUILD.8:280
msgid ""
"A space-delimited array of filenames (without a preceding slash). The "
"I<backup> line will be propagated to the package meta-info file for pacman. "
@@ -1585,13 +1588,13 @@
msgstr ""
# type: TP
-#: makepkg.8:317 PKGBUILD.8:281
+#: makepkg.8:317 ./PKGBUILD.8:281
#, no-wrap
msgid "B<depends >I<(array)>"
msgstr ""
# type: Plain text
-#: makepkg.8:325 PKGBUILD.8:289
+#: makepkg.8:325 ./PKGBUILD.8:289
msgid ""
"An array of packages that this package depends on to build and run. "
"Packages in this list should be surrounded with single quotes and contain at "
@@ -1603,26 +1606,26 @@
msgstr ""
# type: TP
-#: makepkg.8:326 PKGBUILD.8:290
+#: makepkg.8:326 ./PKGBUILD.8:290
#, no-wrap
msgid "B<makedepends >I<(array)>"
msgstr ""
# type: Plain text
-#: makepkg.8:330 PKGBUILD.8:294
+#: makepkg.8:330 ./PKGBUILD.8:294
msgid ""
"An array of packages that this package depends on to build (ie, not required "
"to run). Packages in this list should follow the same format as I<depends>."
msgstr ""
# type: TP
-#: makepkg.8:331 PKGBUILD.8:303
+#: makepkg.8:331 ./PKGBUILD.8:303
#, no-wrap
msgid "B<conflicts >I<(array)>"
msgstr ""
# type: Plain text
-#: makepkg.8:336 PKGBUILD.8:308
+#: makepkg.8:336 ./PKGBUILD.8:308
msgid ""
"An array of packages that will conflict with this package (ie, they cannot "
"both be installed at the same time). This directive follows the same format "
@@ -1630,13 +1633,13 @@
msgstr ""
# type: TP
-#: makepkg.8:337 PKGBUILD.8:309
+#: makepkg.8:337 ./PKGBUILD.8:309
#, no-wrap
msgid "B<provides >I<(array)>"
msgstr ""
# type: Plain text
-#: makepkg.8:343 PKGBUILD.8:315
+#: makepkg.8:343 ./PKGBUILD.8:315
msgid ""
"An array of \"virtual provisions\" that this package provides. This allows "
"a package to provide dependency names other than it's own package name. For "
@@ -1646,13 +1649,13 @@
msgstr ""
# type: TP
-#: makepkg.8:344 PKGBUILD.8:316
+#: makepkg.8:344 ./PKGBUILD.8:316
#, no-wrap
msgid "B<replaces >I<(array)>"
msgstr ""
# type: Plain text
-#: makepkg.8:350 PKGBUILD.8:322
+#: makepkg.8:350 ./PKGBUILD.8:322
msgid ""
"This is an array of packages that this package should replace, and can be "
"used to handle renamed/combined packages. For example, if the kernel "
@@ -1930,30 +1933,30 @@
msgstr ""
# type: TH
-#: PKGBUILD.8:1
+#: ./PKGBUILD.8:1
#, no-wrap
msgid "PKGBUILD"
msgstr ""
# type: TH
-#: PKGBUILD.8:1
+#: ./PKGBUILD.8:1
#, no-wrap
msgid "June 13, 2006"
msgstr ""
# type: TH
-#: PKGBUILD.8:1
+#: ./PKGBUILD.8:1
#, no-wrap
msgid "Archlinux Developer Manual"
msgstr ""
# type: Plain text
-#: PKGBUILD.8:4
+#: ./PKGBUILD.8:4
msgid "PKGBUILD - Archlinux package builder descriptor"
msgstr ""
# type: Plain text
-#: PKGBUILD.8:8
+#: ./PKGBUILD.8:8
msgid ""
"This manual page is meant to describe general rules about PKGBUILDs. If "
"you're interested in the package builder B<makepkg> itself, then see its "
@@ -1961,7 +1964,7 @@
msgstr ""
# type: Plain text
-#: PKGBUILD.8:17
+#: ./PKGBUILD.8:17
#, no-wrap
msgid ""
"# Last Modified: Sun, 19 Jun 2005 15:24:32 +0000\n"
@@ -1970,7 +1973,7 @@
msgstr ""
# type: Plain text
-#: PKGBUILD.8:27
+#: ./PKGBUILD.8:27
#, no-wrap
msgid ""
"pkgname=dvdauthor\n"
@@ -1985,27 +1988,27 @@
msgstr ""
# type: Plain text
-#: PKGBUILD.8:29
+#: ./PKGBUILD.8:29
#, no-wrap
msgid "# optimization OK\n"
msgstr ""
# type: Plain text
-#: PKGBUILD.8:34
+#: ./PKGBUILD.8:34
msgid ""
"As you can see, the setup is fairly simple. The first line tracks the time "
"of the last update, this is automatically updated after a successful build."
msgstr ""
# type: Plain text
-#: PKGBUILD.8:37
+#: ./PKGBUILD.8:37
msgid ""
"The next line defines its build time. Of course, it depends on your "
"hardware, so we use SBUs instead of minutes as a unit."
msgstr ""
# type: Plain text
-#: PKGBUILD.8:41
+#: ./PKGBUILD.8:41
msgid ""
"SBU is the Static Binutils Unit, which means the time \"repoman merge "
"binutils\" takes on your machine. By default makepkg will print out how many "
@@ -2014,12 +2017,12 @@
msgstr ""
# type: Plain text
-#: PKGBUILD.8:43
+#: ./PKGBUILD.8:43
msgid "SBU=\"257\""
msgstr ""
# type: Plain text
-#: PKGBUILD.8:47
+#: ./PKGBUILD.8:47
msgid ""
"The line above means compiling binutils on your machine took 257 seconds. "
"Starting from this point, makepkg will print out SBUs instead of seconds "
@@ -2028,7 +2031,7 @@
msgstr ""
# type: Plain text
-#: PKGBUILD.8:53
+#: ./PKGBUILD.8:53
msgid ""
"If you wish to maintain the package, write your name or nick and e-mail "
"address to the third line. If you don't plan to maintain the package just "
@@ -2039,7 +2042,7 @@
msgstr ""
# type: Plain text
-#: PKGBUILD.8:61
+#: ./PKGBUILD.8:61
msgid ""
"pkgname defines the package name. It should not contain any uppercase "
"letters. The package version defines the upstream version, while the "
@@ -2052,14 +2055,14 @@
msgstr ""
# type: Plain text
-#: PKGBUILD.8:64
+#: ./PKGBUILD.8:64
msgid ""
"pkgdesc is a short one-line description for the package. Usually taken from "
"the project's homepage or manpage. Try to keep the lenght under 80 chars."
msgstr ""
# type: Plain text
-#: PKGBUILD.8:69
+#: ./PKGBUILD.8:69
msgid ""
"depends() is a bash array which defines the dependencies of the package. "
"depends() means the other package is required for building and using the "
@@ -2068,7 +2071,7 @@
msgstr ""
# type: Plain text
-#: PKGBUILD.8:78
+#: ./PKGBUILD.8:78
msgid ""
"The next line is a special Finclude commands which allows you to inherit any "
"directive from a PKGBUILD scheme. They can be found in the FST, under "
@@ -2081,7 +2084,7 @@
msgstr ""
# type: Plain text
-#: PKGBUILD.8:82
+#: ./PKGBUILD.8:82
msgid ""
"The groups() array's first element can't be omitted, and it should be a "
"valid \"first group\". This means it should be in a foo or foo-extra format, "
@@ -2089,7 +2092,7 @@
msgstr ""
# type: Plain text
-#: PKGBUILD.8:90
+#: ./PKGBUILD.8:90
msgid ""
"The archs() array defines for which architectures the given package is "
"available. If it's not available, it means that gensync will skip it when "
@@ -2102,7 +2105,7 @@
msgstr ""
# type: Plain text
-#: PKGBUILD.8:95
+#: ./PKGBUILD.8:95
msgid ""
"The sha1sums() array can be generated with the makepkg -g command. Its "
"purpose is to prevent compiling from wrong sources, especially when the "
@@ -2111,7 +2114,7 @@
msgstr ""
# type: Plain text
-#: PKGBUILD.8:103
+#: ./PKGBUILD.8:103
msgid ""
"The last line will be added automatically to the end of the PKGBUILD if the "
"build() function used your $CFLAGS or $CXXFLAGS. This is handy if you want "
@@ -2123,7 +2126,7 @@
msgstr ""
# type: Plain text
-#: PKGBUILD.8:111
+#: ./PKGBUILD.8:111
msgid ""
"Finally we define a build() function that will build the package. If you "
"don't want to do anything special, probably you don't have to specify "
@@ -2135,7 +2138,7 @@
msgstr ""
# type: Plain text
-#: PKGBUILD.8:117
+#: ./PKGBUILD.8:117
msgid ""
"Once the package is successfully installed into the package root, I<makepkg> "
"will prepare some documentation. It will then strip debugging info from "
@@ -2145,14 +2148,14 @@
msgstr ""
# type: Plain text
-#: PKGBUILD.8:120
+#: ./PKGBUILD.8:120
msgid ""
"At this point you should have a package file in the current directory, named "
"something like name-version-release-arch.fpm. Done!"
msgstr ""
# type: Plain text
-#: PKGBUILD.8:163
+#: ./PKGBUILD.8:163
msgid ""
"The install script does not need to be specified in the I<source> array. If "
"you omit the install directive then makepkg will check for the "
@@ -2160,19 +2163,19 @@
msgstr ""
# type: Plain text
-#: PKGBUILD.8:166
+#: ./PKGBUILD.8:166
msgid ""
"You can find a scriptlet skeleton in the /docs/tech/skel/ directory, use it "
"when creating new packages."
msgstr ""
# type: Plain text
-#: PKGBUILD.8:168
+#: ./PKGBUILD.8:168
msgid "The scriptlet messages are parsed, a simple example tells you everything:"
msgstr ""
# type: Plain text
-#: PKGBUILD.8:177
+#: ./PKGBUILD.8:177
#, no-wrap
msgid ""
"post_upgrade()\n"
@@ -2186,41 +2189,41 @@
msgstr ""
# type: Plain text
-#: PKGBUILD.8:192
+#: ./PKGBUILD.8:192
msgid "This is the release number specific to Archlinux Linux packages."
msgstr ""
# type: TP
-#: PKGBUILD.8:197
+#: ./PKGBUILD.8:197
#, no-wrap
msgid "B<pkgdesc_localized>"
msgstr ""
# type: Plain text
-#: PKGBUILD.8:200
+#: ./PKGBUILD.8:200
msgid "Array of the localized package descriptions."
msgstr ""
# type: Plain text
-#: PKGBUILD.8:203
+#: ./PKGBUILD.8:203
msgid "The format is the following: pkgdesc_localized=('xx_YY foo' 'xx_YY bar')"
msgstr ""
# type: Plain text
-#: PKGBUILD.8:213
+#: ./PKGBUILD.8:213
msgid ""
"Sets the license type (eg, \"GPL\", \"BSD\", \"NON-FREE\"). (B<Note>: This "
"option is still in development and may change in the future)"
msgstr ""
# type: TP
-#: PKGBUILD.8:221
+#: ./PKGBUILD.8:221
#, no-wrap
msgid "B<up2date>"
msgstr ""
# type: Plain text
-#: PKGBUILD.8:226
+#: ./PKGBUILD.8:226
msgid ""
"This directive should contain a command that prints the current upstream "
"stable version of the project. This way we can check for newer version "
@@ -2228,7 +2231,7 @@
msgstr ""
# type: Plain text
-#: PKGBUILD.8:243
+#: ./PKGBUILD.8:243
msgid ""
"If this field is present, it should contain an MD5 hash for every source "
"file specified in the I<source> array (in the same order). makepkg will use "
@@ -2239,13 +2242,13 @@
msgstr ""
# type: TP
-#: PKGBUILD.8:244
+#: ./PKGBUILD.8:244
#, no-wrap
msgid "B<sha1sums >I<(array)>"
msgstr ""
# type: Plain text
-#: PKGBUILD.8:252
+#: ./PKGBUILD.8:252
msgid ""
"If this field is present, it should contain an SHA1 hash for every source "
"file specified in the I<source> array (in the same order). makepkg will use "
@@ -2256,13 +2259,13 @@
msgstr ""
# type: TP
-#: PKGBUILD.8:253
+#: ./PKGBUILD.8:253
#, no-wrap
msgid "B<signatures >I<(array)>"
msgstr ""
# type: Plain text
-#: PKGBUILD.8:258
+#: ./PKGBUILD.8:258
msgid ""
"If this field is present, it should contain an array of gpg signatures "
"required to validate the source files. Where there is no signature available "
@@ -2270,18 +2273,18 @@
msgstr ""
# type: Plain text
-#: PKGBUILD.8:260
+#: ./PKGBUILD.8:260
msgid "signatures=(${source[0]}.asc '')"
msgstr ""
# type: TP
-#: PKGBUILD.8:267
+#: ./PKGBUILD.8:267
#, no-wrap
msgid "B<archs >I<(array)>"
msgstr ""
# type: Plain text
-#: PKGBUILD.8:272
+#: ./PKGBUILD.8:272
msgid ""
"This array defines on which architectures the given package is avalibable. "
"If it's not available, that will mean that gensync will skip it when "
@@ -2289,13 +2292,13 @@
msgstr ""
# type: TP
-#: PKGBUILD.8:295
+#: ./PKGBUILD.8:295
#, no-wrap
msgid "B<rodepends >I<(array)>"
msgstr ""
# type: Plain text
-#: PKGBUILD.8:302
+#: ./PKGBUILD.8:302
msgid ""
"An array of packages that this package depends on to run (ie, not required "
"to build). Generally I<rodepends> should be avoided in favour of I<depends> "
@@ -2305,18 +2308,18 @@
msgstr ""
# type: TP
-#: PKGBUILD.8:323
+#: ./PKGBUILD.8:323
#, no-wrap
msgid "B<options >I<(array)>"
msgstr ""
# type: Plain text
-#: PKGBUILD.8:326
+#: ./PKGBUILD.8:326
msgid "This is an array of various boolean options. The possible values are:"
msgstr ""
# type: Plain text
-#: PKGBUILD.8:339
+#: ./PKGBUILD.8:339
#, no-wrap
msgid ""
"nodocs Don't add any documentation automatically (ie. when there'll be\n"
@@ -2337,13 +2340,13 @@
msgstr ""
# type: SH
-#: PKGBUILD.8:341
+#: ./PKGBUILD.8:341
#, no-wrap
msgid "What is the process of chrooted build ?"
msgstr ""
# type: Plain text
-#: PKGBUILD.8:347
+#: ./PKGBUILD.8:347
msgid ""
"First, what is chroot? We currently use fakeroot to prevent build() from "
"modifying the host system, and we use a prefix or DESTDIR directive to "
@@ -2352,7 +2355,7 @@
msgstr ""
# type: Plain text
-#: PKGBUILD.8:355
+#: ./PKGBUILD.8:355
msgid ""
"This system lacks of the ability to control the list of installed packages "
"during the build on the system of a packager, the given compiled package "
@@ -2365,14 +2368,14 @@
msgstr ""
# type: Plain text
-#: PKGBUILD.8:358
+#: ./PKGBUILD.8:358
msgid ""
"Of course there is a sollution to avoid this, to use a real chroot instead "
"of a simple fakeroot. What is this means? The followings:"
msgstr ""
# type: Plain text
-#: PKGBUILD.8:366
+#: ./PKGBUILD.8:366
msgid ""
"When starting the build, a core chroot system is installed under "
"/var/chroot. (Of course you can change this value under /etc/makepkg.conf.) "
@@ -2384,7 +2387,7 @@
msgstr ""
# type: Plain text
-#: PKGBUILD.8:372
+#: ./PKGBUILD.8:372
msgid ""
"When you start building with makepkg -R, pacman will install these packages "
"to /var/chroot if necessary. This will produce a fully \"clean\" Archlinux "
@@ -2394,7 +2397,7 @@
msgstr ""
# type: Plain text
-#: PKGBUILD.8:377
+#: ./PKGBUILD.8:377
msgid ""
"Here comes the fun part. The packages listed in depends() and makedepends() "
"are installed to this clean (/var/chroot) system. From this point, this "
@@ -2403,7 +2406,7 @@
msgstr ""
# type: Plain text
-#: PKGBUILD.8:381
+#: ./PKGBUILD.8:381
msgid ""
"After this the chroot should be cleaned up which means the removal of the "
"installed depends() and makedepends(). This ensures us not to build from "
@@ -2411,7 +2414,7 @@
msgstr ""
# type: Plain text
-#: PKGBUILD.8:385
+#: ./PKGBUILD.8:385
msgid ""
"This way we can prevent lots of dependency problems and it is even possible "
"to build packages for a different Archlinux version. This is quite efficent "
@@ -2419,7 +2422,7 @@
msgstr ""
# type: Plain text
-#: PKGBUILD.8:389
+#: ./PKGBUILD.8:389
msgid ""
"If the build is failed, the working directory will not be deleted, you can "
"find it under /var/chroot/var/tmp/fst. Later if you want to clean your "
@@ -2428,20 +2431,20 @@
msgstr ""
# type: Plain text
-#: PKGBUILD.8:392
+#: ./PKGBUILD.8:392
msgid ""
"To activate building in a chroot, you should run makepkg as root at least "
"with the -R option."
msgstr ""
# type: SH
-#: PKGBUILD.8:393
+#: ./PKGBUILD.8:393
#, no-wrap
msgid "Package splitting"
msgstr ""
# type: Plain text
-#: PKGBUILD.8:397
+#: ./PKGBUILD.8:397
msgid ""
"Package splitting means moving out a list of specifed files to subpackages "
"(like libmysql out of mysql) and then defining the properties of "
@@ -2449,7 +2452,7 @@
msgstr ""
# type: Plain text
-#: PKGBUILD.8:402
+#: ./PKGBUILD.8:402
msgid ""
"NOTE: if you create several subpackages, maintaining those packages will "
"require more and more time. Thus, unnecessary splits aren't welcome. "
@@ -2458,14 +2461,14 @@
msgstr ""
# type: Plain text
-#: PKGBUILD.8:405
+#: ./PKGBUILD.8:405
msgid ""
"The B<subpkgs()> array is to define the pkgnames of the subpackages. From "
"now all the directives has their subfoo equivalent:"
msgstr ""
# type: Plain text
-#: PKGBUILD.8:421
+#: ./PKGBUILD.8:421
#, no-wrap
msgid ""
"pkgname -E<gt> subpkgs()\n"
@@ -2486,7 +2489,7 @@
msgstr ""
# type: Plain text
-#: PKGBUILD.8:425
+#: ./PKGBUILD.8:425
msgid ""
"Also note that bash does not support two-dimensional arrays, so when "
"defining the array of arrays, then quotes are the major separators and "
@@ -2494,12 +2497,12 @@
msgstr ""
# type: Plain text
-#: PKGBUILD.8:427
+#: ./PKGBUILD.8:427
msgid "Simple example:"
msgstr ""
# type: Plain text
-#: PKGBUILD.8:434
+#: ./PKGBUILD.8:434
#, no-wrap
msgid ""
"Add the followings to your bottom of your PKGBUILD\n"
@@ -2511,14 +2514,14 @@
msgstr ""
# type: Plain text
-#: PKGBUILD.8:438
+#: ./PKGBUILD.8:438
msgid ""
"You may define conflicts, replaces and other directives for your "
"subpackages, but the requirement is only to define these 5 ones."
msgstr ""
# type: Plain text
-#: PKGBUILD.8:443
+#: ./PKGBUILD.8:443
msgid ""
"The second part is to move some files to the - just defined - "
"subpackages. You should use the Fsplit command for this at the end of your "
@@ -2527,32 +2530,32 @@
msgstr ""
# type: Plain text
-#: PKGBUILD.8:446
+#: ./PKGBUILD.8:446
#, no-wrap
msgid "Fsplit subpkgname usr/share/\n"
msgstr ""
# type: Plain text
-#: PKGBUILD.8:449
+#: ./PKGBUILD.8:449
msgid ""
"This will move the /usr/share dir of the package to the \"subpkgname\" "
"subpackage."
msgstr ""
# type: Plain text
-#: PKGBUILD.8:452
+#: ./PKGBUILD.8:452
msgid ""
"NOTE: never use a trailing slash when defining file patterns, especially if "
"you use wildcards in it!"
msgstr ""
# type: Plain text
-#: PKGBUILD.8:456
+#: ./PKGBUILD.8:456
msgid "B<makepkg>(8), B<pacman>(8)"
msgstr ""
# type: Plain text
-#: PKGBUILD.8:460
+#: ./PKGBUILD.8:460
#, no-wrap
msgid ""
"Judd Vinet E<lt>jvinet(a)zeroflux.orgE<gt>\n"
Index: pacman-lib/lib/libalpm/add.c
diff -u pacman-lib/lib/libalpm/add.c:1.105 pacman-lib/lib/libalpm/add.c:1.106
--- pacman-lib/lib/libalpm/add.c:1.105 Tue Jan 30 00:41:13 2007
+++ pacman-lib/lib/libalpm/add.c Tue Jan 30 02:47:19 2007
@@ -105,7 +105,7 @@
return(0);
}
-int _alpm_add_loadtarget(pmtrans_t *trans, pmdb_t *db, char *name)
+int SYMHIDDEN _alpm_add_loadtarget(pmtrans_t *trans, pmdb_t *db, char *name)
{
pmpkg_t *info = NULL;
pmpkg_t *dummy;
@@ -154,7 +154,7 @@
if(trans->flags & PM_TRANS_FLAG_FRESHEN) {
/* only upgrade/install this package if it is already installed and at a lesser version */
dummy = _alpm_db_get_pkgfromcache(db, pkgname);
- if(dummy == NULL || _alpm_versioncmp(dummy->version, pkgver) >= 0) {
+ if(dummy == NULL || alpm_versioncmp(dummy->version, pkgver) >= 0) {
pm_errno = PM_ERR_PKG_CANT_FRESH;
goto error;
}
@@ -166,7 +166,7 @@
for(i = trans->packages; i; i = i->next) {
pmpkg_t *pkg = i->data;
if(strcmp(pkg->name, pkgname) == 0) {
- if(_alpm_versioncmp(pkg->version, pkgver) < 0) {
+ if(alpm_versioncmp(pkg->version, pkgver) < 0) {
pmpkg_t *newpkg;
_alpm_log(PM_LOG_WARNING, _("replacing older version %s-%s by %s in target list"),
pkg->name, pkg->version, pkgver);
Index: pacman-lib/lib/libalpm/alpm.c
diff -u pacman-lib/lib/libalpm/alpm.c:1.107 pacman-lib/lib/libalpm/alpm.c:1.108
--- pacman-lib/lib/libalpm/alpm.c:1.107 Mon Jan 29 22:46:33 2007
+++ pacman-lib/lib/libalpm/alpm.c Tue Jan 30 02:47:19 2007
@@ -63,7 +63,7 @@
/* Globals */
pmhandle_t *handle = NULL;
-enum _pmerrno_t pm_errno;
+enum _pmerrno_t pm_errno SYMEXPORT;
/** \addtogroup alpm_interface Interface Functions
* @brief Functions to initialize and release libalpm
@@ -75,7 +75,7 @@
* @param root the full path of the root we'll be installing to (usually /)
* @return 0 on success, -1 on error (pm_errno is set accordingly)
*/
-int alpm_initialize(const char *root)
+int SYMEXPORT alpm_initialize(const char *root)
{
char str[PATH_MAX];
@@ -99,7 +99,7 @@
/** Release the library. This should be the last alpm call you make.
* @return 0 on success, -1 on error (pm_errno is set accordingly)
*/
-int alpm_release()
+int SYMEXPORT alpm_release()
{
int dbs_left = 0;
@@ -139,7 +139,7 @@
* @param treename the name of the repository
* @return a pmdb_t* on success (the value), NULL on error
*/
-pmdb_t *alpm_db_register(char *treename)
+pmdb_t SYMEXPORT *alpm_db_register(char *treename)
{
/* Sanity checks */
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, NULL));
@@ -245,7 +245,7 @@
* @return 0 on success, > 0 on error (pm_errno is set accordingly), < 0 if up
* to date
*/
-int alpm_db_update(int force, pmdb_t *db)
+int SYMEXPORT alpm_db_update(int force, pmdb_t *db)
{
alpm_list_t *lp;
char path[PATH_MAX];
@@ -330,7 +330,7 @@
* @param name of the package
* @return the package entry on success, NULL on error
*/
-pmpkg_t *alpm_db_readpkg(pmdb_t *db, char *name)
+pmpkg_t SYMEXPORT *alpm_db_readpkg(pmdb_t *db, char *name)
{
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
@@ -344,7 +344,7 @@
* @param db pointer to the package database to get the package from
* @return the list of packages on success, NULL on error
*/
-alpm_list_t *alpm_db_getpkgcache(pmdb_t *db)
+alpm_list_t SYMEXPORT *alpm_db_getpkgcache(pmdb_t *db)
{
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
@@ -358,7 +358,7 @@
* @param name name of the package
* @return the list of packages on success, NULL on error
*/
-alpm_list_t *alpm_db_whatprovides(pmdb_t *db, char *name)
+alpm_list_t SYMEXPORT *alpm_db_whatprovides(pmdb_t *db, char *name)
{
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
@@ -373,7 +373,7 @@
* @param name of the group
* @return the groups entry on success, NULL on error
*/
-pmgrp_t *alpm_db_readgrp(pmdb_t *db, char *name)
+pmgrp_t SYMEXPORT *alpm_db_readgrp(pmdb_t *db, char *name)
{
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
@@ -387,7 +387,7 @@
* @param db pointer to the package database to get the group from
* @return the list of groups on success, NULL on error
*/
-alpm_list_t *alpm_db_getgrpcache(pmdb_t *db)
+alpm_list_t SYMEXPORT *alpm_db_getgrpcache(pmdb_t *db)
{
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
@@ -408,7 +408,7 @@
* @param pkg address of the package pointer
* @return 0 on success, -1 on error (pm_errno is set accordingly)
*/
-int alpm_pkg_load(char *filename, pmpkg_t **pkg)
+int SYMEXPORT alpm_pkg_load(char *filename, pmpkg_t **pkg)
{
_alpm_log(PM_LOG_FUNCTION, "enter alpm_pkg_load");
@@ -429,7 +429,7 @@
* @param pkg package pointer to free
* @return 0 on success, -1 on error (pm_errno is set accordingly)
*/
-int alpm_pkg_free(pmpkg_t *pkg)
+int SYMEXPORT alpm_pkg_free(pmpkg_t *pkg)
{
_alpm_log(PM_LOG_FUNCTION, "enter alpm_pkg_free");
@@ -543,9 +543,9 @@
* @return postive, 0 or negative if ver1 is less, equal or more
* than ver2, respectively.
*/
-int alpm_pkg_vercmp(const char *ver1, const char *ver2)
+int SYMEXPORT alpm_pkg_vercmp(const char *ver1, const char *ver2)
{
- return(_alpm_versioncmp(ver1, ver2));
+ return(alpm_versioncmp(ver1, ver2));
}
/* internal */
@@ -556,7 +556,7 @@
"x86_64",
};
-char *alpm_pkg_name_hasarch(char *pkgname)
+char SYMEXPORT *alpm_pkg_name_hasarch(char *pkgname)
{
/* TODO remove this when we transfer everything over to -ARCH
*
@@ -596,7 +596,7 @@
* @param db pointer to the package database to search in
* @return the list of packages on success, NULL on error
*/
-alpm_list_t *alpm_db_search(pmdb_t *db)
+alpm_list_t SYMEXPORT *alpm_db_search(pmdb_t *db)
{
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
@@ -622,7 +622,7 @@
* @param progress progress callback function pointer
* @return 0 on success, -1 on error (pm_errno is set accordingly)
*/
-int alpm_trans_init(pmtranstype_t type, unsigned int flags,
+int SYMEXPORT alpm_trans_init(pmtranstype_t type, unsigned int flags,
alpm_trans_cb_event event, alpm_trans_cb_conv conv,
alpm_trans_cb_progress progress)
{
@@ -651,7 +651,7 @@
/** Search for packages to upgrade and add them to the transaction.
* @return 0 on success, -1 on error (pm_errno is set accordingly)
*/
-int alpm_trans_sysupgrade()
+int SYMEXPORT alpm_trans_sysupgrade()
{
pmtrans_t *trans;
@@ -669,7 +669,7 @@
* @param target the name of the target to add
* @return 0 on success, -1 on error (pm_errno is set accordingly)
*/
-int alpm_trans_addtarget(char *target)
+int SYMEXPORT alpm_trans_addtarget(char *target)
{
pmtrans_t *trans;
@@ -689,7 +689,7 @@
* of an error can be dumped (ie. list of conflicting files)
* @return 0 on success, -1 on error (pm_errno is set accordingly)
*/
-int alpm_trans_prepare(alpm_list_t **data)
+int SYMEXPORT alpm_trans_prepare(alpm_list_t **data)
{
/* Sanity checks */
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
@@ -706,7 +706,7 @@
* of an error can be dumped (ie. list of conflicting files)
* @return 0 on success, -1 on error (pm_errno is set accordingly)
*/
-int alpm_trans_commit(alpm_list_t **data)
+int SYMEXPORT alpm_trans_commit(alpm_list_t **data)
{
/* Sanity checks */
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
@@ -726,7 +726,7 @@
/** Release a transaction.
* @return 0 on success, -1 on error (pm_errno is set accordingly)
*/
-int alpm_trans_release()
+int SYMEXPORT alpm_trans_release()
{
pmtrans_t *trans;
char path[PATH_MAX];
@@ -774,7 +774,7 @@
* @param fmt output format
* @return 0 on success, -1 on error (pm_errno is set accordingly)
*/
-int alpm_logaction(char *fmt, ...)
+int SYMEXPORT alpm_logaction(char *fmt, ...)
{
char str[LOG_STR_LEN];
va_list args;
@@ -812,7 +812,7 @@
* @param name name of the file
* @return the checksum on success, NULL on error
*/
-char *alpm_get_md5sum(char *name)
+char SYMEXPORT *alpm_get_md5sum(char *name)
{
ASSERT(name != NULL, return(NULL));
@@ -823,7 +823,7 @@
* @param name name of the file
* @return the checksum on success, NULL on error
*/
-char *alpm_get_sha1sum(char *name)
+char SYMEXPORT *alpm_get_sha1sum(char *name)
{
ASSERT(name != NULL, return(NULL));
@@ -834,7 +834,7 @@
* @param url
* @return the downloaded filename on success, NULL on error
*/
-char *alpm_fetch_pkgurl(char *url)
+char SYMEXPORT *alpm_fetch_pkgurl(char *url)
{
ASSERT(strstr(url, "://"), return(NULL));
@@ -847,7 +847,7 @@
* @param this_section the config current section being parsed
* @return 0 on success, -1 on error (pm_errno is set accordingly)
*/
-int alpm_parse_config(char *file, alpm_cb_db_register callback, const char *this_section)
+int SYMEXPORT alpm_parse_config(char *file, alpm_cb_db_register callback, const char *this_section)
{
FILE *fp = NULL;
char line[PATH_MAX+1];
Index: pacman-lib/lib/libalpm/alpm.h
diff -u pacman-lib/lib/libalpm/alpm.h:1.67 pacman-lib/lib/libalpm/alpm.h:1.68
--- pacman-lib/lib/libalpm/alpm.h:1.67 Tue Jan 23 22:02:54 2007
+++ pacman-lib/lib/libalpm/alpm.h Tue Jan 30 02:47:20 2007
@@ -486,6 +486,9 @@
char *alpm_strerror(int err);
+/* Version Compare */
+int alpm_versioncmp(const char *a, const char *b);
+
#ifdef __cplusplus
}
#endif
Index: pacman-lib/lib/libalpm/alpm_list.c
diff -u pacman-lib/lib/libalpm/alpm_list.c:1.5 pacman-lib/lib/libalpm/alpm_list.c:1.6
--- pacman-lib/lib/libalpm/alpm_list.c:1.5 Mon Jan 29 22:46:33 2007
+++ pacman-lib/lib/libalpm/alpm_list.c Tue Jan 30 02:47:20 2007
@@ -52,7 +52,7 @@
/** Free a list, but not the contained data
* @param list the list to free
*/
-void alpm_list_free(alpm_list_t *list)
+void SYMEXPORT alpm_list_free(alpm_list_t *list)
{
alpm_list_t *it = list;
@@ -67,7 +67,7 @@
* @param list the list to free
* @param fn a free function for the internal data
*/
-void alpm_list_free_inner(alpm_list_t *list, alpm_list_fn_free fn)
+void SYMEXPORT alpm_list_free_inner(alpm_list_t *list, alpm_list_fn_free fn)
{
alpm_list_t *it = list;
@@ -87,7 +87,7 @@
* @param data the new item to be added to the list
* @return the resultant list, or NULL on failure
*/
-alpm_list_t *alpm_list_add(alpm_list_t *list, void *data)
+alpm_list_t SYMEXPORT *alpm_list_add(alpm_list_t *list, void *data)
{
alpm_list_t *ptr, *lp;
@@ -305,7 +305,7 @@
* @param list the list to copy
* @return a NEW list containing non-duplicated items
*/
-alpm_list_t *alpm_list_remove_dupes(alpm_list_t *list)
+alpm_list_t SYMEXPORT *alpm_list_remove_dupes(alpm_list_t *list)
{ /* TODO does removing the strdup here cause invalid free's anywhere? */
alpm_list_t *lp = list, *newlist = NULL;
while(lp) {
@@ -354,7 +354,7 @@
* @param list the list
* @return the first element in the list
*/
-alpm_list_t *alpm_list_first(alpm_list_t *list)
+alpm_list_t SYMEXPORT *alpm_list_first(alpm_list_t *list)
{
return(list);
}
@@ -377,7 +377,7 @@
* @param entry the list entry
* @return the next element, or NULL when no more elements exist
*/
-alpm_list_t *alpm_list_next(alpm_list_t *entry)
+alpm_list_t SYMEXPORT *alpm_list_next(alpm_list_t *entry)
{
return(entry->next);
}
@@ -398,7 +398,7 @@
* @param entry the list entry
* @return the contained data, or NULL if none
*/
-void *alpm_list_getdata(const alpm_list_t *entry)
+void SYMEXPORT *alpm_list_getdata(const alpm_list_t *entry)
{
if(entry == NULL) return(NULL);
return(entry->data);
@@ -410,7 +410,7 @@
* @param list the list to operate on
* @return the number of list items
*/
-int alpm_list_count(const alpm_list_t *list)
+int SYMEXPORT alpm_list_count(const alpm_list_t *list)
{
unsigned int i = 0;
const alpm_list_t *lp = list;
Index: pacman-lib/lib/libalpm/conflict.c
diff -u pacman-lib/lib/libalpm/conflict.c:1.32 pacman-lib/lib/libalpm/conflict.c:1.33
--- pacman-lib/lib/libalpm/conflict.c:1.32 Mon Jan 29 22:46:33 2007
+++ pacman-lib/lib/libalpm/conflict.c Tue Jan 30 02:47:20 2007
@@ -360,7 +360,7 @@
return(conflicts);
}
-const char *alpm_conflict_get_target(pmconflict_t *conflict)
+const char SYMEXPORT *alpm_conflict_get_target(pmconflict_t *conflict)
{
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
@@ -369,7 +369,7 @@
return conflict->target;
}
-pmconflicttype_t alpm_conflict_get_type(pmconflict_t *conflict)
+pmconflicttype_t SYMEXPORT alpm_conflict_get_type(pmconflict_t *conflict)
{
/* Sanity checks */
ASSERT(handle != NULL, return(-1));
@@ -378,7 +378,7 @@
return conflict->type;
}
-const char *alpm_conflict_get_file(pmconflict_t *conflict)
+const char SYMEXPORT *alpm_conflict_get_file(pmconflict_t *conflict)
{
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
@@ -387,7 +387,7 @@
return conflict->file;
}
-const char *alpm_conflict_get_ctarget(pmconflict_t *conflict)
+const char SYMEXPORT *alpm_conflict_get_ctarget(pmconflict_t *conflict)
{
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
Index: pacman-lib/lib/libalpm/db.c
diff -u pacman-lib/lib/libalpm/db.c:1.56 pacman-lib/lib/libalpm/db.c:1.57
--- pacman-lib/lib/libalpm/db.c:1.56 Tue Jan 23 22:02:54 2007
+++ pacman-lib/lib/libalpm/db.c Tue Jan 30 02:47:20 2007
@@ -199,7 +199,7 @@
return(db);
}
-const char *alpm_db_get_name(pmdb_t *db)
+const char SYMEXPORT *alpm_db_get_name(pmdb_t *db)
{
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
Index: pacman-lib/lib/libalpm/deps.c
diff -u pacman-lib/lib/libalpm/deps.c:1.61 pacman-lib/lib/libalpm/deps.c:1.62
--- pacman-lib/lib/libalpm/deps.c:1.61 Tue Jan 30 00:41:13 2007
+++ pacman-lib/lib/libalpm/deps.c Tue Jan 30 02:47:20 2007
@@ -646,7 +646,7 @@
return(-1);
}
-const char *alpm_dep_get_target(pmdepmissing_t *miss)
+const char SYMEXPORT *alpm_dep_get_target(pmdepmissing_t *miss)
{
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
@@ -655,7 +655,7 @@
return miss->target;
}
-pmdeptype_t alpm_dep_get_type(pmdepmissing_t *miss)
+pmdeptype_t SYMEXPORT alpm_dep_get_type(pmdepmissing_t *miss)
{
/* Sanity checks */
ASSERT(handle != NULL, return(-1));
@@ -664,7 +664,7 @@
return miss->type;
}
-pmdepmod_t alpm_dep_get_mod(pmdepmissing_t *miss)
+pmdepmod_t SYMEXPORT alpm_dep_get_mod(pmdepmissing_t *miss)
{
/* Sanity checks */
ASSERT(handle != NULL, return(-1));
@@ -673,7 +673,7 @@
return miss->depend.mod;
}
-const char *alpm_dep_get_name(pmdepmissing_t *miss)
+const char SYMEXPORT *alpm_dep_get_name(pmdepmissing_t *miss)
{
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
@@ -682,7 +682,7 @@
return miss->depend.name;
}
-const char *alpm_dep_get_version(pmdepmissing_t *miss)
+const char SYMEXPORT *alpm_dep_get_version(pmdepmissing_t *miss)
{
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
Index: pacman-lib/lib/libalpm/error.c
diff -u pacman-lib/lib/libalpm/error.c:1.15 pacman-lib/lib/libalpm/error.c:1.16
--- pacman-lib/lib/libalpm/error.c:1.15 Thu Jan 18 11:53:00 2007
+++ pacman-lib/lib/libalpm/error.c Tue Jan 30 02:47:20 2007
@@ -26,7 +26,7 @@
#include "util.h"
#include "alpm.h"
-char *alpm_strerror(int err)
+char SYMEXPORT *alpm_strerror(int err)
{
switch(err) {
/* System */
Index: pacman-lib/lib/libalpm/group.c
diff -u pacman-lib/lib/libalpm/group.c:1.12 pacman-lib/lib/libalpm/group.c:1.13
--- pacman-lib/lib/libalpm/group.c:1.12 Mon Jan 22 20:34:58 2007
+++ pacman-lib/lib/libalpm/group.c Tue Jan 30 02:47:20 2007
@@ -70,7 +70,7 @@
return(strcmp(grp1->name, grp2->name));
}
-const char *alpm_grp_get_name(pmgrp_t *grp)
+const char SYMEXPORT *alpm_grp_get_name(pmgrp_t *grp)
{
/* Sanity checks */
ASSERT(grp != NULL, return(NULL));
@@ -78,7 +78,7 @@
return grp->name;
}
-alpm_list_t *alpm_grp_get_packages(pmgrp_t *grp)
+alpm_list_t SYMEXPORT *alpm_grp_get_packages(pmgrp_t *grp)
{
/* Sanity checks */
ASSERT(grp != NULL, return(NULL));
Index: pacman-lib/lib/libalpm/handle.c
diff -u pacman-lib/lib/libalpm/handle.c:1.28 pacman-lib/lib/libalpm/handle.c:1.29
--- pacman-lib/lib/libalpm/handle.c:1.28 Tue Jan 23 22:02:54 2007
+++ pacman-lib/lib/libalpm/handle.c Tue Jan 30 02:47:20 2007
@@ -118,9 +118,9 @@
alpm_cb_log alpm_option_get_logcb() { return handle->logcb; }
alpm_cb_download alpm_option_get_dlcb() { return handle->dlcb; }
unsigned short alpm_option_get_logmask() { return handle->logmask; }
-const char *alpm_option_get_root() { return handle->root; }
-const char *alpm_option_get_dbpath() { return handle->dbpath; }
-const char *alpm_option_get_cachedir() { return handle->cachedir; }
+const char SYMEXPORT *alpm_option_get_root() { return handle->root; }
+const char SYMEXPORT *alpm_option_get_dbpath() { return handle->dbpath; }
+const char SYMEXPORT *alpm_option_get_cachedir() { return handle->cachedir; }
const char *alpm_option_get_logfile() { return handle->logfile; }
unsigned short alpm_option_get_usesyslog() { return handle->usesyslog; }
alpm_list_t *alpm_option_get_noupgrades() { return handle->noupgrade; }
@@ -130,21 +130,21 @@
time_t alpm_option_get_upgradedelay() { return handle->upgradedelay; }
const char *alpm_option_get_xfercommand() { return handle->xfercommand; }
unsigned short alpm_option_get_nopassiveftp() { return handle->nopassiveftp; }
-unsigned short alpm_option_get_chomp() { return handle->chomp; }
+unsigned short SYMEXPORT alpm_option_get_chomp() { return handle->chomp; }
alpm_list_t *alpm_option_get_needles() { return handle->needles; }
unsigned short alpm_option_get_usecolor() { return handle->use_color; }
pmdb_t *alpm_option_get_localdb() { return handle->db_local; }
-alpm_list_t *alpm_option_get_syncdbs()
+alpm_list_t SYMEXPORT *alpm_option_get_syncdbs()
{
return handle->dbs_sync;
}
-void alpm_option_set_logcb(alpm_cb_log cb) { handle->logcb = cb; }
+void SYMEXPORT alpm_option_set_logcb(alpm_cb_log cb) { handle->logcb = cb; }
-void alpm_option_set_dlcb(alpm_cb_download cb) { handle->dlcb = cb; }
+void SYMEXPORT alpm_option_set_dlcb(alpm_cb_download cb) { handle->dlcb = cb; }
-void alpm_option_set_logmask(unsigned short mask) { handle->logmask = mask; }
+void SYMEXPORT alpm_option_set_logmask(unsigned short mask) { handle->logmask = mask; }
void alpm_option_set_root(const char *root)
{
@@ -152,7 +152,7 @@
if(root) handle->root = strdup(root);
}
-void alpm_option_set_dbpath(const char *dbpath)
+void SYMEXPORT alpm_option_set_dbpath(const char *dbpath)
{
if(handle->dbpath) FREE(handle->dbpath);
if(dbpath) handle->dbpath = strdup(dbpath);
@@ -205,7 +205,7 @@
if(noextract) handle->noextract = noextract;
}
-void alpm_option_add_ignorepkg(char *pkg)
+void SYMEXPORT alpm_option_add_ignorepkg(char *pkg)
{
handle->ignorepkg = alpm_list_add(handle->ignorepkg, strdup(pkg));
}
@@ -243,7 +243,7 @@
void alpm_option_set_chomp(unsigned short chomp) { handle->chomp = chomp; }
-void alpm_option_add_needle(char *needle)
+void SYMEXPORT alpm_option_add_needle(char *needle)
{
handle->needles = alpm_list_add(handle->needles, strdup(needle));
}
Index: pacman-lib/lib/libalpm/package.c
diff -u pacman-lib/lib/libalpm/package.c:1.51 pacman-lib/lib/libalpm/package.c:1.52
--- pacman-lib/lib/libalpm/package.c:1.51 Wed Jan 24 03:51:51 2007
+++ pacman-lib/lib/libalpm/package.c Tue Jan 30 02:47:20 2007
@@ -457,7 +457,7 @@
return pkg->filename;
}
-const char *alpm_pkg_get_name(pmpkg_t *pkg)
+const char SYMEXPORT *alpm_pkg_get_name(pmpkg_t *pkg)
{
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
@@ -466,7 +466,7 @@
return pkg->name;
}
-const char *alpm_pkg_get_version(pmpkg_t *pkg)
+const char SYMEXPORT *alpm_pkg_get_version(pmpkg_t *pkg)
{
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
@@ -475,7 +475,7 @@
return pkg->version;
}
-const char *alpm_pkg_get_desc(pmpkg_t *pkg)
+const char SYMEXPORT *alpm_pkg_get_desc(pmpkg_t *pkg)
{
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
@@ -487,7 +487,7 @@
return pkg->desc;
}
-const char *alpm_pkg_get_url(pmpkg_t *pkg)
+const char SYMEXPORT *alpm_pkg_get_url(pmpkg_t *pkg)
{
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
@@ -499,7 +499,7 @@
return pkg->url;
}
-const char *alpm_pkg_get_builddate(pmpkg_t *pkg)
+const char SYMEXPORT *alpm_pkg_get_builddate(pmpkg_t *pkg)
{
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
@@ -511,7 +511,7 @@
return pkg->builddate;
}
-const char *alpm_pkg_get_buildtype(pmpkg_t *pkg)
+const char SYMEXPORT *alpm_pkg_get_buildtype(pmpkg_t *pkg)
{
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
@@ -523,7 +523,7 @@
return pkg->buildtype;
}
-const char *alpm_pkg_get_installdate(pmpkg_t *pkg)
+const char SYMEXPORT *alpm_pkg_get_installdate(pmpkg_t *pkg)
{
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
@@ -535,7 +535,7 @@
return pkg->installdate;
}
-const char *alpm_pkg_get_packager(pmpkg_t *pkg)
+const char SYMEXPORT *alpm_pkg_get_packager(pmpkg_t *pkg)
{
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
@@ -547,7 +547,7 @@
return pkg->packager;
}
-const char *alpm_pkg_get_md5sum(pmpkg_t *pkg)
+const char SYMEXPORT *alpm_pkg_get_md5sum(pmpkg_t *pkg)
{
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
@@ -559,7 +559,7 @@
return pkg->md5sum;
}
-const char *alpm_pkg_get_sha1sum(pmpkg_t *pkg)
+const char SYMEXPORT *alpm_pkg_get_sha1sum(pmpkg_t *pkg)
{
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
@@ -571,7 +571,7 @@
return pkg->sha1sum;
}
-const char *alpm_pkg_get_arch(pmpkg_t *pkg)
+const char SYMEXPORT *alpm_pkg_get_arch(pmpkg_t *pkg)
{
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
@@ -583,7 +583,7 @@
return pkg->arch;
}
-unsigned long alpm_pkg_get_size(pmpkg_t *pkg)
+unsigned long SYMEXPORT alpm_pkg_get_size(pmpkg_t *pkg)
{
/* Sanity checks */
ASSERT(handle != NULL, return(-1));
@@ -595,7 +595,7 @@
return pkg->size;
}
-unsigned long alpm_pkg_get_isize(pmpkg_t *pkg)
+unsigned long SYMEXPORT alpm_pkg_get_isize(pmpkg_t *pkg)
{
/* Sanity checks */
ASSERT(handle != NULL, return(-1));
@@ -607,7 +607,7 @@
return pkg->isize;
}
-pmpkgreason_t alpm_pkg_get_reason(pmpkg_t *pkg)
+pmpkgreason_t SYMEXPORT alpm_pkg_get_reason(pmpkg_t *pkg)
{
/* Sanity checks */
ASSERT(handle != NULL, return(-1));
@@ -619,7 +619,7 @@
return pkg->reason;
}
-alpm_list_t *alpm_pkg_get_licenses(pmpkg_t *pkg)
+alpm_list_t SYMEXPORT *alpm_pkg_get_licenses(pmpkg_t *pkg)
{
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
@@ -631,7 +631,7 @@
return pkg->license;
}
-alpm_list_t *alpm_pkg_get_groups(pmpkg_t *pkg)
+alpm_list_t SYMEXPORT *alpm_pkg_get_groups(pmpkg_t *pkg)
{
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
@@ -644,7 +644,7 @@
}
/* depends */
-alpm_list_t *alpm_pkg_get_depends(pmpkg_t *pkg)
+alpm_list_t SYMEXPORT *alpm_pkg_get_depends(pmpkg_t *pkg)
{
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
@@ -656,7 +656,7 @@
return pkg->depends;
}
-alpm_list_t *alpm_pkg_get_removes(pmpkg_t *pkg)
+alpm_list_t SYMEXPORT *alpm_pkg_get_removes(pmpkg_t *pkg)
{
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
@@ -668,7 +668,7 @@
return pkg->removes;
}
-alpm_list_t *alpm_pkg_get_requiredby(pmpkg_t *pkg)
+alpm_list_t SYMEXPORT *alpm_pkg_get_requiredby(pmpkg_t *pkg)
{
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
@@ -680,7 +680,7 @@
return pkg->requiredby;
}
-alpm_list_t *alpm_pkg_get_conflicts(pmpkg_t *pkg)
+alpm_list_t SYMEXPORT *alpm_pkg_get_conflicts(pmpkg_t *pkg)
{
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
@@ -692,7 +692,7 @@
return pkg->conflicts;
}
-alpm_list_t *alpm_pkg_get_provides(pmpkg_t *pkg)
+alpm_list_t SYMEXPORT *alpm_pkg_get_provides(pmpkg_t *pkg)
{
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
@@ -704,7 +704,7 @@
return pkg->provides;
}
-alpm_list_t *alpm_pkg_get_replaces(pmpkg_t *pkg)
+alpm_list_t SYMEXPORT *alpm_pkg_get_replaces(pmpkg_t *pkg)
{
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
@@ -716,7 +716,7 @@
return pkg->replaces;
}
-alpm_list_t *alpm_pkg_get_files(pmpkg_t *pkg)
+alpm_list_t SYMEXPORT *alpm_pkg_get_files(pmpkg_t *pkg)
{
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
@@ -729,7 +729,7 @@
return pkg->files;
}
-alpm_list_t *alpm_pkg_get_backup(pmpkg_t *pkg)
+alpm_list_t SYMEXPORT *alpm_pkg_get_backup(pmpkg_t *pkg)
{
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
@@ -742,7 +742,7 @@
return pkg->backup;
}
-unsigned short alpm_pkg_has_scriptlet(pmpkg_t *pkg)
+unsigned short SYMEXPORT alpm_pkg_has_scriptlet(pmpkg_t *pkg)
{
/* Sanity checks */
ASSERT(handle != NULL, return(-1));
Index: pacman-lib/lib/libalpm/sync.c
diff -u pacman-lib/lib/libalpm/sync.c:1.93 pacman-lib/lib/libalpm/sync.c:1.94
--- pacman-lib/lib/libalpm/sync.c:1.93 Mon Jan 29 22:46:34 2007
+++ pacman-lib/lib/libalpm/sync.c Tue Jan 30 02:47:20 2007
@@ -227,7 +227,7 @@
}
/* compare versions and see if we need to upgrade */
- cmp = _alpm_versioncmp(local->version, spkg->version);
+ cmp = alpm_versioncmp(local->version, spkg->version);
if(cmp > 0 && !spkg->force) {
/* local version is newer */
pmdb_t *db = spkg->data;
@@ -340,7 +340,7 @@
local = _alpm_db_get_pkgfromcache(db_local, spkg->name);
if(local) {
- cmp = _alpm_versioncmp(local->version, spkg->version);
+ cmp = alpm_versioncmp(local->version, spkg->version);
if(cmp > 0 && !spkg->force) {
/* local version is newer -- get confirmation before adding */
int resp = 0;
@@ -1069,7 +1069,7 @@
return(-1);
}
-pmsynctype_t alpm_sync_get_type(pmsyncpkg_t *sync)
+pmsynctype_t SYMEXPORT alpm_sync_get_type(pmsyncpkg_t *sync)
{
/* Sanity checks */
ASSERT(sync != NULL, return(-1));
@@ -1077,7 +1077,7 @@
return sync->type;
}
-pmpkg_t *alpm_sync_get_package(pmsyncpkg_t *sync)
+pmpkg_t SYMEXPORT *alpm_sync_get_package(pmsyncpkg_t *sync)
{
/* Sanity checks */
ASSERT(sync != NULL, return(NULL));
@@ -1085,7 +1085,7 @@
return sync->pkg;
}
-void *alpm_sync_get_data(pmsyncpkg_t *sync)
+void SYMEXPORT *alpm_sync_get_data(pmsyncpkg_t *sync)
{
/* Sanity checks */
ASSERT(sync != NULL, return(NULL));
Index: pacman-lib/lib/libalpm/trans.c
diff -u pacman-lib/lib/libalpm/trans.c:1.32 pacman-lib/lib/libalpm/trans.c:1.33
--- pacman-lib/lib/libalpm/trans.c:1.32 Mon Jan 29 22:46:34 2007
+++ pacman-lib/lib/libalpm/trans.c Tue Jan 30 02:47:20 2007
@@ -237,7 +237,7 @@
return handle->trans->type;
}
-unsigned int alpm_trans_get_flags()
+unsigned int SYMEXPORT alpm_trans_get_flags()
{
/* Sanity checks */
ASSERT(handle != NULL, return(-1));
@@ -255,7 +255,7 @@
return handle->trans->targets;
}
-alpm_list_t * alpm_trans_get_packages()
+alpm_list_t SYMEXPORT * alpm_trans_get_packages()
{
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
Index: pacman-lib/lib/libalpm/util.h
diff -u pacman-lib/lib/libalpm/util.h:1.19 pacman-lib/lib/libalpm/util.h:1.20
--- pacman-lib/lib/libalpm/util.h:1.19 Tue Jan 23 22:02:54 2007
+++ pacman-lib/lib/libalpm/util.h Tue Jan 30 02:47:20 2007
@@ -76,6 +76,10 @@
char* mkdtemp(char *template);
#endif
+/* check exported library symbols with: nm -C -D <lib> */
+#define SYMEXPORT __attribute__((visibility("default")))
+#define SYMHIDDEN __attribute__((visibility("hidden")))
+
#endif /* _ALPM_UTIL_H */
/* vim: set ts=2 sw=2 noet: */
Index: pacman-lib/lib/libalpm/versioncmp.c
diff -u pacman-lib/lib/libalpm/versioncmp.c:1.10 pacman-lib/lib/libalpm/versioncmp.c:1.11
--- pacman-lib/lib/libalpm/versioncmp.c:1.10 Mon Jan 29 22:46:34 2007
+++ pacman-lib/lib/libalpm/versioncmp.c Tue Jan 30 02:47:20 2007
@@ -148,7 +148,7 @@
#endif
/* this function was taken from rpm 4.0.4 and rewritten */
-int _alpm_versioncmp(const char *a, const char *b)
+int SYMEXPORT alpm_versioncmp(const char *a, const char *b)
{
char str1[64], str2[64];
char *ptr1, *ptr2;
@@ -236,7 +236,7 @@
if((!*one) && (!*two)) {
/* compare release numbers */
- if(rel1 && rel2) return(_alpm_versioncmp(rel1, rel2));
+ if(rel1 && rel2) return(alpm_versioncmp(rel1, rel2));
return(0);
}
@@ -252,7 +252,7 @@
if(dep->mod == PM_DEP_MOD_ANY) {
equal = 1;
} else {
- int cmp = _alpm_versioncmp(pkg->version, dep->version);
+ int cmp = alpm_versioncmp(pkg->version, dep->version);
switch(dep->mod) {
case PM_DEP_MOD_EQ: equal = (cmp == 0); break;
case PM_DEP_MOD_GE: equal = (cmp >= 0); break;
Index: pacman-lib/lib/libalpm/versioncmp.h
diff -u pacman-lib/lib/libalpm/versioncmp.h:1.5 pacman-lib/lib/libalpm/versioncmp.h:1.6
--- pacman-lib/lib/libalpm/versioncmp.h:1.5 Wed Nov 22 04:03:42 2006
+++ pacman-lib/lib/libalpm/versioncmp.h Tue Jan 30 02:47:20 2007
@@ -26,7 +26,6 @@
#include "deps.h"
#include "package.h"
-int _alpm_versioncmp(const char *a, const char *b);
int _alpm_depcmp(pmpkg_t *pkg, pmdepend_t *dep);
#endif
Index: pacman-lib/src/util/vercmp.c
diff -u pacman-lib/src/util/vercmp.c:1.5 pacman-lib/src/util/vercmp.c:1.6
--- pacman-lib/src/util/vercmp.c:1.5 Wed Nov 22 21:36:26 2006
+++ pacman-lib/src/util/vercmp.c Tue Jan 30 02:47:20 2007
@@ -27,7 +27,7 @@
#ifndef PATH_MAX
#define PATH_MAX 1024
#endif
-#include "versioncmp.h"
+#include <alpm.h>
int main(int argc, char *argv[])
{
@@ -45,7 +45,7 @@
return(0);
}
- ret = _alpm_versioncmp(s1, s2);
+ ret = alpm_versioncmp(s1, s2);
printf("%d\n", ret);
return(ret);
}
1
0
Date: Tuesday, January 30, 2007 @ 02:35:51
Author: dan
Path: /home/cvs-pacman/pacman-lib
Added: TODO.dan (1.1)
adding my personal TODO file
----------+
TODO.dan | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 64 insertions(+)
Index: pacman-lib/TODO.dan
diff -u /dev/null pacman-lib/TODO.dan:1.1
--- /dev/null Tue Jan 30 02:35:51 2007
+++ pacman-lib/TODO.dan Tue Jan 30 02:35:51 2007
@@ -0,0 +1,64 @@
+TODO.dan
+This is my personal TODO list. No guarantees if it is out of date and things
+ no longer apply. If you want to help out with any of it, send me an email.
+
+* Variable names in makepkg.conf--confusing
+ - some use 'USE_', others do not
+ - some are 'NO', some are 'KEEP', etc.
+ - some options use 0/1, others are y/n
+* Should undocumented makepkg (and thus PKGBUILD) options be put in the
+ manpage, as well as including sections for them in the makepkg.conf file?
+* Go through all makepkg bugs in flyspray and see if they are rectified:
+ http://bugs.archlinux.org/index.php?tasks=&project=1&string=makepkg
+
+* Documentation- no one likes to write it, but everyone reads it. Work on the
+ man pages and make sure they are up to date.
+* doc/PKGBUILD.5- continue cleanup work
+* PKGBUILD man page should be in section 5 and not section 8
+
+* Port the libdownload (libfetch) manpage from BSD style to Linux style, or at
+ very least change references to BSD.
+
+* Revise build system to a more static one (Aaron mentioned wmii system).
+
+* NEWS file updating and cleanup. Get rid of items that are bugfixes of never-
+ released code, etc.
+
+* New cache cleaning functionality in pacman - keep installed version, choose
+ number to keep, etc. Good python script in the forums that we should try to
+ emulate, perhaps.
+* pacman - downgrade feature - allow users to see cached packages andi
+ downgrade to (previous or any?) available options.
+
+* alpm_log_action & install script logging interaction - producing duplicate
+ entries in pacman logs (possibly fixed? needs more testing but looks good)
+
+* Extreme similarity between some of the sync and add code...we have to be able
+ to abstract more away from sync actions and add actions to just 'actions'
+ (example: sync,c, add.c, and deptest.c all contain a switch on PM_DEP_MOD_*)
+
+* Merge update, add, and sync code when possible, so we reduce duplication.
+
+* For Pacman 3.1 - List every function, define, etc. in libalpm. Give one
+ sentence description of each. If it sounds like two are similar, find a way
+ to combine or refactor them. If it is unnecessary- delete it. Stop keeping
+ everything clustered in little add/sync/remove parts, allow transactions to
+ share code.
+
+* Pacman 3.1 - Go through options list. Decide if namings are good, all options
+ are still relevant, etc. Ideas for -Re (#6273), changing meaning of -c (has
+ two meanings, another FS bug), etc.
+
+* Monotone suggestion- allow changing of a branch name after commit (example:
+ I meant to commit to a new branch, but I forgot --branch option on the
+ commit. Can I remove the original branch cert and replace it with a new
+ one?)
+
+Quick hits:
+* log_progress and cb_trans_progress - same function? not quite but commonality
+* unsigned int vs. unsigned
+* 'ldd' & 'ldd -u' - many linkages
+* possibly split utilities/extras from pacman package
+* makepkg3 produces files with arch appended- gensync can't deal with it
+* Fix repo-add script so it replaces packages instead of simply adding new onesi
+ (so old version is properly removed).
1
0
Hi,
* Fix building outside $(srcdir).
* Removed ./gen-mirrorlist.sh invocation from configure script:
Mirror-files are generated by make, not configure.
Jürgen
2
2
Date: Tuesday, January 30, 2007 @ 01:31:18
Author: aaron
Path: /home/cvs-pacman/pacman-lib/scripts
Removed: aurbuild (1.2)
This is a silly script now that a fancy aurbuild is out in the wild (on the AUR,
surprisingly enough, heh)
----------+
aurbuild | 25 -------------------------
1 file changed, 25 deletions(-)
Index: pacman-lib/scripts/aurbuild
diff -u pacman-lib/scripts/aurbuild:1.2 pacman-lib/scripts/aurbuild:removed
--- pacman-lib/scripts/aurbuild:1.2 Wed Dec 20 20:53:41 2006
+++ pacman-lib/scripts/aurbuild Tue Jan 30 01:31:18 2007
@@ -1,25 +0,0 @@
-#!/bin/bash
-
-die() {
- echo $*
- exit 1
-}
-
-if [ "$1" == "" ]; then
- echo "usage: aurbuild <package_name>"
- echo
- exit 1
-fi
-pkgname=$1
-[ -d $pkgname ] && die "Directory '$pkgname' already exists"
-[ -f $pkgname ] && die "File '$pkgname' already exists"
-
-echo "Downloading $pkgname.tar.gz"
-wget -q http://aur.archlinux.org/packages/$pkgname/$pkgname.tar.gz || die "Failed to fetch $1.pkg.tar.gz"
-
-tar zxf $pkgname.tar.gz || die "Extraction failed"
-rm -f $pkgname.tar.gz
-cd $pkgname || die "Failed to cwd"
-makepkg
-
-# vim: set ts=2 sw=2 noet:
1
0
Date: Tuesday, January 30, 2007 @ 00:41:13
Author: dan
Path: /home/cvs-pacman/pacman-lib
Modified: lib/libalpm/Makefile.am (1.15 -> 1.16)
lib/libalpm/add.c (1.104 -> 1.105)
lib/libalpm/deps.c (1.60 -> 1.61) lib/libalpm/util.c (1.41 -> 1.42)
scripts/makeworld (1.6 -> 1.7) src/pacman/sync.c (1.100 -> 1.101)
* Remove -fno-strict-aliasing as it is now unnecessary to compile.
* Fix up add.c a bit better than it was in regards to FS #3492.
* Optimized the sqrt call in dependency cycle checking to a single call.
* Removal of an outdated comment.
-------------------------+
lib/libalpm/Makefile.am | 4 +---
lib/libalpm/add.c | 32 +++++++++++++++++++++++++-------
lib/libalpm/deps.c | 13 ++++++-------
lib/libalpm/util.c | 4 ++--
scripts/makeworld | 2 +-
src/pacman/sync.c | 1 -
6 files changed, 35 insertions(+), 21 deletions(-)
Index: pacman-lib/lib/libalpm/Makefile.am
diff -u pacman-lib/lib/libalpm/Makefile.am:1.15 pacman-lib/lib/libalpm/Makefile.am:1.16
--- pacman-lib/lib/libalpm/Makefile.am:1.15 Mon Jan 29 17:18:31 2007
+++ pacman-lib/lib/libalpm/Makefile.am Tue Jan 30 00:41:13 2007
@@ -1,8 +1,6 @@
AUTOMAKE_OPTIONS = gnu
DEFINES = -pedantic -D_GNU_SOURCE
-#libalpm isn't fully C99 safe with the strict aliasing rules
-# to be fixed in the future
-AM_CFLAGS = $(DEFINES) -fno-strict-aliasing
+AM_CFLAGS = $(DEFINES)
SUBDIRS = po
localedir = $(datadir)/locale
Index: pacman-lib/lib/libalpm/add.c
diff -u pacman-lib/lib/libalpm/add.c:1.104 pacman-lib/lib/libalpm/add.c:1.105
--- pacman-lib/lib/libalpm/add.c:1.104 Mon Jan 29 22:46:33 2007
+++ pacman-lib/lib/libalpm/add.c Tue Jan 30 00:41:13 2007
@@ -211,9 +211,12 @@
}
-static int name_cmp(const void *p1, const void *p2)
+/* This is still messy. We have a lot of compare functions, and we should
+ * try to consolidate them as much as we can (between add and sync) */
+static int pkg_cmp(const void *p1, const void *p2)
{
- return(strcmp(((pmpkg_t *)p1)->name, (const char *)p2));
+ return(strcmp(((pmdepmissing_t *)p1)->target,
+ ((pmdepmissing_t *)p2)->target));
}
int _alpm_add_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data)
@@ -253,11 +256,26 @@
/* Attempt to resolve conflicts */
QUESTION(trans, PM_TRANS_CONV_CONFLICT_PKG, miss->target, miss->depend.name, NULL, &skip_this);
if(skip_this) {
- pmpkg_t **pkg = NULL;
- lp = alpm_list_remove(lp, (void *)miss->depend.name, name_cmp, (void **)pkg);
- FREEPKG(*pkg);
- }
- }
+ pmdepmissing_t *pkg = NULL;
+ lp = alpm_list_remove(lp, (void *)miss, pkg_cmp, (void*)&pkg);
+ /* TODO: We remove the conflict from the list but never actually remove
+ * the package. Need to do this to fix FS #3492. The sync code should
+ * provide an example of how to do this, as it handles replaces and
+ * removes. We run into problems because we do a file conflict check
+ * below and it fails there. A force flag will skip that part, but
+ * still not remove the original package designated here for removal.
+ * Better yet, dump all this shitty duplicate code and somehow combine
+ * it with the sync code. */
+ FREE(pkg);
+ if(lp == NULL) {
+ break;
+ }
+ }
+ }
+ /* Removal code should go here, as described above. Instead of simply
+ * removing items, perhaps throw them in another list to be removed, then
+ * proceed as sync.c would? I'm not sure because I'm not familiar enough
+ * with the codebase. */
if(lp != NULL) {
if(data) {
*data = lp;
Index: pacman-lib/lib/libalpm/deps.c
diff -u pacman-lib/lib/libalpm/deps.c:1.60 pacman-lib/lib/libalpm/deps.c:1.61
--- pacman-lib/lib/libalpm/deps.c:1.60 Mon Jan 29 22:46:33 2007
+++ pacman-lib/lib/libalpm/deps.c Tue Jan 30 00:41:13 2007
@@ -106,6 +106,7 @@
int change = 1;
int numscans = 0;
int numtargs = 0;
+ int maxscans;
if(targets == NULL) {
return(NULL);
@@ -116,15 +117,13 @@
numtargs++;
}
+ maxscans = (int)sqrt(numtargs);
+
_alpm_log(PM_LOG_DEBUG, _("started sorting dependencies"));
while(change) {
alpm_list_t *tmptargs = NULL;
change = 0;
- /* TODO only use of a math.h function in entire libalpm,
- * can we get rid of it? Former code line:
- *if(numscans > numtargs) {
- */
- if(numscans > sqrt(numtargs)) {
+ if(numscans > maxscans) {
_alpm_log(PM_LOG_DEBUG, _("possible dependency cycle detected"));
continue;
}
@@ -321,9 +320,9 @@
/* else if still not found... */
if(!found) {
_alpm_log(PM_LOG_DEBUG, _("checkdeps: found %s as a dependency for %s"),
- depend.name, tp->name);
+ depend.name, tp->name);
miss = _alpm_depmiss_new(tp->name, PM_DEP_TYPE_DEPEND, depend.mod,
- depend.name, depend.version);
+ depend.name, depend.version);
if(!_alpm_depmiss_isin(miss, baddeps)) {
baddeps = alpm_list_add(baddeps, miss);
} else {
Index: pacman-lib/lib/libalpm/util.c
diff -u pacman-lib/lib/libalpm/util.c:1.41 pacman-lib/lib/libalpm/util.c:1.42
--- pacman-lib/lib/libalpm/util.c:1.41 Thu Jan 25 20:33:03 2007
+++ pacman-lib/lib/libalpm/util.c Tue Jan 30 00:41:13 2007
@@ -359,8 +359,8 @@
/* Use ISO-8601 date format */
fprintf(f, "[%04d-%02d-%02d %02d:%02d] %s\n",
- tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday,
- tm->tm_hour, tm->tm_min, str);
+ tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday,
+ tm->tm_hour, tm->tm_min, str);
fflush(f);
}
Index: pacman-lib/scripts/makeworld
diff -u pacman-lib/scripts/makeworld:1.6 pacman-lib/scripts/makeworld:1.7
--- pacman-lib/scripts/makeworld:1.6 Thu Jan 25 21:13:16 2007
+++ pacman-lib/scripts/makeworld Tue Jan 30 00:41:13 2007
@@ -148,7 +148,7 @@
fi
done
done
-ed=`date +"[%b %d %H:%M]"`
+ed=$(date +"[%b %d %H:%M]")
echo "makeworld complete." >>$toplevel/build.log
echo " started: $sd" >>$toplevel/build.log
Index: pacman-lib/src/pacman/sync.c
diff -u pacman-lib/src/pacman/sync.c:1.100 pacman-lib/src/pacman/sync.c:1.101
--- pacman-lib/src/pacman/sync.c:1.100 Mon Jan 29 22:46:34 2007
+++ pacman-lib/src/pacman/sync.c Tue Jan 30 00:41:13 2007
@@ -526,7 +526,6 @@
found++;
MSG(NL, _(":: group %s:\n"), targ);
/* remove dupe entries in case a package exists in multiple repos */
- /* (the dupe function takes a pmlist_t* and returns a list_t*) */
alpm_list_t *pkgs = alpm_list_remove_dupes(alpm_grp_get_packages(grp));
list_display(" ", pkgs);
if(yesno(_(":: Install whole content? [Y/n] "))) {
1
0
30 Jan '07
Date: Monday, January 29, 2007 @ 23:15:14
Author: dan
Path: /home/cvs-pacman/pacman-lib/src/pacman
Modified: package.c (1.24 -> 1.25)
* Modified info query so it doesn't show more than available when querying a
package file.
-----------+
package.c | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
Index: pacman-lib/src/pacman/package.c
diff -u pacman-lib/src/pacman/package.c:1.24 pacman-lib/src/pacman/package.c:1.25
--- pacman-lib/src/pacman/package.c:1.24 Thu Jan 25 21:13:16 2007
+++ pacman-lib/src/pacman/package.c Mon Jan 29 23:15:14 2007
@@ -34,6 +34,10 @@
#include "package.h"
/* Display the content of an installed package
+ *
+ * level: <1 - omits N/A info for file query (-Qp)
+ * 1 - normal level
+ * >1 - extra information (backup files)
*/
void dump_pkg_full(pmpkg_t *pkg, int level)
{
@@ -69,25 +73,28 @@
list_display(_("Provides :"), alpm_pkg_get_provides(pkg));
list_display(_("Depends On :"), alpm_pkg_get_depends(pkg));
list_display(_("Removes :"), alpm_pkg_get_removes(pkg));
- /* TODO only applicable if querying installed package, not a file */
- list_display(_("Required By :"), alpm_pkg_get_requiredby(pkg));
+ /* Only applicable if installed */
+ if(level > 0) {
+ list_display(_("Required By :"), alpm_pkg_get_requiredby(pkg));
+ }
list_display(_("Conflicts With :"), alpm_pkg_get_conflicts(pkg));
printf(_("Installed Size : %ld K\n"), (long)alpm_pkg_get_size(pkg) / 1024);
printf(_("Packager : %s\n"), (char *)alpm_pkg_get_packager(pkg));
printf(_("Architecture : %s\n"), (char *)alpm_pkg_get_arch(pkg));
printf(_("Build Date : %s %s\n"), bdate, strlen(bdate) ? "UTC" : "");
printf(_("Build Type : %s\n"), strlen(type) ? type : _("Unknown"));
- /* TODO only applicable if querying installed package, not a file */
- printf(_("Install Date : %s %s\n"), idate, strlen(idate) ? "UTC" : "");
- printf(_("Install Script : %s\n"), alpm_pkg_has_scriptlet(pkg) ? _("Yes") : _("No"));
- printf(_("Reason : %s\n"), reason);
+ if(level > 0) {
+ printf(_("Install Date : %s %s\n"), idate, strlen(idate) ? "UTC" : "");
+ printf(_("Install Reason : %s\n"), reason);
+ }
+ printf(_("Install Script : %s\n"),
+ alpm_pkg_has_scriptlet(pkg) ? _("Yes") : _("No"));
printf(_("Description : "));
indentprint(alpm_pkg_get_desc(pkg), 17);
printf("\n");
/* Print additional package info if info flag passed more than once */
- /* TODO only applicable if querying installed package, not a file */
if(level > 1) {
/* call new backup function */
dump_pkg_backups(pkg);
1
0
Date: Monday, January 29, 2007 @ 22:46:34
Author: dan
Path: /home/cvs-pacman/pacman-lib
Modified: lib/libalpm/add.c (1.103 -> 1.104)
lib/libalpm/alpm.c (1.106 -> 1.107)
lib/libalpm/alpm_list.c (1.4 -> 1.5)
lib/libalpm/alpm_list.h (1.2 -> 1.3)
lib/libalpm/cache.c (1.27 -> 1.28)
lib/libalpm/conflict.c (1.31 -> 1.32)
lib/libalpm/deps.c (1.59 -> 1.60)
lib/libalpm/provide.c (1.8 -> 1.9)
lib/libalpm/remove.c (1.57 -> 1.58)
lib/libalpm/server.c (1.16 -> 1.17)
lib/libalpm/sync.c (1.92 -> 1.93)
lib/libalpm/trans.c (1.31 -> 1.32)
lib/libalpm/versioncmp.c (1.9 -> 1.10)
src/pacman/sync.c (1.99 -> 1.100)
Discussed on IRC for a bit, this makes the following changes for clarity:
* alpm_list_is_in --> alpm_list_find
* alpm_list_is_strin --> alpm_list_find_str
* Flip parameters of both functions to be inline with rest of alpm_list.
First commit, woohoo.
--------------------------+
lib/libalpm/add.c | 6 +++---
lib/libalpm/alpm.c | 2 +-
lib/libalpm/alpm_list.c | 8 ++++----
lib/libalpm/alpm_list.h | 4 ++--
lib/libalpm/cache.c | 4 ++--
lib/libalpm/conflict.c | 7 ++++---
lib/libalpm/deps.c | 6 +++---
lib/libalpm/provide.c | 2 +-
lib/libalpm/remove.c | 5 +++--
lib/libalpm/server.c | 2 +-
lib/libalpm/sync.c | 14 +++++++-------
lib/libalpm/trans.c | 2 +-
lib/libalpm/versioncmp.c | 3 ++-
src/pacman/sync.c | 4 ++--
14 files changed, 36 insertions(+), 33 deletions(-)
Index: pacman-lib/lib/libalpm/add.c
diff -u pacman-lib/lib/libalpm/add.c:1.103 pacman-lib/lib/libalpm/add.c:1.104
--- pacman-lib/lib/libalpm/add.c:1.103 Tue Jan 23 22:02:53 2007
+++ pacman-lib/lib/libalpm/add.c Mon Jan 29 22:46:33 2007
@@ -507,7 +507,7 @@
* eg, /home/httpd/html/index.html may be removed so index.php
* could be used.
*/
- if(alpm_list_is_strin(pathname, handle->noextract)) {
+ if(alpm_list_find_str(handle->noextract, pathname)) {
alpm_logaction(_("notice: %s is in NoExtract -- skipping extraction"), pathname);
archive_read_data_skip (archive);
continue;
@@ -516,7 +516,7 @@
if(!stat(expath, &buf) && !S_ISDIR(buf.st_mode)) {
/* file already exists */
if(!pmo_upgrade || oldpkg == NULL) {
- nb = alpm_list_is_strin(pathname, info->backup);
+ nb = alpm_list_find_str(info->backup, pathname);
} else {
/* op == PM_TRANS_TYPE_UPGRADE */
md5_orig = _alpm_needbackup(pathname, oldpkg->backup);
@@ -525,7 +525,7 @@
nb = 1;
}
}
- if(alpm_list_is_strin(pathname, handle->noupgrade)) {
+ if(alpm_list_find_str(handle->noupgrade, pathname)) {
notouch = 1;
nb = 0;
}
Index: pacman-lib/lib/libalpm/alpm.c
diff -u pacman-lib/lib/libalpm/alpm.c:1.106 pacman-lib/lib/libalpm/alpm.c:1.107
--- pacman-lib/lib/libalpm/alpm.c:1.106 Thu Jan 25 21:13:16 2007
+++ pacman-lib/lib/libalpm/alpm.c Mon Jan 29 22:46:33 2007
@@ -265,7 +265,7 @@
ASSERT(handle->trans->state == STATE_INITIALIZED, RET_ERR(PM_ERR_TRANS_NOT_INITIALIZED, -1));
ASSERT(handle->trans->type == PM_TRANS_TYPE_SYNC, RET_ERR(PM_ERR_TRANS_TYPE, -1));
- if(!alpm_list_is_in(db, handle->dbs_sync)) {
+ if(!alpm_list_find(handle->dbs_sync, db)) {
RET_ERR(PM_ERR_DB_NOT_FOUND, -1);
}
Index: pacman-lib/lib/libalpm/alpm_list.c
diff -u pacman-lib/lib/libalpm/alpm_list.c:1.4 pacman-lib/lib/libalpm/alpm_list.c:1.5
--- pacman-lib/lib/libalpm/alpm_list.c:1.4 Wed Jan 24 03:51:51 2007
+++ pacman-lib/lib/libalpm/alpm_list.c Mon Jan 29 22:46:33 2007
@@ -309,7 +309,7 @@
{ /* TODO does removing the strdup here cause invalid free's anywhere? */
alpm_list_t *lp = list, *newlist = NULL;
while(lp) {
- if(!alpm_list_is_in(lp->data, newlist)) {
+ if(!alpm_list_find(newlist, lp->data)) {
newlist = alpm_list_add(newlist, lp->data);
}
lp = lp->next;
@@ -426,7 +426,7 @@
* @param haystack the list to search
* @return 1 if `needle` is found, 0 otherwise
*/
-int alpm_list_is_in(const void *needle, alpm_list_t *haystack)
+int alpm_list_find(alpm_list_t *haystack, const void *needle)
{
alpm_list_t *lp = haystack;
while(lp) {
@@ -440,12 +440,12 @@
/* Test for existence of a string in a alpm_list_t
*/
-/** Is a _string_ in the list (optimization of alpm_list_is_in for strings)
+/** Is a _string_ in the list (optimization of alpm_list_find for strings)
* @param needle the string to compare
* @param haystack the list to search
* @return 1 if `needle` is found, 0 otherwise
*/
-int alpm_list_is_strin(const char *needle, alpm_list_t *haystack)
+int alpm_list_find_str(alpm_list_t *haystack, const char *needle)
{
alpm_list_t *lp = haystack;
while(lp) {
Index: pacman-lib/lib/libalpm/alpm_list.h
diff -u pacman-lib/lib/libalpm/alpm_list.h:1.2 pacman-lib/lib/libalpm/alpm_list.h:1.3
--- pacman-lib/lib/libalpm/alpm_list.h:1.2 Wed Jan 24 03:51:51 2007
+++ pacman-lib/lib/libalpm/alpm_list.h Mon Jan 29 22:46:33 2007
@@ -64,8 +64,8 @@
/* misc */
int alpm_list_count(const alpm_list_t *list);
-int alpm_list_is_in(const void *needle, alpm_list_t *haystack);
-int alpm_list_is_strin(const char *needle, alpm_list_t *haystack);
+int alpm_list_find(alpm_list_t *haystack, const void *needle);
+int alpm_list_find_str(alpm_list_t *haystack,const char *needle);
#endif /* _ALPM_LIST_H */
Index: pacman-lib/lib/libalpm/cache.c
diff -u pacman-lib/lib/libalpm/cache.c:1.27 pacman-lib/lib/libalpm/cache.c:1.28
--- pacman-lib/lib/libalpm/cache.c:1.27 Wed Jan 24 03:51:51 2007
+++ pacman-lib/lib/libalpm/cache.c Mon Jan 29 22:46:33 2007
@@ -202,7 +202,7 @@
pmpkg_t *pkg = lp->data;
for(i = pkg->groups; i; i = i->next) {
- if(!alpm_list_is_strin(i->data, db->grpcache)) {
+ if(!alpm_list_find_str(db->grpcache, i->data)) {
pmgrp_t *grp = _alpm_grp_new();
STRNCPY(grp->name, (char *)i->data, GRP_NAME_LEN);
@@ -215,7 +215,7 @@
pmgrp_t *grp = j->data;
if(strcmp(grp->name, i->data) == 0) {
- if(!alpm_list_is_strin(pkg->name, grp->packages)) {
+ if(!alpm_list_find_str(grp->packages, pkg->name)) {
grp->packages = alpm_list_add_sorted(grp->packages, (char *)pkg->name, _alpm_grp_cmp);
}
}
Index: pacman-lib/lib/libalpm/conflict.c
diff -u pacman-lib/lib/libalpm/conflict.c:1.31 pacman-lib/lib/libalpm/conflict.c:1.32
--- pacman-lib/lib/libalpm/conflict.c:1.31 Tue Jan 23 22:02:54 2007
+++ pacman-lib/lib/libalpm/conflict.c Mon Jan 29 22:46:33 2007
@@ -240,7 +240,7 @@
if(strcmp(filestr, ".INSTALL") == 0) {
continue;
}
- if(alpm_list_is_strin(filestr, p2->files)) {
+ if(alpm_list_find_str(p2->files, filestr)) {
pmconflict_t *conflict = malloc(sizeof(pmconflict_t));
if(conflict == NULL) {
_alpm_log(PM_LOG_ERROR, _("malloc failure: could not allocate %d bytes"),
@@ -284,7 +284,7 @@
_alpm_log(PM_LOG_DEBUG, _("loading FILES info for '%s'"), dbpkg->name);
_alpm_db_read(db, INFRQ_FILES, dbpkg);
}
- if(dbpkg && alpm_list_is_strin(j->data, dbpkg->files)) {
+ if(dbpkg && alpm_list_find_str(dbpkg->files, j->data)) {
ok = 1;
}
/* Make sure that the supposedly-conflicting file is not actually just
@@ -315,7 +315,8 @@
_alpm_db_read(db, INFRQ_FILES, dbpkg2);
}
/* If it used to exist in there, but doesn't anymore */
- if(dbpkg2 && !alpm_list_is_strin(filestr, p1->files) && alpm_list_is_strin(filestr, dbpkg2->files)) {
+ if(dbpkg2 && !alpm_list_find_str(p1->files, filestr)
+ && alpm_list_find_str(dbpkg2->files, filestr)) {
ok = 1;
/* Add to the "skip list" of files that we shouldn't remove during an upgrade.
*
Index: pacman-lib/lib/libalpm/deps.c
diff -u pacman-lib/lib/libalpm/deps.c:1.59 pacman-lib/lib/libalpm/deps.c:1.60
--- pacman-lib/lib/libalpm/deps.c:1.59 Thu Jan 25 21:13:16 2007
+++ pacman-lib/lib/libalpm/deps.c Mon Jan 29 22:46:33 2007
@@ -363,7 +363,7 @@
spkg = k->data;
}
if(spkg) {
- if(alpm_list_is_strin(tp->name, spkg->provides)) {
+ if(alpm_list_find_str(spkg->provides, tp->name)) {
found = 1;
}
}
@@ -549,7 +549,7 @@
/* check if one of the packages in *list already provides this dependency */
for(j = list; j && !found; j = j->next) {
pmpkg_t *sp = (pmpkg_t *)j->data;
- if(alpm_list_is_strin(miss->depend.name, sp->provides)) {
+ if(alpm_list_find_str(sp->provides, miss->depend.name)) {
_alpm_log(PM_LOG_DEBUG, _("%s provides dependency %s -- skipping"),
sp->name, miss->depend.name);
found = 1;
@@ -602,7 +602,7 @@
* something we're not supposed to.
*/
int usedep = 1;
- if(alpm_list_is_strin(sync->name, handle->ignorepkg)) {
+ if(alpm_list_find_str(handle->ignorepkg, sync->name)) {
pmpkg_t *dummypkg = _alpm_pkg_new(miss->target, NULL);
QUESTION(trans, PM_TRANS_CONV_INSTALL_IGNOREPKG, dummypkg, sync, NULL, &usedep);
FREEPKG(dummypkg);
Index: pacman-lib/lib/libalpm/provide.c
diff -u pacman-lib/lib/libalpm/provide.c:1.8 pacman-lib/lib/libalpm/provide.c:1.9
--- pacman-lib/lib/libalpm/provide.c:1.8 Fri Jan 19 04:28:45 2007
+++ pacman-lib/lib/libalpm/provide.c Mon Jan 29 22:46:33 2007
@@ -42,7 +42,7 @@
for(lp = _alpm_db_get_pkgcache(db, INFRQ_DEPENDS); lp; lp = lp->next) {
pmpkg_t *info = lp->data;
- if(alpm_list_is_strin(package, info->provides)) {
+ if(alpm_list_find_str(info->provides, package)) {
pkgs = alpm_list_add(pkgs, info);
}
}
Index: pacman-lib/lib/libalpm/remove.c
diff -u pacman-lib/lib/libalpm/remove.c:1.57 pacman-lib/lib/libalpm/remove.c:1.58
--- pacman-lib/lib/libalpm/remove.c:1.57 Tue Jan 23 11:05:21 2007
+++ pacman-lib/lib/libalpm/remove.c Mon Jan 29 22:46:33 2007
@@ -78,7 +78,8 @@
}
/* ignore holdpkgs on upgrade */
- if((trans == handle->trans) && alpm_list_is_strin(info->name, handle->holdpkg)) {
+ if((trans == handle->trans)
+ && alpm_list_find_str(handle->holdpkg, info->name)) {
int resp = 0;
QUESTION(trans, PM_TRANS_CONV_REMOVE_HOLDPKG, info, NULL, NULL, &resp);
if(!resp) {
@@ -177,7 +178,7 @@
FREE(checksum);
} if ( !nb && trans->type == PM_TRANS_TYPE_UPGRADE ) {
/* check noupgrade */
- if ( alpm_list_is_strin(file, handle->noupgrade) ) {
+ if ( alpm_list_find_str(handle->noupgrade, file) ) {
nb = 1;
}
}
Index: pacman-lib/lib/libalpm/server.c
diff -u pacman-lib/lib/libalpm/server.c:1.16 pacman-lib/lib/libalpm/server.c:1.17
--- pacman-lib/lib/libalpm/server.c:1.16 Fri Jan 19 04:28:45 2007
+++ pacman-lib/lib/libalpm/server.c Mon Jan 29 22:46:33 2007
@@ -137,7 +137,7 @@
snprintf(realfile, PATH_MAX, "%s/%s", localpath, fn);
snprintf(output, PATH_MAX, "%s/%s.part", localpath, fn);
- if(alpm_list_is_strin(fn, complete)) {
+ if(alpm_list_find_str(complete, fn)) {
continue;
}
Index: pacman-lib/lib/libalpm/sync.c
diff -u pacman-lib/lib/libalpm/sync.c:1.92 pacman-lib/lib/libalpm/sync.c:1.93
--- pacman-lib/lib/libalpm/sync.c:1.92 Tue Jan 23 22:02:54 2007
+++ pacman-lib/lib/libalpm/sync.c Mon Jan 29 22:46:34 2007
@@ -137,7 +137,7 @@
pmpkg_t *lpkg = m->data;
if(strcmp(k->data, lpkg->name) == 0) {
_alpm_log(PM_LOG_DEBUG, _("checking replacement '%s' for package '%s'"), k->data, spkg->name);
- if(alpm_list_is_strin(lpkg->name, handle->ignorepkg)) {
+ if(alpm_list_find_str(handle->ignorepkg, lpkg->name)) {
_alpm_log(PM_LOG_WARNING, _("%s-%s: ignoring package upgrade (to be replaced by %s-%s)"),
lpkg->name, lpkg->version, spkg->name, spkg->version);
} else {
@@ -235,7 +235,7 @@
local->name, local->version, db->treename, spkg->version);
} else if(cmp == 0) {
/* versions are identical */
- } else if(alpm_list_is_strin(spkg->name, handle->ignorepkg)) {
+ } else if(alpm_list_find_str(handle->ignorepkg, spkg->name)) {
/* package should be ignored (IgnorePkg) */
_alpm_log(PM_LOG_WARNING, _("%s-%s: ignoring package upgrade (%s)"),
local->name, local->version, spkg->version);
@@ -535,7 +535,7 @@
local = _alpm_db_get_pkgfromcache(db_local, miss->depend.name);
/* check if this package also "provides" the package it's conflicting with
*/
- if(alpm_list_is_strin(miss->depend.name, sync->pkg->provides)) {
+ if(alpm_list_find_str(sync->pkg->provides, miss->depend.name)) {
/* so just treat it like a "replaces" item so the REQUIREDBY
* fields are inherited properly.
*/
@@ -559,8 +559,8 @@
/* figure out which one was requested in targets. If they both were,
* then it's still an unresolvable conflict. */
- target = alpm_list_is_strin(miss->target, trans->targets);
- depend = alpm_list_is_strin(miss->depend.name, trans->targets);
+ target = alpm_list_find_str(trans->targets, miss->target);
+ depend = alpm_list_find_str(trans->targets, miss->depend.name);
if(depend && !target) {
_alpm_log(PM_LOG_DEBUG, _("'%s' is in the target list -- keeping it"),
miss->depend.name);
@@ -591,7 +591,7 @@
_alpm_log(PM_LOG_DEBUG, _("resolving package '%s' conflict"), miss->target);
if(local) {
int doremove = 0;
- if(!alpm_list_is_strin(miss->depend.name, asked)) {
+ if(!alpm_list_find_str(asked, miss->depend.name)) {
QUESTION(trans, PM_TRANS_CONV_CONFLICT_PKG, miss->target, miss->depend.name, NULL, &doremove);
asked = alpm_list_add(asked, strdup(miss->depend.name));
if(doremove) {
@@ -1020,7 +1020,7 @@
pmpkg_t *old = j->data;
/* merge lists */
for(k = old->requiredby; k; k = k->next) {
- if(!alpm_list_is_strin(k->data, new->requiredby)) {
+ if(!alpm_list_find_str(new->requiredby, k->data)) {
/* replace old's name with new's name in the requiredby's dependency list */
alpm_list_t *m;
pmpkg_t *depender = _alpm_db_get_pkgfromcache(db_local, k->data);
Index: pacman-lib/lib/libalpm/trans.c
diff -u pacman-lib/lib/libalpm/trans.c:1.31 pacman-lib/lib/libalpm/trans.c:1.32
--- pacman-lib/lib/libalpm/trans.c:1.31 Tue Jan 23 22:02:54 2007
+++ pacman-lib/lib/libalpm/trans.c Mon Jan 29 22:46:34 2007
@@ -116,7 +116,7 @@
ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1));
ASSERT(target != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1));
- if(alpm_list_is_strin(target, trans->targets)) {
+ if(alpm_list_find_str(trans->targets, target)) {
RET_ERR(PM_ERR_TRANS_DUP_TARGET, -1);
}
Index: pacman-lib/lib/libalpm/versioncmp.c
diff -u pacman-lib/lib/libalpm/versioncmp.c:1.9 pacman-lib/lib/libalpm/versioncmp.c:1.10
--- pacman-lib/lib/libalpm/versioncmp.c:1.9 Tue Jan 23 22:02:54 2007
+++ pacman-lib/lib/libalpm/versioncmp.c Mon Jan 29 22:46:34 2007
@@ -247,7 +247,8 @@
{
int equal = 0;
- if(strcmp(pkg->name, dep->name) == 0 || alpm_list_is_strin(dep->name, pkg->provides)) {
+ if(strcmp(pkg->name, dep->name) == 0
+ || alpm_list_find_str(pkg->provides, dep->name)) {
if(dep->mod == PM_DEP_MOD_ANY) {
equal = 1;
} else {
Index: pacman-lib/src/pacman/sync.c
diff -u pacman-lib/src/pacman/sync.c:1.99 pacman-lib/src/pacman/sync.c:1.100
--- pacman-lib/src/pacman/sync.c:1.99 Wed Jan 24 03:51:51 2007
+++ pacman-lib/src/pacman/sync.c Mon Jan 29 22:46:34 2007
@@ -159,7 +159,7 @@
/* TODO Do not remove the currently installed version EITHER */
if(!strcmp(name, n)) {
char *ptr = (alpm_pkg_vercmp(version, v) < 0) ? str : s;
- if(!alpm_list_is_strin(ptr, clean)) {
+ if(!alpm_list_find_str(clean, ptr)) {
clean = alpm_list_add(clean, strdup(ptr));
}
}
@@ -645,7 +645,7 @@
for(j = data; j; j = alpm_list_next(j)) {
pmpkg_t *p = alpm_list_getdata(j);
const char *pkgname = alpm_pkg_get_name(p);
- if(!alpm_list_is_strin(pkgname, list_remove)) {
+ if(!alpm_list_find_str(list_remove, pkgname)) {
list_remove = alpm_list_add(list_remove, strdup(pkgname));
}
}
1
0
[pacman-dev] [patch] Clarify naming of alpm_list_is_in and alpm_list_is_strin
by Dan McGee 29 Jan '07
by Dan McGee 29 Jan '07
29 Jan '07
Discussed on IRC for a bit, this makes the following changes for clarity:
alpm_list_is_in --> alpm_list_find
alpm_list_is_strin --> alpm_list_find_str
Signed-off-by: Dan McGee <dpmcgee(a)gmail.com>
============================================================
--- lib/libalpm/add.c f7f5b94f49941840e59c8157645660cf1a3f36ed
+++ lib/libalpm/add.c 0570d12d507222d69470ef4053f44a2bdaf57e6b
@@ -521,7 +521,7 @@ int _alpm_add_commit(pmtrans_t *trans, p
* eg, /home/httpd/html/index.html may be removed so index.php
* could be used.
*/
- if(alpm_list_is_strin(pathname, handle->noextract)) {
+ if(alpm_list_find_str(pathname, handle->noextract)) {
alpm_logaction(_("notice: %s is in NoExtract -- skipping
extraction"), pathname);
archive_read_data_skip (archive);
continue;
@@ -530,7 +530,7 @@ int _alpm_add_commit(pmtrans_t *trans, p
if(!stat(expath, &buf) && !S_ISDIR(buf.st_mode)) {
/* file already exists */
if(!pmo_upgrade || oldpkg == NULL) {
- nb = alpm_list_is_strin(pathname, info->backup);
+ nb = alpm_list_find_str(pathname, info->backup);
} else {
/* op == PM_TRANS_TYPE_UPGRADE */
md5_orig = _alpm_needbackup(pathname, oldpkg->backup);
@@ -539,7 +539,7 @@ int _alpm_add_commit(pmtrans_t *trans, p
nb = 1;
}
}
- if(alpm_list_is_strin(pathname, handle->noupgrade)) {
+ if(alpm_list_find_str(pathname, handle->noupgrade)) {
notouch = 1;
nb = 0;
}
============================================================
--- lib/libalpm/alpm.c c21f46f9408260ed9ffb15cfa98a167ef0d4aec5
+++ lib/libalpm/alpm.c c6f1bfd08412853d58126614c236c8a5eb66d004
@@ -265,7 +265,7 @@ int alpm_db_update(int force, pmdb_t *db
ASSERT(handle->trans->state == STATE_INITIALIZED,
RET_ERR(PM_ERR_TRANS_NOT_INITIALIZED, -1));
ASSERT(handle->trans->type == PM_TRANS_TYPE_SYNC,
RET_ERR(PM_ERR_TRANS_TYPE, -1));
- if(!alpm_list_is_in(db, handle->dbs_sync)) {
+ if(!alpm_list_find(db, handle->dbs_sync)) {
RET_ERR(PM_ERR_DB_NOT_FOUND, -1);
}
============================================================
--- lib/libalpm/alpm_list.c 89407ce88ca5365c8de6852ffbfbf864b1ca5443
+++ lib/libalpm/alpm_list.c e729ea1f26d90b87427613043842a0ebd969d5c7
@@ -309,7 +309,7 @@ alpm_list_t *alpm_list_remove_dupes(alpm
{ /* TODO does removing the strdup here cause invalid free's anywhere? */
alpm_list_t *lp = list, *newlist = NULL;
while(lp) {
- if(!alpm_list_is_in(lp->data, newlist)) {
+ if(!alpm_list_find(lp->data, newlist)) {
newlist = alpm_list_add(newlist, lp->data);
}
lp = lp->next;
@@ -426,7 +426,7 @@ int alpm_list_count(const alpm_list_t *l
* @param haystack the list to search
* @return 1 if `needle` is found, 0 otherwise
*/
-int alpm_list_is_in(const void *needle, alpm_list_t *haystack)
+int alpm_list_find(const void *needle, alpm_list_t *haystack)
{
alpm_list_t *lp = haystack;
while(lp) {
@@ -440,12 +440,12 @@ int alpm_list_is_in(const void *needle,
/* Test for existence of a string in a alpm_list_t
*/
-/** Is a _string_ in the list (optimization of alpm_list_is_in for strings)
+/** Is a _string_ in the list (optimization of alpm_list_find for strings)
* @param needle the string to compare
* @param haystack the list to search
* @return 1 if `needle` is found, 0 otherwise
*/
-int alpm_list_is_strin(const char *needle, alpm_list_t *haystack)
+int alpm_list_find_str(const char *needle, alpm_list_t *haystack)
{
alpm_list_t *lp = haystack;
while(lp) {
============================================================
--- lib/libalpm/alpm_list.h 65744c2511074c24ada34e4097fe8277eb3a825d
+++ lib/libalpm/alpm_list.h bfc3b1109168fee870d57acb4e61dfabd6af510e
@@ -64,8 +64,8 @@ int alpm_list_count(const alpm_list_t *l
/* misc */
int alpm_list_count(const alpm_list_t *list);
-int alpm_list_is_in(const void *needle, alpm_list_t *haystack);
-int alpm_list_is_strin(const char *needle, alpm_list_t *haystack);
+int alpm_list_find(const void *needle, alpm_list_t *haystack);
+int alpm_list_find_str(const char *needle, alpm_list_t *haystack);
#endif /* _ALPM_LIST_H */
============================================================
--- lib/libalpm/cache.c cf0de6656dad87fe422f0c3ae6ea89b1e6faff06
+++ lib/libalpm/cache.c 0fadc44e68b0a673866c62d25a24564374fc0547
@@ -202,7 +202,7 @@ int _alpm_db_load_grpcache(pmdb_t *db)
pmpkg_t *pkg = lp->data;
for(i = pkg->groups; i; i = i->next) {
- if(!alpm_list_is_strin(i->data, db->grpcache)) {
+ if(!alpm_list_find_str(i->data, db->grpcache)) {
pmgrp_t *grp = _alpm_grp_new();
STRNCPY(grp->name, (char *)i->data, GRP_NAME_LEN);
@@ -215,7 +215,7 @@ int _alpm_db_load_grpcache(pmdb_t *db)
pmgrp_t *grp = j->data;
if(strcmp(grp->name, i->data) == 0) {
- if(!alpm_list_is_strin(pkg->name, grp->packages)) {
+ if(!alpm_list_find_str(pkg->name, grp->packages)) {
grp->packages = alpm_list_add_sorted(grp->packages, (char
*)pkg->name, _alpm_grp_cmp);
}
}
============================================================
--- lib/libalpm/conflict.c d366da1dc21fb6f26a4cceb654ef96afe39af3f2
+++ lib/libalpm/conflict.c 66e83be4095176722b4963146f811e99d948c15f
@@ -240,7 +240,7 @@ alpm_list_t *_alpm_db_find_conflicts(pmd
if(strcmp(filestr, ".INSTALL") == 0) {
continue;
}
- if(alpm_list_is_strin(filestr, p2->files)) {
+ if(alpm_list_find_str(filestr, p2->files)) {
pmconflict_t *conflict = malloc(sizeof(pmconflict_t));
if(conflict == NULL) {
_alpm_log(PM_LOG_ERROR, _("malloc failure: could not allocate
%d bytes"),
@@ -284,7 +284,7 @@ alpm_list_t *_alpm_db_find_conflicts(pmd
_alpm_log(PM_LOG_DEBUG, _("loading FILES info for '%s'"), dbpkg->name);
_alpm_db_read(db, INFRQ_FILES, dbpkg);
}
- if(dbpkg && alpm_list_is_strin(j->data, dbpkg->files)) {
+ if(dbpkg && alpm_list_find_str(j->data, dbpkg->files)) {
ok = 1;
}
/* Make sure that the supposedly-conflicting file is not actually just
@@ -315,7 +315,7 @@ alpm_list_t *_alpm_db_find_conflicts(pmd
_alpm_db_read(db, INFRQ_FILES, dbpkg2);
}
/* If it used to exist in there, but doesn't anymore */
- if(dbpkg2 && !alpm_list_is_strin(filestr, p1->files) &&
alpm_list_is_strin(filestr, dbpkg2->files)) {
+ if(dbpkg2 && !alpm_list_find_str(filestr, p1->files) &&
alpm_list_find_str(filestr, dbpkg2->files)) {
ok = 1;
/* Add to the "skip list" of files that we shouldn't remove
during an upgrade.
*
============================================================
--- lib/libalpm/deps.c a8ae50c4334acc48a98a1183ca5bcd843d83c39f
+++ lib/libalpm/deps.c 24278ab90a5c00a33e1a21cb875cfbc053d2d82b
@@ -363,7 +363,7 @@ alpm_list_t *_alpm_checkdeps(pmtrans_t *
spkg = k->data;
}
if(spkg) {
- if(alpm_list_is_strin(tp->name, spkg->provides)) {
+ if(alpm_list_find_str(tp->name, spkg->provides)) {
found = 1;
}
}
@@ -549,7 +549,7 @@ int _alpm_resolvedeps(pmdb_t *local, alp
/* check if one of the packages in *list already provides this dependency */
for(j = list; j && !found; j = j->next) {
pmpkg_t *sp = (pmpkg_t *)j->data;
- if(alpm_list_is_strin(miss->depend.name, sp->provides)) {
+ if(alpm_list_find_str(miss->depend.name, sp->provides)) {
_alpm_log(PM_LOG_DEBUG, _("%s provides dependency %s -- skipping"),
sp->name, miss->depend.name);
found = 1;
@@ -602,7 +602,7 @@ int _alpm_resolvedeps(pmdb_t *local, alp
* something we're not supposed to.
*/
int usedep = 1;
- if(alpm_list_is_strin(sync->name, handle->ignorepkg)) {
+ if(alpm_list_find_str(sync->name, handle->ignorepkg)) {
pmpkg_t *dummypkg = _alpm_pkg_new(miss->target, NULL);
QUESTION(trans, PM_TRANS_CONV_INSTALL_IGNOREPKG, dummypkg, sync,
NULL, &usedep);
FREEPKG(dummypkg);
============================================================
--- lib/libalpm/provide.c 340bf3f5bafcca439183bc8b41156f6db6c53a10
+++ lib/libalpm/provide.c 24328333cf3265338ad6783101e192f394192056
@@ -42,7 +42,7 @@ alpm_list_t *_alpm_db_whatprovides(pmdb_
for(lp = _alpm_db_get_pkgcache(db, INFRQ_DEPENDS); lp; lp = lp->next) {
pmpkg_t *info = lp->data;
- if(alpm_list_is_strin(package, info->provides)) {
+ if(alpm_list_find_str(package, info->provides)) {
pkgs = alpm_list_add(pkgs, info);
}
}
============================================================
--- lib/libalpm/remove.c 73c2f04c80f0978d3c535c97d763dcd3e3fb6e5f
+++ lib/libalpm/remove.c f84eb0ecac1032a61def4a123ef4bfcde0b5b438
@@ -78,7 +78,7 @@ int _alpm_remove_loadtarget(pmtrans_t *t
}
/* ignore holdpkgs on upgrade */
- if((trans == handle->trans) && alpm_list_is_strin(info->name,
handle->holdpkg)) {
+ if((trans == handle->trans) && alpm_list_find_str(info->name,
handle->holdpkg)) {
int resp = 0;
QUESTION(trans, PM_TRANS_CONV_REMOVE_HOLDPKG, info, NULL, NULL, &resp);
if(!resp) {
@@ -177,7 +177,7 @@ static void unlink_file(pmpkg_t *info, a
FREE(checksum);
} if ( !nb && trans->type == PM_TRANS_TYPE_UPGRADE ) {
/* check noupgrade */
- if ( alpm_list_is_strin(file, handle->noupgrade) ) {
+ if ( alpm_list_find_str(file, handle->noupgrade) ) {
nb = 1;
}
}
============================================================
--- lib/libalpm/server.c 86e081ac5aa03be1df09f38ade17b435ee07b588
+++ lib/libalpm/server.c f9ba2ac6efaf849f179e0c22a80004c2ab941798
@@ -137,7 +137,7 @@ int _alpm_downloadfiles_forreal(alpm_lis
snprintf(realfile, PATH_MAX, "%s/%s", localpath, fn);
snprintf(output, PATH_MAX, "%s/%s.part", localpath, fn);
- if(alpm_list_is_strin(fn, complete)) {
+ if(alpm_list_find_str(fn, complete)) {
continue;
}
============================================================
--- lib/libalpm/sync.c a60e4ac114269308af71677a8a487542a06a4a60
+++ lib/libalpm/sync.c 97783930dcd1b6daa661c7c5f56a62a5a15522b8
@@ -143,7 +143,7 @@ static int find_replacements(pmtrans_t *
pmpkg_t *lpkg = m->data;
if(strcmp(k->data, lpkg->name) == 0) {
_alpm_log(PM_LOG_DEBUG, _("checking replacement '%s' for
package '%s'"), k->data, spkg->name);
- if(alpm_list_is_strin(lpkg->name, handle->ignorepkg)) {
+ if(alpm_list_find_str(lpkg->name, handle->ignorepkg)) {
_alpm_log(PM_LOG_WARNING, _("%s-%s: ignoring package upgrade
(to be replaced by %s-%s)"),
lpkg->name, lpkg->version, spkg->name, spkg->version);
} else {
@@ -241,7 +241,7 @@ int _alpm_sync_sysupgrade(pmtrans_t *tra
local->name, local->version, db->treename, spkg->version);
} else if(cmp == 0) {
/* versions are identical */
- } else if(alpm_list_is_strin(spkg->name, handle->ignorepkg)) {
+ } else if(alpm_list_find_str(spkg->name, handle->ignorepkg)) {
/* package should be ignored (IgnorePkg) */
_alpm_log(PM_LOG_WARNING, _("%s-%s: ignoring package upgrade (%s)"),
local->name, local->version, spkg->version);
@@ -541,7 +541,7 @@ int _alpm_sync_prepare(pmtrans_t *trans,
local = _alpm_db_get_pkgfromcache(db_local, miss->depend.name);
/* check if this package also "provides" the package it's conflicting with
*/
- if(alpm_list_is_strin(miss->depend.name, sync->pkg->provides)) {
+ if(alpm_list_find_str(miss->depend.name, sync->pkg->provides)) {
/* so just treat it like a "replaces" item so the REQUIREDBY
* fields are inherited properly.
*/
@@ -565,8 +565,8 @@ int _alpm_sync_prepare(pmtrans_t *trans,
/* figure out which one was requested in targets. If they both were,
* then it's still an unresolvable conflict. */
- target = alpm_list_is_strin(miss->target, trans->targets);
- depend = alpm_list_is_strin(miss->depend.name, trans->targets);
+ target = alpm_list_find_str(miss->target, trans->targets);
+ depend = alpm_list_find_str(miss->depend.name, trans->targets);
if(depend && !target) {
_alpm_log(PM_LOG_DEBUG, _("'%s' is in the target list -- keeping it"),
miss->depend.name);
@@ -597,7 +597,7 @@ int _alpm_sync_prepare(pmtrans_t *trans,
_alpm_log(PM_LOG_DEBUG, _("resolving package '%s' conflict"),
miss->target);
if(local) {
int doremove = 0;
- if(!alpm_list_is_strin(miss->depend.name, asked)) {
+ if(!alpm_list_find_str(miss->depend.name, asked)) {
QUESTION(trans, PM_TRANS_CONV_CONFLICT_PKG, miss->target,
miss->depend.name, NULL, &doremove);
asked = alpm_list_add(asked, strdup(miss->depend.name));
if(doremove) {
@@ -1026,7 +1026,7 @@ int _alpm_sync_commit(pmtrans_t *trans,
pmpkg_t *old = j->data;
/* merge lists */
for(k = old->requiredby; k; k = k->next) {
- if(!alpm_list_is_strin(k->data, new->requiredby)) {
+ if(!alpm_list_find_str(k->data, new->requiredby)) {
/* replace old's name with new's name in the requiredby's
dependency list */
alpm_list_t *m;
pmpkg_t *depender = _alpm_db_get_pkgfromcache(db_local, k->data);
============================================================
--- lib/libalpm/trans.c 34f23365edf1db0a0aa8bd4bf95cb15796f61a1b
+++ lib/libalpm/trans.c 443b29376093a471a6bfe9e5051e0f4ace63aa9e
@@ -116,7 +116,7 @@ int _alpm_trans_addtarget(pmtrans_t *tra
ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1));
ASSERT(target != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1));
- if(alpm_list_is_strin(target, trans->targets)) {
+ if(alpm_list_find_str(target, trans->targets)) {
RET_ERR(PM_ERR_TRANS_DUP_TARGET, -1);
}
============================================================
--- lib/libalpm/versioncmp.c 582ae9673c26f5d6a2fcd94448abecfa769796a5
+++ lib/libalpm/versioncmp.c 03cc3c0c3845fa1efabdea7c295af687701ea508
@@ -247,7 +247,7 @@ int _alpm_depcmp(pmpkg_t *pkg, pmdepend_
{
int equal = 0;
- if(strcmp(pkg->name, dep->name) == 0 ||
alpm_list_is_strin(dep->name, pkg->provides)) {
+ if(strcmp(pkg->name, dep->name) == 0 ||
alpm_list_find_str(dep->name, pkg->provides)) {
if(dep->mod == PM_DEP_MOD_ANY) {
equal = 1;
} else {
============================================================
--- src/pacman/sync.c b390058b1dd027e02247832600d7ff544e8c5174
+++ src/pacman/sync.c 1700c5913b3911c286546326e7898cb0f9abe6fa
@@ -159,7 +159,7 @@ static int sync_cleancache(int level)
/* TODO Do not remove the currently installed version EITHER */
if(!strcmp(name, n)) {
char *ptr = (alpm_pkg_vercmp(version, v) < 0) ? str : s;
- if(!alpm_list_is_strin(ptr, clean)) {
+ if(!alpm_list_find_str(ptr, clean)) {
clean = alpm_list_add(clean, strdup(ptr));
}
}
@@ -644,7 +644,7 @@ int pacman_sync(alpm_list_t *targets)
for(j = data; j; j = alpm_list_next(j)) {
pmpkg_t *p = alpm_list_getdata(j);
const char *pkgname = alpm_pkg_get_name(p);
- if(!alpm_list_is_strin(pkgname, list_remove)) {
+ if(!alpm_list_find_str(pkgname, list_remove)) {
list_remove = alpm_list_add(list_remove, strdup(pkgname));
}
}
2
4
[pacman-dev] [patch] Modified info query so unknown attributes are not shown
by Dan McGee 27 Jan '07
by Dan McGee 27 Jan '07
27 Jan '07
(Patched on my local tree, so it may not line up perfectly, but it is
very straightforward.)
* Modified info query so it doesn't show more than available when querying a
package file.
Signed-off-by: Dan McGee <dpmcgee(a)gmail.com>
#
# old_revision [6ed5dfeba6a29ca2c5158f88f2d76b21fc8938f3]
#
# patch "src/pacman/package.c"
# from [1c53121b062b4ee21f6b372e5e3ffbceb3b2b36f]
# to [d935dbb664984fa0b60ea08b3132946f49be2214]
#
============================================================
--- src/pacman/package.c 1c53121b062b4ee21f6b372e5e3ffbceb3b2b36f
+++ src/pacman/package.c d935dbb664984fa0b60ea08b3132946f49be2214
@@ -34,6 +34,10 @@
#include "package.h"
/* Display the content of an installed package
+ *
+ * level: <1 - omits N/A info for file query (-Qp)
+ * 1 - normal level
+ * >1 - extra information (backup files)
*/
void dump_pkg_full(pmpkg_t *pkg, int level)
{
@@ -69,26 +73,26 @@ void dump_pkg_full(pmpkg_t *pkg, int lev
list_display(_("Provides :"), alpm_pkg_get_provides(pkg));
list_display(_("Depends On :"), alpm_pkg_get_depends(pkg));
list_display(_("Removes :"), alpm_pkg_get_removes(pkg));
- /* TODO only applicable if querying installed package, not a file */
- list_display(_("Required By :"), alpm_pkg_get_requiredby(pkg));
+ if(level > 0) { /* Only applicable if installed package */
+ list_display(_("Required By :"), alpm_pkg_get_requiredby(pkg));
+ }
list_display(_("Conflicts With :"), alpm_pkg_get_conflicts(pkg));
printf(_("Installed Size : %ld K\n"), (long)alpm_pkg_get_size(pkg) / 1024);
printf(_("Packager : %s\n"), (char *)alpm_pkg_get_packager(pkg));
printf(_("Architecture : %s\n"), (char *)alpm_pkg_get_arch(pkg));
printf(_("Build Date : %s %s\n"), bdate, strlen(bdate) ? "UTC" : "");
printf(_("Build Type : %s\n"), strlen(type) ? type : _("Unknown"));
- /* TODO only applicable if querying installed package, not a file */
- printf(_("Install Date : %s %s\n"), idate, strlen(idate) ? "UTC" : "");
+ if(level > 0) {
+ printf(_("Install Date : %s %s\n"), idate, strlen(idate) ? "UTC" : "");
+ printf(_("Install Reason : %s\n"), reason);
+ }
printf(_("Install Script : %s\n"), alpm_pkg_has_scriptlet(pkg) ?
_("Yes") : _("No"));
- printf(_("Reason : %s\n"), reason);
- /* TODO only applicable if querying installed package, not a file */
printf(_("Description : "));
indentprint(alpm_pkg_get_desc(pkg), 17);
printf("\n");
/* Print additional package info if info flag passed more than once */
- /* TODO only applicable if querying installed package, not a file */
if(level > 1) {
/* call new backup function */
dump_pkg_backups(pkg);
1
0
26 Jan '07
Date: Thursday, January 25, 2007 @ 21:19:24
Author: aaron
Path: /home/cvs-pacman/pacman-lib/src/pacman
Modified: downloadprog.c (1.7 -> 1.8)
Missed that 8)
----------------+
downloadprog.c | 1 -
1 file changed, 1 deletion(-)
Index: pacman-lib/src/pacman/downloadprog.c
diff -u pacman-lib/src/pacman/downloadprog.c:1.7 pacman-lib/src/pacman/downloadprog.c:1.8
--- pacman-lib/src/pacman/downloadprog.c:1.7 Thu Jan 25 21:13:16 2007
+++ pacman-lib/src/pacman/downloadprog.c Thu Jan 25 21:19:24 2007
@@ -56,7 +56,6 @@
/* a little hard to conceal easter eggs in open-source software,
* but they're still fun. ;) */
const unsigned short chomp = alpm_option_get_chomp();
- unsigned int chomp = 0;
char *fname, *p;
unsigned int maxcols = getcols();
unsigned int progresslen = maxcols - 57;
1
0
Date: Thursday, January 25, 2007 @ 21:13:17
Author: aaron
Path: /home/cvs-pacman/pacman-lib
Modified: autoclean.sh (1.7 -> 1.8) configure.ac (1.22 -> 1.23)
etc/pacman.d/Makefile.am (1.3 -> 1.4)
lib/libalpm/Makefile.am (1.13 -> 1.14)
lib/libalpm/alpm.c (1.105 -> 1.106)
lib/libalpm/deps.c (1.58 -> 1.59) scripts/makeworld (1.5 -> 1.6)
src/pacman/Makefile.am (1.11 -> 1.12)
src/pacman/downloadprog.c (1.6 -> 1.7)
src/pacman/package.c (1.23 -> 1.24)
src/pacman/pacman.c (1.83 -> 1.84) src/pacman/trans.h (1.6 -> 1.7)
src/pacman/util.c (1.23 -> 1.24)
Dan McGee <dpmcgee(a)gmail.com>
* Lots of code cleanup, and type fixes
* Make 'makeworld' a bit more in-line with the other stuff
* Make -Si and -Qi operations appear the same
---------------------------+
autoclean.sh | 1 +
configure.ac | 26 ++++++++++----------------
etc/pacman.d/Makefile.am | 1 -
lib/libalpm/Makefile.am | 2 +-
lib/libalpm/alpm.c | 4 ++--
lib/libalpm/deps.c | 4 ++--
scripts/makeworld | 12 ++++++------
src/pacman/Makefile.am | 4 ++--
src/pacman/downloadprog.c | 6 +++---
src/pacman/package.c | 22 +++++++++++-----------
src/pacman/pacman.c | 4 ++--
src/pacman/trans.h | 1 +
src/pacman/util.c | 2 +-
13 files changed, 42 insertions(+), 47 deletions(-)
Index: pacman-lib/autoclean.sh
diff -u pacman-lib/autoclean.sh:1.7 pacman-lib/autoclean.sh:1.8
--- pacman-lib/autoclean.sh:1.7 Tue Dec 19 02:58:29 2006
+++ pacman-lib/autoclean.sh Thu Jan 25 21:13:16 2007
@@ -36,6 +36,7 @@
rm -rf etc/Makefile
rm -rf etc/pacman.d/Makefile.in
rm -rf etc/pacman.d/Makefile
+rm -rf etc/pacman.d/{current,extra,community,unstable,release}
rm -rf etc/abs/Makefile.in
rm -rf etc/abs/Makefile
Index: pacman-lib/configure.ac
diff -u pacman-lib/configure.ac:1.22 pacman-lib/configure.ac:1.23
--- pacman-lib/configure.ac:1.22 Thu Jan 11 12:34:51 2007
+++ pacman-lib/configure.ac Thu Jan 25 21:13:16 2007
@@ -147,7 +147,7 @@
dnl Help line for debug
AC_ARG_ENABLE(debug,
- AC_HELP_STRING([ --enable-debug], [Enable debugging support]),
+ AC_HELP_STRING([--enable-debug], [Enable debugging support]),
[debug=$enableval], [debug=yes])
dnl Help line for fakeroot
@@ -292,26 +292,20 @@
fi
dnl Check for math
-AC_CHECK_LIB([m], [log10], [AC_CHECK_HEADER([math.h], [LIBM='-lm'])])
-if test -n "$LIBM"; then
- LDFLAGS="$LDFLAGS $LIBM"
-else
- AC_MSG_ERROR("math library not found!");
+AC_CHECK_LIB([m], [sqrt], [AC_CHECK_HEADER([math.h], [LIBM='-lm'])])
+if test -z "$LIBM"; then
+ AC_MSG_ERROR("math library needed to compile pacman!");
fi
dnl Check for libarchive
AC_CHECK_LIB([archive], [archive_read_data], [AC_CHECK_HEADER([archive.h], [LIBARCHIVE='-larchive'])])
-if test -n "$LIBARCHIVE"; then
- LDFLAGS="$LDFLAGS $LIBARCHIVE"
-else
+if test -z "$LIBARCHIVE"; then
AC_MSG_ERROR("libarchive is needed to compile pacman!");
fi
dnl Check for libdownload
AC_CHECK_LIB([download], [downloadParseURL], [AC_CHECK_HEADER([download.h], [LIBDOWNLOAD='-ldownload'])])
-if test -n "$LIBDOWNLOAD"; then
- LDFLAGS="$LDFLAGS $LIBDOWNLOAD"
-else
+if test -z "$LIBDOWNLOAD"; then
AC_MSG_ERROR("libdownload is needed to compile pacman!");
fi
@@ -326,20 +320,20 @@
dnl Enable or disable debug code
AC_MSG_CHECKING(for debug mode request)
-if test x$debug = xyes ; then
- AM_CONDITIONAL(PACMAN_DEBUG, test x$debug = xyes)
+if test "$debug" = "yes" ; then
+ AM_CONDITIONAL(PACMAN_DEBUG, test "$debug" = "yes")
CFLAGS="$CFLAGS -g -Wall -Werror -std=c99 -DPACMAN_DEBUG"
LDFLAGS="$LDFLAGS -lmcheck"
AC_MSG_RESULT(yes)
else
- AM_CONDITIONAL(PACMAN_DEBUG, test x$debug = xno)
+ AM_CONDITIONAL(PACMAN_DEBUG, test "$debug" = "no")
CFLAGS="$CFLAGS -Wall -std=c99"
AC_MSG_RESULT(no)
fi
dnl Enable or disable fakeroot code
AC_MSG_CHECKING(for fakeroot proof support)
-if test x$fakeroot = xyes ; then
+if test "$fakeroot" = "yes" ; then
AC_MSG_RESULT(yes)
else
CFLAGS="$CFLAGS -DFAKEROOT"
Index: pacman-lib/etc/pacman.d/Makefile.am
diff -u pacman-lib/etc/pacman.d/Makefile.am:1.3 pacman-lib/etc/pacman.d/Makefile.am:1.4
--- pacman-lib/etc/pacman.d/Makefile.am:1.3 Tue Jan 16 22:40:09 2007
+++ pacman-lib/etc/pacman.d/Makefile.am Thu Jan 25 21:13:16 2007
@@ -1,7 +1,6 @@
EXTRA_DIST = community current extra release unstable
clean:
- rm $(EXTRA_DIST)
install-data-hook:
mkdir -p $(DESTDIR)$(sysconfdir)/pacman.d ; \
Index: pacman-lib/lib/libalpm/Makefile.am
diff -u pacman-lib/lib/libalpm/Makefile.am:1.13 pacman-lib/lib/libalpm/Makefile.am:1.14
--- pacman-lib/lib/libalpm/Makefile.am:1.13 Fri Jan 19 04:28:44 2007
+++ pacman-lib/lib/libalpm/Makefile.am Thu Jan 25 21:13:16 2007
@@ -40,7 +40,7 @@
libalpm_la_SOURCES = $(TARGETS)
libalpm_la_LDFLAGS = -no-undefined -version-info $(PM_VERSION_INFO)
-libalpm_la_LIBADD = -larchive -ldownload
+libalpm_la_LIBADD = -larchive -ldownload -lm
if HAS_DOXYGEN
all: doxygen.in
Index: pacman-lib/lib/libalpm/alpm.c
diff -u pacman-lib/lib/libalpm/alpm.c:1.105 pacman-lib/lib/libalpm/alpm.c:1.106
--- pacman-lib/lib/libalpm/alpm.c:1.105 Tue Jan 23 22:02:54 2007
+++ pacman-lib/lib/libalpm/alpm.c Thu Jan 25 21:13:16 2007
@@ -566,7 +566,7 @@
* and
* package-name-bar-1.2.3-1
*/
- int i = 0;
+ size_t i = 0;
char *arch, *cmp, *p;
if((p = strrchr(pkgname, '-'))) {
@@ -1008,7 +1008,7 @@
_alpm_log(PM_LOG_DEBUG, _("config: xfercommand: %s"), ptr);
} else if (!strcmp(key, "UPGRADEDELAY")) {
/* The config value is in days, we use seconds */
- long ud = atol(ptr) * 60 * 60 *24;
+ time_t ud = atol(ptr) * 60 * 60 *24;
alpm_option_set_upgradedelay(ud);
_alpm_log(PM_LOG_DEBUG, _("config: upgradedelay: %d"), ud);
} else {
Index: pacman-lib/lib/libalpm/deps.c
diff -u pacman-lib/lib/libalpm/deps.c:1.58 pacman-lib/lib/libalpm/deps.c:1.59
--- pacman-lib/lib/libalpm/deps.c:1.58 Tue Jan 23 22:02:54 2007
+++ pacman-lib/lib/libalpm/deps.c Thu Jan 25 21:13:16 2007
@@ -249,9 +249,9 @@
}
if(!_alpm_depcmp(tp, &depend)) {
_alpm_log(PM_LOG_DEBUG, _("checkdeps: found %s as required by %s"),
- depend.name, p->name);
+ depend.name, p->name);
miss = _alpm_depmiss_new(p->name, PM_DEP_TYPE_REQUIRED, depend.mod,
- depend.name, depend.version);
+ depend.name, depend.version);
if(!_alpm_depmiss_isin(miss, baddeps)) {
baddeps = alpm_list_add(baddeps, miss);
} else {
Index: pacman-lib/scripts/makeworld
diff -u pacman-lib/scripts/makeworld:1.5 pacman-lib/scripts/makeworld:1.6
--- pacman-lib/scripts/makeworld:1.5 Wed Dec 20 20:53:41 2006
+++ pacman-lib/scripts/makeworld Thu Jan 25 21:13:16 2007
@@ -20,8 +20,8 @@
# USA.
#
-version="2.9.8"
-toplevel=`pwd`
+version="3.0.0"
+toplevel=$(pwd)
usage() {
echo "makeworld version $version"
@@ -119,13 +119,13 @@
# convert a (possibly) relative path to absolute
cd $dest
-dest=`pwd`
+dest=$(pwd)
cd - &>/dev/null
-sd=`date +"[%b %d %H:%M]"`
+sd=$(date +"[%b %d %H:%M]")
for category in $*; do
- for port in `find $toplevel/$category -maxdepth 1 -mindepth 1 -type d | sort`; do
+ for port in $(find $toplevel/$category -maxdepth 1 -mindepth 1 -type d | sort); do
cd $port
if [ -f PKGBUILD ]; then
. PKGBUILD
@@ -138,7 +138,7 @@
buildstatus=1
fi
fi
- d=`date +"[%b %d %H:%M]"`
+ d=$(date +"[%b %d %H:%M]")
echo -n "$d " >>$toplevel/build.log
case $buildstatus in
0) echo "$pkgname already built -- skipping" >>$toplevel/build.log ;;
Index: pacman-lib/src/pacman/Makefile.am
diff -u pacman-lib/src/pacman/Makefile.am:1.11 pacman-lib/src/pacman/Makefile.am:1.12
--- pacman-lib/src/pacman/Makefile.am:1.11 Fri Jan 19 04:28:46 2007
+++ pacman-lib/src/pacman/Makefile.am Thu Jan 25 21:13:16 2007
@@ -17,9 +17,9 @@
pacman_static_SOURCES = $(pacman_SOURCES)
pacman_LDADD = -L$(top_srcdir)/lib/libalpm/.libs \
- -ldownload -lm -lalpm
+ -ldownload -lalpm
pacman_static_LDADD = -L$(top_srcdir)/lib/libalpm/.libs/ \
- -ldownload -lm -lalpm
+ -ldownload -lalpm
pacman_static_LDFLAGS = $(LDFLAGS) -all-static
Index: pacman-lib/src/pacman/downloadprog.c
diff -u pacman-lib/src/pacman/downloadprog.c:1.6 pacman-lib/src/pacman/downloadprog.c:1.7
--- pacman-lib/src/pacman/downloadprog.c:1.6 Fri Jan 19 04:28:46 2007
+++ pacman-lib/src/pacman/downloadprog.c Thu Jan 25 21:13:16 2007
@@ -53,6 +53,9 @@
{
static unsigned int lasthash = 0, mouth = 0;
unsigned int i, hash;
+ /* a little hard to conceal easter eggs in open-source software,
+ * but they're still fun. ;) */
+ const unsigned short chomp = alpm_option_get_chomp();
unsigned int chomp = 0;
char *fname, *p;
unsigned int maxcols = getcols();
@@ -75,9 +78,6 @@
return;
}
- /* a little hard to conceal easter eggs in open-source software, but they're still fun. ;) */
- chomp = alpm_option_get_chomp();
-
gettimeofday(¤t_time, NULL);
total_timediff = current_time.tv_sec-initial_time.tv_sec
+ (float)(current_time.tv_usec-initial_time.tv_usec) / 1000000;
Index: pacman-lib/src/pacman/package.c
diff -u pacman-lib/src/pacman/package.c:1.23 pacman-lib/src/pacman/package.c:1.24
--- pacman-lib/src/pacman/package.c:1.23 Mon Jan 22 03:52:18 2007
+++ pacman-lib/src/pacman/package.c Thu Jan 25 21:13:16 2007
@@ -63,24 +63,24 @@
/* actual output */
printf(_("Name : %s\n"), (char *)alpm_pkg_get_name(pkg));
printf(_("Version : %s\n"), (char *)alpm_pkg_get_version(pkg));
- list_display(_("Groups :"), alpm_pkg_get_groups(pkg));
- printf(_("Packager : %s\n"), (char *)alpm_pkg_get_packager(pkg));
printf(_("URL : %s\n"), (char *)alpm_pkg_get_url(pkg));
list_display(_("License :"), alpm_pkg_get_licenses(pkg));
+ list_display(_("Groups :"), alpm_pkg_get_groups(pkg));
+ list_display(_("Provides :"), alpm_pkg_get_provides(pkg));
+ list_display(_("Depends On :"), alpm_pkg_get_depends(pkg));
+ list_display(_("Removes :"), alpm_pkg_get_removes(pkg));
+ /* TODO only applicable if querying installed package, not a file */
+ list_display(_("Required By :"), alpm_pkg_get_requiredby(pkg));
+ list_display(_("Conflicts With :"), alpm_pkg_get_conflicts(pkg));
+ printf(_("Installed Size : %ld K\n"), (long)alpm_pkg_get_size(pkg) / 1024);
+ printf(_("Packager : %s\n"), (char *)alpm_pkg_get_packager(pkg));
printf(_("Architecture : %s\n"), (char *)alpm_pkg_get_arch(pkg));
- printf(_("Installed Size : %ld\n"), (long int)alpm_pkg_get_size(pkg));
printf(_("Build Date : %s %s\n"), bdate, strlen(bdate) ? "UTC" : "");
printf(_("Build Type : %s\n"), strlen(type) ? type : _("Unknown"));
/* TODO only applicable if querying installed package, not a file */
printf(_("Install Date : %s %s\n"), idate, strlen(idate) ? "UTC" : "");
printf(_("Install Script : %s\n"), alpm_pkg_has_scriptlet(pkg) ? _("Yes") : _("No"));
printf(_("Reason : %s\n"), reason);
- list_display(_("Provides :"), alpm_pkg_get_provides(pkg));
- list_display(_("Depends On :"), alpm_pkg_get_depends(pkg));
- list_display(_("Removes :"), alpm_pkg_get_removes(pkg));
- /* TODO only applicable if querying installed package, not a file */
- list_display(_("Required By :"), alpm_pkg_get_requiredby(pkg));
- list_display(_("Conflicts With :"), alpm_pkg_get_conflicts(pkg));
printf(_("Description : "));
indentprint(alpm_pkg_get_desc(pkg), 17);
@@ -117,8 +117,8 @@
list_display(_("Removes :"), alpm_pkg_get_removes(pkg));
list_display(_("Conflicts With :"), alpm_pkg_get_conflicts(pkg));
list_display(_("Replaces :"), alpm_pkg_get_replaces(pkg));
- printf(_("Download Size : %ld\n"), (long)alpm_pkg_get_size(pkg));
- printf(_("Installed Size : %ld\n"), (long)alpm_pkg_get_isize(pkg));
+ printf(_("Download Size : %6.2f K\n"), (float)alpm_pkg_get_size(pkg) / 1024.0);
+ printf(_("Installed Size : %6.2f K\n"), (float)alpm_pkg_get_isize(pkg) / 1024.0);
printf(_("Description : "));
indentprint(alpm_pkg_get_desc(pkg), 17);
Index: pacman-lib/src/pacman/pacman.c
diff -u pacman-lib/src/pacman/pacman.c:1.83 pacman-lib/src/pacman/pacman.c:1.84
--- pacman-lib/src/pacman/pacman.c:1.83 Wed Jan 24 11:57:19 2007
+++ pacman-lib/src/pacman/pacman.c Thu Jan 25 21:13:16 2007
@@ -121,8 +121,8 @@
printf(_("usage: %s {-Q --query} [options] [package]\n"), myname);
printf(_("options:\n"));
printf(_(" -c, --changelog view the changelog of a package\n"));
- printf(_(" -e, --orphans list all packages that were installed as a dependency\n"));
- printf(_(" and are not required by any other packages\n"));
+ printf(_(" -e, --orphans list all packages installed as dependencies but no longer\n"));
+ printf(_(" required by any package\n"));
printf(_(" -g, --groups view all members of a package group\n"));
printf(_(" -i, --info view package information\n"));
printf(_(" -l, --list list the contents of the queried package\n"));
Index: pacman-lib/src/pacman/trans.h
diff -u pacman-lib/src/pacman/trans.h:1.6 pacman-lib/src/pacman/trans.h:1.7
--- pacman-lib/src/pacman/trans.h:1.6 Tue Jan 23 22:02:55 2007
+++ pacman-lib/src/pacman/trans.h Thu Jan 25 21:13:16 2007
@@ -28,6 +28,7 @@
void cb_trans_conv(pmtransconv_t event, void *data1, void *data2,
void *data3, int *response);
+/* callback to handle display of the progress bar for transactions */
void cb_trans_progress(pmtransprog_t event, char *pkgname, int percent,
int howmany, int remain);
Index: pacman-lib/src/pacman/util.c
diff -u pacman-lib/src/pacman/util.c:1.23 pacman-lib/src/pacman/util.c:1.24
--- pacman-lib/src/pacman/util.c:1.23 Wed Jan 24 11:57:19 2007
+++ pacman-lib/src/pacman/util.c Thu Jan 25 21:13:16 2007
@@ -167,7 +167,7 @@
while(*p) {
if(*p == ' ') {
const char *next = NULL;
- int len;
+ unsigned int len;
p++;
if(p == NULL || *p == ' ') continue;
next = strchr(p, ' ');
1
0
Date: Thursday, January 25, 2007 @ 20:57:06
Author: aaron
Path: /home/cvs-pacman/pacman-lib/doc
Modified: pacman.8.in (1.9 -> 1.10)
Forgot this patch from Dan McGee as part of the bug #5409 fixes
-------------+
pacman.8.in | 3 +++
1 file changed, 3 insertions(+)
Index: pacman-lib/doc/pacman.8.in
diff -u pacman-lib/doc/pacman.8.in:1.9 pacman-lib/doc/pacman.8.in:1.10
--- pacman-lib/doc/pacman.8.in:1.9 Tue Dec 5 02:38:34 2006
+++ pacman-lib/doc/pacman.8.in Thu Jan 25 20:57:06 2007
@@ -305,6 +305,9 @@
follow a URL naming structure. Currently only ftp is supported for remote servers. If you
want to use a local directory, you can specify the full path with a 'file://' prefix, as
shown above.
+The order of repositories in the file matters; repositories listed first will
+take precidence over those listed later in the file when packages in two
+repositories have identical names, regardless of version number.
.SH USING YOUR OWN REPOSITORY
Let's say you have a bunch of custom packages in \fI/home/pkgs\fP and their respective PKGBUILD
files are all in \fI/var/abs/local\fP. All you need to do is generate a compressed package database
1
0
Date: Thursday, January 25, 2007 @ 20:34:27
Author: aaron
Path: /home/cvs-pacman/pacman-lib/src/pacman
Modified: trans.c (1.28 -> 1.29)
* copy and paste error, "resolving deps" -> "cleaning up"
Signed-off-by: Dan McGee <dpmcgee(a)gmail.com>
---------+
trans.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: pacman-lib/src/pacman/trans.c
diff -u pacman-lib/src/pacman/trans.c:1.28 pacman-lib/src/pacman/trans.c:1.29
--- pacman-lib/src/pacman/trans.c:1.28 Tue Jan 23 22:02:55 2007
+++ pacman-lib/src/pacman/trans.c Thu Jan 25 20:34:26 2007
@@ -60,7 +60,7 @@
}
break;
case PM_TRANS_EVT_CLEANUP_START:
- pm_fprintf(stderr, NL, _("resolving dependencies... "));
+ pm_fprintf(stderr, NL, _("cleaning up... "));
break;
case PM_TRANS_EVT_RESOLVEDEPS_START:
pm_fprintf(stderr, NL, _("resolving dependencies... "));
1
0
[pacman-dev] CVS update of pacman-lib (etc/pacman.conf.in lib/libalpm/util.c)
by Aaron Griffin 26 Jan '07
by Aaron Griffin 26 Jan '07
26 Jan '07
Date: Thursday, January 25, 2007 @ 20:33:03
Author: aaron
Path: /home/cvs-pacman/pacman-lib
Modified: etc/pacman.conf.in (1.3 -> 1.4) lib/libalpm/util.c (1.40 -> 1.41)
* Fix FS #3107- Use ISO date style
* Fix FS #5409- document that pacman.conf repo ordering is important
Signed-off-by: Dan McGee <dpmcgee(a)gmail.com>
--------------------+
etc/pacman.conf.in | 4 +++-
lib/libalpm/util.c | 9 +++++----
2 files changed, 8 insertions(+), 5 deletions(-)
Index: pacman-lib/etc/pacman.conf.in
diff -u pacman-lib/etc/pacman.conf.in:1.3 pacman-lib/etc/pacman.conf.in:1.4
--- pacman-lib/etc/pacman.conf.in:1.3 Thu Dec 21 12:51:50 2006
+++ pacman-lib/etc/pacman.conf.in Thu Jan 25 20:33:03 2007
@@ -21,7 +21,9 @@
# - can be defined here or included from another file
# - pacman will search repositories in the order defined here
# - local/custom mirrors can be added here or in separate files
-
+# - repositories listed first will take precedence when packages
+# have identical names, regardless of version number
+#
#[testing]
#Server = ftp://ftp.archlinux.org/testing/os/i686
Index: pacman-lib/lib/libalpm/util.c
diff -u pacman-lib/lib/libalpm/util.c:1.40 pacman-lib/lib/libalpm/util.c:1.41
--- pacman-lib/lib/libalpm/util.c:1.40 Tue Jan 23 22:02:54 2007
+++ pacman-lib/lib/libalpm/util.c Thu Jan 25 20:33:03 2007
@@ -357,10 +357,11 @@
t = time(NULL);
tm = localtime(&t);
- fprintf(f, "[%02d/%02d/%02d %02d:%02d] %s\n",
- tm->tm_mon+1, tm->tm_mday, tm->tm_year-100,
- tm->tm_hour, tm->tm_min,
- str);
+ /* Use ISO-8601 date format */
+ fprintf(f, "[%04d-%02d-%02d %02d:%02d] %s\n",
+ tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday,
+ tm->tm_hour, tm->tm_min, str);
+
fflush(f);
}
1
0
Date: Thursday, January 25, 2007 @ 20:26:09
Author: aaron
Path: /home/cvs-pacman/pacman-lib/scripts
Modified: makepkg (1.34 -> 1.35)
James Rosten <seinfeld90 at gmail.com>
* Use PKGDEST and SRCDEST from the environment (if defined) when calling makepkg
---------+
makepkg | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
Index: pacman-lib/scripts/makepkg
diff -u pacman-lib/scripts/makepkg:1.34 pacman-lib/scripts/makepkg:1.35
--- pacman-lib/scripts/makepkg:1.34 Tue Jan 23 11:02:37 2007
+++ pacman-lib/scripts/makepkg Thu Jan 25 20:26:08 2007
@@ -27,7 +27,6 @@
myver='3.0.0'
startdir=$(pwd)
-PKGDEST=$startdir
BUILDSCRIPT="PKGBUILD"
PKGEXT="pkg.tar.gz"
@@ -314,6 +313,11 @@
ARGLIST=$@
+#preserve environment variables
+PKGDEST=${PKGDEST:-$startdir} #default to $startdir if undefined
+_PKGDEST=${PKGDEST}
+_SRCDEST=$SRCDEST
+
#Source makepkg.conf; fail if it is not found
if [ -f /etc/makepkg.conf ]; then
source /etc/makepkg.conf
@@ -327,6 +331,10 @@
source ~/.makepkg.conf
fi
+# override settings with an environment variable for batch processing
+PKGDEST=${_PKGDEST:-$PKGDEST}
+SRCDEST=${_SRCDEST:-$SRCDEST}
+
while [ "$#" -ne "0" ]; do
case $1 in
# pacman
1
0
Someone with the proper permissions, I found these on the bugtracker
today and they seem to be old, outdated, or otherwise unnecessary:
FS#4036 — file can't recognize python 2.4 byte-code
- It can now
FS#5009 — pacman-optimize makes errnous fs assumptions
- Didn't Jaime fix this with his recent rewrite?
FS#5555 — pacman -Scc is slow
-Quote from bug report - "sorry that I couldn't come up with
something better, but I just had to get #5555 ;)"
-Good luck speeding it up- I think it just removes the directory
and recreates it
-Dan
2
1
[pacman-dev] [patch] Fix FS #3107 (Use ISO style dates), FS #5409 (document pacman.conf order is relevent)
by Dan McGee 25 Jan '07
by Dan McGee 25 Jan '07
25 Jan '07
* Fix FS #3107- Use ISO date style
* Fix FS #5409- document that pacman.conf repo ordering is important
Signed-off-by: Dan McGee <dpmcgee(a)gmail.com>
============================================================
--- doc/pacman.8.in 3143c0f4de3cd5ca7ddbf100690e91a8d3d7f7b6
+++ doc/pacman.8.in e9a8f44c7a2ced2b3594bd41a6f60dd1a026a144
@@ -305,6 +305,9 @@ shown above.
follow a URL naming structure. Currently only ftp is supported for
remote servers. If you
want to use a local directory, you can specify the full path with a
'file://' prefix, as
shown above.
+The order of repositories in the file matters; repositories listed first will
+take precidence over those listed later in the file when packages in two
+repositories have identical names, regardless of version number.
.SH USING YOUR OWN REPOSITORY
Let's say you have a bunch of custom packages in \fI/home/pkgs\fP and
their respective PKGBUILD
files are all in \fI/var/abs/local\fP. All you need to do is
generate a compressed package database
============================================================
--- etc/pacman.conf.in f0a4dc45658de05f03658969dc81136801736229
+++ etc/pacman.conf.in de8076ec76dd59832b10616c782e471e2d1d5ed7
@@ -21,6 +21,8 @@ HoldPkg = pacman glibc
# - can be defined here or included from another file
# - pacman will search repositories in the order defined here
# - local/custom mirrors can be added here or in separate files
+# - repositories listed first will take precedence when packages
+# have identical names, regardless of version number
#[testing]
#Server = ftp://ftp.archlinux.org/testing/os/i686
============================================================
--- lib/libalpm/util.c 1749c1006346422efcc2257de4ff96e74ebc9336
+++ lib/libalpm/util.c 0a2ce942c427b52148f0dfab02a3c3dd5cc15b67
@@ -357,10 +357,10 @@ int _alpm_logaction(unsigned short usesy
t = time(NULL);
tm = localtime(&t);
- fprintf(f, "[%02d/%02d/%02d %02d:%02d] %s\n",
- tm->tm_mon+1, tm->tm_mday, tm->tm_year-100,
- tm->tm_hour, tm->tm_min,
- str);
+ /* Use ISO-8601 date format */
+ fprintf(f, "[%04d-%02d-%02d %02d:%02d] %s\n",
+ tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday,
+ tm->tm_hour, tm->tm_min, str);
fflush(f);
}
1
0
[pacman-dev] [psuedo-patch] First attempt at FS#3492 and fix a copy-paste error
by Dan McGee 25 Jan '07
by Dan McGee 25 Jan '07
25 Jan '07
If you are interested in fixing this bug, let me know. Otherwise I'm
going to put this on the back burner for a bit and hopefully get back
to it later. If you do want to work on it and have questions, shoot me
an email or talk to me on IRC when I'm on (as toofishes).
* start to fixing FS #3492, fixed typecasts, clarified actions,
added notes to code but not actual removal code that is
necessary, as I'm not sure what the best plan of action is.
* copy and paste error, "resolving deps" -> "cleaning up"
Signed-off-by: Dan McGee <dpmcgee(a)gmail.com>
#
# old_revision [8b849d94fb042fa6b42cad8ff6938fe27406dadb]
#
# patch "lib/libalpm/add.c"
# from [5340d7f7768bf9d8ec37b907a422350c510c8f39]
# to [2e8010675af78d63c5f57b2eb7c71b0f4a2db455]
#
# patch "src/pacman/trans.c"
# from [1f02954b56601d065e49e0c52c92e3af395c65fd]
# to [41d5b28cb0602a8b59368da1b5b3ef1874048af1]
#
============================================================
--- lib/libalpm/add.c 5340d7f7768bf9d8ec37b907a422350c510c8f39
+++ lib/libalpm/add.c 2e8010675af78d63c5f57b2eb7c71b0f4a2db455
@@ -210,10 +210,9 @@ error:
return(-1);
}
-
-static int name_cmp(const void *p1, const void *p2)
+static int pkg_cmp(const void *p1, const void *p2)
{
- return(strcmp(((pmpkg_t *)p1)->name, (const char *)p2));
+ return(strcmp(((pmdepmissing_t *)p1)->target, ((pmdepmissing_t
*)p2)->target));
}
int _alpm_add_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data)
@@ -253,11 +252,26 @@ int _alpm_add_prepare(pmtrans_t *trans,
/* Attempt to resolve conflicts */
QUESTION(trans, PM_TRANS_CONV_CONFLICT_PKG, miss->target,
miss->depend.name, NULL, &skip_this);
if(skip_this) {
- pmpkg_t **pkg = NULL;
- lp = alpm_list_remove(lp, (void *)miss->depend.name, name_cmp,
(void **)pkg);
- FREEPKG(*pkg);
+ pmdepmissing_t *pkg = NULL;
+ lp = alpm_list_remove(lp, (void *)miss, pkg_cmp, (void*)&pkg);
+ /* TODO: We remove the conflict from the list but never actually remove
+ * the package. Need to do this to fix FS #3492. The sync code should
+ * provide an example of how to do this, as it handles replaces and
+ * removes. We run into problems because we do a file conflict check
+ * below and it fails there. A force flag will skip that part, but
+ * still not remove the original package designated here for removal.
+ * Better yet, dump all this shitty duplicate code and somehow combine
+ * it with the sync code. */
+ FREE(pkg);
+ if(lp == NULL) {
+ break;
+ }
}
}
+ /* Removal code should go here, as described above. Instead of simply
+ * removing items, perhaps throw them in another list to be removed, then
+ * proceed as sync.c would? I'm not sure because I'm not familiar enough
+ * with the codebase. */
if(lp != NULL) {
if(data) {
*data = lp;
@@ -283,8 +297,10 @@ int _alpm_add_prepare(pmtrans_t *trans,
_alpm_log(PM_LOG_FLOW1, _("cleaning up"));
for (lp=trans->packages; lp!=NULL; lp=lp->next) {
info=(pmpkg_t *)lp->data;
+ fprintf(stderr, "package: %s %s\n", info->name, info->version); /* DEBUG */
for (rmlist=info->removes; rmlist!=NULL; rmlist=rmlist->next) {
snprintf(rm_fname, PATH_MAX, "%s%s", handle->root, (char *)rmlist->data);
+ fprintf(stderr, " removing %s\n", rm_fname); /* DEBUG */
remove(rm_fname);
}
}
============================================================
--- src/pacman/trans.c 1f02954b56601d065e49e0c52c92e3af395c65fd
+++ src/pacman/trans.c 41d5b28cb0602a8b59368da1b5b3ef1874048af1
@@ -60,7 +60,7 @@ void cb_trans_evt(pmtransevt_t event, vo
}
break;
case PM_TRANS_EVT_CLEANUP_START:
- pm_fprintf(stderr, NL, _("resolving dependencies... "));
+ pm_fprintf(stderr, NL, _("cleaning up... "));
break;
case PM_TRANS_EVT_RESOLVEDEPS_START:
pm_fprintf(stderr, NL, _("resolving dependencies... "));
1
0
Date: Wednesday, January 24, 2007 @ 03:51:51
Author: aaron
Path: /home/cvs-pacman/pacman-lib
Added: config.rpath (1.1)
Modified: .cvsignore (1.2 -> 1.3) TODO.aaron (1.9 -> 1.10)
lib/libalpm/alpm_list.c (1.3 -> 1.4)
lib/libalpm/alpm_list.h (1.1 -> 1.2)
lib/libalpm/be_files.c (1.21 -> 1.22)
lib/libalpm/cache.c (1.26 -> 1.27)
lib/libalpm/package.c (1.50 -> 1.51)
src/pacman/add.c (1.24 -> 1.25) src/pacman/deptest.c (1.11 -> 1.12)
src/pacman/log.c (1.23 -> 1.24) src/pacman/query.c (1.18 -> 1.19)
src/pacman/remove.c (1.24 -> 1.25) src/pacman/sync.c (1.98 -> 1.99)
* Shuffled some of the alpm_list free funtions - still not perfect, but better
* Added alpm_list_remove_node for single list node removal
* Proper error checking/output for failed db_read/db_write (missing files)
* Invalid packages (missing files) are now removed from the package cache
* -Qs and -Ss output now look the same
* config.rpath causes errors on one machine I had, so I added it to CVS
* Fixed a "clobbered memory" issue when installing groups - only the outer list
should be free'd, not the contained data
-------------------------+
.cvsignore | 1
TODO.aaron | 3
config.rpath | 614 ++++++++++++++++++++++++++++++++++++++++++++++
lib/libalpm/alpm_list.c | 55 +++-
lib/libalpm/alpm_list.h | 13
lib/libalpm/be_files.c | 23 -
lib/libalpm/cache.c | 9
lib/libalpm/package.c | 3
src/pacman/add.c | 2
src/pacman/deptest.c | 4
src/pacman/log.c | 6
src/pacman/query.c | 17 -
src/pacman/remove.c | 2
src/pacman/sync.c | 11
14 files changed, 710 insertions(+), 53 deletions(-)
Index: pacman-lib/.cvsignore
diff -u pacman-lib/.cvsignore:1.2 pacman-lib/.cvsignore:1.3
--- pacman-lib/.cvsignore:1.2 Tue Jan 16 22:40:08 2007
+++ pacman-lib/.cvsignore Wed Jan 24 03:51:50 2007
@@ -9,7 +9,6 @@
config.log
config.status
config.sub
-config.rpath
configure
depcomp
install-sh
Index: pacman-lib/TODO.aaron
diff -u pacman-lib/TODO.aaron:1.9 pacman-lib/TODO.aaron:1.10
--- pacman-lib/TODO.aaron:1.9 Fri Jan 19 12:42:58 2007
+++ pacman-lib/TODO.aaron Wed Jan 24 03:51:50 2007
@@ -22,6 +22,9 @@
- maybe it's my fault, but I see little difference between PM_LOG_FLOW1,
PM_LOG_FLOW2, and PM_LOG_DEBUG. We might want to just do away with flow1
and flow2 and use debug across the board.
+ - clear up list allocation/deallocation - some lists need to be free'd, some
+ do not and there is no clear indication WHEN this should happen.
+ - remove DB entries (directories) on a read error?
* pacman: A LOT of functions are way too long. There should be an upper limit of
100-200 lines. _alpm_add_commit is around 600 lines, and is far too complex.
Index: pacman-lib/config.rpath
diff -u /dev/null pacman-lib/config.rpath:1.1
--- /dev/null Wed Jan 24 03:51:51 2007
+++ pacman-lib/config.rpath Wed Jan 24 03:51:50 2007
@@ -0,0 +1,614 @@
+#! /bin/sh
+# Output a system dependent set of variables, describing how to set the
+# run time search path of shared libraries in an executable.
+#
+# Copyright 1996-2006 Free Software Foundation, Inc.
+# Taken from GNU libtool, 2001
+# Originally by Gordon Matzigkeit <gord(a)gnu.ai.mit.edu>, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# The first argument passed to this file is the canonical host specification,
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
+# should be set by the caller.
+#
+# The set of defined variables is at the end of this script.
+
+# Known limitations:
+# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
+# than 256 bytes, otherwise the compiler driver will dump core. The only
+# known workaround is to choose shorter directory names for the build
+# directory and/or the installation directory.
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+shrext=.so
+
+host="$1"
+host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+# Code taken from libtool.m4's _LT_CC_BASENAME.
+
+for cc_temp in $CC""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
+
+# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.
+
+wl=
+if test "$GCC" = yes; then
+ wl='-Wl,'
+else
+ case "$host_os" in
+ aix*)
+ wl='-Wl,'
+ ;;
+ darwin*)
+ case $cc_basename in
+ xlc*)
+ wl='-Wl,'
+ ;;
+ esac
+ ;;
+ mingw* | pw32* | os2*)
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ wl='-Wl,'
+ ;;
+ irix5* | irix6* | nonstopux*)
+ wl='-Wl,'
+ ;;
+ newsos6)
+ ;;
+ linux*)
+ case $cc_basename in
+ icc* | ecc*)
+ wl='-Wl,'
+ ;;
+ pgcc | pgf77 | pgf90)
+ wl='-Wl,'
+ ;;
+ ccc*)
+ wl='-Wl,'
+ ;;
+ como)
+ wl='-lopt='
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ wl='-Wl,'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ osf3* | osf4* | osf5*)
+ wl='-Wl,'
+ ;;
+ sco3.2v5*)
+ ;;
+ solaris*)
+ wl='-Wl,'
+ ;;
+ sunos4*)
+ wl='-Qoption ld '
+ ;;
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ wl='-Wl,'
+ ;;
+ sysv4*MP*)
+ ;;
+ unicos*)
+ wl='-Wl,'
+ ;;
+ uts4*)
+ ;;
+ esac
+fi
+
+# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS.
+
+hardcode_libdir_flag_spec=
+hardcode_libdir_separator=
+hardcode_direct=no
+hardcode_minus_L=no
+
+case "$host_os" in
+ cygwin* | mingw* | pw32*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+esac
+
+ld_shlibs=yes
+if test "$with_gnu_ld" = yes; then
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ # Unlike libtool, we use -rpath here, not --rpath, since the documented
+ # option of GNU ld is called -rpath, not --rpath.
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ case "$host_os" in
+ aix3* | aix4* | aix5*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs=no
+ fi
+ ;;
+ amigaos*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ # Samuel A. Falvo II <kc5tja(a)dolphin.openprojects.net> reports
+ # that the semantics of dynamic libraries on AmigaOS, at least up
+ # to version 4, is to share data among multiple programs linked
+ # with the same dynamic library. Since this doesn't match the
+ # behavior of shared libraries on other platforms, we cannot use
+ # them.
+ ld_shlibs=no
+ ;;
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ cygwin* | mingw* | pw32*)
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec='-L$libdir'
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ interix3*)
+ hardcode_direct=no
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ linux*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ netbsd*)
+ ;;
+ solaris*)
+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+ ld_shlibs=no
+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs=no
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ ;;
+ sunos4*)
+ hardcode_direct=yes
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ if test "$ld_shlibs" = no; then
+ hardcode_libdir_flag_spec=
+ fi
+else
+ case "$host_os" in
+ aix3*)
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L=yes
+ if test "$GCC" = yes; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct=unsupported
+ fi
+ ;;
+ aix4* | aix5*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ else
+ aix_use_runtimelinking=no
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+ fi
+ hardcode_direct=yes
+ hardcode_libdir_separator=':'
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ hardcode_direct=yes
+ else
+ # We have old collect2
+ hardcode_direct=unsupported
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
+ fi
+ ;;
+ esac
+ fi
+ # Begin _LT_AC_SYS_LIBPATH_AIX.
+ echo 'int main () { return 0; }' > conftest.c
+ ${CC} ${LDFLAGS} conftest.c -o conftest
+ aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+ if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+ fi
+ if test -z "$aix_libpath"; then
+ aix_libpath="/usr/lib:/lib"
+ fi
+ rm -f conftest.c conftest
+ # End _LT_AC_SYS_LIBPATH_AIX.
+ if test "$aix_use_runtimelinking" = yes; then
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+ else
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ fi
+ fi
+ ;;
+ amigaos*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ # see comment about different semantics on the GNU ld section
+ ld_shlibs=no
+ ;;
+ bsdi[45]*)
+ ;;
+ cygwin* | mingw* | pw32*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec=' '
+ libext=lib
+ ;;
+ darwin* | rhapsody*)
+ hardcode_direct=no
+ if test "$GCC" = yes ; then
+ :
+ else
+ case $cc_basename in
+ xlc*)
+ ;;
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+ fi
+ ;;
+ dgux*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ ;;
+ freebsd1*)
+ ld_shlibs=no
+ ;;
+ freebsd2.2*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ ;;
+ freebsd2*)
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ ;;
+ freebsd* | kfreebsd*-gnu | dragonfly*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ ;;
+ hpux9*)
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ hpux10*)
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ fi
+ ;;
+ hpux11*)
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_direct=no
+ ;;
+ *)
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ esac
+ fi
+ ;;
+ irix5* | irix6* | nonstopux*)
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ netbsd*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ ;;
+ newsos6)
+ hardcode_direct=yes
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ openbsd*)
+ hardcode_direct=yes
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ else
+ case "$host_os" in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ *)
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ ;;
+ os2*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ osf3*)
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ osf4* | osf5*)
+ if test "$GCC" = yes; then
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ # Both cc and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec='-rpath $libdir'
+ fi
+ hardcode_libdir_separator=:
+ ;;
+ solaris*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ sunos4*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ ;;
+ sysv4)
+ case $host_vendor in
+ sni)
+ hardcode_direct=yes # is this really true???
+ ;;
+ siemens)
+ hardcode_direct=no
+ ;;
+ motorola)
+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ ;;
+ sysv4.3*)
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ ld_shlibs=yes
+ fi
+ ;;
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
+ ;;
+ sysv5* | sco3.2v5* | sco5v6*)
+ hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+ hardcode_libdir_separator=':'
+ ;;
+ uts4*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ ;;
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+fi
+
+# Check dynamic linker characteristics
+# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
+libname_spec='lib$name'
+case "$host_os" in
+ aix3*)
+ ;;
+ aix4* | aix5*)
+ ;;
+ amigaos*)
+ ;;
+ beos*)
+ ;;
+ bsdi[45]*)
+ ;;
+ cygwin* | mingw* | pw32*)
+ shrext=.dll
+ ;;
+ darwin* | rhapsody*)
+ shrext=.dylib
+ ;;
+ dgux*)
+ ;;
+ freebsd1*)
+ ;;
+ kfreebsd*-gnu)
+ ;;
+ freebsd* | dragonfly*)
+ ;;
+ gnu*)
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $host_cpu in
+ ia64*)
+ shrext=.so
+ ;;
+ hppa*64*)
+ shrext=.sl
+ ;;
+ *)
+ shrext=.sl
+ ;;
+ esac
+ ;;
+ interix3*)
+ ;;
+ irix5* | irix6* | nonstopux*)
+ case "$host_os" in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
+ *) libsuff= shlibsuff= ;;
+ esac
+ ;;
+ esac
+ ;;
+ linux*oldld* | linux*aout* | linux*coff*)
+ ;;
+ linux*)
+ ;;
+ knetbsd*-gnu)
+ ;;
+ netbsd*)
+ ;;
+ newsos6)
+ ;;
+ nto-qnx*)
+ ;;
+ openbsd*)
+ ;;
+ os2*)
+ libname_spec='$name'
+ shrext=.dll
+ ;;
+ osf3* | osf4* | osf5*)
+ ;;
+ solaris*)
+ ;;
+ sunos4*)
+ ;;
+ sysv4 | sysv4.3*)
+ ;;
+ sysv4*MP*)
+ ;;
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ ;;
+ uts4*)
+ ;;
+esac
+
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
+shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
+escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+
+LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
+
+# How to pass a linker flag through the compiler.
+wl="$escaped_wl"
+
+# Static library suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally "so").
+shlibext="$shlibext"
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator="$hardcode_libdir_separator"
+
+# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct="$hardcode_direct"
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L="$hardcode_minus_L"
+
+EOF
Index: pacman-lib/lib/libalpm/alpm_list.c
diff -u pacman-lib/lib/libalpm/alpm_list.c:1.3 pacman-lib/lib/libalpm/alpm_list.c:1.4
--- pacman-lib/lib/libalpm/alpm_list.c:1.3 Mon Jan 22 20:34:58 2007
+++ pacman-lib/lib/libalpm/alpm_list.c Wed Jan 24 03:51:51 2007
@@ -49,33 +49,37 @@
return(list);
}
-/** Free a list structure and possibly the internal data as well
+/** Free a list, but not the contained data
* @param list the list to free
- * @param fn a free function for the internal data, or NULL for none
*/
-void alpm_list_free(alpm_list_t *list, alpm_list_fn_free fn)
+void alpm_list_free(alpm_list_t *list)
{
alpm_list_t *it = list;
while(it) {
- alpm_list_t *ptr = it->next;
- if(fn && it->data) {
- fn(it->data);
- }
- FREE(it);
- it = ptr;
+ alpm_list_t *tmp = it->next;
+ free(it);
+ it = tmp;
}
}
-/** Free the outer list, but not the contained data
- * A minor simplification of alpm_list_free
+/** Free the internal data of a list structure
* @param list the list to free
+ * @param fn a free function for the internal data
*/
-void alpm_list_free_outer(alpm_list_t *list)
+void alpm_list_free_inner(alpm_list_t *list, alpm_list_fn_free fn)
{
- alpm_list_free(list, NULL);
+ alpm_list_t *it = list;
+
+ while(it) {
+ if(fn && it->data) {
+ fn(it->data);
+ }
+ it = it->next;
+ }
}
+
/* Mutators */
/** Add a new item to the list
@@ -271,6 +275,31 @@
return(haystack);
}
+/** Remove the passed in node from the list that it is a part of
+ * @note this DOES NOT free the node
+ * @param node the list node we're removing
+ * @return the node which took the place of this one
+ */
+alpm_list_t *alpm_list_remove_node(alpm_list_t *node)
+{
+ if(!node) return(NULL);
+
+ alpm_list_t *ret = NULL;
+
+ if(node->prev) {
+ node->prev->next = node->next;
+ ret = node->prev;
+ node->prev = NULL;
+ }
+ if(node->next) {
+ node->next->prev = node->prev;
+ ret = node->next;
+ node->next = NULL;
+ }
+
+ return(ret);
+}
+
/** Create a new list without any duplicates
* @note DOES NOT copy data members
* @param list the list to copy
Index: pacman-lib/lib/libalpm/alpm_list.h
diff -u pacman-lib/lib/libalpm/alpm_list.h:1.1 pacman-lib/lib/libalpm/alpm_list.h:1.2
--- pacman-lib/lib/libalpm/alpm_list.h:1.1 Fri Jan 19 04:28:44 2007
+++ pacman-lib/lib/libalpm/alpm_list.h Wed Jan 24 03:51:51 2007
@@ -30,18 +30,18 @@
struct __alpm_list_t *next;
};
-/* TODO we should do away with these... they're messy */
-#define _FREELIST(p, f) do { if(p) { alpm_list_free(p, f); p = NULL; } } while(0)
-#define FREELIST(p) _FREELIST(p, free)
-#define FREELISTPTR(p) _FREELIST(p, NULL)
+/* TODO we should do away with these... they're messy*/
+#define _FREELIST(p, f) do { alpm_list_free_inner(p, f); alpm_list_free(p); p = NULL; } while(0)
+#define FREELIST(p) _FREELIST(p, free)
+#define FREELISTPTR(p) do { alpm_list_free(p); p = NULL; } while(0)
typedef void (*alpm_list_fn_free)(void *); /* item deallocation callback */
typedef int (*alpm_list_fn_cmp)(const void *, const void *); /* item comparison callback */
/* allocation */
alpm_list_t *alpm_list_new(void);
-void alpm_list_free(alpm_list_t *list, alpm_list_fn_free fn);
-void alpm_list_free_outer(alpm_list_t *list);
+void alpm_list_free(alpm_list_t *list);
+void alpm_list_free_inner(alpm_list_t *list, alpm_list_fn_free fn);
/* item mutators */
alpm_list_t *alpm_list_add(alpm_list_t *list, void *data);
@@ -49,6 +49,7 @@
alpm_list_t* alpm_list_mmerge(alpm_list_t *left, alpm_list_t *right, alpm_list_fn_cmp fn);
alpm_list_t* alpm_list_msort(alpm_list_t *list, int n, alpm_list_fn_cmp fn);
alpm_list_t *alpm_list_remove(alpm_list_t *haystack, void *needle, alpm_list_fn_cmp fn, void **data);
+alpm_list_t *alpm_list_remove_node(alpm_list_t *node);
alpm_list_t *alpm_list_remove_dupes(alpm_list_t *list);
alpm_list_t *alpm_list_strdup(alpm_list_t *list);
alpm_list_t *alpm_list_reverse(alpm_list_t *list);
Index: pacman-lib/lib/libalpm/be_files.c
diff -u pacman-lib/lib/libalpm/be_files.c:1.21 pacman-lib/lib/libalpm/be_files.c:1.22
--- pacman-lib/lib/libalpm/be_files.c:1.21 Tue Jan 23 22:02:54 2007
+++ pacman-lib/lib/libalpm/be_files.c Wed Jan 24 03:51:51 2007
@@ -217,9 +217,8 @@
/* DESC */
if(inforeq & INFRQ_DESC) {
snprintf(path, PATH_MAX, "%s/%s-%s/desc", db->path, info->name, info->version);
- fp = fopen(path, "r");
- if(fp == NULL) {
- _alpm_log(PM_LOG_DEBUG, "%s (%s)", path, strerror(errno));
+ if((fp = fopen(path, "r")) == NULL) {
+ _alpm_log(PM_LOG_ERROR, _("could not open file %s: %s"), path, strerror(errno));
goto error;
}
while(!feof(fp)) {
@@ -362,9 +361,8 @@
/* FILES */
if(inforeq & INFRQ_FILES) {
snprintf(path, PATH_MAX, "%s/%s-%s/files", db->path, info->name, info->version);
- fp = fopen(path, "r");
- if(fp == NULL) {
- _alpm_log(PM_LOG_WARNING, "%s (%s)", path, strerror(errno));
+ if((fp = fopen(path, "r")) == NULL) {
+ _alpm_log(PM_LOG_ERROR, _("could not open file %s: %s"), path, strerror(errno));
goto error;
}
while(fgets(line, 256, fp)) {
@@ -386,9 +384,8 @@
/* DEPENDS */
if(inforeq & INFRQ_DEPENDS) {
snprintf(path, PATH_MAX, "%s/%s-%s/depends", db->path, info->name, info->version);
- fp = fopen(path, "r");
- if(fp == NULL) {
- _alpm_log(PM_LOG_WARNING, "%s (%s)", path, strerror(errno));
+ if((fp = fopen(path, "r")) == NULL) {
+ _alpm_log(PM_LOG_ERROR, _("could not open file %s: %s"), path, strerror(errno));
goto error;
}
while(!feof(fp)) {
@@ -474,8 +471,8 @@
_alpm_log(PM_LOG_DEBUG, _("writing %s-%s DESC information back to db"), info->name, info->version);
snprintf(path, PATH_MAX, "%s/%s-%s/desc", db->path, info->name, info->version);
if((fp = fopen(path, "w")) == NULL) {
- _alpm_log(PM_LOG_ERROR, _("db_write: could not open file %s/desc"), db->treename);
- retval = 1;
+ _alpm_log(PM_LOG_ERROR, _("could not open file %s: %s"), path, strerror(errno));
+ retval = -1;
goto cleanup;
}
fprintf(fp, "%%NAME%%\n%s\n\n"
@@ -560,7 +557,7 @@
_alpm_log(PM_LOG_DEBUG, _("writing %s-%s FILES information back to db"), info->name, info->version);
snprintf(path, PATH_MAX, "%s/%s-%s/files", db->path, info->name, info->version);
if((fp = fopen(path, "w")) == NULL) {
- _alpm_log(PM_LOG_ERROR, _("db_write: could not open file %s/files"), db->treename);
+ _alpm_log(PM_LOG_ERROR, _("could not open file %s: %s"), path, strerror(errno));
retval = -1;
goto cleanup;
}
@@ -587,7 +584,7 @@
_alpm_log(PM_LOG_DEBUG, _("writing %s-%s DEPENDS information back to db"), info->name, info->version);
snprintf(path, PATH_MAX, "%s/%s-%s/depends", db->path, info->name, info->version);
if((fp = fopen(path, "w")) == NULL) {
- _alpm_log(PM_LOG_ERROR, _("db_write: could not open file %s/depends"), db->treename);
+ _alpm_log(PM_LOG_ERROR, _("could not open file %s: %s"), path, strerror(errno));
retval = -1;
goto cleanup;
}
Index: pacman-lib/lib/libalpm/cache.c
diff -u pacman-lib/lib/libalpm/cache.c:1.26 pacman-lib/lib/libalpm/cache.c:1.27
--- pacman-lib/lib/libalpm/cache.c:1.26 Tue Jan 23 22:02:54 2007
+++ pacman-lib/lib/libalpm/cache.c Wed Jan 24 03:51:51 2007
@@ -112,8 +112,13 @@
for(p = db->pkgcache; p; p = p->next) {
pmpkg_t *pkg = (pmpkg_t *)p->data;
if(infolevel != INFRQ_NONE && !(pkg->infolevel & infolevel)) {
- _alpm_db_read(db, infolevel, pkg);
- reloaded = 1;
+ if(_alpm_db_read(db, infolevel, pkg) == -1) {
+ _alpm_log(PM_LOG_ERROR, _("failed to read package '%s-%s', removing from package cache"),
+ pkg->name, pkg->version);
+ p = alpm_list_remove_node(p);
+ } else {
+ reloaded = 1;
+ }
}
}
if(reloaded) {
Index: pacman-lib/lib/libalpm/package.c
diff -u pacman-lib/lib/libalpm/package.c:1.50 pacman-lib/lib/libalpm/package.c:1.51
--- pacman-lib/lib/libalpm/package.c:1.50 Tue Jan 23 22:02:54 2007
+++ pacman-lib/lib/libalpm/package.c Wed Jan 24 03:51:51 2007
@@ -29,6 +29,7 @@
#include <string.h>
#include <libintl.h>
#include <locale.h>
+#include <errno.h>
/* pacman */
#include "log.h"
#include "util.h"
@@ -136,7 +137,7 @@
int linenum = 0;
if((fp = fopen(descfile, "r")) == NULL) {
- _alpm_log(PM_LOG_ERROR, _("could not open file %s"), descfile);
+ _alpm_log(PM_LOG_ERROR, _("could not open file %s: %s"), descfile, strerror(errno));
return(-1);
}
Index: pacman-lib/src/pacman/add.c
diff -u pacman-lib/src/pacman/add.c:1.24 pacman-lib/src/pacman/add.c:1.25
--- pacman-lib/src/pacman/add.c:1.24 Tue Jan 23 22:02:55 2007
+++ pacman-lib/src/pacman/add.c Wed Jan 24 03:51:51 2007
@@ -167,7 +167,7 @@
cleanup:
if(data) {
- alpm_list_free(data, NULL);
+ alpm_list_free(data);
}
if(alpm_trans_release() == -1) {
ERR(NL, _("failed to release transaction (%s)\n"), alpm_strerror(pm_errno));
Index: pacman-lib/src/pacman/deptest.c
diff -u pacman-lib/src/pacman/deptest.c:1.11 pacman-lib/src/pacman/deptest.c:1.12
--- pacman-lib/src/pacman/deptest.c:1.11 Tue Jan 23 22:02:55 2007
+++ pacman-lib/src/pacman/deptest.c Wed Jan 24 03:51:51 2007
@@ -130,7 +130,7 @@
}
synctargs = alpm_list_add(synctargs, strdup(alpm_dep_get_name(miss)));
}
- alpm_list_free(data, NULL);
+ alpm_list_free(data);
break;
case PM_ERR_CONFLICTING_DEPS:
/* we can't auto-resolve conflicts */
@@ -139,7 +139,7 @@
MSG(NL, _("conflict: %s"), alpm_dep_get_name(miss));
}
retval = 127;
- alpm_list_free(data, NULL);
+ alpm_list_free(data);
break;
default:
retval = 127;
Index: pacman-lib/src/pacman/log.c
diff -u pacman-lib/src/pacman/log.c:1.23 pacman-lib/src/pacman/log.c:1.24
--- pacman-lib/src/pacman/log.c:1.23 Fri Jan 19 04:28:46 2007
+++ pacman-lib/src/pacman/log.c Wed Jan 24 03:51:51 2007
@@ -192,12 +192,14 @@
pch--;
}
*++pch = 0;
- strtrim(response);
+ if(strlen(response) != 0) {
+ strtrim(response);
+ }
/* User hits 'enter', forcing a newline here */
neednl = 0;
- if(!strcasecmp(response, _("Y")) || !strcasecmp(response, _("YES")) || !strlen(response)) {
+ if(!strcasecmp(response, _("Y")) || !strcasecmp(response, _("YES")) || strlen(response) == 0) {
return(1);
}
}
Index: pacman-lib/src/pacman/query.c
diff -u pacman-lib/src/pacman/query.c:1.18 pacman-lib/src/pacman/query.c:1.19
--- pacman-lib/src/pacman/query.c:1.18 Fri Jan 19 04:28:46 2007
+++ pacman-lib/src/pacman/query.c Wed Jan 24 03:51:51 2007
@@ -98,16 +98,23 @@
return(1);
}
for(i = ret; i; i = alpm_list_next(i)) {
+ char *group = NULL;
+ alpm_list_t *grp;
pmpkg_t *pkg = alpm_list_getdata(i);
- printf("local/%s/%s %s\n ",
- (char *)alpm_list_getdata(alpm_pkg_get_groups(pkg)),
- alpm_pkg_get_name(pkg),
- alpm_pkg_get_version(pkg));
+ printf("local/%s %s", alpm_pkg_get_name(pkg), alpm_pkg_get_version(pkg));
+
+ if((grp = alpm_pkg_get_groups(pkg)) != NULL) {
+ group = alpm_list_getdata(grp);
+ printf(" (%s)\n ", (char *)alpm_list_getdata(grp));
+ } else {
+ printf("\n ");
+ }
+
indentprint(alpm_pkg_get_desc(pkg), 4);
printf("\n");
}
- alpm_list_free_outer(ret);
+ alpm_list_free(ret);
return(0);
}
Index: pacman-lib/src/pacman/remove.c
diff -u pacman-lib/src/pacman/remove.c:1.24 pacman-lib/src/pacman/remove.c:1.25
--- pacman-lib/src/pacman/remove.c:1.24 Fri Jan 19 04:28:46 2007
+++ pacman-lib/src/pacman/remove.c Wed Jan 24 03:51:51 2007
@@ -103,7 +103,7 @@
MSG(NL, _(":: %s is required by %s\n"), alpm_dep_get_target(miss),
alpm_dep_get_name(miss));
}
- alpm_list_free(data, NULL);
+ alpm_list_free(data);
break;
default:
break;
Index: pacman-lib/src/pacman/sync.c
diff -u pacman-lib/src/pacman/sync.c:1.98 pacman-lib/src/pacman/sync.c:1.99
--- pacman-lib/src/pacman/sync.c:1.98 Tue Jan 23 22:02:55 2007
+++ pacman-lib/src/pacman/sync.c Wed Jan 24 03:51:51 2007
@@ -265,7 +265,7 @@
indentprint(alpm_pkg_get_desc(pkg), 4);
printf("\n\n");
}
- alpm_list_free_outer(ret);
+ alpm_list_free(ret);
} else {
for(j = alpm_db_getpkgcache(db); j; j = alpm_list_next(j)) {
pmpkg_t *pkg = alpm_list_getdata(j);
@@ -375,7 +375,7 @@
if(db == NULL) {
ERR(NL, _("repository \"%s\" was not found.\n"),repo);
- FREELISTPTR(ls);
+ alpm_list_free(ls);
return(1);
}
@@ -395,7 +395,7 @@
}
if(targets) {
- FREELISTPTR(ls);
+ alpm_list_free(ls);
}
return(0);
@@ -541,7 +541,7 @@
}
}
}
- FREELIST(pkgs);
+ alpm_list_free(pkgs);
}
}
if(!found) {
@@ -756,8 +756,7 @@
*/
cleanup:
if(data) {
- alpm_list_free(data, NULL);
- data = NULL;
+ alpm_list_free(data);
}
if(alpm_trans_release() == -1) {
ERR(NL, _("failed to release transaction (%s)\n"), alpm_strerror(pm_errno));
5
7
[pacman-dev] CVS update of pacman-lib/src/pacman (log.c pacman.c util.c)
by Aaron Griffin 24 Jan '07
by Aaron Griffin 24 Jan '07
24 Jan '07
Date: Wednesday, January 24, 2007 @ 11:57:19
Author: aaron
Path: /home/cvs-pacman/pacman-lib/src/pacman
Modified: log.c (1.24 -> 1.25) pacman.c (1.82 -> 1.83) util.c (1.22 -> 1.23)
Cleanup 'neednl' usage - make it static
----------+
log.c | 2 +-
pacman.c | 18 +++---------------
util.c | 1 -
3 files changed, 4 insertions(+), 17 deletions(-)
Index: pacman-lib/src/pacman/log.c
diff -u pacman-lib/src/pacman/log.c:1.24 pacman-lib/src/pacman/log.c:1.25
--- pacman-lib/src/pacman/log.c:1.24 Wed Jan 24 03:51:51 2007
+++ pacman-lib/src/pacman/log.c Wed Jan 24 11:57:19 2007
@@ -37,7 +37,7 @@
extern config_t *config;
-int neednl = 0; /* for cleaner message output */
+static int neednl = 0; /* for cleaner message output */
static int needpad = 0; /* pad blanks to terminal width */
/* simple helper for needpad */
Index: pacman-lib/src/pacman/pacman.c
diff -u pacman-lib/src/pacman/pacman.c:1.82 pacman-lib/src/pacman/pacman.c:1.83
--- pacman-lib/src/pacman/pacman.c:1.82 Fri Jan 19 04:28:46 2007
+++ pacman-lib/src/pacman/pacman.c Wed Jan 24 11:57:19 2007
@@ -78,8 +78,6 @@
/* list of targets specified on command line */
static alpm_list_t *pm_targets;
-extern int neednl;
-
/* Display usage/syntax for the specified operation.
* op: the operation code requested
* myname: basename(argv[0])
@@ -197,14 +195,8 @@
FREELIST(pm_targets);
FREECONF(config);
- if(neednl) {
- putchar('\n');
- }
-
- /* restore the cursor
- printf("\033[?25h\033[?0c");
- fflush(stdout);
- */
+ /* This fixes up any missing newlines (neednl) */
+ MSG(NL, "");
exit(signum);
}
@@ -407,10 +399,6 @@
signal(SIGTERM, cleanup);
signal(SIGSEGV, cleanup);
- /* hide the cursor, prevent flicker during fancy graphics
- printf("\033[?25l\033[?1c");
- */
-
/* i18n init */
lang=getenv("LC_ALL");
if(lang==NULL || lang[0]=='\0')
@@ -419,7 +407,7 @@
lang=getenv("LANG");
setlocale(LC_ALL, lang);
- // workaround for tr_TR
+ /* workaround for tr_TR */
if(lang && !strcmp(lang, "tr_TR"))
setlocale(LC_CTYPE, "C");
bindtextdomain("pacman", "/usr/share/locale");
Index: pacman-lib/src/pacman/util.c
diff -u pacman-lib/src/pacman/util.c:1.22 pacman-lib/src/pacman/util.c:1.23
--- pacman-lib/src/pacman/util.c:1.22 Fri Jan 19 04:28:47 2007
+++ pacman-lib/src/pacman/util.c Wed Jan 24 11:57:19 2007
@@ -49,7 +49,6 @@
#include "log.h"
extern config_t *config;
-extern int neednl;
/* gets the current screen column width */
unsigned int getcols()
1
0
I've made a few changes in my side branch that I've been maintaining
and wanted to see if anything here is good enough to be put on the
main line. I have the patch below and a comment or two before each
individual file diff explaining what I changed and why. Search for ***
to find my added comments.
-Dan
****These files should be removed here and not by make, since they are
created by configure, not make.
============================================================
--- autoclean.sh 1924ab94d4748bd719b6d05c3c9754e0ef6e5dc5
+++ autoclean.sh f01e101d3eda8c4a5719702b7c73ac288dd7be57
@@ -36,6 +36,7 @@ rm -rf etc/pacman.d/Makefile
rm -rf etc/Makefile
rm -rf etc/pacman.d/Makefile.in
rm -rf etc/pacman.d/Makefile
+rm -rf etc/pacman.d/{current,extra,community,unstable,release}
rm -rf etc/abs/Makefile.in
rm -rf etc/abs/Makefile
***Got rid of spurious spaces, cleaned up library checking code-- if
we don't have math, archive, or download, we can't build, and we don't
need to include them here, only in the specific directories they are
used.
============================================================
--- configure.ac 8358b1c0036a631a10901e015f2a3625c370863b
+++ configure.ac 4945cc3d67c50784681ee7de5301976c8fcafcd4
@@ -147,7 +147,7 @@ AC_ARG_ENABLE(debug,
dnl Help line for debug
AC_ARG_ENABLE(debug,
- AC_HELP_STRING([ --enable-debug], [Enable debugging support]),
+ AC_HELP_STRING([--enable-debug], [Enable debugging support]),
[debug=$enableval], [debug=yes])
dnl Help line for fakeroot
@@ -292,26 +292,20 @@ dnl Check for math
fi
dnl Check for math
-AC_CHECK_LIB([m], [log10], [AC_CHECK_HEADER([math.h], [LIBM='-lm'])])
-if test -n "$LIBM"; then
- LDFLAGS="$LDFLAGS $LIBM"
-else
- AC_MSG_ERROR("math library not found!");
+AC_CHECK_LIB([m], [sqrt], [AC_CHECK_HEADER([math.h], [LIBM='-lm'])])
+if test -z "$LIBM"; then
+ AC_MSG_ERROR("math library needed to compile pacman!");
fi
dnl Check for libarchive
AC_CHECK_LIB([archive], [archive_read_data],
[AC_CHECK_HEADER([archive.h], [LIBARCHIVE='-larchive'])])
-if test -n "$LIBARCHIVE"; then
- LDFLAGS="$LDFLAGS $LIBARCHIVE"
-else
+if test -z "$LIBARCHIVE"; then
AC_MSG_ERROR("libarchive is needed to compile pacman!");
fi
dnl Check for libdownload
AC_CHECK_LIB([download], [downloadParseURL],
[AC_CHECK_HEADER([download.h], [LIBDOWNLOAD='-ldownload'])])
-if test -n "$LIBDOWNLOAD"; then
- LDFLAGS="$LDFLAGS $LIBDOWNLOAD"
-else
+if test -z "$LIBDOWNLOAD"; then
AC_MSG_ERROR("libdownload is needed to compile pacman!");
fi
@@ -326,20 +320,20 @@ AC_MSG_CHECKING(for debug mode request)
dnl Enable or disable debug code
AC_MSG_CHECKING(for debug mode request)
-if test x$debug = xyes ; then
- AM_CONDITIONAL(PACMAN_DEBUG, test x$debug = xyes)
+if test "$debug" = yes ; then
+ AM_CONDITIONAL(PACMAN_DEBUG, test "$debug" = "yes")
CFLAGS="$CFLAGS -g -Wall -Werror -std=c99 -DPACMAN_DEBUG"
LDFLAGS="$LDFLAGS -lmcheck"
AC_MSG_RESULT(yes)
else
- AM_CONDITIONAL(PACMAN_DEBUG, test x$debug = xno)
+ AM_CONDITIONAL(PACMAN_DEBUG, test "$debug" = "no")
CFLAGS="$CFLAGS -Wall -std=c99"
AC_MSG_RESULT(no)
fi
dnl Enable or disable fakeroot code
AC_MSG_CHECKING(for fakeroot proof support)
-if test x$fakeroot = xyes ; then
+if test "$fakeroot" = "yes" ; then
AC_MSG_RESULT(yes)
else
CFLAGS="$CFLAGS -DFAKEROOT"
***As stated above, these shouldn't be removed by the makefile.
============================================================
--- etc/pacman.d/Makefile.am 840cb3c81402c99b85ac891ca9aa6ea73c9a6665
+++ etc/pacman.d/Makefile.am 6ed630aed49de51817151acf1039130ca0f4186b
@@ -1,7 +1,6 @@ clean:
EXTRA_DIST = community current extra release unstable
clean:
- rm $(EXTRA_DIST)
install-data-hook:
mkdir -p $(DESTDIR)$(sysconfdir)/pacman.d ; \
***Include math library here where needed.
============================================================
--- lib/libalpm/Makefile.am 3c32b7ed489cabd115bb7d62d895513102f9723e
+++ lib/libalpm/Makefile.am 7e25d2b6af9cc5f0fbfb808e84c4cf06c31abfdd
@@ -40,7 +40,7 @@ libalpm_la_LDFLAGS = -no-undefined -vers
libalpm_la_SOURCES = $(TARGETS)
libalpm_la_LDFLAGS = -no-undefined -version-info $(PM_VERSION_INFO)
-libalpm_la_LIBADD = -larchive -ldownload
+libalpm_la_LIBADD = -larchive -ldownload -lm
if HAS_DOXYGEN
all: doxygen.in
***Two minor typing changes, probably not real necessary.
============================================================
--- lib/libalpm/alpm.c 4a523ffcb264a38c24b6c192702e7c6e437518f0
+++ lib/libalpm/alpm.c c21f46f9408260ed9ffb15cfa98a167ef0d4aec5
@@ -566,7 +566,7 @@ char *alpm_pkg_name_hasarch(char *pkgnam
* and
* package-name-bar-1.2.3-1
*/
- int i = 0;
+ size_t i = 0;
char *arch, *cmp, *p;
if((p = strrchr(pkgname, '-'))) {
@@ -1008,7 +1008,7 @@ int alpm_parse_config(char *file, alpm_c
_alpm_log(PM_LOG_DEBUG, _("config: xfercommand: %s"), ptr);
} else if (!strcmp(key, "UPGRADEDELAY")) {
/* The config value is in days, we use seconds */
- long ud = atol(ptr) * 60 * 60 *24;
+ time_t ud = atol(ptr) * 60 * 60 *24;
alpm_option_set_upgradedelay(ud);
_alpm_log(PM_LOG_DEBUG, _("config: upgradedelay: %d"), ud);
} else {
***Refactor square root so it is only called once.
============================================================
--- lib/libalpm/deps.c 600ed931f1f4e65ee5d87065d81cd0d17d34857d
+++ lib/libalpm/deps.c dc04f286046eefcb489b10bab01ded162c357e82
@@ -106,6 +106,7 @@ alpm_list_t *_alpm_sortbydeps(alpm_list_
int change = 1;
int numscans = 0;
int numtargs = 0;
+ int maxscans;
if(targets == NULL) {
return(NULL);
@@ -116,15 +117,14 @@ alpm_list_t *_alpm_sortbydeps(alpm_list_
numtargs++;
}
+ /* calculate this here so we aren't doing it each loop */
+ maxscans = (int)sqrt(numtargs);
+
_alpm_log(PM_LOG_DEBUG, _("started sorting dependencies"));
while(change) {
alpm_list_t *tmptargs = NULL;
change = 0;
- /* TODO only use of a math.h function in entire libalpm,
- * can we get rid of it? Former code line:
- *if(numscans > numtargs) {
- */
- if(numscans > sqrt(numtargs)) {
+ if(numscans > maxscans) {
_alpm_log(PM_LOG_DEBUG, _("possible dependency cycle detected"));
continue;
}
@@ -321,9 +321,9 @@ alpm_list_t *_alpm_checkdeps(pmtrans_t *
/* else if still not found... */
if(!found) {
_alpm_log(PM_LOG_DEBUG, _("checkdeps: found %s as a dependency for %s"),
- depend.name, tp->name);
+ depend.name, tp->name);
miss = _alpm_depmiss_new(tp->name, PM_DEP_TYPE_DEPEND, depend.mod,
- depend.name, depend.version);
+ depend.name, depend.version);
if(!_alpm_depmiss_isin(miss, baddeps)) {
baddeps = alpm_list_add(baddeps, miss);
} else {
***Just quick updates to script- update version number, convert `` to $().
============================================================
--- scripts/makeworld 3295e2dacc2a9c6e391f6fc76ee591c95a887744
+++ scripts/makeworld b341ff0d4176b487df69da2bc015890263a42910
@@ -20,8 +20,8 @@
# USA.
#
-version="2.9.8"
-toplevel=`pwd`
+version="3.0.0"
+toplevel=$(pwd)
usage() {
echo "makeworld version $version"
@@ -119,13 +119,13 @@ cd $dest
# convert a (possibly) relative path to absolute
cd $dest
-dest=`pwd`
+dest=$(pwd)
cd - &>/dev/null
-sd=`date +"[%b %d %H:%M]"`
+sd=$(date +"[%b %d %H:%M]")
for category in $*; do
- for port in `find $toplevel/$category -maxdepth 1 -mindepth 1 -type
d | sort`; do
+ for port in $(find $toplevel/$category -maxdepth 1 -mindepth 1 -type
d | sort); do
cd $port
if [ -f PKGBUILD ]; then
. PKGBUILD
@@ -138,7 +138,7 @@ for category in $*; do
buildstatus=1
fi
fi
- d=`date +"[%b %d %H:%M]"`
+ d=$(date +"[%b %d %H:%M]")
echo -n "$d " >>$toplevel/build.log
case $buildstatus in
0) echo "$pkgname already built -- skipping" >>$toplevel/build.log ;;
@@ -148,7 +148,7 @@ done
fi
done
done
-ed=`date +"[%b %d %H:%M]"`
+ed=$(date +"[%b %d %H:%M]")
echo "makeworld complete." >>$toplevel/build.log
echo " started: $sd" >>$toplevel/build.log
***With some changes below, no longer need math library on frontend.
Be sure to sanity check my changes below, however.
============================================================
--- src/pacman/Makefile.am 4f082673b275a96c909b442bf3bcff121bc00d33
+++ src/pacman/Makefile.am 54351cf1782dd3d0e8fedf766250f7a77145b1c3
@@ -17,9 +17,9 @@ pacman_LDADD = -L$(top_srcdir)/lib/libal
pacman_static_SOURCES = $(pacman_SOURCES)
pacman_LDADD = -L$(top_srcdir)/lib/libalpm/.libs \
- -ldownload -lm -lalpm
+ -ldownload -lalpm
pacman_static_LDADD = -L$(top_srcdir)/lib/libalpm/.libs/ \
- -ldownload -lm -lalpm
+ -ldownload -lalpm
pacman_static_LDFLAGS = $(LDFLAGS) -all-static
***Changed type to match return type and moved it up to variable declaration.
============================================================
--- src/pacman/downloadprog.c 7d676cc84c01eff241f7b3abbf8eca9e7d45b1dc
+++ src/pacman/downloadprog.c 3fbd45421973235cdb2e5b000ca17735f9a4f0d6
@@ -53,7 +53,9 @@ void log_progress(const char *filename,
{
static unsigned int lasthash = 0, mouth = 0;
unsigned int i, hash;
- unsigned int chomp = 0;
+ /* a little hard to conceal easter eggs in open-source software,
+ * but they're still fun. ;) */
+ const unsigned short chomp = alpm_option_get_chomp();
char *fname, *p;
unsigned int maxcols = getcols();
unsigned int progresslen = maxcols - 57;
@@ -75,9 +77,6 @@ void log_progress(const char *filename,
return;
}
- /* a little hard to conceal easter eggs in open-source software, but
they're still fun. ;) */
- chomp = alpm_option_get_chomp();
-
gettimeofday(¤t_time, NULL);
total_timediff = current_time.tv_sec-initial_time.tv_sec
+ (float)(current_time.tv_usec-initial_time.tv_usec) / 1000000;
***Reorder options so pacman -Qi and pacman -Si output are much more
similar (to the extent they can be). Also, print sizes using kilobytes
instead of bytes.
============================================================
--- src/pacman/package.c 83c565ab5f2ce16c6029730312e3fc36e0fc5a34
+++ src/pacman/package.c 6843843535db726227361a3955a1ee4f0e7c413b
@@ -63,24 +63,25 @@ void dump_pkg_full(pmpkg_t *pkg, int lev
/* actual output */
printf(_("Name : %s\n"), (char *)alpm_pkg_get_name(pkg));
printf(_("Version : %s\n"), (char *)alpm_pkg_get_version(pkg));
+ printf(_("URL : %s\n"), (char *)alpm_pkg_get_url(pkg));
+ list_display(_("License :"), alpm_pkg_get_licenses(pkg));
list_display(_("Groups :"), alpm_pkg_get_groups(pkg));
+ list_display(_("Provides :"), alpm_pkg_get_provides(pkg));
+ list_display(_("Depends On :"), alpm_pkg_get_depends(pkg));
+ list_display(_("Removes :"), alpm_pkg_get_removes(pkg));
+ /* TODO only applicable if querying installed package, not a file */
+ list_display(_("Required By :"), alpm_pkg_get_requiredby(pkg));
+ list_display(_("Conflicts With :"), alpm_pkg_get_conflicts(pkg));
+ printf(_("Installed Size : %ld K\n"), (long)alpm_pkg_get_size(pkg) / 1024);
printf(_("Packager : %s\n"), (char *)alpm_pkg_get_packager(pkg));
- printf(_("URL : %s\n"), (char *)alpm_pkg_get_url(pkg));
- list_display(_("License :"), alpm_pkg_get_licenses(pkg));
printf(_("Architecture : %s\n"), (char *)alpm_pkg_get_arch(pkg));
- printf(_("Installed Size : %ld\n"), (long int)alpm_pkg_get_size(pkg));
printf(_("Build Date : %s %s\n"), bdate, strlen(bdate) ? "UTC" : "");
printf(_("Build Type : %s\n"), strlen(type) ? type : _("Unknown"));
/* TODO only applicable if querying installed package, not a file */
printf(_("Install Date : %s %s\n"), idate, strlen(idate) ? "UTC" : "");
printf(_("Install Script : %s\n"), alpm_pkg_has_scriptlet(pkg) ?
_("Yes") : _("No"));
printf(_("Reason : %s\n"), reason);
- list_display(_("Provides :"), alpm_pkg_get_provides(pkg));
- list_display(_("Depends On :"), alpm_pkg_get_depends(pkg));
- list_display(_("Removes :"), alpm_pkg_get_removes(pkg));
/* TODO only applicable if querying installed package, not a file */
- list_display(_("Required By :"), alpm_pkg_get_requiredby(pkg));
- list_display(_("Conflicts With :"), alpm_pkg_get_conflicts(pkg));
printf(_("Description : "));
indentprint(alpm_pkg_get_desc(pkg), 17);
@@ -117,8 +118,8 @@ void dump_pkg_sync(pmpkg_t *pkg, const c
list_display(_("Removes :"), alpm_pkg_get_removes(pkg));
list_display(_("Conflicts With :"), alpm_pkg_get_conflicts(pkg));
list_display(_("Replaces :"), alpm_pkg_get_replaces(pkg));
- printf(_("Download Size : %ld\n"), (long)alpm_pkg_get_size(pkg));
- printf(_("Installed Size : %ld\n"), (long)alpm_pkg_get_isize(pkg));
+ printf(_("Download Size : %ld K\n"), (long)alpm_pkg_get_size(pkg) / 1024);
+ printf(_("Installed Size : %ld K\n"), (long)alpm_pkg_get_isize(pkg) / 1024);
printf(_("Description : "));
indentprint(alpm_pkg_get_desc(pkg), 17);
***Reword a usage instruction.
============================================================
--- src/pacman/pacman.c 1b006c77745dc36301ee96f5dfc4ce231124342f
+++ src/pacman/pacman.c 7894fabbf4e27e17090dbecb8235ffcfbf60210e
@@ -123,8 +123,8 @@ static void usage(int op, char *myname)
printf(_("usage: %s {-Q --query} [options] [package]\n"), myname);
printf(_("options:\n"));
printf(_(" -c, --changelog view the changelog of a package\n"));
- printf(_(" -e, --orphans list all packages that were
installed as a dependency\n"));
- printf(_(" and are not required by any other
packages\n"));
+ printf(_(" -e, --orphans list all packages installed as
dependencies but no longer\n"
+ " required by any package\n"));
printf(_(" -g, --groups view all members of a package group\n"));
printf(_(" -i, --info view package information\n"));
printf(_(" -l, --list list the contents of the queried
package\n"));
***Remove use of math.h by making assumptions about the possible range
of the former log10 call. As long as we are installing <1000 packages
(a reasonable assumption?), this new code works fine.
***Refactor two functions out to allow better variable declaration
(closer to where they are actually used, and not initialized if
unused). fill_progress might also be applicable now in the other
status bar display (downloadprog, I believe).
***Fix indenting of a switch statement.
============================================================
--- src/pacman/trans.c 1f02954b56601d065e49e0c52c92e3af395c65fd
+++ src/pacman/trans.c 7ea136c95d81f51115ff6bab946917be89a71b13
@@ -26,7 +26,6 @@
#include <sys/stat.h>
#include <unistd.h>
#include <dirent.h>
-#include <math.h>
#include <libintl.h>
#include <alpm.h>
@@ -42,13 +41,84 @@ static int prevpercent=0; /* for less pr
static int prevpercent=0; /* for less progressbar output */
+/* static function declarations */
+static void retrieve_local(void *data1, void *data2);
+static void fill_progress(int percent);
+
+/* refactored function from below because of variable declaration */
+static void retrieve_local(void *data1, void *data2)
+{
+ const unsigned int maxcols = getcols();
+ char out[PATH_MAX];
+ unsigned int i;
+
+ MSG(NL, " %s [", (char*)data1);
+ STRNCPY(out, (char*)data2, maxcols-42);
+ MSG(CL, "%s", out);
+ for(i = strlen(out); i < maxcols-43; i++) {
+ MSG(CL, " ");
+ }
+ fputs(_("] 100% LOCAL "), stdout);
+}
+
+/* refactored from below to make variable declaration cleaner */
+static void fill_progress(int percent)
+{
+ const unsigned short chomp = alpm_option_get_chomp();
+ const unsigned int progresslen = getcols() - 57;
+ const unsigned int hash = percent * progresslen / 100;
+ unsigned int lasthash = 0, mouth = 0;
+ unsigned int i;
+
+ /* hide the cursor, prevent flicker during fancy graphics
+ printf("\033[?25l\033[?1c[");
+ */
+ printf("[");
+ for(i = progresslen; i > 1; --i) {
+ /* if special progress bar enabled */
+ if(chomp) {
+ if(i > progresslen - hash) {
+ printf("-");
+ } else if(i == progresslen - hash) {
+ if(lasthash == hash) {
+ if(mouth) {
+ printf("\033[1;33mC\033[m");
+ } else {
+ printf("\033[1;33mc\033[m");
+ }
+ } else {
+ lasthash = hash;
+ mouth = mouth == 1 ? 0 : 1;
+ if(mouth) {
+ printf("\033[1;33mC\033[m");
+ } else {
+ printf("\033[1;33mc\033[m");
+ }
+ }
+ } else if(i%3 == 0) {
+ printf("\033[0;37mo\033[m");
+ } else {
+ printf("\033[0;37m \033[m");
+ }
+ } /* else regular progress bar */
+ else if(i > progresslen - hash) {
+ printf("#");
+ } else {
+ printf("-");
+ }
+ }
+ printf("] %3d%%\r", percent);
+
+ if(percent == 100) {
+ printf("\n");
+ }
+}
+
/* Callback to handle transaction events
*/
void cb_trans_evt(pmtransevt_t event, void *data1, void *data2)
{
char str[LOG_STR_LEN] = "";
- char out[PATH_MAX];
- int i;
switch(event) {
case PM_TRANS_EVT_CHECKDEPS_START:
@@ -155,14 +225,7 @@ void cb_trans_evt(pmtransevt_t event, vo
fflush(stdout);
break;
case PM_TRANS_EVT_RETRIEVE_LOCAL:
- MSG(NL, " %s [", (char*)data1);
- unsigned int maxcols = getcols();
- STRNCPY(out, (char*)data2, maxcols-42);
- MSG(CL, "%s", out);
- for(i = strlen(out); i < maxcols-43; i++) {
- MSG(CL, " ");
- }
- fputs(_("] 100% LOCAL "), stdout);
+ retrieve_local(data1, data2);
break;
}
}
@@ -289,11 +352,14 @@ void cb_trans_progress(pmtransprog_t eve
void cb_trans_progress(pmtransprog_t event, char *pkgname, int percent,
int howmany, int remain)
{
- static int lasthash = 0, mouth = 0;
- int i, hash;
- long chomp = 0;
- unsigned int maxcols = getcols();
- unsigned int maxpkglen, progresslen = maxcols - 57;
+ /* these 3 vars determine size of the howmany/remaining packages counter
+ * change from log10 allows elimination of math library from front end
+ * former code: log10(howmany) or log10(remain)
+ * current code: identical to above as long as value < 1000 */
+ const int digitshm= howmany < 10 ? 1 : (howmany < 100 ? 2 : 3);
+ const int digitsr = remain < 10 ? 1 : (remain < 100 ? 2 : 3);
+ unsigned int maxpkglen;
+ int i;
char *ptr = NULL;
if(config->noprogressbar) {
@@ -306,12 +372,8 @@ void cb_trans_progress(pmtransprog_t eve
set_output_padding(0); /* shut it off again */
}
- if (!pkgname)
+ if (!pkgname || percent > 100 || percent == prevpercent)
return;
- if (percent > 100)
- return;
- if(percent == prevpercent)
- return;
prevpercent=percent;
switch (event) {
@@ -331,78 +393,38 @@ void cb_trans_progress(pmtransprog_t eve
ptr = _("checking for file conflicts");
break;
}
- hash=percent*progresslen/100;
- // if the package name is too long, then slice the ending
- maxpkglen=46-strlen(ptr)-(3+2*(int)log10(howmany));
- if(strlen(pkgname)>maxpkglen)
- pkgname[maxpkglen]='\0';
+ maxpkglen = 46 - strlen(ptr) - (3 + 2 * digitshm);
+ /* if the package name is too long, then slice the ending */
+ if(strlen(pkgname) > maxpkglen)
+ pkgname[maxpkglen] = '\0';
+
switch (event) {
- case PM_TRANS_PROGRESS_ADD_START:
- case PM_TRANS_PROGRESS_UPGRADE_START:
- case PM_TRANS_PROGRESS_REMOVE_START:
- putchar('(');
- for(i=0;i<(int)log10(howmany)-(int)log10(remain);i++)
- putchar(' ');
- printf("%d/%d) %s %s ", remain, howmany, ptr, pkgname);
- if (strlen(pkgname)<maxpkglen)
- for (i=maxpkglen-strlen(pkgname)-1; i>0; i--)
+ case PM_TRANS_PROGRESS_ADD_START:
+ case PM_TRANS_PROGRESS_UPGRADE_START:
+ case PM_TRANS_PROGRESS_REMOVE_START:
+ putchar('(');
+ for(i = 0;i < digitshm - digitsr; i++)
putchar(' ');
- break;
+ printf("%d/%d) %s %s ", remain, howmany, ptr, pkgname);
+ if (strlen(pkgname) < maxpkglen)
+ for (i = maxpkglen - strlen(pkgname) - 1; i > 0; i--)
+ putchar(' ');
+ break;
- case PM_TRANS_PROGRESS_CONFLICTS_START:
- printf("%s (", ptr);
- for(i=0;i<(int)log10(howmany)-(int)log10(remain);i++)
- putchar(' ');
- printf("%d/%d) ", remain, howmany);
- for (i=maxpkglen; i>0; i--)
- putchar(' ');
- break;
- }
+ case PM_TRANS_PROGRESS_CONFLICTS_START:
+ printf("%s (", ptr);
+ for(i = 0; i < digitshm - digitsr; i++)
+ putchar(' ');
+ printf("%d/%d) ", remain, howmany);
+ for (i = maxpkglen; i > 0; i--)
+ putchar(' ');
+ break;
- chomp = alpm_option_get_chomp();
-
- /* hide the cursor, prevent flicker during fancy graphics
- printf("\033[?25l\033[?1c[");
- */
- printf("[");
- for(i = progresslen; i > 0; --i) {
- if(chomp) {
- if(i > progresslen - hash) {
- printf("-");
- } else if(i == progresslen - hash) {
- if(lasthash == hash) {
- if(mouth) {
- printf("\033[1;33mC\033[m");
- } else {
- printf("\033[1;33mc\033[m");
- }
- } else {
- lasthash = hash;
- mouth = mouth == 1 ? 0 : 1;
- if(mouth) {
- printf("\033[1;33mC\033[m");
- } else {
- printf("\033[1;33mc\033[m");
- }
- }
- } else if(i%3 == 0) {
- printf("\033[0;37mo\033[m");
- } else {
- printf("\033[0;37m \033[m");
- }
- } else if(i > progresslen - hash) {
- printf("#");
- } else {
- printf("-");
- }
}
- printf("] %3d%%\r", percent);
- if(percent == 100) {
- printf("\n");
- }
+ fill_progress(percent);
}
/* vim: set ts=2 sw=2 noet: */
***Add a missing comment.
============================================================
--- src/pacman/trans.h 4d7d7f9b948979d070bcc648027c26b73c7732d3
+++ src/pacman/trans.h 1fd2c160d34e607571f0829820c924f6179f8193
@@ -28,6 +28,7 @@ void cb_trans_conv(pmtransconv_t event,
void cb_trans_conv(pmtransconv_t event, void *data1, void *data2,
void *data3, int *response);
+/* callback to handle display of the progress bar for transactions */
void cb_trans_progress(pmtransprog_t event, char *pkgname, int percent,
int howmany, int remain);
***Slight type change to match where it is used.
============================================================
--- src/pacman/util.c c553258df09eae12fbdd31a68295c1e47097a030
+++ src/pacman/util.c f30c0a9ab665739c13b47bb33b44e086c88c3783
@@ -168,7 +168,7 @@ void indentprint(const char *str, unsign
while(*p) {
if(*p == ' ') {
const char *next = NULL;
- int len;
+ unsigned int len;
p++;
if(p == NULL || *p == ' ') continue;
next = strchr(p, ' ');
1
0