summaryrefslogtreecommitdiffstats
path: root/src/pacsync.c
diff options
context:
space:
mode:
authorJudd Vinet <judd@archlinux.org>2004-07-17 03:55:28 +0200
committerJudd Vinet <judd@archlinux.org>2004-07-17 03:55:28 +0200
commit75ace390f7f497300adb59b3597f1cec2f31c21f (patch)
tree049335bf63daecb412c94e2afcd1e52f7575434f /src/pacsync.c
parentf6661379c68b541115efe25285965bbd4eb32d25 (diff)
downloadpacman-75ace390f7f497300adb59b3597f1cec2f31c21f.tar.gz
pacman-75ace390f7f497300adb59b3597f1cec2f31c21f.tar.xz
Imported from pacman-2.8.1.tar.gz
Diffstat (limited to 'src/pacsync.c')
-rw-r--r--src/pacsync.c31
1 files changed, 28 insertions, 3 deletions
diff --git a/src/pacsync.c b/src/pacsync.c
index 4ea0bc95..342f6c9c 100644
--- a/src/pacsync.c
+++ b/src/pacsync.c
@@ -40,9 +40,9 @@ static int log_progress(netbuf *ctl, int xfered, void *arg);
static char sync_fnm[25];
static int offset;
static struct timeval t0, t;
- static float rate;
- static int xfered1;
- static unsigned char eta_h, eta_m, eta_s;
+static float rate;
+static int xfered1;
+static unsigned char eta_h, eta_m, eta_s;
/* pacman options */
extern char *pmo_root;
@@ -457,4 +457,29 @@ syncpkg_t* find_pkginsync(char *needle, PMList *haystack)
return sync;
}
+/* Remove a package from a list of syncpkg_t elements
+ */
+PMList* rm_pkginsync(char *needle, PMList *haystack)
+{
+ PMList *i;
+ syncpkg_t *sync = NULL;
+ PMList *newlist = NULL;
+
+ for(i = haystack; i; i = i->next) {
+ sync = (syncpkg_t*)i->data;
+ if(!sync) continue;
+ if(strcmp(sync->pkg->name, needle)) {
+ newlist = list_add(newlist, sync);
+ } else {
+ FREEPKG(sync->pkg);
+ FREELISTPKGS(sync->replaces);
+ FREE(sync);
+ }
+ i->data = NULL;
+ }
+ FREELIST(haystack);
+
+ return newlist;
+}
+
/* vim: set ts=2 sw=2 noet: */