Subversion Repositories SvarDOS

Rev

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

Rev 1560 Rev 1690
Line 1... Line 1...
1
/*
1
/*
2
 * pkgnet - pulls SvarDOS packages from the project's online repository
2
 * pkgnet - pulls SvarDOS packages from the project's online repository
3
 *
3
 *
4
 * PUBLISHED UNDER THE TERMS OF THE MIT LICENSE
4
 * PUBLISHED UNDER THE TERMS OF THE MIT LICENSE
5
 *
5
 *
6
 * COPYRIGHT (C) 2016-2023 MATEUSZ VISTE, ALL RIGHTS RESERVED.
6
 * COPYRIGHT (C) 2016-2024 MATEUSZ VISTE, ALL RIGHTS RESERVED.
7
 *
7
 *
8
 * Permission is hereby granted, free of charge, to any person obtaining a
8
 * Permission is hereby granted, free of charge, to any person obtaining a
9
 * copy of this software and associated documentation files (the "Software"),
9
 * copy of this software and associated documentation files (the "Software"),
10
 * to deal in the Software without restriction, including without limitation
10
 * to deal in the Software without restriction, including without limitation
11
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
Line 38... Line 38...
38
#include "svarlang.lib\svarlang.h"
38
#include "svarlang.lib\svarlang.h"
39
 
39
 
40
#include "../../pkg/trunk/lsm.h"
40
#include "../../pkg/trunk/lsm.h"
41
 
41
 
42
 
42
 
43
#define PVER "20230823"
43
#define PVER "20240201"
44
#define PDATE "2021-2023"
44
#define PDATE "2021-2024"
45
 
45
 
46
#define HOSTADDR "svardos.org"
46
#define HOSTADDR "svardos.org"
47
 
47
 
48
 
48
 
49
/* convenience define that outputs nls strings to screen (followed by CR/LF) */
49
/* convenience define that outputs nls strings to screen (followed by CR/LF) */
Line 207... Line 207...
207
    }
207
    }
208
  }
208
  }
209
 
209
 
210
  /* if first call, open the package directory */
210
  /* if first call, open the package directory */
211
  if (dp == NULL) {
211
  if (dp == NULL) {
212
    sprintf(buff, "%s\\packages", dosdir);
212
    sprintf(buff, "%s\\appinfo", dosdir);
213
    dp = opendir(buff);
213
    dp = opendir(buff);
214
    if (dp == NULL) {
214
    if (dp == NULL) {
215
      putsnls(9, 1); /* "ERROR: Could not access %DOSDIR%\\packages directory" */
215
      putsnls(9, 1); /* "ERROR: Could not access %DOSDIR%\\appinfo directory" */
216
      return(0);
216
      return(0);
217
    }
217
    }
218
  }
218
  }
219
 
219
 
220
  for (;;) {
220
  for (;;) {
Line 225... Line 225...
225
      closedir(dp);
225
      closedir(dp);
226
      return(0);
226
      return(0);
227
    }
227
    }
228
 
228
 
229
    tlen = strlen(ep->d_name);
229
    tlen = strlen(ep->d_name);
230
    if (tlen < 4) continue; /* files must be at least 5 bytes long ("x.lst") */
230
    if (tlen < 4) continue; /* files must be at least 5 bytes long ("x.lsm") */
231
    if (strcasecmp(ep->d_name + tlen - 4, ".lst") != 0) continue;  /* if not an .lst file, skip it silently */
231
    if (strcasecmp(ep->d_name + tlen - 4, ".lsm") != 0) continue;  /* if not an .lsm file, skip it silently */
232
    ep->d_name[tlen - 4] = 0; /* trim out the ".lst" suffix */
232
    ep->d_name[tlen - 4] = 0; /* trim out the ".lsm" suffix */
233
 
233
 
234
    /* load the metadata from %DOSDIR\APPINFO\*.lsm */
234
    /* load the metadata from %DOSDIR\APPINFO\*.lsm */
235
    sprintf(buff, "%s\\appinfo\\%s.lsm", dosdir, ep->d_name);
235
    sprintf(buff, "%s\\appinfo\\%s.lsm", dosdir, ep->d_name);
236
    readlsm(buff, ver, sizeof(ver));
236
    readlsm(buff, ver, sizeof(ver));
237
 
237