Flags are named XBPS_FLAG_XXX, add XBPS_FLAG_FORCE.

--HG--
extra : convert_revision : 4f7ad37910303a87788b2daac9b4ba11bf39becd
This commit is contained in:
Juan RP 2009-08-11 14:01:28 +02:00
parent bd8e232a2d
commit 3e42bc6410
4 changed files with 13 additions and 12 deletions

View file

@ -113,7 +113,7 @@ main(int argc, char **argv)
break;
case 'v':
verbose = true;
flags |= XBPS_VERBOSE;
flags |= XBPS_FLAG_VERBOSE;
break;
case '?':
default:

View file

@ -58,7 +58,8 @@
#define XBPS_PKGINDEX_VERSION "1.0"
/* Verbose messages */
#define XBPS_VERBOSE 0x00000001
#define XBPS_FLAG_VERBOSE 0x00000001
#define XBPS_FLAG_FORCE 0x00000002
#define ARCHIVE_READ_BLOCKSIZE 10240

View file

@ -97,7 +97,7 @@ remove_pkg_metadir(const char *pkgname)
}
if ((rv = unlink(path)) == -1) {
if (flags & XBPS_VERBOSE)
if (flags & XBPS_FLAG_VERBOSE)
printf("WARNING: can't remove %s (%s)\n",
pkgname, strerror(errno));
}
@ -144,13 +144,13 @@ remove_pkg_files(prop_dictionary_t dict)
return EINVAL;
}
if ((rv = remove(path)) == -1) {
if (flags & XBPS_VERBOSE)
if (flags & XBPS_FLAG_VERBOSE)
printf("WARNING: can't remove link %s (%s)\n",
file, strerror(errno));
free(path);
continue;
}
if (flags & XBPS_VERBOSE)
if (flags & XBPS_FLAG_VERBOSE)
printf("Removed link: %s\n", file);
free(path);
@ -199,7 +199,7 @@ files:
free(path);
continue;
} else if (rv == ERANGE) {
if (flags & XBPS_VERBOSE)
if (flags & XBPS_FLAG_VERBOSE)
printf("WARNING: SHA256 doesn't match "
"for %s %s, ignoring...\n",
curftype, file);
@ -211,14 +211,14 @@ files:
return rv;
}
if ((rv = remove(path)) == -1) {
if (flags & XBPS_VERBOSE)
if (flags & XBPS_FLAG_VERBOSE)
printf("WARNING: can't remove "
"%s %s (%s)\n", curftype, file,
strerror(errno));
free(path);
continue;
}
if (flags & XBPS_VERBOSE)
if (flags & XBPS_FLAG_VERBOSE)
printf("Removed %s: %s\n", curftype, file);
free(path);
@ -256,7 +256,7 @@ dirs:
free(path);
continue;
}
if (flags & XBPS_VERBOSE) {
if (flags & XBPS_FLAG_VERBOSE) {
printf("WARNING: can't remove "
"directory %s (%s)\n", file,
strerror(errno));
@ -264,7 +264,7 @@ dirs:
continue;
}
}
if (flags & XBPS_VERBOSE)
if (flags & XBPS_FLAG_VERBOSE)
printf("Removed directory: %s\n", file);
free(path);

View file

@ -232,7 +232,7 @@ unpack_archive_fini(struct archive *ar, prop_dictionary_t pkg,
archive_error_string(ar));
return rv;;
} else if (rv == EEXIST) {
if (flags & XBPS_VERBOSE) {
if (flags & XBPS_FLAG_VERBOSE) {
printf("WARNING: ignoring existent "
"path: %s\n",
archive_entry_pathname(entry));
@ -241,7 +241,7 @@ unpack_archive_fini(struct archive *ar, prop_dictionary_t pkg,
continue;
}
}
if (flags & XBPS_VERBOSE) {
if (flags & XBPS_FLAG_VERBOSE) {
printf(" %s\n", archive_entry_pathname(entry));
(void)fflush(stdout);
}