Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/alpm.c
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2005-03-20 09:22:03 +0000
committerAurelien Foret <aurelien@archlinux.org>2005-03-20 09:22:03 +0000
commit72c24395762c985e404f65f7ec1064efed1d44b5 (patch)
treec2841990bcb4d09359a215d9c48035b9e74506d3 /lib/libalpm/alpm.c
parent18db4c168bca90d3d44ccd9b4b4d076d2426516d (diff)
Added support for .lastupdate files (from pacman 2.9.1)
Diffstat (limited to 'lib/libalpm/alpm.c')
-rw-r--r--lib/libalpm/alpm.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/lib/libalpm/alpm.c b/lib/libalpm/alpm.c
index 94c8d2dc..93ac2fad 100644
--- a/lib/libalpm/alpm.c
+++ b/lib/libalpm/alpm.c
@@ -205,17 +205,31 @@ int alpm_db_unregister(PM_DB *db)
return(0);
}
-int alpm_db_update(char *treename, char *archive)
+int alpm_db_getlastupdate(PM_DB *db, char *ts)
{
/* Sanity checks */
- ASSERT(handle != NULL, return(-1));
- ASSERT(treename != NULL && strlen(treename) != 0, RET_ERR(PM_ERR_WRONG_ARGS, -1));
+ ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
+ ASSERT(db != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1));
+
+ return(db_getlastupdate(db, handle->root, handle->dbpath, ts));
+}
+
+int alpm_db_update(PM_DB *db, char *archive, char *ts)
+{
+ /* Sanity checks */
+ ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
+ ASSERT(db != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1));
+
+ /* ORE
+ Does it make sense to update the 'local' database, or should we prevent it? */
+
+ /* ORE
+ check if the database is registered: if not, return an error */
/* ORE
- Does it make sense to update the 'local' database, or should we prevent it?
- stat(archive); */
+ stat() the archive to check it exists */
- return(db_update(handle->root, handle->dbpath, treename, archive));
+ return(db_update(db, handle->root, handle->dbpath, archive, ts));
}
PM_PKG *alpm_db_readpkg(PM_DB *db, char *name)