Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   ArchLinux Pacman Development (http://www.linux-archive.org/archlinux-pacman-development/)
-   -   added some comments to _alpm_unpack (http://www.linux-archive.org/archlinux-pacman-development/67242-added-some-comments-_alpm_unpack.html)

"K. Piche" 04-10-2008 02:24 AM

added some comments to _alpm_unpack
 
>From 2ded6c6f0a30eb10cf811ff70db6e0f1c62a6b50 Mon Sep 17 00:00:00 2001
From: K. Piche <kevin@archlinux.org>
Date: Tue, 8 Apr 2008 23:30:46 -0400
Subject: [PATCH] Some comments for _alpm_unpack.

Signed-off-by: K. Piche <kevin@archlinux.org>
---
lib/libalpm/util.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c
index 9d86331..9f431ed 100644
--- a/lib/libalpm/util.c
+++ b/lib/libalpm/util.c
@@ -370,6 +370,13 @@ int _alpm_lckrm()

/* Compression functions */

+/**
+ * @brief Unpack a specific file or all files in an archive.
+ *
+ * @param archive the archive to unpack
+ * @param prefix where to extract the files
+ * @param fn a file within the archive to unpack or NULL for all
+ */
int _alpm_unpack(const char *archive, const char *prefix, const char
*fn)
{
int ret = 1;
@@ -407,13 +414,17 @@ int _alpm_unpack(const char *archive, const char
*prefix, const char *fn)
archive_entry_set_mode(entry, 0755);
}

+ /* If a specific file was requested skip entries that don't match. */
if (fn && strcmp(fn, entryname)) {
+ _alpm_log(PM_LOG_DEBUG, "skipping: %s
", entryname);
if (archive_read_data_skip(_archive) != ARCHIVE_OK) {
ret = 1;
goto cleanup;
}
continue;
}
+
+ /* Extract the archive entry. */
ret = 0;
snprintf(expath, PATH_MAX, "%s/%s", prefix, entryname);
archive_entry_set_pathname(entry, expath);
--
1.5.4.5


--
K. Piche <kpiche@rogers.com>


_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev


All times are GMT. The time now is 11:33 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.