Skip to content

Commit

Permalink
Add control to mkdir db and cache directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Alexandre Peyroux committed Jul 13, 2013
1 parent 715cbdd commit 7741fe2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 7 additions & 2 deletions fsops.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,14 @@ void
create_dirs()
{
/* create database repository */
mkdir(PKGIN_DB, 0755);
if(-1 == mkdir(PKGIN_DB, 0755))
errx(EXIT_FAILURE, MSG_MKDIR_DB_REPOSITORY_FAILED,
strerror(errno)); // look errno
/* create cache repository */
mkdir(pkgin_cache, 0755);
if(-1 == mkdir(pkgin_cache, 0755))
errx(EXIT_FAILURE, MSG_MKDIR_CACHE_REPOSITORY_FAILED,
strerror(errno));

}

char *
Expand Down
2 changes: 2 additions & 0 deletions messages.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ please re-run %s with a package name matching one of the following:\n"
/* fsops.c */
#define MSG_TRANS_FAILED "Failed to translate %s in repository config file"
#define MSG_INVALID_REPOS "Invalid repository: %s"
#define MSG_MKDIR_DB_REPOSITORY_FAILED "Failed to create database repository %s\n"
#define MSG_MKDIR_CACHE_REPOSITORY_FAILED "Failed to create cache repository %s\n"

/* selection.c */
#define MSG_EMPTY_IMPORT_LIST "Empty import list."
Expand Down

0 comments on commit 7741fe2

Please sign in to comment.