diff options
Diffstat (limited to 'dpkg.c')
-rw-r--r-- | dpkg.c | 31 |
1 files changed, 0 insertions, 31 deletions
@@ -116,37 +116,6 @@ static int package_compare(const void *p1, const void *p2) | |||
116 | ((package_t *)p2)->package); | 116 | ((package_t *)p2)->package); |
117 | } | 117 | } |
118 | 118 | ||
119 | /* | ||
120 | * NOTE: this was handled by a "rm -rf" shell command | ||
121 | * Maybe theis behaviour should be integrated into the rm applet | ||
122 | * (i dont appreciate the rm applets recursive action fn)-bug1 | ||
123 | */ | ||
124 | static int remove_dir(const char *dirname) | ||
125 | { | ||
126 | struct dirent *fp; | ||
127 | DIR *dp = opendir(dirname); | ||
128 | while ((fp = readdir(dp)) != NULL) { | ||
129 | struct stat statbuf; | ||
130 | char *filename; | ||
131 | |||
132 | filename = (char *) xcalloc(1, strlen(dirname) + strlen(fp->d_name) + 2); | ||
133 | strcpy(filename, dirname); | ||
134 | strcat(filename, fp->d_name); | ||
135 | lstat(filename, &statbuf); | ||
136 | |||
137 | if ((strcmp(fp->d_name, ".") != 0) && (strcmp(fp->d_name, "..") != 0)) { | ||
138 | if (S_ISDIR(statbuf.st_mode)) { | ||
139 | remove_dir(strcat(filename, "/")); | ||
140 | } | ||
141 | else if (remove(filename) == -1) { | ||
142 | perror_msg(filename); | ||
143 | } | ||
144 | } | ||
145 | } | ||
146 | remove(dirname); | ||
147 | return EXIT_SUCCESS; | ||
148 | } | ||
149 | |||
150 | #ifdef DODEPENDS | 119 | #ifdef DODEPENDS |
151 | #include <ctype.h> | 120 | #include <ctype.h> |
152 | 121 | ||