r4864 - trunk/src/target/opkg/libopkg
tick at docs.openmoko.org
tick at docs.openmoko.org
Sun Dec 14 12:09:29 CET 2008
Author: tick
Date: 2008-12-14 12:09:29 +0100 (Sun, 14 Dec 2008)
New Revision: 4864
Modified:
trunk/src/target/opkg/libopkg/opkg.c
Log:
opkg: trivial rename old_pkg_to_new to pkg_clone as a more readable name.
Modified: trunk/src/target/opkg/libopkg/opkg.c
===================================================================
--- trunk/src/target/opkg/libopkg/opkg.c 2008-12-14 11:09:16 UTC (rev 4863)
+++ trunk/src/target/opkg/libopkg/opkg.c 2008-12-14 11:09:29 UTC (rev 4864)
@@ -52,8 +52,11 @@
/** Private Functions ***/
+/**
+ * Clone a pkg_t
+ */
static opkg_package_t*
-old_pkg_to_new (pkg_t *old)
+pkg_clone (pkg_t *old)
{
opkg_package_t *new;
@@ -70,6 +73,8 @@
new->tags = sstrdup (old->tags);
new->url = sstrdup (old->url);
+#undef sstrdup
+
new->size = (old->size) ? atoi (old->size) : 0;
new->installed = (old->state_status == SS_INSTALLED);
@@ -418,7 +423,7 @@
new->state_flag |= SF_USER;
pdata.action = OPKG_INSTALL;
- pdata.package = old_pkg_to_new (new);
+ pdata.package = pkg_clone (new);
progress (pdata, 0);
@@ -448,7 +453,7 @@
continue;
opkg_package_free (pdata.package);
- pdata.package = old_pkg_to_new (pkg);
+ pdata.package = pkg_clone (pkg);
pdata.action = OPKG_DOWNLOAD;
if (pkg->src == NULL)
@@ -500,7 +505,7 @@
/* 75% of "install" progress is for downloading */
opkg_package_free (pdata.package);
- pdata.package = old_pkg_to_new (new);
+ pdata.package = pkg_clone (new);
pdata.action = OPKG_INSTALL;
progress (pdata, 75);
@@ -564,7 +569,7 @@
}
pdata.action = OPKG_REMOVE;
- pdata.package = old_pkg_to_new (pkg);
+ pdata.package = pkg_clone (pkg);
progress (pdata, 0);
@@ -640,7 +645,7 @@
}
pdata.action = OPKG_INSTALL;
- pdata.package = old_pkg_to_new (pkg);
+ pdata.package = pkg_clone (pkg);
progress (pdata, 0);
err = opkg_upgrade_pkg (opkg->conf, pkg);
@@ -701,7 +706,7 @@
{
pkg = installed->pkgs[i];
- pdata.package = old_pkg_to_new (pkg);
+ pdata.package = pkg_clone (pkg);
progress (pdata, 99 * i / installed->len);
opkg_package_free (pdata.package);
@@ -916,7 +921,7 @@
pkg = all->pkgs[i];
- package = old_pkg_to_new (pkg);
+ package = pkg_clone (pkg);
callback (opkg, package, user_data);
opkg_package_free (package);
}
@@ -948,7 +953,7 @@
new = pkg_hash_fetch_best_installation_candidate_by_name(opkg->conf, old->name, NULL);
- package = old_pkg_to_new (new);
+ package = pkg_clone (new);
callback (opkg, package, user_data);
opkg_package_free (package);
}
@@ -1005,7 +1010,7 @@
}
/* match found */
- package = old_pkg_to_new (pkg);
+ package = pkg_clone (pkg);
break;
}
More information about the commitlog
mailing list