summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2011-06-28 14:39:43 +1000
committerAllan McRae <allan@archlinux.org>2011-06-28 23:28:23 +1000
commitcd1e39ba62ea564c1c29a918aa1a4d6aac9a351e (patch)
tree48878228b113af5520b72d27770499f13b65d284
parentbfe1771067e372420d857094befd6c6ea5b28495 (diff)
downloadpacman-cd1e39ba62ea564c1c29a918aa1a4d6aac9a351e.tar.xz
Rename pmbackup_t to alpm_backup_t
Signed-off-by: Allan McRae <allan@archlinux.org>
-rw-r--r--lib/libalpm/add.c6
-rw-r--r--lib/libalpm/alpm.h4
-rw-r--r--lib/libalpm/backup.c14
-rw-r--r--lib/libalpm/backup.h8
-rw-r--r--lib/libalpm/be_local.c6
-rw-r--r--lib/libalpm/be_package.c4
-rw-r--r--lib/libalpm/remove.c4
-rw-r--r--src/pacman/package.c4
8 files changed, 25 insertions, 25 deletions
diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c
index 3455744f..b8b1ca18 100644
--- a/lib/libalpm/add.c
+++ b/lib/libalpm/add.c
@@ -252,7 +252,7 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive,
if(alpm_list_find_str(handle->noupgrade, entryname)) {
notouch = 1;
} else {
- pmbackup_t *backup;
+ alpm_backup_t *backup;
/* go to the backup array and see if our conflict is there */
/* check newpkg first, so that adding backup files is retroactive */
backup = _alpm_needbackup(entryname, alpm_pkg_get_backup(newpkg));
@@ -303,7 +303,7 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive,
/* update the md5 hash in newpkg's backup (it will be the new orginal) */
alpm_list_t *i;
for(i = alpm_pkg_get_backup(newpkg); i; i = i->next) {
- pmbackup_t *backup = i->data;
+ alpm_backup_t *backup = i->data;
char *newhash;
if(!backup->name || strcmp(backup->name, entryname_orig) != 0) {
continue;
@@ -435,7 +435,7 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive,
/* calculate an hash if this is in newpkg's backup */
alpm_list_t *i;
for(i = alpm_pkg_get_backup(newpkg); i; i = i->next) {
- pmbackup_t *backup = i->data;
+ alpm_backup_t *backup = i->data;
char *newhash;
if(!backup->name || strcmp(backup->name, entryname_orig) != 0) {
continue;
diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h
index 9c321d67..d8fb8349 100644
--- a/lib/libalpm/alpm.h
+++ b/lib/libalpm/alpm.h
@@ -161,10 +161,10 @@ typedef struct _alpm_delta_t {
} alpm_delta_t;
/** Local package or package file backup entry */
-typedef struct _pmbackup_t {
+typedef struct _alpm_backup_t {
char *name;
char *hash;
-} pmbackup_t;
+} alpm_backup_t;
/*
* Logging facilities
diff --git a/lib/libalpm/backup.c b/lib/libalpm/backup.c
index 408c0e17..0334042c 100644
--- a/lib/libalpm/backup.c
+++ b/lib/libalpm/backup.c
@@ -33,7 +33,7 @@
#include "util.h"
/* split a backup string "file\thash" into the relevant components */
-int _alpm_split_backup(const char *string, pmbackup_t **backup)
+int _alpm_split_backup(const char *string, alpm_backup_t **backup)
{
char *str, *ptr;
@@ -58,7 +58,7 @@ int _alpm_split_backup(const char *string, pmbackup_t **backup)
/* Look for a filename in a alpm_pkg_t.backup list. If we find it,
* then we return the full backup entry.
*/
-pmbackup_t *_alpm_needbackup(const char *file, const alpm_list_t *backup_list)
+alpm_backup_t *_alpm_needbackup(const char *file, const alpm_list_t *backup_list)
{
const alpm_list_t *lp;
@@ -68,7 +68,7 @@ pmbackup_t *_alpm_needbackup(const char *file, const alpm_list_t *backup_list)
/* run through the backup list and parse out the hash for our file */
for(lp = backup_list; lp; lp = lp->next) {
- pmbackup_t *backup = lp->data;
+ alpm_backup_t *backup = lp->data;
if(strcmp(file, backup->name) == 0) {
return backup;
@@ -78,17 +78,17 @@ pmbackup_t *_alpm_needbackup(const char *file, const alpm_list_t *backup_list)
return NULL;
}
-void _alpm_backup_free(pmbackup_t *backup)
+void _alpm_backup_free(alpm_backup_t *backup)
{
free(backup->name);
free(backup->hash);
free(backup);
}
-pmbackup_t *_alpm_backup_dup(const pmbackup_t *backup)
+alpm_backup_t *_alpm_backup_dup(const alpm_backup_t *backup)
{
- pmbackup_t *newbackup;
- CALLOC(newbackup, 1, sizeof(pmbackup_t), return NULL);
+ alpm_backup_t *newbackup;
+ CALLOC(newbackup, 1, sizeof(alpm_backup_t), return NULL);
STRDUP(newbackup->name, backup->name, return NULL);
STRDUP(newbackup->hash, backup->hash, return NULL);
diff --git a/lib/libalpm/backup.h b/lib/libalpm/backup.h
index be8de97a..39c01a6d 100644
--- a/lib/libalpm/backup.h
+++ b/lib/libalpm/backup.h
@@ -23,10 +23,10 @@
#include "alpm_list.h"
#include "alpm.h"
-int _alpm_split_backup(const char *string, pmbackup_t **backup);
-pmbackup_t *_alpm_needbackup(const char *file, const alpm_list_t *backup_list);
-void _alpm_backup_free(pmbackup_t *backup);
-pmbackup_t *_alpm_backup_dup(const pmbackup_t *backup);
+int _alpm_split_backup(const char *string, alpm_backup_t **backup);
+alpm_backup_t *_alpm_needbackup(const char *file, const alpm_list_t *backup_list);
+void _alpm_backup_free(alpm_backup_t *backup);
+alpm_backup_t *_alpm_backup_dup(const alpm_backup_t *backup);
#endif /* _ALPM_BACKUP_H */
diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c
index 06a948c1..19b06bb5 100644
--- a/lib/libalpm/be_local.c
+++ b/lib/libalpm/be_local.c
@@ -683,8 +683,8 @@ int _alpm_local_db_read(alpm_db_t *db, alpm_pkg_t *info, pmdbinfrq_t inforeq)
}
} else if(strcmp(line, "%BACKUP%") == 0) {
while(fgets(line, sizeof(line), fp) && strlen(_alpm_strtrim(line))) {
- pmbackup_t *backup;
- CALLOC(backup, 1, sizeof(pmbackup_t), goto error);
+ alpm_backup_t *backup;
+ CALLOC(backup, 1, sizeof(alpm_backup_t), goto error);
if(_alpm_split_backup(line, &backup)) {
goto error;
}
@@ -887,7 +887,7 @@ int _alpm_local_db_write(alpm_db_t *db, alpm_pkg_t *info, pmdbinfrq_t inforeq)
if(info->backup) {
fprintf(fp, "%%BACKUP%%\n");
for(lp = info->backup; lp; lp = lp->next) {
- pmbackup_t *backup = lp->data;
+ alpm_backup_t *backup = lp->data;
fprintf(fp, "%s\t%s\n", backup->name, backup->hash);
}
fprintf(fp, "\n");
diff --git a/lib/libalpm/be_package.c b/lib/libalpm/be_package.c
index a372526d..a4c6c559 100644
--- a/lib/libalpm/be_package.c
+++ b/lib/libalpm/be_package.c
@@ -200,8 +200,8 @@ static int parse_descfile(alpm_handle_t *handle, struct archive *a, alpm_pkg_t *
} else if(strcmp(key, "provides") == 0) {
newpkg->provides = alpm_list_add(newpkg->provides, strdup(ptr));
} else if(strcmp(key, "backup") == 0) {
- pmbackup_t *backup;
- CALLOC(backup, 1, sizeof(pmbackup_t), return -1);
+ alpm_backup_t *backup;
+ CALLOC(backup, 1, sizeof(alpm_backup_t), return -1);
STRDUP(backup->name, ptr, return -1);
newpkg->backup = alpm_list_add(newpkg->backup, backup);
} else if(strcmp(key, "force") == 0) {
diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c
index 3412774b..86571a4f 100644
--- a/lib/libalpm/remove.c
+++ b/lib/libalpm/remove.c
@@ -254,7 +254,7 @@ static void unlink_file(alpm_handle_t *handle, alpm_pkg_t *info, const char *fil
}
} else {
/* if the file needs backup and has been modified, back it up to .pacsave */
- pmbackup_t *backup = _alpm_needbackup(filename, alpm_pkg_get_backup(info));
+ alpm_backup_t *backup = _alpm_needbackup(filename, alpm_pkg_get_backup(info));
if(backup) {
if(nosave) {
_alpm_log(handle, PM_LOG_DEBUG, "transaction is set to NOSAVE, not backing up '%s'\n", file);
@@ -307,7 +307,7 @@ int _alpm_upgraderemove_package(alpm_handle_t *handle,
/* old package backup list */
alpm_list_t *filelist = alpm_pkg_get_files(newpkg);
for(b = alpm_pkg_get_backup(newpkg); b; b = b->next) {
- const pmbackup_t *backup = b->data;
+ const alpm_backup_t *backup = b->data;
/* safety check (fix the upgrade026 pactest) */
if(!alpm_list_find_str(filelist, backup->name)) {
continue;
diff --git a/src/pacman/package.c b/src/pacman/package.c
index 49d80ef0..6b480873 100644
--- a/src/pacman/package.c
+++ b/src/pacman/package.c
@@ -151,7 +151,7 @@ void dump_pkg_full(alpm_pkg_t *pkg, enum pkg_from from, int extra)
}
static const char *get_backup_file_status(const char *root,
- const pmbackup_t *backup)
+ const alpm_backup_t *backup)
{
char path[PATH_MAX];
const char *ret;
@@ -200,7 +200,7 @@ void dump_pkg_backups(alpm_pkg_t *pkg)
if(alpm_pkg_get_backup(pkg)) {
/* package has backup files, so print them */
for(i = alpm_pkg_get_backup(pkg); i; i = alpm_list_next(i)) {
- const pmbackup_t *backup = alpm_list_getdata(i);
+ const alpm_backup_t *backup = alpm_list_getdata(i);
const char *value;
if(!backup->hash) {
continue;