Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/src/util/convertdb.c
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2005-10-06 19:02:14 +0000
committerAurelien Foret <aurelien@archlinux.org>2005-10-06 19:02:14 +0000
commit52670048845e27f707bfb23613822090e9f78fe2 (patch)
tree3f9de1a2b089fc9e6df4ff01e2bfcaec62fce945 /src/util/convertdb.c
parent543940173d17b8a06b8f4e9cbb9ed507cb7b2db6 (diff)
Applied patch from Christian Hamar (krics@linuxforum.hu)
Diffstat (limited to 'src/util/convertdb.c')
-rw-r--r--src/util/convertdb.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/util/convertdb.c b/src/util/convertdb.c
index 6fbebb23..b5436013 100644
--- a/src/util/convertdb.c
+++ b/src/util/convertdb.c
@@ -28,7 +28,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
-#include "pacconf.h"
+#include "alpm.h"
#include "list.h"
#include "util.h"
@@ -48,7 +48,7 @@ int main(int argc, char* argv[])
struct stat buf;
char dbdir[PATH_MAX];
- sprintf(dbdir, "/%s", PACDBDIR);
+ sprintf(dbdir, "/%s", PM_DBPATH);
if(argc < 2) {
printf("converts a pacman 1.x database to a pacman 2.0 format\n");
@@ -73,8 +73,8 @@ int main(int argc, char* argv[])
perror(dbdir);
return(1);
}
- trim(name);
- trim(ver);
+ _alpm_strtrim(name);
+ _alpm_strtrim(ver);
fprintf(stderr, "converting %s\n", name);
/* package directory */
snprintf(topdir, PATH_MAX, "%s/%s-%s", argv[1], name, ver);
@@ -111,14 +111,14 @@ int main(int argc, char* argv[])
return(1);
}
fputs("%FILES%\n", fp);
- while(fgets(line, 255, db) && strcmp(trim(line), "")) {
- trim(line);
+ while(fgets(line, 255, db) && strcmp(_alpm_strtrim(line), "")) {
+ _alpm_strtrim(line);
ptr = line;
/* check for backup designation and frontslashes that shouldn't be there */
if(line[0] == '*') ptr++;
if(*ptr == '/') ptr++;
- if(line[0] == '*') backup = list_add(backup, strdup(ptr));
+ if(line[0] == '*') backup = pm_list_add(backup, strdup(ptr));
fprintf(fp, "%s\n", ptr);
}
@@ -137,7 +137,7 @@ int main(int argc, char* argv[])
snprintf(line, PATH_MAX, "/bin/cp %s %s/install", path, topdir);
system(line);
}
- list_free(backup);
+ pm_list_free(backup);
}
umask(oldumask);
return(0);