Pacman-dev
Threads by month
- ----- 2024 -----
- 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
January 2007
- 23 participants
- 104 discussions
I'm just curious why the -w argument was removed from makepkg? It
apparently was removed in rev 1.23:
http://cvs.archlinux.org/cgi-bin/viewcvs.cgi/scripts/makepkg.diff?r1=1.22&r…
I know that aurbuild is currently making use of it, for example.
Scott
7
18
Date: Tuesday, January 23, 2007 @ 22:02:55
Author: aaron
Path: /home/cvs-pacman/pacman-lib
Modified: lib/libalpm/add.c (1.102 -> 1.103)
lib/libalpm/alpm.c (1.104 -> 1.105)
lib/libalpm/alpm.h (1.66 -> 1.67)
lib/libalpm/be_files.c (1.20 -> 1.21)
lib/libalpm/cache.c (1.25 -> 1.26)
lib/libalpm/cache.h (1.9 -> 1.10)
lib/libalpm/conflict.c (1.30 -> 1.31)
lib/libalpm/conflict.h (1.10 -> 1.11)
lib/libalpm/db.c (1.55 -> 1.56) lib/libalpm/db.h (1.22 -> 1.23)
lib/libalpm/deps.c (1.57 -> 1.58) lib/libalpm/deps.h (1.16 -> 1.17)
lib/libalpm/handle.c (1.27 -> 1.28)
lib/libalpm/handle.h (1.13 -> 1.14) lib/libalpm/log.c (1.8 -> 1.9)
lib/libalpm/log.h (1.7 -> 1.8) lib/libalpm/package.c (1.49 -> 1.50)
lib/libalpm/package.h (1.23 -> 1.24)
lib/libalpm/sync.c (1.91 -> 1.92) lib/libalpm/sync.h (1.16 -> 1.17)
lib/libalpm/trans.c (1.30 -> 1.31)
lib/libalpm/trans.h (1.21 -> 1.22)
lib/libalpm/util.c (1.39 -> 1.40) lib/libalpm/util.h (1.18 -> 1.19)
lib/libalpm/versioncmp.c (1.8 -> 1.9)
src/pacman/add.c (1.23 -> 1.24) src/pacman/deptest.c (1.10 -> 1.11)
src/pacman/sync.c (1.97 -> 1.98) src/pacman/trans.c (1.27 -> 1.28)
src/pacman/trans.h (1.5 -> 1.6)
This mainly deals with code clarity- removing currently unneeded
optimizations in order to make the code much more readable and
type-checkable. Every enum in the library now has it's own type that
should be used instead of the generic 'unsigned char'. In addition,
several #define statements dealing with constants were converted to
enums.
Signed-off-by: Dan McGee <dpmcgee(a)gmail.com>
--------------------------+
lib/libalpm/add.c | 2
lib/libalpm/alpm.c | 6 +-
lib/libalpm/alpm.h | 132 +++++++++++++++++++++++++--------------------
lib/libalpm/be_files.c | 2
lib/libalpm/cache.c | 8 +-
lib/libalpm/cache.h | 6 +-
lib/libalpm/conflict.c | 2
lib/libalpm/conflict.h | 2
lib/libalpm/db.c | 2
lib/libalpm/db.h | 20 +++---
lib/libalpm/deps.c | 39 ++++++++-----
lib/libalpm/deps.h | 17 +++--
lib/libalpm/handle.c | 32 ++++++++--
lib/libalpm/handle.h | 4 -
lib/libalpm/log.c | 2
lib/libalpm/log.h | 4 +
lib/libalpm/package.c | 4 -
lib/libalpm/package.h | 15 ++---
lib/libalpm/sync.c | 2
lib/libalpm/sync.h | 2
lib/libalpm/trans.c | 6 +-
lib/libalpm/trans.h | 28 +++++----
lib/libalpm/util.c | 4 -
lib/libalpm/util.h | 2
lib/libalpm/versioncmp.c | 14 ++--
src/pacman/add.c | 14 +++-
src/pacman/deptest.c | 14 +++-
src/pacman/sync.c | 19 ++++--
src/pacman/trans.c | 78 ++++++++++++++------------
src/pacman/trans.h | 8 +-
30 files changed, 290 insertions(+), 200 deletions(-)
Index: pacman-lib/lib/libalpm/add.c
diff -u pacman-lib/lib/libalpm/add.c:1.102 pacman-lib/lib/libalpm/add.c:1.103
--- pacman-lib/lib/libalpm/add.c:1.102 Fri Jan 19 04:28:44 2007
+++ pacman-lib/lib/libalpm/add.c Tue Jan 23 22:02:53 2007
@@ -332,7 +332,7 @@
register struct archive *archive;
struct archive_entry *entry;
char expath[PATH_MAX], cwd[PATH_MAX] = "", *what;
- unsigned char cb_state;
+ pmtransprog_t cb_state;
time_t t;
alpm_list_t *targ, *lp;
Index: pacman-lib/lib/libalpm/alpm.c
diff -u pacman-lib/lib/libalpm/alpm.c:1.104 pacman-lib/lib/libalpm/alpm.c:1.105
--- pacman-lib/lib/libalpm/alpm.c:1.104 Fri Jan 19 04:28:44 2007
+++ pacman-lib/lib/libalpm/alpm.c Tue Jan 23 22:02:54 2007
@@ -63,7 +63,7 @@
/* Globals */
pmhandle_t *handle = NULL;
-enum __pmerrno_t pm_errno;
+enum _pmerrno_t pm_errno;
/** \addtogroup alpm_interface Interface Functions
* @brief Functions to initialize and release libalpm
@@ -622,7 +622,9 @@
* @param progress progress callback function pointer
* @return 0 on success, -1 on error (pm_errno is set accordingly)
*/
-int alpm_trans_init(unsigned char type, unsigned int flags, alpm_trans_cb_event event, alpm_trans_cb_conv conv, alpm_trans_cb_progress progress)
+int alpm_trans_init(pmtranstype_t type, unsigned int flags,
+ alpm_trans_cb_event event, alpm_trans_cb_conv conv,
+ alpm_trans_cb_progress progress)
{
char path[PATH_MAX];
Index: pacman-lib/lib/libalpm/alpm.h
diff -u pacman-lib/lib/libalpm/alpm.h:1.66 pacman-lib/lib/libalpm/alpm.h:1.67
--- pacman-lib/lib/libalpm/alpm.h:1.66 Fri Jan 19 04:28:44 2007
+++ pacman-lib/lib/libalpm/alpm.h Tue Jan 23 22:02:54 2007
@@ -71,13 +71,15 @@
*/
/* Levels */
-#define PM_LOG_DEBUG 0x01
-#define PM_LOG_ERROR 0x02
-#define PM_LOG_WARNING 0x04
-#define PM_LOG_FLOW1 0x08
-#define PM_LOG_FLOW2 0x10
-#define PM_LOG_FUNCTION 0x20
-#define PM_LOG_DOWNLOAD 0x40
+typedef enum _pmloglevel_t {
+ PM_LOG_DEBUG = 0x01,
+ PM_LOG_ERROR = 0x02,
+ PM_LOG_WARNING = 0x04,
+ PM_LOG_FLOW1 = 0x08,
+ PM_LOG_FLOW2 = 0x10,
+ PM_LOG_FUNCTION = 0x20,
+ PM_LOG_DOWNLOAD = 0x40
+} pmloglevel_t;
typedef void (*alpm_cb_log)(unsigned short, char *);
int alpm_logaction(char *fmt, ...);
@@ -100,8 +102,8 @@
alpm_cb_download alpm_option_get_dlcb();
void alpm_option_set_dlcb(alpm_cb_download cb);
-unsigned char alpm_option_get_logmask();
-void alpm_option_set_logmask(unsigned char mask);
+unsigned short alpm_option_get_logmask();
+void alpm_option_set_logmask(unsigned short mask);
const char *alpm_option_get_root();
void alpm_option_set_root(const char *root);
@@ -115,8 +117,8 @@
const char *alpm_option_get_logfile();
void alpm_option_set_logfile(const char *logfile);
-unsigned char alpm_option_get_usesyslog();
-void alpm_option_set_usesyslog(unsigned char usesyslog);
+unsigned short alpm_option_get_usesyslog();
+void alpm_option_set_usesyslog(unsigned short usesyslog);
alpm_list_t *alpm_option_get_noupgrades();
void alpm_option_add_noupgrade(char *pkg);
@@ -188,19 +190,26 @@
/* Info parameters */
/* reasons -- ie, why the package was installed */
-#define PM_PKG_REASON_EXPLICIT 0 /* explicitly requested by the user */
-#define PM_PKG_REASON_DEPEND 1 /* installed as a dependency for another package */
+typedef enum _pmpkgreason_t {
+ PM_PKG_REASON_EXPLICIT = 0, /* explicitly requested by the user */
+ PM_PKG_REASON_DEPEND = 1 /* installed as a dependency for another package */
+} pmpkgreason_t;
/* package name formats */
-#define PM_PKG_WITHOUT_ARCH 0 /* pkgname-pkgver-pkgrel, used under PM_DBPATH */
-#define PM_PKG_WITH_ARCH 1 /* ie, pkgname-pkgver-pkgrel-arch, used under PM_CACHEDIR */
+/*
+typedef enum _pmpkghasarch_t {
+ PM_PKG_WITHOUT_ARCH = 0, / pkgname-pkgver-pkgrel, used under PM_DBPATH /
+ PM_PKG_WITH_ARCH = 1 / pkgname-pkgver-pkgrel-arch, used under PM_CACHEDIR /
+} pmpkghasarch_t;
+*/
int alpm_pkg_load(char *filename, pmpkg_t **pkg);
int alpm_pkg_free(pmpkg_t *pkg);
int alpm_pkg_checkmd5sum(pmpkg_t *pkg);
int alpm_pkg_checksha1sum(pmpkg_t *pkg);
char *alpm_fetch_pkgurl(char *url);
-int alpm_parse_config(char *file, alpm_cb_db_register callback, const char *this_section);
+int alpm_parse_config(char *file, alpm_cb_db_register callback,
+ const char *this_section);
int alpm_pkg_vercmp(const char *ver1, const char *ver2);
char *alpm_pkg_name_hasarch(char *pkgname);
@@ -218,7 +227,7 @@
const char *alpm_pkg_get_arch(pmpkg_t *pkg);
unsigned long alpm_pkg_get_size(pmpkg_t *pkg);
unsigned long alpm_pkg_get_isize(pmpkg_t *pkg);
-unsigned char alpm_pkg_get_reason(pmpkg_t *pkg);
+pmpkgreason_t alpm_pkg_get_reason(pmpkg_t *pkg);
alpm_list_t *alpm_pkg_get_licenses(pmpkg_t *pkg);
alpm_list_t *alpm_pkg_get_groups(pmpkg_t *pkg);
alpm_list_t *alpm_pkg_get_depends(pmpkg_t *pkg);
@@ -229,7 +238,7 @@
alpm_list_t *alpm_pkg_get_replaces(pmpkg_t *pkg);
alpm_list_t *alpm_pkg_get_files(pmpkg_t *pkg);
alpm_list_t *alpm_pkg_get_backup(pmpkg_t *pkg);
-unsigned char alpm_pkg_has_scriptlet(pmpkg_t *pkg);
+unsigned short alpm_pkg_has_scriptlet(pmpkg_t *pkg);
/*
* Groups
@@ -242,13 +251,13 @@
*/
/* Types */
-enum {
+typedef enum _pmsynctype_t {
PM_SYNC_TYPE_REPLACE = 1,
PM_SYNC_TYPE_UPGRADE,
PM_SYNC_TYPE_DEPEND
-};
+} pmsynctype_t;
-unsigned char alpm_sync_get_type(pmsyncpkg_t *sync);
+pmsynctype_t alpm_sync_get_type(pmsyncpkg_t *sync);
pmpkg_t *alpm_sync_get_package(pmsyncpkg_t *sync);
void *alpm_sync_get_data(pmsyncpkg_t *sync);
@@ -257,30 +266,32 @@
*/
/* Types */
-enum {
+typedef enum _pmtranstype_t {
PM_TRANS_TYPE_ADD = 1,
PM_TRANS_TYPE_REMOVE,
PM_TRANS_TYPE_UPGRADE,
PM_TRANS_TYPE_SYNC
-};
+} pmtranstype_t;
/* Flags */
-#define PM_TRANS_FLAG_NODEPS 0x01
-#define PM_TRANS_FLAG_FORCE 0x02
-#define PM_TRANS_FLAG_NOSAVE 0x04
-#define PM_TRANS_FLAG_FRESHEN 0x08
-#define PM_TRANS_FLAG_CASCADE 0x10
-#define PM_TRANS_FLAG_RECURSE 0x20
-#define PM_TRANS_FLAG_DBONLY 0x40
-#define PM_TRANS_FLAG_DEPENDSONLY 0x80
-#define PM_TRANS_FLAG_ALLDEPS 0x100
-#define PM_TRANS_FLAG_DOWNLOADONLY 0x200
-#define PM_TRANS_FLAG_NOSCRIPTLET 0x400
-#define PM_TRANS_FLAG_NOCONFLICTS 0x800
-#define PM_TRANS_FLAG_PRINTURIS 0x1000
+typedef enum _pmtransflag_t {
+ PM_TRANS_FLAG_NODEPS = 0x01,
+ PM_TRANS_FLAG_FORCE = 0x02,
+ PM_TRANS_FLAG_NOSAVE = 0x04,
+ PM_TRANS_FLAG_FRESHEN = 0x08,
+ PM_TRANS_FLAG_CASCADE = 0x10,
+ PM_TRANS_FLAG_RECURSE = 0x20,
+ PM_TRANS_FLAG_DBONLY = 0x40,
+ PM_TRANS_FLAG_DEPENDSONLY = 0x80,
+ PM_TRANS_FLAG_ALLDEPS = 0x100,
+ PM_TRANS_FLAG_DOWNLOADONLY = 0x200,
+ PM_TRANS_FLAG_NOSCRIPTLET = 0x400,
+ PM_TRANS_FLAG_NOCONFLICTS = 0x800,
+ PM_TRANS_FLAG_PRINTURIS = 0x1000
+} pmtransflag_t;
/* Transaction Events */
-enum {
+typedef enum _pmtransevt_t {
PM_TRANS_EVT_CHECKDEPS_START = 1,
PM_TRANS_EVT_CHECKDEPS_DONE,
PM_TRANS_EVT_FILECONFLICTS_START,
@@ -306,10 +317,10 @@
PM_TRANS_EVT_PRINTURI,
PM_TRANS_EVT_RETRIEVE_START,
PM_TRANS_EVT_RETRIEVE_LOCAL
-};
+} pmtransevt_t;
/* Transaction Conversations (ie, questions) */
-enum {
+typedef enum _pmtransconv_t {
PM_TRANS_CONV_INSTALL_IGNOREPKG = 0x01,
PM_TRANS_CONV_REPLACE_PKG = 0x02,
PM_TRANS_CONV_CONFLICT_PKG = 0x04,
@@ -317,30 +328,33 @@
PM_TRANS_CONV_LOCAL_NEWER = 0x10,
PM_TRANS_CONV_LOCAL_UPTODATE = 0x20,
PM_TRANS_CONV_REMOVE_HOLDPKG = 0x40
-};
+} pmtransconv_t;
/* Transaction Progress */
-enum {
+typedef enum _pmtransprog_t {
PM_TRANS_PROGRESS_ADD_START,
PM_TRANS_PROGRESS_UPGRADE_START,
PM_TRANS_PROGRESS_REMOVE_START,
PM_TRANS_PROGRESS_CONFLICTS_START
-};
+} pmtransprog_t;
/* Transaction Event callback */
-typedef void (*alpm_trans_cb_event)(unsigned char, void *, void *);
+typedef void (*alpm_trans_cb_event)(pmtransevt_t, void *, void *);
/* Transaction Conversation callback */
-typedef void (*alpm_trans_cb_conv)(unsigned char, void *, void *, void *, int *);
+typedef void (*alpm_trans_cb_conv)(pmtransconv_t, void *, void *,
+ void *, int *);
/* Transaction Progress callback */
-typedef void (*alpm_trans_cb_progress)(unsigned char, char *, int, int, int);
+typedef void (*alpm_trans_cb_progress)(pmtransprog_t, char *, int, int, int);
-unsigned char alpm_trans_get_type();
+pmtranstype_t alpm_trans_get_type();
unsigned int alpm_trans_get_flags();
alpm_list_t * alpm_trans_get_targets();
alpm_list_t * alpm_trans_get_packages();
-int alpm_trans_init(unsigned char type, unsigned int flags, alpm_trans_cb_event cb_event, alpm_trans_cb_conv conv, alpm_trans_cb_progress cb_progress);
+int alpm_trans_init(pmtranstype_t type, unsigned int flags,
+ alpm_trans_cb_event cb_event, alpm_trans_cb_conv conv,
+ alpm_trans_cb_progress cb_progress);
int alpm_trans_sysupgrade(void);
int alpm_trans_addtarget(char *target);
int alpm_trans_prepare(alpm_list_t **data);
@@ -351,21 +365,22 @@
* Dependencies and conflicts
*/
-enum {
+typedef enum _pmdepmod_t {
PM_DEP_MOD_ANY = 1,
PM_DEP_MOD_EQ,
PM_DEP_MOD_GE,
PM_DEP_MOD_LE
-};
-enum {
+} pmdepmod_t;
+
+typedef enum _pmdeptype_t {
PM_DEP_TYPE_DEPEND = 1,
PM_DEP_TYPE_REQUIRED,
PM_DEP_TYPE_CONFLICT
-};
+} pmdeptype_t;
const char *alpm_dep_get_target(pmdepmissing_t *miss);
-unsigned char alpm_dep_get_type(pmdepmissing_t *miss);
-unsigned char alpm_dep_get_mod(pmdepmissing_t *miss);
+pmdeptype_t alpm_dep_get_type(pmdepmissing_t *miss);
+pmdepmod_t alpm_dep_get_mod(pmdepmissing_t *miss);
const char *alpm_dep_get_name(pmdepmissing_t *miss);
const char *alpm_dep_get_version(pmdepmissing_t *miss);
@@ -373,19 +388,20 @@
* File conflicts
*/
-enum {
+typedef enum _pmconflicttype_t {
PM_CONFLICT_TYPE_TARGET = 1,
PM_CONFLICT_TYPE_FILE
-};
+} pmconflicttype_t;
const char *alpm_conflict_get_target(pmconflict_t *conflict);
-unsigned char alpm_conflict_get_type(pmconflict_t *conflict);
+pmconflicttype_t alpm_conflict_get_type(pmconflict_t *conflict);
const char *alpm_conflict_get_file(pmconflict_t *conflict);
const char *alpm_conflict_get_ctarget(pmconflict_t *conflict);
/*
* Helpers
*/
+
/* md5sums */
char *alpm_get_md5sum(char *name);
@@ -394,7 +410,7 @@
/*
* Errors
*/
-enum __pmerrno_t {
+enum _pmerrno_t {
PM_ERR_MEMORY = 1,
PM_ERR_SYSTEM,
PM_ERR_BADPERMS,
@@ -466,7 +482,7 @@
PM_ERR_FORK_FAILED
};
-extern enum __pmerrno_t pm_errno;
+extern enum _pmerrno_t pm_errno;
char *alpm_strerror(int err);
Index: pacman-lib/lib/libalpm/be_files.c
diff -u pacman-lib/lib/libalpm/be_files.c:1.20 pacman-lib/lib/libalpm/be_files.c:1.21
--- pacman-lib/lib/libalpm/be_files.c:1.20 Fri Jan 19 04:28:44 2007
+++ pacman-lib/lib/libalpm/be_files.c Tue Jan 23 22:02:54 2007
@@ -98,7 +98,7 @@
rewinddir(db->handle);
}
-pmpkg_t *_alpm_db_scan(pmdb_t *db, char *target, unsigned int inforeq)
+pmpkg_t *_alpm_db_scan(pmdb_t *db, char *target, pmdbinfrq_t inforeq)
{
struct dirent *ent = NULL;
struct stat sbuf;
Index: pacman-lib/lib/libalpm/cache.c
diff -u pacman-lib/lib/libalpm/cache.c:1.25 pacman-lib/lib/libalpm/cache.c:1.26
--- pacman-lib/lib/libalpm/cache.c:1.25 Fri Jan 19 04:28:44 2007
+++ pacman-lib/lib/libalpm/cache.c Tue Jan 23 22:02:54 2007
@@ -41,12 +41,12 @@
/* Returns a new package cache from db.
* It frees the cache if it already exists.
*/
-int _alpm_db_load_pkgcache(pmdb_t *db, unsigned char infolevel)
+int _alpm_db_load_pkgcache(pmdb_t *db, pmdbinfrq_t infolevel)
{
pmpkg_t *info;
int count = 0;
/* The group cache needs INFRQ_DESC as well */
- /*unsigned char infolevel = INFRQ_DEPENDS | INFRQ_DESC;*/
+ /* pmdbinfrq_t infolevel = INFRQ_DEPENDS | INFRQ_DESC;*/
if(db == NULL) {
return(-1);
@@ -86,7 +86,7 @@
}
}
-alpm_list_t *_alpm_db_get_pkgcache(pmdb_t *db, unsigned char infolevel)
+alpm_list_t *_alpm_db_get_pkgcache(pmdb_t *db, pmdbinfrq_t infolevel)
{
if(db == NULL) {
return(NULL);
@@ -101,7 +101,7 @@
return(db->pkgcache);
}
-int _alpm_db_ensure_pkgcache(pmdb_t *db, unsigned char infolevel)
+int _alpm_db_ensure_pkgcache(pmdb_t *db, pmdbinfrq_t infolevel)
{
int reloaded = 0;
/* for each pkg, check and reload if the requested
Index: pacman-lib/lib/libalpm/cache.h
diff -u pacman-lib/lib/libalpm/cache.h:1.9 pacman-lib/lib/libalpm/cache.h:1.10
--- pacman-lib/lib/libalpm/cache.h:1.9 Fri Jan 19 04:28:44 2007
+++ pacman-lib/lib/libalpm/cache.h Tue Jan 23 22:02:54 2007
@@ -27,12 +27,12 @@
#include "package.h"
/* packages */
-int _alpm_db_load_pkgcache(pmdb_t *db, unsigned char infolevel);
+int _alpm_db_load_pkgcache(pmdb_t *db, pmdbinfrq_t infolevel);
void _alpm_db_free_pkgcache(pmdb_t *db);
int _alpm_db_add_pkgincache(pmdb_t *db, pmpkg_t *pkg);
int _alpm_db_remove_pkgfromcache(pmdb_t *db, pmpkg_t *pkg);
-alpm_list_t *_alpm_db_get_pkgcache(pmdb_t *db, unsigned char infolevel);
-int _alpm_db_ensure_pkgcache(pmdb_t *db, unsigned char infolevel);
+alpm_list_t *_alpm_db_get_pkgcache(pmdb_t *db, pmdbinfrq_t infolevel);
+int _alpm_db_ensure_pkgcache(pmdb_t *db, pmdbinfrq_t infolevel);
pmpkg_t *_alpm_db_get_pkgfromcache(pmdb_t *db, char *target);
/* groups */
int _alpm_db_load_grpcache(pmdb_t *db);
Index: pacman-lib/lib/libalpm/conflict.c
diff -u pacman-lib/lib/libalpm/conflict.c:1.30 pacman-lib/lib/libalpm/conflict.c:1.31
--- pacman-lib/lib/libalpm/conflict.c:1.30 Fri Jan 19 04:28:44 2007
+++ pacman-lib/lib/libalpm/conflict.c Tue Jan 23 22:02:54 2007
@@ -368,7 +368,7 @@
return conflict->target;
}
-unsigned char alpm_conflict_get_type(pmconflict_t *conflict)
+pmconflicttype_t alpm_conflict_get_type(pmconflict_t *conflict)
{
/* Sanity checks */
ASSERT(handle != NULL, return(-1));
Index: pacman-lib/lib/libalpm/conflict.h
diff -u pacman-lib/lib/libalpm/conflict.h:1.10 pacman-lib/lib/libalpm/conflict.h:1.11
--- pacman-lib/lib/libalpm/conflict.h:1.10 Fri Jan 19 04:28:44 2007
+++ pacman-lib/lib/libalpm/conflict.h Tue Jan 23 22:02:54 2007
@@ -28,7 +28,7 @@
struct __pmconflict_t {
char target[PKG_NAME_LEN];
- unsigned char type;
+ pmconflicttype_t type;
char file[CONFLICT_FILE_LEN];
char ctarget[PKG_NAME_LEN];
};
Index: pacman-lib/lib/libalpm/db.c
diff -u pacman-lib/lib/libalpm/db.c:1.55 pacman-lib/lib/libalpm/db.c:1.56
--- pacman-lib/lib/libalpm/db.c:1.55 Mon Jan 22 20:34:58 2007
+++ pacman-lib/lib/libalpm/db.c Tue Jan 23 22:02:54 2007
@@ -110,7 +110,7 @@
char *matched = NULL;
regex_t reg;
- if(regcomp(®, targ, REG_EXTENDED | REG_NOSUB | REG_ICASE) != 0) {
+ if(regcomp(®, targ, REG_EXTENDED | REG_NOSUB | REG_ICASE | REG_NEWLINE) != 0) {
RET_ERR(PM_ERR_INVALID_REGEX, NULL);
}
Index: pacman-lib/lib/libalpm/db.h
diff -u pacman-lib/lib/libalpm/db.h:1.22 pacman-lib/lib/libalpm/db.h:1.23
--- pacman-lib/lib/libalpm/db.h:1.22 Fri Jan 19 04:28:44 2007
+++ pacman-lib/lib/libalpm/db.h Tue Jan 23 22:02:54 2007
@@ -27,12 +27,14 @@
#include <limits.h>
/* Database entries */
-#define INFRQ_NONE 0x00
-#define INFRQ_DESC 0x01
-#define INFRQ_DEPENDS 0x02
-#define INFRQ_FILES 0x04
-#define INFRQ_SCRIPTLET 0x08
-#define INFRQ_ALL 0xFF
+typedef enum _pmdbinfrq_t {
+ INFRQ_NONE = 0x00,
+ INFRQ_DESC = 0x01,
+ INFRQ_DEPENDS = 0x02,
+ INFRQ_FILES = 0x04,
+ INFRQ_SCRIPTLET = 0x08,
+ INFRQ_ALL = 0xFF
+} pmdbinfrq_t;
/* Database */
struct __pmdb_t {
@@ -55,9 +57,9 @@
int _alpm_db_open(pmdb_t *db);
void _alpm_db_close(pmdb_t *db);
void _alpm_db_rewind(pmdb_t *db);
-pmpkg_t *_alpm_db_scan(pmdb_t *db, char *target, unsigned int inforeq);
-int _alpm_db_read(pmdb_t *db, unsigned int inforeq, pmpkg_t *info);
-int _alpm_db_write(pmdb_t *db, pmpkg_t *info, unsigned int inforeq);
+pmpkg_t *_alpm_db_scan(pmdb_t *db, char *target, pmdbinfrq_t inforeq);
+int _alpm_db_read(pmdb_t *db, pmdbinfrq_t inforeq, pmpkg_t *info);
+int _alpm_db_write(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq);
int _alpm_db_remove(pmdb_t *db, pmpkg_t *info);
int _alpm_db_getlastupdate(pmdb_t *db, char *ts);
int _alpm_db_setlastupdate(pmdb_t *db, char *ts);
Index: pacman-lib/lib/libalpm/deps.c
diff -u pacman-lib/lib/libalpm/deps.c:1.57 pacman-lib/lib/libalpm/deps.c:1.58
--- pacman-lib/lib/libalpm/deps.c:1.57 Fri Jan 19 04:28:44 2007
+++ pacman-lib/lib/libalpm/deps.c Tue Jan 23 22:02:54 2007
@@ -44,8 +44,9 @@
extern pmhandle_t *handle;
-pmdepmissing_t *_alpm_depmiss_new(const char *target, unsigned char type, unsigned char depmod,
- const char *depname, const char *depversion)
+pmdepmissing_t *_alpm_depmiss_new(const char *target, pmdeptype_t type,
+ pmdepmod_t depmod, const char *depname,
+ const char *depversion)
{
pmdepmissing_t *miss;
@@ -187,7 +188,8 @@
* dependencies can include versions with depmod operators.
*
*/
-alpm_list_t *_alpm_checkdeps(pmtrans_t *trans, pmdb_t *db, unsigned char op, alpm_list_t *packages)
+alpm_list_t *_alpm_checkdeps(pmtrans_t *trans, pmdb_t *db, pmtranstype_t op,
+ alpm_list_t *packages)
{
pmdepend_t depend;
alpm_list_t *i, *j, *k;
@@ -224,7 +226,7 @@
continue;
}
if(_alpm_pkg_isin(p->name, packages)) {
- /* this package is also in the upgrade list, so don't worry about it */
+ /* this package also in the upgrade list, so don't worry about it */
continue;
}
_alpm_db_read(db, INFRQ_DEPENDS, p);
@@ -246,8 +248,10 @@
FREELISTPTR(provides);
}
if(!_alpm_depcmp(tp, &depend)) {
- _alpm_log(PM_LOG_DEBUG, _("checkdeps: found %s as required by %s"), depend.name, p->name);
- miss = _alpm_depmiss_new(p->name, PM_DEP_TYPE_REQUIRED, depend.mod, depend.name, depend.version);
+ _alpm_log(PM_LOG_DEBUG, _("checkdeps: found %s as required by %s"),
+ depend.name, p->name);
+ miss = _alpm_depmiss_new(p->name, PM_DEP_TYPE_REQUIRED, depend.mod,
+ depend.name, depend.version);
if(!_alpm_depmiss_isin(miss, baddeps)) {
baddeps = alpm_list_add(baddeps, miss);
} else {
@@ -278,7 +282,8 @@
_alpm_splitdep((char *)j->data, &depend);
found = 0;
/* check database for literal packages */
- for(k = _alpm_db_get_pkgcache(db, INFRQ_DESC|INFRQ_DEPENDS); k && !found; k = k->next) {
+ for(k = _alpm_db_get_pkgcache(db, INFRQ_DESC|INFRQ_DEPENDS);
+ k && !found; k = k->next) {
pmpkg_t *p = (pmpkg_t *)k->data;
found = _alpm_depcmp(p, &depend);
}
@@ -316,8 +321,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);
- miss = _alpm_depmiss_new(tp->name, PM_DEP_TYPE_DEPEND, depend.mod, depend.name, depend.version);
+ depend.name, tp->name);
+ miss = _alpm_depmiss_new(tp->name, PM_DEP_TYPE_DEPEND, depend.mod,
+ depend.name, depend.version);
if(!_alpm_depmiss_isin(miss, baddeps)) {
baddeps = alpm_list_add(baddeps, miss);
} else {
@@ -363,8 +369,10 @@
}
}
if(!found) {
- _alpm_log(PM_LOG_DEBUG, _("checkdeps: found %s as required by %s"), reqname, tp->name);
- miss = _alpm_depmiss_new(tp->name, PM_DEP_TYPE_REQUIRED, PM_DEP_MOD_ANY, j->data, NULL);
+ _alpm_log(PM_LOG_DEBUG, _("checkdeps: found %s as required by %s"),
+ reqname, tp->name);
+ miss = _alpm_depmiss_new(tp->name, PM_DEP_TYPE_REQUIRED,
+ PM_DEP_MOD_ANY, j->data, NULL);
if(!_alpm_depmiss_isin(miss, baddeps)) {
baddeps = alpm_list_add(baddeps, miss);
} else {
@@ -512,8 +520,9 @@
*
* make sure *list and *trail are already initialized
*/
-int _alpm_resolvedeps(pmdb_t *local, alpm_list_t *dbs_sync, pmpkg_t *syncpkg, alpm_list_t *list,
- alpm_list_t *trail, pmtrans_t *trans, alpm_list_t **data)
+int _alpm_resolvedeps(pmdb_t *local, alpm_list_t *dbs_sync, pmpkg_t *syncpkg,
+ alpm_list_t *list, alpm_list_t *trail, pmtrans_t *trans,
+ alpm_list_t **data)
{
alpm_list_t *i, *j;
alpm_list_t *targ;
@@ -647,7 +656,7 @@
return miss->target;
}
-unsigned char alpm_dep_get_type(pmdepmissing_t *miss)
+pmdeptype_t alpm_dep_get_type(pmdepmissing_t *miss)
{
/* Sanity checks */
ASSERT(handle != NULL, return(-1));
@@ -656,7 +665,7 @@
return miss->type;
}
-unsigned char alpm_dep_get_mod(pmdepmissing_t *miss)
+pmdepmod_t alpm_dep_get_mod(pmdepmissing_t *miss)
{
/* Sanity checks */
ASSERT(handle != NULL, return(-1));
Index: pacman-lib/lib/libalpm/deps.h
diff -u pacman-lib/lib/libalpm/deps.h:1.16 pacman-lib/lib/libalpm/deps.h:1.17
--- pacman-lib/lib/libalpm/deps.h:1.16 Fri Jan 19 04:28:45 2007
+++ pacman-lib/lib/libalpm/deps.h Tue Jan 23 22:02:54 2007
@@ -30,7 +30,7 @@
/* Dependency */
struct __pmdepend_t {
- unsigned char mod;
+ pmdepmod_t mod;
char name[PKG_NAME_LEN];
char version[PKG_VERSION_LEN];
};
@@ -38,19 +38,22 @@
/* Missing dependency */
struct __pmdepmissing_t {
char target[PKG_NAME_LEN];
- unsigned char type;
+ pmdeptype_t type;
pmdepend_t depend;
};
-pmdepmissing_t *_alpm_depmiss_new(const char *target, unsigned char type, unsigned char depmod,
- const char *depname, const char *depversion);
+pmdepmissing_t *_alpm_depmiss_new(const char *target, pmdeptype_t type,
+ pmdepmod_t depmod, const char *depname,
+ const char *depversion);
int _alpm_depmiss_isin(pmdepmissing_t *needle, alpm_list_t *haystack);
alpm_list_t *_alpm_sortbydeps(alpm_list_t *targets, int mode);
-alpm_list_t *_alpm_checkdeps(pmtrans_t *trans, pmdb_t *db, unsigned char op, alpm_list_t *packages);
+alpm_list_t *_alpm_checkdeps(pmtrans_t *trans, pmdb_t *db, pmtranstype_t op,
+ alpm_list_t *packages);
int _alpm_splitdep(char *depstr, pmdepend_t *depend);
alpm_list_t *_alpm_removedeps(pmdb_t *db, alpm_list_t *targs);
-int _alpm_resolvedeps(pmdb_t *local, alpm_list_t *dbs_sync, pmpkg_t *syncpkg, alpm_list_t *list,
- alpm_list_t *trail, pmtrans_t *trans, alpm_list_t **data);
+int _alpm_resolvedeps(pmdb_t *local, alpm_list_t *dbs_sync, pmpkg_t *syncpkg,
+ alpm_list_t *list, alpm_list_t *trail, pmtrans_t *trans,
+ alpm_list_t **data);
#endif /* _ALPM_DEPS_H */
Index: pacman-lib/lib/libalpm/handle.c
diff -u pacman-lib/lib/libalpm/handle.c:1.27 pacman-lib/lib/libalpm/handle.c:1.28
--- pacman-lib/lib/libalpm/handle.c:1.27 Fri Jan 19 04:28:45 2007
+++ pacman-lib/lib/libalpm/handle.c Tue Jan 23 22:02:54 2007
@@ -117,12 +117,12 @@
alpm_cb_log alpm_option_get_logcb() { return handle->logcb; }
alpm_cb_download alpm_option_get_dlcb() { return handle->dlcb; }
-unsigned char alpm_option_get_logmask() { return handle->logmask; }
+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 *alpm_option_get_logfile() { return handle->logfile; }
-unsigned char alpm_option_get_usesyslog() { return handle->usesyslog; }
+unsigned short alpm_option_get_usesyslog() { return handle->usesyslog; }
alpm_list_t *alpm_option_get_noupgrades() { return handle->noupgrade; }
alpm_list_t *alpm_option_get_noextracts() { return handle->noextract; }
alpm_list_t *alpm_option_get_ignorepkgs() { return handle->ignorepkg; }
@@ -135,13 +135,16 @@
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() { return handle->dbs_sync; }
+alpm_list_t *alpm_option_get_syncdbs()
+{
+ return handle->dbs_sync;
+}
void alpm_option_set_logcb(alpm_cb_log cb) { handle->logcb = cb; }
void alpm_option_set_dlcb(alpm_cb_download cb) { handle->dlcb = cb; }
-void alpm_option_set_logmask(unsigned char mask) { handle->logmask = mask; }
+void alpm_option_set_logmask(unsigned short mask) { handle->logmask = mask; }
void alpm_option_set_root(const char *root)
{
@@ -176,12 +179,16 @@
}
}
-void alpm_option_set_usesyslog(unsigned char usesyslog) { handle->usesyslog = usesyslog; }
+void alpm_option_set_usesyslog(unsigned short usesyslog)
+{
+ handle->usesyslog = usesyslog;
+}
void alpm_option_add_noupgrade(char *pkg)
{
handle->noupgrade = alpm_list_add(handle->noupgrade, strdup(pkg));
}
+
void alpm_option_set_noupgrades(alpm_list_t *noupgrade)
{
if(handle->noupgrade) FREELIST(handle->noupgrade);
@@ -218,7 +225,10 @@
if(holdpkgs) handle->holdpkg = holdpkgs;
}
-void alpm_option_set_upgradedelay(time_t delay) { handle->upgradedelay = delay; }
+void alpm_option_set_upgradedelay(time_t delay)
+{
+ handle->upgradedelay = delay;
+}
void alpm_option_set_xfercommand(const char *cmd)
{
@@ -226,7 +236,10 @@
if(cmd) handle->xfercommand = strdup(cmd);
}
-void alpm_option_set_nopassiveftp(unsigned short nopasv) { handle->nopassiveftp = nopasv; }
+void alpm_option_set_nopassiveftp(unsigned short nopasv)
+{
+ handle->nopassiveftp = nopasv;
+}
void alpm_option_set_chomp(unsigned short chomp) { handle->chomp = chomp; }
@@ -239,6 +252,9 @@
if(handle->needles) FREELIST(handle->needles);
if(needles) handle->needles = needles;
}
-void alpm_option_set_usecolor(unsigned short usecolor) { handle->use_color = usecolor; }
+void alpm_option_set_usecolor(unsigned short usecolor)
+{
+ handle->use_color = usecolor;
+}
/* vim: set ts=2 sw=2 et: */
Index: pacman-lib/lib/libalpm/handle.h
diff -u pacman-lib/lib/libalpm/handle.h:1.13 pacman-lib/lib/libalpm/handle.h:1.14
--- pacman-lib/lib/libalpm/handle.h:1.13 Fri Jan 19 04:28:45 2007
+++ pacman-lib/lib/libalpm/handle.h Tue Jan 23 22:02:54 2007
@@ -45,12 +45,12 @@
/* options */
alpm_cb_log logcb; /* Log callback function */
alpm_cb_download dlcb; /* Download callback function */
- unsigned char logmask; /* Output mask for logging functions */
+ unsigned short logmask; /* Output mask for logging functions */
char *root; /* Root path, default '/' */
char *dbpath; /* Base path to pacman's DBs */
char *cachedir; /* Base path to pacman's cache */
char *logfile; /* Name of the file to log to */ /*TODO is this used?*/
- unsigned char usesyslog; /* Use syslog instead of logfile? */
+ unsigned short usesyslog; /* Use syslog instead of logfile? */
alpm_list_t *noupgrade; /* List of packages NOT to be upgraded */
alpm_list_t *noextract; /* List of packages NOT to extrace */ /*TODO is this used?*/
Index: pacman-lib/lib/libalpm/log.c
diff -u pacman-lib/lib/libalpm/log.c:1.8 pacman-lib/lib/libalpm/log.c:1.9
--- pacman-lib/lib/libalpm/log.c:1.8 Mon Nov 20 04:10:24 2006
+++ pacman-lib/lib/libalpm/log.c Tue Jan 23 22:02:54 2007
@@ -27,7 +27,7 @@
#include "alpm.h"
#include "log.h"
-void _alpm_log(unsigned char flag, char *fmt, ...)
+void _alpm_log(pmloglevel_t flag, char *fmt, ...)
{
alpm_cb_log logcb = alpm_option_get_logcb();
if(logcb == NULL) {
Index: pacman-lib/lib/libalpm/log.h
diff -u pacman-lib/lib/libalpm/log.h:1.7 pacman-lib/lib/libalpm/log.h:1.8
--- pacman-lib/lib/libalpm/log.h:1.7 Mon Nov 20 04:10:24 2006
+++ pacman-lib/lib/libalpm/log.h Tue Jan 23 22:02:54 2007
@@ -21,9 +21,11 @@
#ifndef _ALPM_LOG_H
#define _ALPM_LOG_H
+#include "alpm.h"
+
#define LOG_STR_LEN 1024
-void _alpm_log(unsigned char flag, char *fmt, ...);
+void _alpm_log(pmloglevel_t flag, char *fmt, ...);
#endif /* _ALPM_LOG_H */
Index: pacman-lib/lib/libalpm/package.c
diff -u pacman-lib/lib/libalpm/package.c:1.49 pacman-lib/lib/libalpm/package.c:1.50
--- pacman-lib/lib/libalpm/package.c:1.49 Mon Jan 22 11:16:51 2007
+++ pacman-lib/lib/libalpm/package.c Tue Jan 23 22:02:54 2007
@@ -606,7 +606,7 @@
return pkg->isize;
}
-unsigned char alpm_pkg_get_reason(pmpkg_t *pkg)
+pmpkgreason_t alpm_pkg_get_reason(pmpkg_t *pkg)
{
/* Sanity checks */
ASSERT(handle != NULL, return(-1));
@@ -741,7 +741,7 @@
return pkg->backup;
}
-unsigned char alpm_pkg_has_scriptlet(pmpkg_t *pkg)
+unsigned short alpm_pkg_has_scriptlet(pmpkg_t *pkg)
{
/* Sanity checks */
ASSERT(handle != NULL, return(-1));
Index: pacman-lib/lib/libalpm/package.h
diff -u pacman-lib/lib/libalpm/package.h:1.23 pacman-lib/lib/libalpm/package.h:1.24
--- pacman-lib/lib/libalpm/package.h:1.23 Fri Jan 19 04:28:45 2007
+++ pacman-lib/lib/libalpm/package.h Tue Jan 23 22:02:54 2007
@@ -30,11 +30,12 @@
#endif
#include "alpm.h"
+#include "db.h"
-enum {
+typedef enum _pmpkgfrom_t {
PKG_FROM_CACHE = 1,
PKG_FROM_FILE
-};
+} pmpkgfrom_t;
/* Packages */
#define PKG_FILENAME_LEN 512
@@ -65,10 +66,10 @@
char arch[PKG_ARCH_LEN];
unsigned long size;
unsigned long isize;
- unsigned char scriptlet;
- unsigned char force;
+ unsigned short scriptlet;
+ unsigned short force;
time_t date;
- unsigned char reason;
+ pmpkgreason_t reason;
alpm_list_t *desc_localized;
alpm_list_t *license;
alpm_list_t *replaces;
@@ -81,9 +82,9 @@
alpm_list_t *conflicts;
alpm_list_t *provides;
/* internal */
- unsigned char origin;
+ unsigned short origin;
void *data;
- unsigned char infolevel;
+ pmdbinfrq_t infolevel;
};
#define FREEPKG(p) do { if(p){_alpm_pkg_free(p); p = NULL;}} while(0)
Index: pacman-lib/lib/libalpm/sync.c
diff -u pacman-lib/lib/libalpm/sync.c:1.91 pacman-lib/lib/libalpm/sync.c:1.92
--- pacman-lib/lib/libalpm/sync.c:1.91 Fri Jan 19 04:28:45 2007
+++ pacman-lib/lib/libalpm/sync.c Tue Jan 23 22:02:54 2007
@@ -1069,7 +1069,7 @@
return(-1);
}
-unsigned char alpm_sync_get_type(pmsyncpkg_t *sync)
+pmsynctype_t alpm_sync_get_type(pmsyncpkg_t *sync)
{
/* Sanity checks */
ASSERT(sync != NULL, return(-1));
Index: pacman-lib/lib/libalpm/sync.h
diff -u pacman-lib/lib/libalpm/sync.h:1.16 pacman-lib/lib/libalpm/sync.h:1.17
--- pacman-lib/lib/libalpm/sync.h:1.16 Fri Jan 19 04:28:45 2007
+++ pacman-lib/lib/libalpm/sync.h Tue Jan 23 22:02:54 2007
@@ -27,7 +27,7 @@
/* Sync package */
struct __pmsyncpkg_t {
- unsigned char type;
+ pmsynctype_t type;
pmpkg_t *pkg;
void *data;
};
Index: pacman-lib/lib/libalpm/trans.c
diff -u pacman-lib/lib/libalpm/trans.c:1.30 pacman-lib/lib/libalpm/trans.c:1.31
--- pacman-lib/lib/libalpm/trans.c:1.30 Fri Jan 19 04:28:45 2007
+++ pacman-lib/lib/libalpm/trans.c Tue Jan 23 22:02:54 2007
@@ -85,7 +85,9 @@
FREE(trans);
}
-int _alpm_trans_init(pmtrans_t *trans, unsigned char type, unsigned int flags, alpm_trans_cb_event event, alpm_trans_cb_conv conv, alpm_trans_cb_progress progress)
+int _alpm_trans_init(pmtrans_t *trans, pmtranstype_t type, unsigned int flags,
+ alpm_trans_cb_event event, alpm_trans_cb_conv conv,
+ alpm_trans_cb_progress progress)
{
/* Sanity checks */
ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1));
@@ -226,7 +228,7 @@
return(0);
}
-unsigned char alpm_trans_get_type()
+pmtranstype_t alpm_trans_get_type()
{
/* Sanity checks */
ASSERT(handle != NULL, return(-1));
Index: pacman-lib/lib/libalpm/trans.h
diff -u pacman-lib/lib/libalpm/trans.h:1.21 pacman-lib/lib/libalpm/trans.h:1.22
--- pacman-lib/lib/libalpm/trans.h:1.21 Fri Jan 19 04:28:45 2007
+++ pacman-lib/lib/libalpm/trans.h Tue Jan 23 22:02:54 2007
@@ -26,11 +26,21 @@
#include "alpm.h"
+typedef enum _pmtransstate_t {
+ STATE_IDLE = 0,
+ STATE_INITIALIZED,
+ STATE_PREPARED,
+ STATE_DOWNLOADING,
+ STATE_COMMITING,
+ STATE_COMMITED,
+ STATE_INTERRUPTED
+} pmtransstate_t;
+
/* Transaction */
struct __pmtrans_t {
- unsigned char type;
+ pmtranstype_t type;
unsigned int flags;
- unsigned char state;
+ pmtransstate_t state;
alpm_list_t *targets; /* alpm_list_t of (char *) */
alpm_list_t *packages; /* alpm_list_t of (pmpkg_t *) or (pmsyncpkg_t *) */
alpm_list_t *skiplist; /* alpm_list_t of (char *) */
@@ -39,16 +49,6 @@
alpm_trans_cb_progress cb_progress;
};
-enum {
- STATE_IDLE = 0,
- STATE_INITIALIZED,
- STATE_PREPARED,
- STATE_DOWNLOADING,
- STATE_COMMITING,
- STATE_COMMITED,
- STATE_INTERRUPTED
-};
-
#define FREETRANS(p) \
do { \
if(p) { \
@@ -77,7 +77,9 @@
pmtrans_t *_alpm_trans_new(void);
void _alpm_trans_free(void *data);
-int _alpm_trans_init(pmtrans_t *trans, unsigned char type, unsigned int flags, alpm_trans_cb_event event, alpm_trans_cb_conv conv, alpm_trans_cb_progress progress);
+int _alpm_trans_init(pmtrans_t *trans, pmtranstype_t type, unsigned int flags,
+ alpm_trans_cb_event event, alpm_trans_cb_conv conv,
+ alpm_trans_cb_progress progress);
int _alpm_trans_sysupgrade(pmtrans_t *trans);
int _alpm_trans_addtarget(pmtrans_t *trans, char *target);
int _alpm_trans_prepare(pmtrans_t *trans, alpm_list_t **data);
Index: pacman-lib/lib/libalpm/util.c
diff -u pacman-lib/lib/libalpm/util.c:1.39 pacman-lib/lib/libalpm/util.c:1.40
--- pacman-lib/lib/libalpm/util.c:1.39 Fri Jan 19 04:28:45 2007
+++ pacman-lib/lib/libalpm/util.c Tue Jan 23 22:02:54 2007
@@ -66,7 +66,7 @@
#ifdef __sun__
/* This is a replacement for strsep which is not portable (missing on Solaris).
- * Copyright (c) 2001 by François Gouget <fgouget_at_codeweavers.com> */
+ * Copyright (c) 2001 by François Gouget <fgouget_at_codeweavers.com> */
char* strsep(char** str, const char* delims)
{
char* token;
@@ -342,7 +342,7 @@
return(0);
}
-int _alpm_logaction(unsigned char usesyslog, FILE *f, const char *str)
+int _alpm_logaction(unsigned short usesyslog, FILE *f, const char *str)
{
_alpm_log(PM_LOG_DEBUG, _("logaction called: %s"), str);
Index: pacman-lib/lib/libalpm/util.h
diff -u pacman-lib/lib/libalpm/util.h:1.18 pacman-lib/lib/libalpm/util.h:1.19
--- pacman-lib/lib/libalpm/util.h:1.18 Fri Jan 19 04:28:45 2007
+++ pacman-lib/lib/libalpm/util.h Tue Jan 23 22:02:54 2007
@@ -62,7 +62,7 @@
int _alpm_lckrm(char *file);
int _alpm_unpack(const char *archive, const char *prefix, const char *fn);
int _alpm_rmrf(char *path);
-int _alpm_logaction(unsigned char usesyslog, FILE *f, const char *str);
+int _alpm_logaction(unsigned short usesyslog, FILE *f, const char *str);
int _alpm_ldconfig(char *root);
#ifdef _ALPM_TRANS_H
int _alpm_runscriptlet(char *util, char *installfn, char *script, char *ver, char *oldver, pmtrans_t *trans);
Index: pacman-lib/lib/libalpm/versioncmp.c
diff -u pacman-lib/lib/libalpm/versioncmp.c:1.8 pacman-lib/lib/libalpm/versioncmp.c:1.9
--- pacman-lib/lib/libalpm/versioncmp.c:1.8 Fri Jan 19 04:28:45 2007
+++ pacman-lib/lib/libalpm/versioncmp.c Tue Jan 23 22:02:54 2007
@@ -253,17 +253,19 @@
} else {
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;
- case PM_DEP_MOD_LE: equal = (cmp <= 0); break;
+ case PM_DEP_MOD_EQ: equal = (cmp == 0); break;
+ case PM_DEP_MOD_GE: equal = (cmp >= 0); break;
+ case PM_DEP_MOD_LE: equal = (cmp <= 0); break;
+ default: equal = 1; break;
}
}
char *mod = "~=";
switch(dep->mod) {
- case PM_DEP_MOD_EQ: mod = "=="; break;
- case PM_DEP_MOD_GE: mod = ">="; break;
- case PM_DEP_MOD_LE: mod = "<="; break;
+ case PM_DEP_MOD_EQ: mod = "=="; break;
+ case PM_DEP_MOD_GE: mod = ">="; break;
+ case PM_DEP_MOD_LE: mod = "<="; break;
+ default: break;
}
if(strlen(dep->version) > 0) {
Index: pacman-lib/src/pacman/add.c
diff -u pacman-lib/src/pacman/add.c:1.23 pacman-lib/src/pacman/add.c:1.24
--- pacman-lib/src/pacman/add.c:1.23 Fri Jan 19 04:28:46 2007
+++ pacman-lib/src/pacman/add.c Tue Jan 23 22:02:55 2007
@@ -96,9 +96,17 @@
MSG(NL, _(":: %s: requires %s"), alpm_dep_get_target(miss),
alpm_dep_get_name(miss));
switch(alpm_dep_get_mod(miss)) {
- case PM_DEP_MOD_EQ: MSG(CL, "=%s", alpm_dep_get_version(miss)); break;
- case PM_DEP_MOD_GE: MSG(CL, ">=%s", alpm_dep_get_version(miss)); break;
- case PM_DEP_MOD_LE: MSG(CL, "<=%s", alpm_dep_get_version(miss)); break;
+ case PM_DEP_MOD_ANY:
+ break;
+ case PM_DEP_MOD_EQ:
+ MSG(CL, "=%s", alpm_dep_get_version(miss));
+ break;
+ case PM_DEP_MOD_GE:
+ MSG(CL, ">=%s", alpm_dep_get_version(miss));
+ break;
+ case PM_DEP_MOD_LE:
+ MSG(CL, "<=%s", alpm_dep_get_version(miss));
+ break;
}
MSG(CL, "\n");
}
Index: pacman-lib/src/pacman/deptest.c
diff -u pacman-lib/src/pacman/deptest.c:1.10 pacman-lib/src/pacman/deptest.c:1.11
--- pacman-lib/src/pacman/deptest.c:1.10 Fri Jan 19 04:28:46 2007
+++ pacman-lib/src/pacman/deptest.c Tue Jan 23 22:02:55 2007
@@ -114,9 +114,17 @@
if(!config->op_d_resolve) {
MSG(NL, _("requires: %s"), alpm_dep_get_name(miss));
switch(alpm_dep_get_mod(miss)) {
- case PM_DEP_MOD_EQ: MSG(CL, "=%s", alpm_dep_get_version(miss)); break;
- case PM_DEP_MOD_GE: MSG(CL, ">=%s", alpm_dep_get_version(miss)); break;
- case PM_DEP_MOD_LE: MSG(CL, "<=%s", alpm_dep_get_version(miss)); break;
+ case PM_DEP_MOD_ANY:
+ break;
+ case PM_DEP_MOD_EQ:
+ MSG(CL, "=%s", alpm_dep_get_version(miss));
+ break;
+ case PM_DEP_MOD_GE:
+ MSG(CL, ">=%s", alpm_dep_get_version(miss));
+ break;
+ case PM_DEP_MOD_LE:
+ MSG(CL, "<=%s", alpm_dep_get_version(miss));
+ break;
}
MSG(CL, "\n");
}
Index: pacman-lib/src/pacman/sync.c
diff -u pacman-lib/src/pacman/sync.c:1.97 pacman-lib/src/pacman/sync.c:1.98
--- pacman-lib/src/pacman/sync.c:1.97 Tue Jan 23 15:09:18 2007
+++ pacman-lib/src/pacman/sync.c Tue Jan 23 22:02:55 2007
@@ -579,12 +579,21 @@
for(i = data; i; i = alpm_list_next(i)) {
pmdepmissing_t *miss = alpm_list_getdata(i);
MSG(NL, ":: %s %s %s", alpm_dep_get_target(miss),
- alpm_dep_get_type(miss) == PM_DEP_TYPE_DEPEND ? _("requires") : _("is required by"),
- alpm_dep_get_name(miss));
+ alpm_dep_get_type(miss) == PM_DEP_TYPE_DEPEND ?
+ _("requires") : _("is required by"),
+ alpm_dep_get_name(miss));
switch(alpm_dep_get_mod(miss)) {
- case PM_DEP_MOD_EQ: MSG(CL, "=%s", alpm_dep_get_version(miss)); break;
- case PM_DEP_MOD_GE: MSG(CL, ">=%s", alpm_dep_get_version(miss)); break;
- case PM_DEP_MOD_LE: MSG(CL, "<=%s", alpm_dep_get_version(miss)); break;
+ case PM_DEP_MOD_ANY:
+ break;
+ case PM_DEP_MOD_EQ:
+ MSG(CL, "=%s", alpm_dep_get_version(miss));
+ break;
+ case PM_DEP_MOD_GE:
+ MSG(CL, ">=%s", alpm_dep_get_version(miss));
+ break;
+ case PM_DEP_MOD_LE:
+ MSG(CL, "<=%s", alpm_dep_get_version(miss));
+ break;
}
MSG(CL, "\n");
}
Index: pacman-lib/src/pacman/trans.c
diff -u pacman-lib/src/pacman/trans.c:1.27 pacman-lib/src/pacman/trans.c:1.28
--- pacman-lib/src/pacman/trans.c:1.27 Fri Jan 19 04:28:46 2007
+++ pacman-lib/src/pacman/trans.c Tue Jan 23 22:02:55 2007
@@ -44,7 +44,7 @@
/* Callback to handle transaction events
*/
-void cb_trans_evt(unsigned char event, void *data1, void *data2)
+void cb_trans_evt(pmtransevt_t event, void *data1, void *data2)
{
char str[LOG_STR_LEN] = "";
char out[PATH_MAX];
@@ -53,38 +53,42 @@
switch(event) {
case PM_TRANS_EVT_CHECKDEPS_START:
pm_fprintf(stderr, NL, _("checking dependencies... "));
- break;
+ break;
case PM_TRANS_EVT_FILECONFLICTS_START:
if(config->noprogressbar) {
MSG(NL, _("checking for file conflicts... "));
}
- break;
+ break;
+ case PM_TRANS_EVT_CLEANUP_START:
+ pm_fprintf(stderr, NL, _("resolving dependencies... "));
+ break;
case PM_TRANS_EVT_RESOLVEDEPS_START:
pm_fprintf(stderr, NL, _("resolving dependencies... "));
- break;
+ break;
case PM_TRANS_EVT_INTERCONFLICTS_START:
pm_fprintf(stderr, NL, _("looking for inter-conflicts... "));
- break;
+ break;
case PM_TRANS_EVT_FILECONFLICTS_DONE:
if(config->noprogressbar) {
MSG(CL, _("done.\n"));
}
- break;
+ break;
case PM_TRANS_EVT_CHECKDEPS_DONE:
+ case PM_TRANS_EVT_CLEANUP_DONE:
case PM_TRANS_EVT_RESOLVEDEPS_DONE:
case PM_TRANS_EVT_INTERCONFLICTS_DONE:
pm_fprintf(stderr, CL, _("done.\n"));
- break;
+ break;
case PM_TRANS_EVT_EXTRACT_DONE:
if(config->noprogressbar) {
MSG(CL, _("done.\n"));
}
- break;
+ break;
case PM_TRANS_EVT_ADD_START:
if(config->noprogressbar) {
MSG(NL, _("installing %s... "), alpm_pkg_get_name(data1));
}
- break;
+ break;
case PM_TRANS_EVT_ADD_DONE:
if(config->noprogressbar) {
MSG(CL, _("done.\n"));
@@ -93,12 +97,12 @@
alpm_pkg_get_name(data1),
alpm_pkg_get_version(data1));
alpm_logaction(str);
- break;
+ break;
case PM_TRANS_EVT_REMOVE_START:
if(config->noprogressbar) {
MSG(NL, _("removing %s... "), alpm_pkg_get_name(data1));
}
- break;
+ break;
case PM_TRANS_EVT_REMOVE_DONE:
if(config->noprogressbar) {
MSG(CL, _("done.\n"));
@@ -107,12 +111,12 @@
alpm_pkg_get_name(data1),
alpm_pkg_get_version(data1));
alpm_logaction(str);
- break;
+ break;
case PM_TRANS_EVT_UPGRADE_START:
if(config->noprogressbar) {
MSG(NL, _("upgrading %s... "), alpm_pkg_get_name(data1));
}
- break;
+ break;
case PM_TRANS_EVT_UPGRADE_DONE:
if(config->noprogressbar) {
MSG(CL, _("done.\n"));
@@ -122,34 +126,34 @@
(char *)alpm_pkg_get_version(data2),
(char *)alpm_pkg_get_version(data1));
alpm_logaction(str);
- break;
+ break;
case PM_TRANS_EVT_INTEGRITY_START:
MSG(NL, _("checking package integrity... "));
- break;
+ break;
case PM_TRANS_EVT_INTEGRITY_DONE:
MSG(CL, _("done.\n"));
- break;
+ break;
case PM_TRANS_EVT_SCRIPTLET_INFO:
MSG(NL, "%s\n", (char*)data1);
- break;
+ break;
case PM_TRANS_EVT_SCRIPTLET_START:
MSG(NL, (char*)data1);
MSG(CL, "...");
- break;
+ break;
case PM_TRANS_EVT_SCRIPTLET_DONE:
if(!(long)data1) {
MSG(CL, _(" done.\n"));
} else {
MSG(CL, _(" failed.\n"));
}
- break;
+ break;
case PM_TRANS_EVT_PRINTURI:
MSG(NL, "%s/%s\n", (char*)data1, (char*)data2);
- break;
+ break;
case PM_TRANS_EVT_RETRIEVE_START:
MSG(NL, _(":: Retrieving packages from %s...\n"), (char*)data1);
fflush(stdout);
- break;
+ break;
case PM_TRANS_EVT_RETRIEVE_LOCAL:
MSG(NL, " %s [", (char*)data1);
unsigned int maxcols = getcols();
@@ -159,11 +163,12 @@
MSG(CL, " ");
}
fputs(_("] 100% LOCAL "), stdout);
- break;
+ break;
}
}
-void cb_trans_conv(unsigned char event, void *data1, void *data2, void *data3, int *response)
+void cb_trans_conv(pmtransconv_t event, void *data1, void *data2,
+ void *data3, int *response)
{
char str[LOG_STR_LEN] = "";
@@ -181,7 +186,7 @@
alpm_pkg_get_name(data2));
*response = yesno(str);
}
- break;
+ break;
case PM_TRANS_CONV_REMOVE_HOLDPKG:
if(config->noask) {
if(config->ask & PM_TRANS_CONV_REMOVE_HOLDPKG) {
@@ -190,11 +195,11 @@
*response = 0;
}
} else {
- snprintf(str, LOG_STR_LEN, _(":: %s is designated as a HoldPkg. Remove anyway? [Y/n] "),
+ snprintf(str, LOG_STR_LEN, _(":: %s is designated as a HoldPkg. Remove anyway? [Y/n] "),
alpm_pkg_get_name(data1));
*response = yesno(str);
}
- break;
+ break;
case PM_TRANS_CONV_REPLACE_PKG:
if(config->noask) {
if(config->ask & PM_TRANS_CONV_REPLACE_PKG) {
@@ -209,7 +214,7 @@
alpm_pkg_get_name(data2));
*response = yesno(str);
}
- break;
+ break;
case PM_TRANS_CONV_CONFLICT_PKG:
if(config->noask) {
if(config->ask & PM_TRANS_CONV_CONFLICT_PKG) {
@@ -224,7 +229,7 @@
(char *)data2);
*response = yesno(str);
}
- break;
+ break;
case PM_TRANS_CONV_LOCAL_NEWER:
if(config->noask) {
if(config->ask & PM_TRANS_CONV_LOCAL_NEWER) {
@@ -242,7 +247,7 @@
*response = 1;
}
}
- break;
+ break;
case PM_TRANS_CONV_LOCAL_UPTODATE:
if(config->noask) {
if(config->ask & PM_TRANS_CONV_LOCAL_UPTODATE) {
@@ -260,7 +265,7 @@
*response = 1;
}
}
- break;
+ break;
case PM_TRANS_CONV_CORRUPTED_PKG:
if(config->noask) {
if(config->ask & PM_TRANS_CONV_CORRUPTED_PKG) {
@@ -277,11 +282,12 @@
*response = 1;
}
}
- break;
+ break;
}
}
-void cb_trans_progress(unsigned char event, char *pkgname, int percent, int howmany, int remain)
+void cb_trans_progress(pmtransprog_t event, char *pkgname, int percent,
+ int howmany, int remain)
{
static int lasthash = 0, mouth = 0;
int i, hash;
@@ -311,19 +317,19 @@
switch (event) {
case PM_TRANS_PROGRESS_ADD_START:
ptr = _("installing");
- break;
+ break;
case PM_TRANS_PROGRESS_UPGRADE_START:
ptr = _("upgrading");
- break;
+ break;
case PM_TRANS_PROGRESS_REMOVE_START:
ptr = _("removing");
- break;
+ break;
case PM_TRANS_PROGRESS_CONFLICTS_START:
ptr = _("checking for file conflicts");
- break;
+ break;
}
hash=percent*progresslen/100;
Index: pacman-lib/src/pacman/trans.h
diff -u pacman-lib/src/pacman/trans.h:1.5 pacman-lib/src/pacman/trans.h:1.6
--- pacman-lib/src/pacman/trans.h:1.5 Sun Oct 15 15:34:53 2006
+++ pacman-lib/src/pacman/trans.h Tue Jan 23 22:02:55 2007
@@ -22,12 +22,14 @@
#define _PM_TRANS_H
/* callback to handle messages/notifications from pacman transactions */
-void cb_trans_evt(unsigned char event, void *data1, void *data2);
+void cb_trans_evt(pmtransevt_t event, void *data1, void *data2);
/* callback to handle questions from pacman transactions (yes/no) */
-void cb_trans_conv(unsigned char event, void *data1, void *data2, void *data3, int *response);
+void cb_trans_conv(pmtransconv_t event, void *data1, void *data2,
+ void *data3, int *response);
-void cb_trans_progress(unsigned char event, char *pkgname, int percent, int howmany, int remain);
+void cb_trans_progress(pmtransprog_t event, char *pkgname, int percent,
+ int howmany, int remain);
#endif /* _PM_TRANS_H */
1
0
Okay...blame wizzomafizzo :P. Because of the new way makepkg deals with files
(not using the extension), files that are actually zipfiles but called something
else that do not need to be extracted will be extracted (this is wizz's
example). Best example I can think of is like a .pk3 file for some games
(which I think is really just a zipfile). Anyway....we came up with the idea of
a noextract=(...) field in the PKGBUILD and the patch is below.
I'm not entirely too sure on whether or not this is entirely necessary...but oh
well.
Patch is below.
~ Jamie / yankees26
Signed-off-by: James Rosten <seinfeld90(a)gmail.com>
Index: makepkg
===================================================================
RCS file: /home/cvs-pacman/pacman-lib/scripts/makepkg,v
retrieving revision 1.33
diff -u -r1.33 makepkg
--- makepkg 22 Jan 2007 19:26:23 -0000 1.33
+++ makepkg 23 Jan 2007 05:34:25 -0000
@@ -425,7 +425,7 @@
unset pkgname pkgver pkgrel pkgdesc url license groups provides md5sums force
unset replaces depends conflicts backup source install build makedepends
-unset options
+unset options noextract
# some applications (eg, blackbox) will not build with some languages
unset LC_ALL LANG
@@ -680,7 +680,17 @@
msg "Extracting Sources..."
for netfile in "${source[@]}"; do
unziphack=0
+ NoExtract=0
file=$(strip_url "$netfile")
+ for skipfile in "${noextract[@]}"; do
+ if [ "$skipfile" = "$file" ]; then
+ NoExtract=1
+ break;
+ fi
+ done
+ if [ $NoExtract -eq 1 ]; then
+ continue;
+ fi
# fix flyspray #6246
file_type=$(file -biz "$file")
unset cmd
7
9
[pacman-dev] [patch] remove use of unsigned char for enums, convert #define constants to enums
by Dan McGee 23 Jan '07
by Dan McGee 23 Jan '07
23 Jan '07
This mainly deals with code clarity- removing currently unneeded
optimizations in order to make the code much more readable and
type-checkable. Every enum in the library now has it's own type that
should be used instead of the generic 'unsigned char'. In addition,
several #define statements dealing with constants were converted to
enums.
Signed-off-by: Dan McGee <dpmcgee(a)gmail.com>
diff -uarp pacman-lib.orig/lib/libalpm/add.c
pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/add.c
--- pacman-lib.orig/lib/libalpm/add.c 2007-01-19 18:09:55.000000000 -0500
+++ pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/add.c 2007-01-19
20:26:21.000000000 -0500
@@ -332,7 +332,7 @@ int _alpm_add_commit(pmtrans_t *trans, p
register struct archive *archive;
struct archive_entry *entry;
char expath[PATH_MAX], cwd[PATH_MAX] = "", *what;
- unsigned char cb_state;
+ pmtransprog_t cb_state;
time_t t;
alpm_list_t *targ, *lp;
diff -uarp pacman-lib.orig/lib/libalpm/alpm.c
pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/alpm.c
--- pacman-lib.orig/lib/libalpm/alpm.c 2007-01-19 18:09:55.000000000 -0500
+++ pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/alpm.c 2007-01-19
20:26:21.000000000 -0500
@@ -63,7 +63,7 @@
/* Globals */
pmhandle_t *handle = NULL;
-enum __pmerrno_t pm_errno;
+enum _pmerrno_t pm_errno;
/** \addtogroup alpm_interface Interface Functions
* @brief Functions to initialize and release libalpm
@@ -622,7 +622,9 @@ alpm_list_t *alpm_db_search(pmdb_t *db)
* @param progress progress callback function pointer
* @return 0 on success, -1 on error (pm_errno is set accordingly)
*/
-int alpm_trans_init(unsigned char type, unsigned int flags,
alpm_trans_cb_event event, alpm_trans_cb_conv conv,
alpm_trans_cb_progress progress)
+int alpm_trans_init(pmtranstype_t type, unsigned int flags,
+ alpm_trans_cb_event event, alpm_trans_cb_conv conv,
+ alpm_trans_cb_progress progress)
{
char path[PATH_MAX];
diff -uarp pacman-lib.orig/lib/libalpm/alpm.h
pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/alpm.h
--- pacman-lib.orig/lib/libalpm/alpm.h 2007-01-19 18:09:55.000000000 -0500
+++ pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/alpm.h 2007-01-19
20:54:46.000000000 -0500
@@ -71,13 +71,15 @@ int alpm_release(void);
*/
/* Levels */
-#define PM_LOG_DEBUG 0x01
-#define PM_LOG_ERROR 0x02
-#define PM_LOG_WARNING 0x04
-#define PM_LOG_FLOW1 0x08
-#define PM_LOG_FLOW2 0x10
-#define PM_LOG_FUNCTION 0x20
-#define PM_LOG_DOWNLOAD 0x40
+typedef enum _pmloglevel_t {
+ PM_LOG_DEBUG = 0x01,
+ PM_LOG_ERROR = 0x02,
+ PM_LOG_WARNING = 0x04,
+ PM_LOG_FLOW1 = 0x08,
+ PM_LOG_FLOW2 = 0x10,
+ PM_LOG_FUNCTION = 0x20,
+ PM_LOG_DOWNLOAD = 0x40
+} pmloglevel_t;
typedef void (*alpm_cb_log)(unsigned short, char *);
int alpm_logaction(char *fmt, ...);
@@ -100,8 +102,8 @@ void alpm_option_set_logcb(alpm_cb_log c
alpm_cb_download alpm_option_get_dlcb();
void alpm_option_set_dlcb(alpm_cb_download cb);
-unsigned char alpm_option_get_logmask();
-void alpm_option_set_logmask(unsigned char mask);
+unsigned short alpm_option_get_logmask();
+void alpm_option_set_logmask(unsigned short mask);
const char *alpm_option_get_root();
void alpm_option_set_root(const char *root);
@@ -115,8 +117,8 @@ void alpm_option_set_cachedir(const char
const char *alpm_option_get_logfile();
void alpm_option_set_logfile(const char *logfile);
-unsigned char alpm_option_get_usesyslog();
-void alpm_option_set_usesyslog(unsigned char usesyslog);
+unsigned short alpm_option_get_usesyslog();
+void alpm_option_set_usesyslog(unsigned short usesyslog);
alpm_list_t *alpm_option_get_noupgrades();
void alpm_option_add_noupgrade(char *pkg);
@@ -188,19 +190,26 @@ alpm_list_t *alpm_db_search(pmdb_t *db);
/* Info parameters */
/* reasons -- ie, why the package was installed */
-#define PM_PKG_REASON_EXPLICIT 0 /* explicitly requested by the user */
-#define PM_PKG_REASON_DEPEND 1 /* installed as a dependency for
another package */
+typedef enum _pmpkgreason_t {
+ PM_PKG_REASON_EXPLICIT = 0, /* explicitly requested by the user */
+ PM_PKG_REASON_DEPEND = 1 /* installed as a dependency for another package */
+} pmpkgreason_t;
/* package name formats */
-#define PM_PKG_WITHOUT_ARCH 0 /* pkgname-pkgver-pkgrel, used under PM_DBPATH */
-#define PM_PKG_WITH_ARCH 1 /* ie, pkgname-pkgver-pkgrel-arch, used
under PM_CACHEDIR */
+/*
+typedef enum _pmpkghasarch_t {
+ PM_PKG_WITHOUT_ARCH = 0, / pkgname-pkgver-pkgrel, used under PM_DBPATH /
+ PM_PKG_WITH_ARCH = 1 / pkgname-pkgver-pkgrel-arch, used under PM_CACHEDIR /
+} pmpkghasarch_t;
+*/
int alpm_pkg_load(char *filename, pmpkg_t **pkg);
int alpm_pkg_free(pmpkg_t *pkg);
int alpm_pkg_checkmd5sum(pmpkg_t *pkg);
int alpm_pkg_checksha1sum(pmpkg_t *pkg);
char *alpm_fetch_pkgurl(char *url);
-int alpm_parse_config(char *file, alpm_cb_db_register callback, const
char *this_section);
+int alpm_parse_config(char *file, alpm_cb_db_register callback,
+ const char *this_section);
int alpm_pkg_vercmp(const char *ver1, const char *ver2);
char *alpm_pkg_name_hasarch(char *pkgname);
@@ -218,7 +227,7 @@ const char *alpm_pkg_get_sha1sum(pmpkg_t
const char *alpm_pkg_get_arch(pmpkg_t *pkg);
unsigned long alpm_pkg_get_size(pmpkg_t *pkg);
unsigned long alpm_pkg_get_isize(pmpkg_t *pkg);
-unsigned char alpm_pkg_get_reason(pmpkg_t *pkg);
+pmpkgreason_t alpm_pkg_get_reason(pmpkg_t *pkg);
alpm_list_t *alpm_pkg_get_licenses(pmpkg_t *pkg);
alpm_list_t *alpm_pkg_get_groups(pmpkg_t *pkg);
alpm_list_t *alpm_pkg_get_depends(pmpkg_t *pkg);
@@ -229,7 +238,7 @@ alpm_list_t *alpm_pkg_get_provides(pmpkg
alpm_list_t *alpm_pkg_get_replaces(pmpkg_t *pkg);
alpm_list_t *alpm_pkg_get_files(pmpkg_t *pkg);
alpm_list_t *alpm_pkg_get_backup(pmpkg_t *pkg);
-unsigned char alpm_pkg_has_scriptlet(pmpkg_t *pkg);
+unsigned short alpm_pkg_has_scriptlet(pmpkg_t *pkg);
/*
* Groups
@@ -242,13 +251,13 @@ alpm_list_t *alpm_grp_get_packages(pmgrp
*/
/* Types */
-enum {
+typedef enum _pmsynctype_t {
PM_SYNC_TYPE_REPLACE = 1,
PM_SYNC_TYPE_UPGRADE,
PM_SYNC_TYPE_DEPEND
-};
+} pmsynctype_t;
-unsigned char alpm_sync_get_type(pmsyncpkg_t *sync);
+pmsynctype_t alpm_sync_get_type(pmsyncpkg_t *sync);
pmpkg_t *alpm_sync_get_package(pmsyncpkg_t *sync);
void *alpm_sync_get_data(pmsyncpkg_t *sync);
@@ -257,30 +266,32 @@ void *alpm_sync_get_data(pmsyncpkg_t *sy
*/
/* Types */
-enum {
+typedef enum _pmtranstype_t {
PM_TRANS_TYPE_ADD = 1,
PM_TRANS_TYPE_REMOVE,
PM_TRANS_TYPE_UPGRADE,
PM_TRANS_TYPE_SYNC
-};
+} pmtranstype_t;
/* Flags */
-#define PM_TRANS_FLAG_NODEPS 0x01
-#define PM_TRANS_FLAG_FORCE 0x02
-#define PM_TRANS_FLAG_NOSAVE 0x04
-#define PM_TRANS_FLAG_FRESHEN 0x08
-#define PM_TRANS_FLAG_CASCADE 0x10
-#define PM_TRANS_FLAG_RECURSE 0x20
-#define PM_TRANS_FLAG_DBONLY 0x40
-#define PM_TRANS_FLAG_DEPENDSONLY 0x80
-#define PM_TRANS_FLAG_ALLDEPS 0x100
-#define PM_TRANS_FLAG_DOWNLOADONLY 0x200
-#define PM_TRANS_FLAG_NOSCRIPTLET 0x400
-#define PM_TRANS_FLAG_NOCONFLICTS 0x800
-#define PM_TRANS_FLAG_PRINTURIS 0x1000
+typedef enum _pmtransflag_t {
+ PM_TRANS_FLAG_NODEPS = 0x01,
+ PM_TRANS_FLAG_FORCE = 0x02,
+ PM_TRANS_FLAG_NOSAVE = 0x04,
+ PM_TRANS_FLAG_FRESHEN = 0x08,
+ PM_TRANS_FLAG_CASCADE = 0x10,
+ PM_TRANS_FLAG_RECURSE = 0x20,
+ PM_TRANS_FLAG_DBONLY = 0x40,
+ PM_TRANS_FLAG_DEPENDSONLY = 0x80,
+ PM_TRANS_FLAG_ALLDEPS = 0x100,
+ PM_TRANS_FLAG_DOWNLOADONLY = 0x200,
+ PM_TRANS_FLAG_NOSCRIPTLET = 0x400,
+ PM_TRANS_FLAG_NOCONFLICTS = 0x800,
+ PM_TRANS_FLAG_PRINTURIS = 0x1000
+} pmtransflag_t;
/* Transaction Events */
-enum {
+typedef enum _pmtransevt_t {
PM_TRANS_EVT_CHECKDEPS_START = 1,
PM_TRANS_EVT_CHECKDEPS_DONE,
PM_TRANS_EVT_FILECONFLICTS_START,
@@ -306,10 +317,10 @@ enum {
PM_TRANS_EVT_PRINTURI,
PM_TRANS_EVT_RETRIEVE_START,
PM_TRANS_EVT_RETRIEVE_LOCAL
-};
+} pmtransevt_t;
/* Transaction Conversations (ie, questions) */
-enum {
+typedef enum _pmtransconv_t {
PM_TRANS_CONV_INSTALL_IGNOREPKG = 0x01,
PM_TRANS_CONV_REPLACE_PKG = 0x02,
PM_TRANS_CONV_CONFLICT_PKG = 0x04,
@@ -317,30 +328,33 @@ enum {
PM_TRANS_CONV_LOCAL_NEWER = 0x10,
PM_TRANS_CONV_LOCAL_UPTODATE = 0x20,
PM_TRANS_CONV_REMOVE_HOLDPKG = 0x40
-};
+} pmtransconv_t;
/* Transaction Progress */
-enum {
+typedef enum _pmtransprog_t {
PM_TRANS_PROGRESS_ADD_START,
PM_TRANS_PROGRESS_UPGRADE_START,
PM_TRANS_PROGRESS_REMOVE_START,
PM_TRANS_PROGRESS_CONFLICTS_START
-};
+} pmtransprog_t;
/* Transaction Event callback */
-typedef void (*alpm_trans_cb_event)(unsigned char, void *, void *);
+typedef void (*alpm_trans_cb_event)(pmtransevt_t, void *, void *);
/* Transaction Conversation callback */
-typedef void (*alpm_trans_cb_conv)(unsigned char, void *, void *,
void *, int *);
+typedef void (*alpm_trans_cb_conv)(pmtransconv_t, void *, void *,
+ void *, int *);
/* Transaction Progress callback */
-typedef void (*alpm_trans_cb_progress)(unsigned char, char *, int, int, int);
+typedef void (*alpm_trans_cb_progress)(pmtransprog_t, char *, int, int, int);
-unsigned char alpm_trans_get_type();
+pmtranstype_t alpm_trans_get_type();
unsigned int alpm_trans_get_flags();
alpm_list_t * alpm_trans_get_targets();
alpm_list_t * alpm_trans_get_packages();
-int alpm_trans_init(unsigned char type, unsigned int flags,
alpm_trans_cb_event cb_event, alpm_trans_cb_conv conv,
alpm_trans_cb_progress cb_progress);
+int alpm_trans_init(pmtranstype_t type, unsigned int flags,
+ alpm_trans_cb_event cb_event, alpm_trans_cb_conv conv,
+ alpm_trans_cb_progress cb_progress);
int alpm_trans_sysupgrade(void);
int alpm_trans_addtarget(char *target);
int alpm_trans_prepare(alpm_list_t **data);
@@ -351,21 +365,22 @@ int alpm_trans_release(void);
* Dependencies and conflicts
*/
-enum {
+typedef enum _pmdepmod_t {
PM_DEP_MOD_ANY = 1,
PM_DEP_MOD_EQ,
PM_DEP_MOD_GE,
PM_DEP_MOD_LE
-};
-enum {
+} pmdepmod_t;
+
+typedef enum _pmdeptype_t {
PM_DEP_TYPE_DEPEND = 1,
PM_DEP_TYPE_REQUIRED,
PM_DEP_TYPE_CONFLICT
-};
+} pmdeptype_t;
const char *alpm_dep_get_target(pmdepmissing_t *miss);
-unsigned char alpm_dep_get_type(pmdepmissing_t *miss);
-unsigned char alpm_dep_get_mod(pmdepmissing_t *miss);
+pmdeptype_t alpm_dep_get_type(pmdepmissing_t *miss);
+pmdepmod_t alpm_dep_get_mod(pmdepmissing_t *miss);
const char *alpm_dep_get_name(pmdepmissing_t *miss);
const char *alpm_dep_get_version(pmdepmissing_t *miss);
@@ -373,19 +388,20 @@ const char *alpm_dep_get_version(pmdepmi
* File conflicts
*/
-enum {
+typedef enum _pmconflicttype_t {
PM_CONFLICT_TYPE_TARGET = 1,
PM_CONFLICT_TYPE_FILE
-};
+} pmconflicttype_t;
const char *alpm_conflict_get_target(pmconflict_t *conflict);
-unsigned char alpm_conflict_get_type(pmconflict_t *conflict);
+pmconflicttype_t alpm_conflict_get_type(pmconflict_t *conflict);
const char *alpm_conflict_get_file(pmconflict_t *conflict);
const char *alpm_conflict_get_ctarget(pmconflict_t *conflict);
/*
* Helpers
*/
+
/* md5sums */
char *alpm_get_md5sum(char *name);
@@ -394,7 +410,7 @@ char *alpm_get_sha1sum(char *name);
/*
* Errors
*/
-enum __pmerrno_t {
+enum _pmerrno_t {
PM_ERR_MEMORY = 1,
PM_ERR_SYSTEM,
PM_ERR_BADPERMS,
@@ -466,7 +482,7 @@ enum __pmerrno_t {
PM_ERR_FORK_FAILED
};
-extern enum __pmerrno_t pm_errno;
+extern enum _pmerrno_t pm_errno;
char *alpm_strerror(int err);
diff -uarp pacman-lib.orig/lib/libalpm/be_files.c
pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/be_files.c
--- pacman-lib.orig/lib/libalpm/be_files.c 2007-01-19 18:09:55.000000000 -0500
+++ pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/be_files.c 2007-01-19
20:26:21.000000000 -0500
@@ -98,7 +98,7 @@ void _alpm_db_rewind(pmdb_t *db)
rewinddir(db->handle);
}
-pmpkg_t *_alpm_db_scan(pmdb_t *db, char *target, unsigned int inforeq)
+pmpkg_t *_alpm_db_scan(pmdb_t *db, char *target, pmdbinfrq_t inforeq)
{
struct dirent *ent = NULL;
struct stat sbuf;
diff -uarp pacman-lib.orig/lib/libalpm/cache.c
pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/cache.c
--- pacman-lib.orig/lib/libalpm/cache.c 2007-01-19 18:09:55.000000000 -0500
+++ pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/cache.c 2007-01-19
20:26:21.000000000 -0500
@@ -41,12 +41,12 @@
/* Returns a new package cache from db.
* It frees the cache if it already exists.
*/
-int _alpm_db_load_pkgcache(pmdb_t *db, unsigned char infolevel)
+int _alpm_db_load_pkgcache(pmdb_t *db, pmdbinfrq_t infolevel)
{
pmpkg_t *info;
int count = 0;
/* The group cache needs INFRQ_DESC as well */
- /*unsigned char infolevel = INFRQ_DEPENDS | INFRQ_DESC;*/
+ /* pmdbinfrq_t infolevel = INFRQ_DEPENDS | INFRQ_DESC;*/
if(db == NULL) {
return(-1);
@@ -86,7 +86,7 @@ void _alpm_db_free_pkgcache(pmdb_t *db)
}
}
-alpm_list_t *_alpm_db_get_pkgcache(pmdb_t *db, unsigned char infolevel)
+alpm_list_t *_alpm_db_get_pkgcache(pmdb_t *db, pmdbinfrq_t infolevel)
{
if(db == NULL) {
return(NULL);
@@ -101,7 +101,7 @@ alpm_list_t *_alpm_db_get_pkgcache(pmdb_
return(db->pkgcache);
}
-int _alpm_db_ensure_pkgcache(pmdb_t *db, unsigned char infolevel)
+int _alpm_db_ensure_pkgcache(pmdb_t *db, pmdbinfrq_t infolevel)
{
int reloaded = 0;
/* for each pkg, check and reload if the requested
diff -uarp pacman-lib.orig/lib/libalpm/cache.h
pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/cache.h
--- pacman-lib.orig/lib/libalpm/cache.h 2007-01-19 18:09:55.000000000 -0500
+++ pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/cache.h 2007-01-19
20:26:21.000000000 -0500
@@ -27,12 +27,12 @@
#include "package.h"
/* packages */
-int _alpm_db_load_pkgcache(pmdb_t *db, unsigned char infolevel);
+int _alpm_db_load_pkgcache(pmdb_t *db, pmdbinfrq_t infolevel);
void _alpm_db_free_pkgcache(pmdb_t *db);
int _alpm_db_add_pkgincache(pmdb_t *db, pmpkg_t *pkg);
int _alpm_db_remove_pkgfromcache(pmdb_t *db, pmpkg_t *pkg);
-alpm_list_t *_alpm_db_get_pkgcache(pmdb_t *db, unsigned char infolevel);
-int _alpm_db_ensure_pkgcache(pmdb_t *db, unsigned char infolevel);
+alpm_list_t *_alpm_db_get_pkgcache(pmdb_t *db, pmdbinfrq_t infolevel);
+int _alpm_db_ensure_pkgcache(pmdb_t *db, pmdbinfrq_t infolevel);
pmpkg_t *_alpm_db_get_pkgfromcache(pmdb_t *db, char *target);
/* groups */
int _alpm_db_load_grpcache(pmdb_t *db);
diff -uarp pacman-lib.orig/lib/libalpm/conflict.c
pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/conflict.c
--- pacman-lib.orig/lib/libalpm/conflict.c 2007-01-19 18:09:55.000000000 -0500
+++ pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/conflict.c 2007-01-19
20:26:21.000000000 -0500
@@ -368,7 +368,7 @@ const char *alpm_conflict_get_target(pmc
return conflict->target;
}
-unsigned char alpm_conflict_get_type(pmconflict_t *conflict)
+pmconflicttype_t alpm_conflict_get_type(pmconflict_t *conflict)
{
/* Sanity checks */
ASSERT(handle != NULL, return(-1));
diff -uarp pacman-lib.orig/lib/libalpm/conflict.h
pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/conflict.h
--- pacman-lib.orig/lib/libalpm/conflict.h 2007-01-19 18:09:55.000000000 -0500
+++ pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/conflict.h 2007-01-19
20:26:21.000000000 -0500
@@ -28,7 +28,7 @@
struct __pmconflict_t {
char target[PKG_NAME_LEN];
- unsigned char type;
+ pmconflicttype_t type;
char file[CONFLICT_FILE_LEN];
char ctarget[PKG_NAME_LEN];
};
diff -uarp pacman-lib.orig/lib/libalpm/db.h
pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/db.h
--- pacman-lib.orig/lib/libalpm/db.h 2007-01-19 18:09:55.000000000 -0500
+++ pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/db.h 2007-01-19
20:26:21.000000000 -0500
@@ -27,12 +27,14 @@
#include <limits.h>
/* Database entries */
-#define INFRQ_NONE 0x00
-#define INFRQ_DESC 0x01
-#define INFRQ_DEPENDS 0x02
-#define INFRQ_FILES 0x04
-#define INFRQ_SCRIPTLET 0x08
-#define INFRQ_ALL 0xFF
+typedef enum _pmdbinfrq_t {
+ INFRQ_NONE = 0x00,
+ INFRQ_DESC = 0x01,
+ INFRQ_DEPENDS = 0x02,
+ INFRQ_FILES = 0x04,
+ INFRQ_SCRIPTLET = 0x08,
+ INFRQ_ALL = 0xFF
+} pmdbinfrq_t;
/* Database */
struct __pmdb_t {
@@ -55,9 +57,9 @@ int _alpm_db_install(pmdb_t *db, const c
int _alpm_db_open(pmdb_t *db);
void _alpm_db_close(pmdb_t *db);
void _alpm_db_rewind(pmdb_t *db);
-pmpkg_t *_alpm_db_scan(pmdb_t *db, char *target, unsigned int inforeq);
-int _alpm_db_read(pmdb_t *db, unsigned int inforeq, pmpkg_t *info);
-int _alpm_db_write(pmdb_t *db, pmpkg_t *info, unsigned int inforeq);
+pmpkg_t *_alpm_db_scan(pmdb_t *db, char *target, pmdbinfrq_t inforeq);
+int _alpm_db_read(pmdb_t *db, pmdbinfrq_t inforeq, pmpkg_t *info);
+int _alpm_db_write(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq);
int _alpm_db_remove(pmdb_t *db, pmpkg_t *info);
int _alpm_db_getlastupdate(pmdb_t *db, char *ts);
int _alpm_db_setlastupdate(pmdb_t *db, char *ts);
diff -uarp pacman-lib.orig/lib/libalpm/deps.c
pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/deps.c
--- pacman-lib.orig/lib/libalpm/deps.c 2007-01-19 18:09:55.000000000 -0500
+++ pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/deps.c 2007-01-19
20:26:21.000000000 -0500
@@ -44,8 +44,9 @@
extern pmhandle_t *handle;
-pmdepmissing_t *_alpm_depmiss_new(const char *target, unsigned char
type, unsigned char depmod,
- const char *depname, const char *depversion)
+pmdepmissing_t *_alpm_depmiss_new(const char *target, pmdeptype_t type,
+ pmdepmod_t depmod, const char *depname,
+ const char *depversion)
{
pmdepmissing_t *miss;
@@ -187,7 +188,8 @@ alpm_list_t *_alpm_sortbydeps(alpm_list_
* dependencies can include versions with depmod operators.
*
*/
-alpm_list_t *_alpm_checkdeps(pmtrans_t *trans, pmdb_t *db, unsigned
char op, alpm_list_t *packages)
+alpm_list_t *_alpm_checkdeps(pmtrans_t *trans, pmdb_t *db, pmtranstype_t op,
+ alpm_list_t *packages)
{
pmdepend_t depend;
alpm_list_t *i, *j, *k;
@@ -224,7 +226,7 @@ alpm_list_t *_alpm_checkdeps(pmtrans_t *
continue;
}
if(_alpm_pkg_isin(p->name, packages)) {
- /* this package is also in the upgrade list, so don't worry about it */
+ /* this package also in the upgrade list, so don't worry about it */
continue;
}
_alpm_db_read(db, INFRQ_DEPENDS, p);
@@ -246,8 +248,10 @@ alpm_list_t *_alpm_checkdeps(pmtrans_t *
FREELISTPTR(provides);
}
if(!_alpm_depcmp(tp, &depend)) {
- _alpm_log(PM_LOG_DEBUG, _("checkdeps: found %s as required by
%s"), depend.name, p->name);
- miss = _alpm_depmiss_new(p->name, PM_DEP_TYPE_REQUIRED,
depend.mod, depend.name, depend.version);
+ _alpm_log(PM_LOG_DEBUG, _("checkdeps: found %s as required by %s"),
+ depend.name, p->name);
+ miss = _alpm_depmiss_new(p->name, PM_DEP_TYPE_REQUIRED, depend.mod,
+ depend.name, depend.version);
if(!_alpm_depmiss_isin(miss, baddeps)) {
baddeps = alpm_list_add(baddeps, miss);
} else {
@@ -278,7 +282,8 @@ alpm_list_t *_alpm_checkdeps(pmtrans_t *
_alpm_splitdep((char *)j->data, &depend);
found = 0;
/* check database for literal packages */
- for(k = _alpm_db_get_pkgcache(db, INFRQ_DESC|INFRQ_DEPENDS); k &&
!found; k = k->next) {
+ for(k = _alpm_db_get_pkgcache(db, INFRQ_DESC|INFRQ_DEPENDS);
+ k && !found; k = k->next) {
pmpkg_t *p = (pmpkg_t *)k->data;
found = _alpm_depcmp(p, &depend);
}
@@ -316,8 +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);
- miss = _alpm_depmiss_new(tp->name, PM_DEP_TYPE_DEPEND,
depend.mod, depend.name, depend.version);
+ depend.name, tp->name);
+ miss = _alpm_depmiss_new(tp->name, PM_DEP_TYPE_DEPEND, depend.mod,
+ depend.name, depend.version);
if(!_alpm_depmiss_isin(miss, baddeps)) {
baddeps = alpm_list_add(baddeps, miss);
} else {
@@ -363,8 +369,10 @@ alpm_list_t *_alpm_checkdeps(pmtrans_t *
}
}
if(!found) {
- _alpm_log(PM_LOG_DEBUG, _("checkdeps: found %s as required by
%s"), reqname, tp->name);
- miss = _alpm_depmiss_new(tp->name, PM_DEP_TYPE_REQUIRED,
PM_DEP_MOD_ANY, j->data, NULL);
+ _alpm_log(PM_LOG_DEBUG, _("checkdeps: found %s as required by %s"),
+ reqname, tp->name);
+ miss = _alpm_depmiss_new(tp->name, PM_DEP_TYPE_REQUIRED,
+ PM_DEP_MOD_ANY, j->data, NULL);
if(!_alpm_depmiss_isin(miss, baddeps)) {
baddeps = alpm_list_add(baddeps, miss);
} else {
@@ -512,8 +520,9 @@ alpm_list_t *_alpm_removedeps(pmdb_t *db
*
* make sure *list and *trail are already initialized
*/
-int _alpm_resolvedeps(pmdb_t *local, alpm_list_t *dbs_sync, pmpkg_t
*syncpkg, alpm_list_t *list,
- alpm_list_t *trail, pmtrans_t *trans, alpm_list_t **data)
+int _alpm_resolvedeps(pmdb_t *local, alpm_list_t *dbs_sync, pmpkg_t *syncpkg,
+ alpm_list_t *list, alpm_list_t *trail, pmtrans_t *trans,
+ alpm_list_t **data)
{
alpm_list_t *i, *j;
alpm_list_t *targ;
@@ -647,7 +656,7 @@ const char *alpm_dep_get_target(pmdepmis
return miss->target;
}
-unsigned char alpm_dep_get_type(pmdepmissing_t *miss)
+pmdeptype_t alpm_dep_get_type(pmdepmissing_t *miss)
{
/* Sanity checks */
ASSERT(handle != NULL, return(-1));
@@ -656,7 +665,7 @@ unsigned char alpm_dep_get_type(pmdepmis
return miss->type;
}
-unsigned char alpm_dep_get_mod(pmdepmissing_t *miss)
+pmdepmod_t alpm_dep_get_mod(pmdepmissing_t *miss)
{
/* Sanity checks */
ASSERT(handle != NULL, return(-1));
diff -uarp pacman-lib.orig/lib/libalpm/deps.h
pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/deps.h
--- pacman-lib.orig/lib/libalpm/deps.h 2007-01-19 18:09:55.000000000 -0500
+++ pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/deps.h 2007-01-19
20:26:21.000000000 -0500
@@ -30,7 +30,7 @@
/* Dependency */
struct __pmdepend_t {
- unsigned char mod;
+ pmdepmod_t mod;
char name[PKG_NAME_LEN];
char version[PKG_VERSION_LEN];
};
@@ -38,19 +38,22 @@ struct __pmdepend_t {
/* Missing dependency */
struct __pmdepmissing_t {
char target[PKG_NAME_LEN];
- unsigned char type;
+ pmdeptype_t type;
pmdepend_t depend;
};
-pmdepmissing_t *_alpm_depmiss_new(const char *target, unsigned char
type, unsigned char depmod,
- const char *depname, const char *depversion);
+pmdepmissing_t *_alpm_depmiss_new(const char *target, pmdeptype_t type,
+ pmdepmod_t depmod, const char *depname,
+ const char *depversion);
int _alpm_depmiss_isin(pmdepmissing_t *needle, alpm_list_t *haystack);
alpm_list_t *_alpm_sortbydeps(alpm_list_t *targets, int mode);
-alpm_list_t *_alpm_checkdeps(pmtrans_t *trans, pmdb_t *db, unsigned
char op, alpm_list_t *packages);
+alpm_list_t *_alpm_checkdeps(pmtrans_t *trans, pmdb_t *db, pmtranstype_t op,
+ alpm_list_t *packages);
int _alpm_splitdep(char *depstr, pmdepend_t *depend);
alpm_list_t *_alpm_removedeps(pmdb_t *db, alpm_list_t *targs);
-int _alpm_resolvedeps(pmdb_t *local, alpm_list_t *dbs_sync, pmpkg_t
*syncpkg, alpm_list_t *list,
- alpm_list_t *trail, pmtrans_t *trans, alpm_list_t **data);
+int _alpm_resolvedeps(pmdb_t *local, alpm_list_t *dbs_sync, pmpkg_t *syncpkg,
+ alpm_list_t *list, alpm_list_t *trail, pmtrans_t *trans,
+ alpm_list_t **data);
#endif /* _ALPM_DEPS_H */
diff -uarp pacman-lib.orig/lib/libalpm/handle.c
pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/handle.c
--- pacman-lib.orig/lib/libalpm/handle.c 2007-01-19 18:09:55.000000000 -0500
+++ pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/handle.c 2007-01-19
20:26:21.000000000 -0500
@@ -117,12 +117,12 @@ int _alpm_handle_free(pmhandle_t *handle
alpm_cb_log alpm_option_get_logcb() { return handle->logcb; }
alpm_cb_download alpm_option_get_dlcb() { return handle->dlcb; }
-unsigned char alpm_option_get_logmask() { return handle->logmask; }
+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 *alpm_option_get_logfile() { return handle->logfile; }
-unsigned char alpm_option_get_usesyslog() { return handle->usesyslog; }
+unsigned short alpm_option_get_usesyslog() { return handle->usesyslog; }
alpm_list_t *alpm_option_get_noupgrades() { return handle->noupgrade; }
alpm_list_t *alpm_option_get_noextracts() { return handle->noextract; }
alpm_list_t *alpm_option_get_ignorepkgs() { return handle->ignorepkg; }
@@ -134,14 +134,17 @@ unsigned short alpm_option_get_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() { return handle->dbs_sync; }
+pmdb_t *alpm_option_get_localdb(pmhandle_t *handle) { return
handle->db_local; }
+alpm_list_t *alpm_option_get_syncdbs(pmhandle_t *handle)
+{
+ return handle->dbs_sync;
+}
void alpm_option_set_logcb(alpm_cb_log cb) { handle->logcb = cb; }
void alpm_option_set_dlcb(alpm_cb_download cb) { handle->dlcb = cb; }
-void alpm_option_set_logmask(unsigned char mask) { handle->logmask = mask; }
+void alpm_option_set_logmask(unsigned short mask) { handle->logmask = mask; }
void alpm_option_set_root(const char *root)
{
@@ -176,12 +179,16 @@ void alpm_option_set_logfile(const char
}
}
-void alpm_option_set_usesyslog(unsigned char usesyslog) {
handle->usesyslog = usesyslog; }
+void alpm_option_set_usesyslog(unsigned short usesyslog)
+{
+ handle->usesyslog = usesyslog;
+}
void alpm_option_add_noupgrade(char *pkg)
{
handle->noupgrade = alpm_list_add(handle->noupgrade, strdup(pkg));
}
+
void alpm_option_set_noupgrades(alpm_list_t *noupgrade)
{
if(handle->noupgrade) FREELIST(handle->noupgrade);
@@ -218,7 +225,10 @@ void alpm_option_set_holdpkgs(alpm_list_
if(holdpkgs) handle->holdpkg = holdpkgs;
}
-void alpm_option_set_upgradedelay(time_t delay) {
handle->upgradedelay = delay; }
+void alpm_option_set_upgradedelay(time_t delay)
+{
+ handle->upgradedelay = delay;
+}
void alpm_option_set_xfercommand(const char *cmd)
{
@@ -226,7 +236,10 @@ void alpm_option_set_xfercommand(const c
if(cmd) handle->xfercommand = strdup(cmd);
}
-void alpm_option_set_nopassiveftp(unsigned short nopasv) {
handle->nopassiveftp = nopasv; }
+void alpm_option_set_nopassiveftp(unsigned short nopasv)
+{
+ handle->nopassiveftp = nopasv;
+}
void alpm_option_set_chomp(unsigned short chomp) { handle->chomp = chomp; }
@@ -239,6 +252,9 @@ void alpm_option_set_needles(alpm_list_t
if(handle->needles) FREELIST(handle->needles);
if(needles) handle->needles = needles;
}
-void alpm_option_set_usecolor(unsigned short usecolor) {
handle->use_color = usecolor; }
+void alpm_option_set_usecolor(unsigned short usecolor)
+{
+ handle->use_color = usecolor;
+}
/* vim: set ts=2 sw=2 et: */
diff -uarp pacman-lib.orig/lib/libalpm/handle.h
pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/handle.h
--- pacman-lib.orig/lib/libalpm/handle.h 2007-01-19 18:09:55.000000000 -0500
+++ pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/handle.h 2007-01-19
20:26:21.000000000 -0500
@@ -45,12 +45,12 @@ typedef struct _pmhandle_t {
/* options */
alpm_cb_log logcb; /* Log callback function */
alpm_cb_download dlcb; /* Download callback function */
- unsigned char logmask; /* Output mask for logging functions */
+ unsigned short logmask; /* Output mask for logging functions */
char *root; /* Root path, default '/' */
char *dbpath; /* Base path to pacman's DBs */
char *cachedir; /* Base path to pacman's cache */
char *logfile; /* Name of the file to log to */ /*TODO is this used?*/
- unsigned char usesyslog; /* Use syslog instead of logfile? */
+ unsigned short usesyslog; /* Use syslog instead of logfile? */
alpm_list_t *noupgrade; /* List of packages NOT to be upgraded */
alpm_list_t *noextract; /* List of packages NOT to extrace */
/*TODO is this used?*/
diff -uarp pacman-lib.orig/lib/libalpm/log.c
pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/log.c
--- pacman-lib.orig/lib/libalpm/log.c 2006-11-20 04:10:24.000000000 -0500
+++ pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/log.c 2007-01-19
20:26:21.000000000 -0500
@@ -27,7 +27,7 @@
#include "alpm.h"
#include "log.h"
-void _alpm_log(unsigned char flag, char *fmt, ...)
+void _alpm_log(pmloglevel_t flag, char *fmt, ...)
{
alpm_cb_log logcb = alpm_option_get_logcb();
if(logcb == NULL) {
diff -uarp pacman-lib.orig/lib/libalpm/log.h
pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/log.h
--- pacman-lib.orig/lib/libalpm/log.h 2006-11-20 04:10:24.000000000 -0500
+++ pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/log.h 2007-01-19
20:49:42.000000000 -0500
@@ -21,9 +21,11 @@
#ifndef _ALPM_LOG_H
#define _ALPM_LOG_H
+#include "alpm.h"
+
#define LOG_STR_LEN 1024
-void _alpm_log(unsigned char flag, char *fmt, ...);
+void _alpm_log(pmloglevel_t flag, char *fmt, ...);
#endif /* _ALPM_LOG_H */
diff -uarp pacman-lib.orig/lib/libalpm/package.c
pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/package.c
--- pacman-lib.orig/lib/libalpm/package.c 2007-01-19 19:25:20.000000000 -0500
+++ pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/package.c 2007-01-19
20:26:21.000000000 -0500
@@ -603,7 +603,7 @@ unsigned long alpm_pkg_get_isize(pmpkg_t
return pkg->isize;
}
-unsigned char alpm_pkg_get_reason(pmpkg_t *pkg)
+pmpkgreason_t alpm_pkg_get_reason(pmpkg_t *pkg)
{
/* Sanity checks */
ASSERT(handle != NULL, return(-1));
@@ -738,7 +738,7 @@ alpm_list_t *alpm_pkg_get_backup(pmpkg_t
return pkg->backup;
}
-unsigned char alpm_pkg_has_scriptlet(pmpkg_t *pkg)
+unsigned short alpm_pkg_has_scriptlet(pmpkg_t *pkg)
{
/* Sanity checks */
ASSERT(handle != NULL, return(-1));
diff -uarp pacman-lib.orig/lib/libalpm/package.h
pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/package.h
--- pacman-lib.orig/lib/libalpm/package.h 2007-01-19 18:09:55.000000000 -0500
+++ pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/package.h 2007-01-19
20:26:21.000000000 -0500
@@ -30,11 +30,12 @@
#endif
#include "alpm.h"
+#include "db.h"
-enum {
+typedef enum _pmpkgfrom_t {
PKG_FROM_CACHE = 1,
PKG_FROM_FILE
-};
+} pmpkgfrom_t;
/* Packages */
#define PKG_FILENAME_LEN 512
@@ -65,10 +66,10 @@ struct __pmpkg_t {
char arch[PKG_ARCH_LEN];
unsigned long size;
unsigned long isize;
- unsigned char scriptlet;
- unsigned char force;
+ unsigned short scriptlet;
+ unsigned short force;
time_t date;
- unsigned char reason;
+ pmpkgreason_t reason;
alpm_list_t *desc_localized;
alpm_list_t *license;
alpm_list_t *replaces;
@@ -81,9 +82,9 @@ struct __pmpkg_t {
alpm_list_t *conflicts;
alpm_list_t *provides;
/* internal */
- unsigned char origin;
+ unsigned short origin;
void *data;
- unsigned char infolevel;
+ pmdbinfrq_t infolevel;
};
#define FREEPKG(p) do { if(p){_alpm_pkg_free(p); p = NULL;}} while(0)
diff -uarp pacman-lib.orig/lib/libalpm/sync.c
pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/sync.c
--- pacman-lib.orig/lib/libalpm/sync.c 2007-01-19 18:09:55.000000000 -0500
+++ pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/sync.c 2007-01-19
20:26:21.000000000 -0500
@@ -1069,7 +1069,7 @@ error:
return(-1);
}
-unsigned char alpm_sync_get_type(pmsyncpkg_t *sync)
+pmsynctype_t alpm_sync_get_type(pmsyncpkg_t *sync)
{
/* Sanity checks */
ASSERT(sync != NULL, return(-1));
diff -uarp pacman-lib.orig/lib/libalpm/sync.h
pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/sync.h
--- pacman-lib.orig/lib/libalpm/sync.h 2007-01-19 18:09:55.000000000 -0500
+++ pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/sync.h 2007-01-19
20:26:21.000000000 -0500
@@ -27,7 +27,7 @@
/* Sync package */
struct __pmsyncpkg_t {
- unsigned char type;
+ pmsynctype_t type;
pmpkg_t *pkg;
void *data;
};
diff -uarp pacman-lib.orig/lib/libalpm/trans.c
pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/trans.c
--- pacman-lib.orig/lib/libalpm/trans.c 2007-01-19 18:09:55.000000000 -0500
+++ pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/trans.c 2007-01-19
20:26:21.000000000 -0500
@@ -85,7 +85,9 @@ void _alpm_trans_free(void *data)
FREE(trans);
}
-int _alpm_trans_init(pmtrans_t *trans, unsigned char type, unsigned
int flags, alpm_trans_cb_event event, alpm_trans_cb_conv conv,
alpm_trans_cb_progress progress)
+int _alpm_trans_init(pmtrans_t *trans, pmtranstype_t type, unsigned int flags,
+ alpm_trans_cb_event event, alpm_trans_cb_conv conv,
+ alpm_trans_cb_progress progress)
{
/* Sanity checks */
ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1));
@@ -226,7 +228,7 @@ int _alpm_trans_commit(pmtrans_t *trans,
return(0);
}
-unsigned char alpm_trans_get_type()
+pmtranstype_t alpm_trans_get_type()
{
/* Sanity checks */
ASSERT(handle != NULL, return(-1));
diff -uarp pacman-lib.orig/lib/libalpm/trans.h
pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/trans.h
--- pacman-lib.orig/lib/libalpm/trans.h 2007-01-19 18:09:55.000000000 -0500
+++ pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/trans.h 2007-01-19
20:26:21.000000000 -0500
@@ -26,11 +26,21 @@
#include "alpm.h"
+typedef enum _pmtransstate_t {
+ STATE_IDLE = 0,
+ STATE_INITIALIZED,
+ STATE_PREPARED,
+ STATE_DOWNLOADING,
+ STATE_COMMITING,
+ STATE_COMMITED,
+ STATE_INTERRUPTED
+} pmtransstate_t;
+
/* Transaction */
struct __pmtrans_t {
- unsigned char type;
+ pmtranstype_t type;
unsigned int flags;
- unsigned char state;
+ pmtransstate_t state;
alpm_list_t *targets; /* alpm_list_t of (char *) */
alpm_list_t *packages; /* alpm_list_t of (pmpkg_t *) or (pmsyncpkg_t *) */
alpm_list_t *skiplist; /* alpm_list_t of (char *) */
@@ -39,16 +49,6 @@ struct __pmtrans_t {
alpm_trans_cb_progress cb_progress;
};
-enum {
- STATE_IDLE = 0,
- STATE_INITIALIZED,
- STATE_PREPARED,
- STATE_DOWNLOADING,
- STATE_COMMITING,
- STATE_COMMITED,
- STATE_INTERRUPTED
-};
-
#define FREETRANS(p) \
do { \
if(p) { \
@@ -77,7 +77,9 @@ do { \
pmtrans_t *_alpm_trans_new(void);
void _alpm_trans_free(void *data);
-int _alpm_trans_init(pmtrans_t *trans, unsigned char type, unsigned
int flags, alpm_trans_cb_event event, alpm_trans_cb_conv conv,
alpm_trans_cb_progress progress);
+int _alpm_trans_init(pmtrans_t *trans, pmtranstype_t type, unsigned int flags,
+ alpm_trans_cb_event event, alpm_trans_cb_conv conv,
+ alpm_trans_cb_progress progress);
int _alpm_trans_sysupgrade(pmtrans_t *trans);
int _alpm_trans_addtarget(pmtrans_t *trans, char *target);
int _alpm_trans_prepare(pmtrans_t *trans, alpm_list_t **data);
diff -uarp pacman-lib.orig/lib/libalpm/util.c
pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/util.c
--- pacman-lib.orig/lib/libalpm/util.c 2007-01-19 18:09:55.000000000 -0500
+++ pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/util.c 2007-01-19
21:24:13.000000000 -0500
@@ -66,7 +66,7 @@
#ifdef __sun__
/* This is a replacement for strsep which is not portable (missing on Solaris).
- * Copyright (c) 2001 by François Gouget <fgouget_at_codeweavers.com> */
+ * Copyright (c) 2001 by François Gouget <fgouget_at_codeweavers.com> */
char* strsep(char** str, const char* delims)
{
char* token;
@@ -342,7 +342,7 @@ int _alpm_rmrf(char *path)
return(0);
}
-int _alpm_logaction(unsigned char usesyslog, FILE *f, const char *str)
+int _alpm_logaction(unsigned short usesyslog, FILE *f, const char *str)
{
_alpm_log(PM_LOG_DEBUG, _("logaction called: %s"), str);
diff -uarp pacman-lib.orig/lib/libalpm/util.h
pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/util.h
--- pacman-lib.orig/lib/libalpm/util.h 2007-01-19 18:09:55.000000000 -0500
+++ pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/util.h 2007-01-19
20:26:21.000000000 -0500
@@ -62,7 +62,7 @@ int _alpm_lckmk(char *file);
int _alpm_lckrm(char *file);
int _alpm_unpack(const char *archive, const char *prefix, const char *fn);
int _alpm_rmrf(char *path);
-int _alpm_logaction(unsigned char usesyslog, FILE *f, const char *str);
+int _alpm_logaction(unsigned short usesyslog, FILE *f, const char *str);
int _alpm_ldconfig(char *root);
#ifdef _ALPM_TRANS_H
int _alpm_runscriptlet(char *util, char *installfn, char *script,
char *ver, char *oldver, pmtrans_t *trans);
diff -uarp pacman-lib.orig/lib/libalpm/versioncmp.c
pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/versioncmp.c
--- pacman-lib.orig/lib/libalpm/versioncmp.c 2007-01-19 18:09:55.000000000 -0500
+++ pacman-lib-monotone/org.archlinux.pacman/lib/libalpm/versioncmp.c 2007-01-19
20:26:21.000000000 -0500
@@ -253,17 +253,19 @@ int _alpm_depcmp(pmpkg_t *pkg, pmdepend_
} else {
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;
- case PM_DEP_MOD_LE: equal = (cmp <= 0); break;
+ case PM_DEP_MOD_EQ: equal = (cmp == 0); break;
+ case PM_DEP_MOD_GE: equal = (cmp >= 0); break;
+ case PM_DEP_MOD_LE: equal = (cmp <= 0); break;
+ default: equal = 1; break;
}
}
char *mod = "~=";
switch(dep->mod) {
- case PM_DEP_MOD_EQ: mod = "=="; break;
- case PM_DEP_MOD_GE: mod = ">="; break;
- case PM_DEP_MOD_LE: mod = "<="; break;
+ case PM_DEP_MOD_EQ: mod = "=="; break;
+ case PM_DEP_MOD_GE: mod = ">="; break;
+ case PM_DEP_MOD_LE: mod = "<="; break;
+ default: break;
}
if(strlen(dep->version) > 0) {
diff -uarp pacman-lib.orig/src/pacman/add.c
pacman-lib-monotone/org.archlinux.pacman/src/pacman/add.c
--- pacman-lib.orig/src/pacman/add.c 2007-01-19 18:09:55.000000000 -0500
+++ pacman-lib-monotone/org.archlinux.pacman/src/pacman/add.c 2007-01-19
20:26:21.000000000 -0500
@@ -96,9 +96,17 @@ int pacman_add(alpm_list_t *targets)
MSG(NL, _(":: %s: requires %s"), alpm_dep_get_target(miss),
alpm_dep_get_name(miss));
switch(alpm_dep_get_mod(miss)) {
- case PM_DEP_MOD_EQ: MSG(CL, "=%s", alpm_dep_get_version(miss)); break;
- case PM_DEP_MOD_GE: MSG(CL, ">=%s", alpm_dep_get_version(miss)); break;
- case PM_DEP_MOD_LE: MSG(CL, "<=%s", alpm_dep_get_version(miss)); break;
+ case PM_DEP_MOD_ANY:
+ break;
+ case PM_DEP_MOD_EQ:
+ MSG(CL, "=%s", alpm_dep_get_version(miss));
+ break;
+ case PM_DEP_MOD_GE:
+ MSG(CL, ">=%s", alpm_dep_get_version(miss));
+ break;
+ case PM_DEP_MOD_LE:
+ MSG(CL, "<=%s", alpm_dep_get_version(miss));
+ break;
}
MSG(CL, "\n");
}
diff -uarp pacman-lib.orig/src/pacman/deptest.c
pacman-lib-monotone/org.archlinux.pacman/src/pacman/deptest.c
--- pacman-lib.orig/src/pacman/deptest.c 2007-01-19 18:09:55.000000000 -0500
+++ pacman-lib-monotone/org.archlinux.pacman/src/pacman/deptest.c 2007-01-19
20:26:21.000000000 -0500
@@ -114,9 +114,17 @@ int pacman_deptest(alpm_list_t *targets)
if(!config->op_d_resolve) {
MSG(NL, _("requires: %s"), alpm_dep_get_name(miss));
switch(alpm_dep_get_mod(miss)) {
- case PM_DEP_MOD_EQ: MSG(CL, "=%s", alpm_dep_get_version(miss)); break;
- case PM_DEP_MOD_GE: MSG(CL, ">=%s", alpm_dep_get_version(miss)); break;
- case PM_DEP_MOD_LE: MSG(CL, "<=%s", alpm_dep_get_version(miss)); break;
+ case PM_DEP_MOD_ANY:
+ break;
+ case PM_DEP_MOD_EQ:
+ MSG(CL, "=%s", alpm_dep_get_version(miss));
+ break;
+ case PM_DEP_MOD_GE:
+ MSG(CL, ">=%s", alpm_dep_get_version(miss));
+ break;
+ case PM_DEP_MOD_LE:
+ MSG(CL, "<=%s", alpm_dep_get_version(miss));
+ break;
}
MSG(CL, "\n");
}
diff -uarp pacman-lib.orig/src/pacman/package.c
pacman-lib-monotone/org.archlinux.pacman/src/pacman/package.c
--- pacman-lib.orig/src/pacman/package.c 2007-01-19 18:09:55.000000000 -0500
+++ pacman-lib-monotone/org.archlinux.pacman/src/pacman/package.c 2007-01-19
19:46:16.000000000 -0500
@@ -30,7 +30,6 @@
/* pacman */
#include "log.h"
#include "util.h"
-#include "list.h"
#include "package.h"
/* Display the content of an installed package
diff -uarp pacman-lib.orig/src/pacman/sync.c
pacman-lib-monotone/org.archlinux.pacman/src/pacman/sync.c
--- pacman-lib.orig/src/pacman/sync.c 2007-01-19 18:09:55.000000000 -0500
+++ pacman-lib-monotone/org.archlinux.pacman/src/pacman/sync.c 2007-01-19
20:26:21.000000000 -0500
@@ -572,12 +572,21 @@ int pacman_sync(alpm_list_t *targets)
for(i = data; i; i = alpm_list_next(i)) {
pmdepmissing_t *miss = alpm_list_getdata(i);
MSG(NL, ":: %s %s %s", alpm_dep_get_target(miss),
- alpm_dep_get_type(miss) == PM_DEP_TYPE_DEPEND ?
_("requires") : _("is required by"),
- alpm_dep_get_name(miss));
+ alpm_dep_get_type(miss) == PM_DEP_TYPE_DEPEND ?
+ _("requires") : _("is required by"),
+ alpm_dep_get_name(miss));
switch(alpm_dep_get_mod(miss)) {
- case PM_DEP_MOD_EQ: MSG(CL, "=%s", alpm_dep_get_version(miss)); break;
- case PM_DEP_MOD_GE: MSG(CL, ">=%s", alpm_dep_get_version(miss)); break;
- case PM_DEP_MOD_LE: MSG(CL, "<=%s", alpm_dep_get_version(miss)); break;
+ case PM_DEP_MOD_ANY:
+ break;
+ case PM_DEP_MOD_EQ:
+ MSG(CL, "=%s", alpm_dep_get_version(miss));
+ break;
+ case PM_DEP_MOD_GE:
+ MSG(CL, ">=%s", alpm_dep_get_version(miss));
+ break;
+ case PM_DEP_MOD_LE:
+ MSG(CL, "<=%s", alpm_dep_get_version(miss));
+ break;
}
MSG(CL, "\n");
}
diff -uarp pacman-lib.orig/src/pacman/trans.c
pacman-lib-monotone/org.archlinux.pacman/src/pacman/trans.c
--- pacman-lib.orig/src/pacman/trans.c 2007-01-19 18:09:55.000000000 -0500
+++ pacman-lib-monotone/org.archlinux.pacman/src/pacman/trans.c 2007-01-19
20:26:21.000000000 -0500
@@ -44,7 +44,7 @@ static int prevpercent=0; /* for less pr
/* Callback to handle transaction events
*/
-void cb_trans_evt(unsigned char event, void *data1, void *data2)
+void cb_trans_evt(pmtransevt_t event, void *data1, void *data2)
{
char str[LOG_STR_LEN] = "";
char out[PATH_MAX];
@@ -53,38 +53,42 @@ void cb_trans_evt(unsigned char event, v
switch(event) {
case PM_TRANS_EVT_CHECKDEPS_START:
pm_fprintf(stderr, NL, _("checking dependencies... "));
- break;
+ break;
case PM_TRANS_EVT_FILECONFLICTS_START:
if(config->noprogressbar) {
MSG(NL, _("checking for file conflicts... "));
}
- break;
+ break;
+ case PM_TRANS_EVT_CLEANUP_START:
+ pm_fprintf(stderr, NL, _("resolving dependencies... "));
+ break;
case PM_TRANS_EVT_RESOLVEDEPS_START:
pm_fprintf(stderr, NL, _("resolving dependencies... "));
- break;
+ break;
case PM_TRANS_EVT_INTERCONFLICTS_START:
pm_fprintf(stderr, NL, _("looking for inter-conflicts... "));
- break;
+ break;
case PM_TRANS_EVT_FILECONFLICTS_DONE:
if(config->noprogressbar) {
MSG(CL, _("done.\n"));
}
- break;
+ break;
case PM_TRANS_EVT_CHECKDEPS_DONE:
+ case PM_TRANS_EVT_CLEANUP_DONE:
case PM_TRANS_EVT_RESOLVEDEPS_DONE:
case PM_TRANS_EVT_INTERCONFLICTS_DONE:
pm_fprintf(stderr, CL, _("done.\n"));
- break;
+ break;
case PM_TRANS_EVT_EXTRACT_DONE:
if(config->noprogressbar) {
MSG(CL, _("done.\n"));
}
- break;
+ break;
case PM_TRANS_EVT_ADD_START:
if(config->noprogressbar) {
MSG(NL, _("installing %s... "), alpm_pkg_get_name(data1));
}
- break;
+ break;
case PM_TRANS_EVT_ADD_DONE:
if(config->noprogressbar) {
MSG(CL, _("done.\n"));
@@ -93,12 +97,12 @@ void cb_trans_evt(unsigned char event, v
alpm_pkg_get_name(data1),
alpm_pkg_get_version(data1));
alpm_logaction(str);
- break;
+ break;
case PM_TRANS_EVT_REMOVE_START:
if(config->noprogressbar) {
MSG(NL, _("removing %s... "), alpm_pkg_get_name(data1));
}
- break;
+ break;
case PM_TRANS_EVT_REMOVE_DONE:
if(config->noprogressbar) {
MSG(CL, _("done.\n"));
@@ -107,12 +111,12 @@ void cb_trans_evt(unsigned char event, v
alpm_pkg_get_name(data1),
alpm_pkg_get_version(data1));
alpm_logaction(str);
- break;
+ break;
case PM_TRANS_EVT_UPGRADE_START:
if(config->noprogressbar) {
MSG(NL, _("upgrading %s... "), alpm_pkg_get_name(data1));
}
- break;
+ break;
case PM_TRANS_EVT_UPGRADE_DONE:
if(config->noprogressbar) {
MSG(CL, _("done.\n"));
@@ -122,34 +126,34 @@ void cb_trans_evt(unsigned char event, v
(char *)alpm_pkg_get_version(data2),
(char *)alpm_pkg_get_version(data1));
alpm_logaction(str);
- break;
+ break;
case PM_TRANS_EVT_INTEGRITY_START:
MSG(NL, _("checking package integrity... "));
- break;
+ break;
case PM_TRANS_EVT_INTEGRITY_DONE:
MSG(CL, _("done.\n"));
- break;
+ break;
case PM_TRANS_EVT_SCRIPTLET_INFO:
MSG(NL, "%s\n", (char*)data1);
- break;
+ break;
case PM_TRANS_EVT_SCRIPTLET_START:
MSG(NL, (char*)data1);
MSG(CL, "...");
- break;
+ break;
case PM_TRANS_EVT_SCRIPTLET_DONE:
if(!(long)data1) {
MSG(CL, _(" done.\n"));
} else {
MSG(CL, _(" failed.\n"));
}
- break;
+ break;
case PM_TRANS_EVT_PRINTURI:
MSG(NL, "%s/%s\n", (char*)data1, (char*)data2);
- break;
+ break;
case PM_TRANS_EVT_RETRIEVE_START:
MSG(NL, _(":: Retrieving packages from %s...\n"), (char*)data1);
fflush(stdout);
- break;
+ break;
case PM_TRANS_EVT_RETRIEVE_LOCAL:
MSG(NL, " %s [", (char*)data1);
unsigned int maxcols = getcols();
@@ -159,11 +163,12 @@ void cb_trans_evt(unsigned char event, v
MSG(CL, " ");
}
fputs(_("] 100% LOCAL "), stdout);
- break;
+ break;
}
}
-void cb_trans_conv(unsigned char event, void *data1, void *data2,
void *data3, int *response)
+void cb_trans_conv(pmtransconv_t event, void *data1, void *data2,
+ void *data3, int *response)
{
char str[LOG_STR_LEN] = "";
@@ -181,7 +186,7 @@ void cb_trans_conv(unsigned char event,
alpm_pkg_get_name(data2));
*response = yesno(str);
}
- break;
+ break;
case PM_TRANS_CONV_REMOVE_HOLDPKG:
if(config->noask) {
if(config->ask & PM_TRANS_CONV_REMOVE_HOLDPKG) {
@@ -190,11 +195,11 @@ void cb_trans_conv(unsigned char event,
*response = 0;
}
} else {
- snprintf(str, LOG_STR_LEN, _(":: %s is designated as a HoldPkg.
Remove anyway? [Y/n] "),
+ snprintf(str, LOG_STR_LEN, _(":: %s is designated as a HoldPkg.
Remove anyway? [Y/n] "),
alpm_pkg_get_name(data1));
*response = yesno(str);
}
- break;
+ break;
case PM_TRANS_CONV_REPLACE_PKG:
if(config->noask) {
if(config->ask & PM_TRANS_CONV_REPLACE_PKG) {
@@ -209,7 +214,7 @@ void cb_trans_conv(unsigned char event,
alpm_pkg_get_name(data2));
*response = yesno(str);
}
- break;
+ break;
case PM_TRANS_CONV_CONFLICT_PKG:
if(config->noask) {
if(config->ask & PM_TRANS_CONV_CONFLICT_PKG) {
@@ -224,7 +229,7 @@ void cb_trans_conv(unsigned char event,
(char *)data2);
*response = yesno(str);
}
- break;
+ break;
case PM_TRANS_CONV_LOCAL_NEWER:
if(config->noask) {
if(config->ask & PM_TRANS_CONV_LOCAL_NEWER) {
@@ -242,7 +247,7 @@ void cb_trans_conv(unsigned char event,
*response = 1;
}
}
- break;
+ break;
case PM_TRANS_CONV_LOCAL_UPTODATE:
if(config->noask) {
if(config->ask & PM_TRANS_CONV_LOCAL_UPTODATE) {
@@ -260,7 +265,7 @@ void cb_trans_conv(unsigned char event,
*response = 1;
}
}
- break;
+ break;
case PM_TRANS_CONV_CORRUPTED_PKG:
if(config->noask) {
if(config->ask & PM_TRANS_CONV_CORRUPTED_PKG) {
@@ -277,11 +282,12 @@ void cb_trans_conv(unsigned char event,
*response = 1;
}
}
- break;
+ break;
}
}
-void cb_trans_progress(unsigned char event, char *pkgname, int
percent, int howmany, int remain)
+void cb_trans_progress(pmtransprog_t event, char *pkgname, int percent,
+ int howmany, int remain)
{
static int lasthash = 0, mouth = 0;
int i, hash;
@@ -311,19 +317,19 @@ void cb_trans_progress(unsigned char eve
switch (event) {
case PM_TRANS_PROGRESS_ADD_START:
ptr = _("installing");
- break;
+ break;
case PM_TRANS_PROGRESS_UPGRADE_START:
ptr = _("upgrading");
- break;
+ break;
case PM_TRANS_PROGRESS_REMOVE_START:
ptr = _("removing");
- break;
+ break;
case PM_TRANS_PROGRESS_CONFLICTS_START:
ptr = _("checking for file conflicts");
- break;
+ break;
}
hash=percent*progresslen/100;
diff -uarp pacman-lib.orig/src/pacman/trans.h
pacman-lib-monotone/org.archlinux.pacman/src/pacman/trans.h
--- pacman-lib.orig/src/pacman/trans.h 2006-10-15 15:34:53.000000000 -0400
+++ pacman-lib-monotone/org.archlinux.pacman/src/pacman/trans.h 2007-01-19
20:26:21.000000000 -0500
@@ -22,12 +22,14 @@
#define _PM_TRANS_H
/* callback to handle messages/notifications from pacman transactions */
-void cb_trans_evt(unsigned char event, void *data1, void *data2);
+void cb_trans_evt(pmtransevt_t event, void *data1, void *data2);
/* callback to handle questions from pacman transactions (yes/no) */
-void cb_trans_conv(unsigned char event, void *data1, void *data2,
void *data3, int *response);
+void cb_trans_conv(pmtransconv_t event, void *data1, void *data2,
+ void *data3, int *response);
-void cb_trans_progress(unsigned char event, char *pkgname, int
percent, int howmany, int remain);
+void cb_trans_progress(pmtransprog_t event, char *pkgname, int percent,
+ int howmany, int remain);
#endif /* _PM_TRANS_H */
3
3
Date: Tuesday, January 23, 2007 @ 15:09:18
Author: aaron
Path: /home/cvs-pacman/pacman-lib/src/pacman
Modified: sync.c (1.96 -> 1.97)
Removed some debugging cruft left in in the last commit
--------+
sync.c | 2 --
1 file changed, 2 deletions(-)
Index: pacman-lib/src/pacman/sync.c
diff -u pacman-lib/src/pacman/sync.c:1.96 pacman-lib/src/pacman/sync.c:1.97
--- pacman-lib/src/pacman/sync.c:1.96 Mon Jan 22 20:34:58 2007
+++ pacman-lib/src/pacman/sync.c Tue Jan 23 15:09:18 2007
@@ -289,8 +289,6 @@
char *grpname = alpm_list_getdata(i);
for(j = syncs; j; j = alpm_list_next(j)) {
pmdb_t *db = alpm_list_getdata(j);
- printf("searching '%s' for groups '%s'\n", alpm_db_get_name(db), grpname);
- fflush(stdout);
pmgrp_t *grp = alpm_db_readgrp(db, grpname);
if(grp) {
1
0
Date: Monday, January 22, 2007 @ 20:34:58
Author: aaron
Path: /home/cvs-pacman/pacman-lib
Modified: lib/libalpm/alpm_list.c (1.2 -> 1.3)
lib/libalpm/db.c (1.54 -> 1.55) lib/libalpm/group.c (1.11 -> 1.12)
src/pacman/sync.c (1.95 -> 1.96)
* Added some calloc calls to replace the malloc-then-set-to-zero functionality
* Fixed -Ss output so as not to call alpm_list_getdata with a NULl list
* Added a NULL check in alpm_list_getdata
* Fixed alpm_list_add_sorted to properly handle a new / beginning insertions
-------------------------+
lib/libalpm/alpm_list.c | 5 ++++-
lib/libalpm/db.c | 8 ++------
lib/libalpm/group.c | 5 +----
src/pacman/sync.c | 23 ++++++++++++++++-------
4 files changed, 23 insertions(+), 18 deletions(-)
Index: pacman-lib/lib/libalpm/alpm_list.c
diff -u pacman-lib/lib/libalpm/alpm_list.c:1.2 pacman-lib/lib/libalpm/alpm_list.c:1.3
--- pacman-lib/lib/libalpm/alpm_list.c:1.2 Mon Jan 22 04:27:00 2007
+++ pacman-lib/lib/libalpm/alpm_list.c Mon Jan 22 20:34:58 2007
@@ -145,8 +145,10 @@
if(prev != NULL) {
prev->next = add; /* In middle. */
+ } else {
+ list = add; /* At beginning, or new list */
}
-
+
return(list);
}
}
@@ -369,6 +371,7 @@
*/
void *alpm_list_getdata(const alpm_list_t *entry)
{
+ if(entry == NULL) return(NULL);
return(entry->data);
}
Index: pacman-lib/lib/libalpm/db.c
diff -u pacman-lib/lib/libalpm/db.c:1.54 pacman-lib/lib/libalpm/db.c:1.55
--- pacman-lib/lib/libalpm/db.c:1.54 Fri Jan 19 04:28:44 2007
+++ pacman-lib/lib/libalpm/db.c Mon Jan 22 20:34:58 2007
@@ -55,14 +55,14 @@
{
pmdb_t *db;
- db = (pmdb_t *)malloc(sizeof(pmdb_t));
+ db = calloc(1, sizeof(pmdb_t));
if(db == NULL) {
_alpm_log(PM_LOG_ERROR, _("malloc failed: could not allocate %d bytes"),
sizeof(pmdb_t));
RET_ERR(PM_ERR_MEMORY, NULL);
}
- db->path = (char *)malloc(strlen(root)+strlen(dbpath)+strlen(treename)+2);
+ db->path = calloc(1, strlen(root)+strlen(dbpath)+strlen(treename)+2);
if(db->path == NULL) {
_alpm_log(PM_LOG_ERROR, _("malloc failed: could not allocate %d bytes"),
strlen(root)+strlen(dbpath)+strlen(treename)+2);
@@ -73,10 +73,6 @@
STRNCPY(db->treename, treename, PATH_MAX);
- db->pkgcache = NULL;
- db->grpcache = NULL;
- db->servers = NULL;
-
return(db);
}
Index: pacman-lib/lib/libalpm/group.c
diff -u pacman-lib/lib/libalpm/group.c:1.11 pacman-lib/lib/libalpm/group.c:1.12
--- pacman-lib/lib/libalpm/group.c:1.11 Fri Jan 19 04:28:45 2007
+++ pacman-lib/lib/libalpm/group.c Mon Jan 22 20:34:58 2007
@@ -36,16 +36,13 @@
{
pmgrp_t* grp;
- grp = (pmgrp_t *)malloc(sizeof(pmgrp_t));
+ grp = calloc(1, sizeof(pmgrp_t));
if(grp == NULL) {
_alpm_log(PM_LOG_ERROR, _("malloc failure: could not allocate %d bytes"),
sizeof(pmgrp_t));
RET_ERR(PM_ERR_MEMORY, NULL);
}
- grp->name[0] = '\0';
- grp->packages = NULL;
-
return(grp);
}
Index: pacman-lib/src/pacman/sync.c
diff -u pacman-lib/src/pacman/sync.c:1.95 pacman-lib/src/pacman/sync.c:1.96
--- pacman-lib/src/pacman/sync.c:1.95 Fri Jan 19 04:28:46 2007
+++ pacman-lib/src/pacman/sync.c Mon Jan 22 20:34:58 2007
@@ -248,14 +248,20 @@
continue;
}
for(j = ret; j; j = alpm_list_next(j)) {
+ char *group = NULL;
+ alpm_list_t *grp;
pmpkg_t *pkg = alpm_list_getdata(j);
- char *group = (char *)alpm_list_getdata(alpm_pkg_get_groups(pkg));
- printf("%s/%s %s %s%s%s\n ",
- alpm_db_get_name(db),
- alpm_pkg_get_name(pkg),
- alpm_pkg_get_version(pkg),
- (group ? " (" : ""), (group ? group : ""), (group ? ") " : ""));
+ printf("%s/%s %s", alpm_db_get_name(db), 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\n");
}
@@ -280,9 +286,12 @@
if(targets) {
for(i = targets; i; i = alpm_list_next(i)) {
+ char *grpname = alpm_list_getdata(i);
for(j = syncs; j; j = alpm_list_next(j)) {
pmdb_t *db = alpm_list_getdata(j);
- pmgrp_t *grp = alpm_db_readgrp(db, alpm_list_getdata(i));
+ printf("searching '%s' for groups '%s'\n", alpm_db_get_name(db), grpname);
+ fflush(stdout);
+ pmgrp_t *grp = alpm_db_readgrp(db, grpname);
if(grp) {
MSG(NL, "%s\n", (char *)alpm_grp_get_name(grp));
3
2
I noticed that even after moving it to *.pacsave it will still try to delete the
original file which fails and causes an error message which will only 'cause the
user to worry about this (possibly), which they don't need to.
Patch is below.
~ Jamie / yankees26
Signed-off-by: James Rosten <seinfeld90(a)gmail.com>
2
1
Date: Tuesday, January 23, 2007 @ 11:05:21
Author: aaron
Path: /home/cvs-pacman/pacman-lib/lib/libalpm
Modified: remove.c (1.56 -> 1.57)
James Rosten <seinfeld90(a)gmail.com>
* attempt to unlink file AFTER moving to .pacsave always fails
----------+
remove.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
Index: pacman-lib/lib/libalpm/remove.c
diff -u pacman-lib/lib/libalpm/remove.c:1.56 pacman-lib/lib/libalpm/remove.c:1.57
--- pacman-lib/lib/libalpm/remove.c:1.56 Fri Jan 19 04:28:45 2007
+++ pacman-lib/lib/libalpm/remove.c Tue Jan 23 11:05:21 2007
@@ -225,9 +225,10 @@
int list_count = alpm_list_count(trans->packages); /* this way we don't have to call alpm_list_count twice during PROGRESS */
PROGRESS(trans, PM_TRANS_PROGRESS_REMOVE_START, info->name, (double)(percent * 100), list_count, (list_count - alpm_list_count(targ) + 1));
++(*position);
- }
- if (unlink(line) == -1) {
- _alpm_log(PM_LOG_ERROR, _("cannot remove file %s: %s"), file, strerror(errno));
+
+ if (unlink(line) == -1) {
+ _alpm_log(PM_LOG_ERROR, _("cannot remove file %s: %s"), file, strerror(errno));
+ }
}
}
}
1
0
Date: Tuesday, January 23, 2007 @ 11:02:37
Author: aaron
Path: /home/cvs-pacman/pacman-lib/scripts
Modified: makepkg (1.33 -> 1.34)
James Rosten <seinfeld90(a)gmail.com>
* noextract PKGBUILD option to NOT extract source files
- implemented with existing in_array function
---------+
makepkg | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
Index: pacman-lib/scripts/makepkg
diff -u pacman-lib/scripts/makepkg:1.33 pacman-lib/scripts/makepkg:1.34
--- pacman-lib/scripts/makepkg:1.33 Mon Jan 22 14:26:23 2007
+++ pacman-lib/scripts/makepkg Tue Jan 23 11:02:37 2007
@@ -425,7 +425,7 @@
unset pkgname pkgver pkgrel pkgdesc url license groups provides md5sums force
unset replaces depends conflicts backup source install build makedepends
-unset options
+unset options noextract
# some applications (eg, blackbox) will not build with some languages
unset LC_ALL LANG
@@ -681,6 +681,11 @@
for netfile in "${source[@]}"; do
unziphack=0
file=$(strip_url "$netfile")
+ if in_array "$file" ${noextract[@]}; then
+ #skip source files in the noextract=() array
+ # these are marked explicitly to NOT be extracted
+ continue
+ fi
# fix flyspray #6246
file_type=$(file -biz "$file")
unset cmd
1
0
[pacman-dev] FS #6246 - makepkg fails if the extensions is wrong on the archive
by James Rosten 23 Jan '07
by James Rosten 23 Jan '07
23 Jan '07
This is a fix for FS #6246 ( http://bugs.archlinux.org/task/6246 ).
Instead of using the extension of the source archive, I make use of
file -biz (the z allows use to know if it is just a bzip2 or a tar.bzip2).
As usual the patch is below.
~ Jamie / yankees26
Signed-off-by: James Rosten <seinfeld90(a)gmail.com>
4
9