Subversion Repositories SvarDOS

Rev

Rev 1678 | Rev 1965 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1678 Rev 1963
Line 31... Line 31...
31
  }
31
  }
32
  /* not in the list yet - add it */
32
  /* not in the list yet - add it */
33
  res = malloc(sizeof(struct dirliststruct) + strlen(path));
33
  res = malloc(sizeof(struct dirliststruct) + strlen(path));
34
  if (res == NULL) {  /* out of memory */
34
  if (res == NULL) {  /* out of memory */
35
    kitten_printf(4, 3, path); /* "Out of memory! Could not store directory %s!" */
35
    kitten_printf(4, 3, path); /* "Out of memory! Could not store directory %s!" */
36
    puts("");
36
    outputnl("");
37
    return(NULL);
37
    return(NULL);
38
  }
38
  }
39
  strcpy(res->dirname, path);
39
  strcpy(res->dirname, path);
40
  res->next = dirlist;
40
  res->next = dirlist;
41
  return(res);
41
  return(res);
Line 77... Line 77...
77
  if (flist == NULL) {
77
  if (flist == NULL) {
78
    sprintf(fpath, "%s\\appinfo\\%s.lsm", dosdir, pkgname);
78
    sprintf(fpath, "%s\\appinfo\\%s.lsm", dosdir, pkgname);
79
    flist = fopen(fpath, "rb");
79
    flist = fopen(fpath, "rb");
80
    if (flist == NULL) {
80
    if (flist == NULL) {
81
      kitten_printf(4, 0, pkgname); /* "Package %s is not installed, so not removed." */
81
      kitten_printf(4, 0, pkgname); /* "Package %s is not installed, so not removed." */
82
      puts("");
82
      outputnl("");
83
      return(-1);
83
      return(-1);
84
    }
84
    }
85
  }
85
  }
86
 
86
 
87
  /* remove all files/folders listed in pkgname.lsm but NOT pkgname.lsm */
87
  /* remove all files/folders listed in pkgname.lsm but NOT pkgname.lsm */
Line 118... Line 118...
118
     * deleted later) */
118
     * deleted later) */
119
    if (strcasecmp(buff, fpath) == 0) continue;
119
    if (strcasecmp(buff, fpath) == 0) continue;
120
 
120
 
121
    /* remove it */
121
    /* remove it */
122
    kitten_printf(4, 4, buff); /* "removing %s" */
122
    kitten_printf(4, 4, buff); /* "removing %s" */
123
    puts("");
123
    outputnl("");
124
    unlink(buff);
124
    unlink(buff);
125
  }
125
  }
126
 
126
 
127
  /* close the lsm file */
127
  /* close the lsm file */
128
  fclose(flist);
128
  fclose(flist);
Line 150... Line 150...
150
    free(dirlistpos);
150
    free(dirlistpos);
151
  }
151
  }
152
 
152
 
153
  /* remove the lst file */
153
  /* remove the lst file */
154
  kitten_printf(4, 4, fpath); /* "removing %s" */
154
  kitten_printf(4, 4, fpath); /* "removing %s" */
155
  puts("");
155
  outputnl("");
156
  unlink(fpath);
156
  unlink(fpath);
157
 
157
 
158
  kitten_printf(4, 5, pkgname); /* "Package %s has been removed." */
158
  kitten_printf(4, 5, pkgname); /* "Package %s has been removed." */
159
  puts("");
159
  outputnl("");
160
  return(0);
160
  return(0);
161
}
161
}