Subversion Repositories SvarDOS

Rev

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

Rev 241 Rev 242
Line 31... Line 31...
31
 
31
 
32
#include "kprintf.h"
32
#include "kprintf.h"
33
#include "libunzip.h"
33
#include "libunzip.h"
34
#include "pkginst.h"
34
#include "pkginst.h"
35
#include "pkgrem.h"
35
#include "pkgrem.h"
-
 
36
#include "showinst.h"
36
#include "version.h"
37
#include "version.h"
37
 
38
 
38
 
39
 
39
enum ACTIONTYPES {
40
enum ACTIONTYPES {
40
  ACTION_INSTALL,
41
  ACTION_INSTALL,
41
  ACTION_REMOVE,
42
  ACTION_REMOVE,
-
 
43
  ACTION_LISTFILES,
42
  ACTION_HELP
44
  ACTION_HELP
43
};
45
};
44
 
46
 
45
 
47
 
46
static int showhelp(void) {
48
static int showhelp(void) {
Line 48... Line 50...
48
         "\n"
50
         "\n"
49
         "PKGINST is the package installer for SvarDOS.\n"
51
         "PKGINST is the package installer for SvarDOS.\n"
50
         "\n"
52
         "\n"
51
         "Usage: PKGINST install package.zip\n"
53
         "Usage: PKGINST install package.zip\n"
52
         "       PKGINST remove package\n"
54
         "       PKGINST remove package\n"
-
 
55
         "       PKGINST listfiles package\n"
53
         "\n"
56
         "\n"
54
         "PKGINST is published under the MIT license. It uses a configuration file\n"
57
         "PKGINST is published under the MIT license. It uses a configuration file\n"
55
         "located at %%DOSDIR%%\\CFG\\PKGINST.CFG\n"
58
         "located at %%DOSDIR%%\\CFG\\PKGINST.CFG\n"
56
         );
59
         );
57
  return(1);
60
  return(1);
Line 65... Line 68...
65
  /* look for valid actions */
68
  /* look for valid actions */
66
  if (strcasecmp(argv[1], "install") == 0) {
69
  if (strcasecmp(argv[1], "install") == 0) {
67
    return(ACTION_INSTALL);
70
    return(ACTION_INSTALL);
68
  } else if (strcasecmp(argv[1], "remove") == 0) {
71
  } else if (strcasecmp(argv[1], "remove") == 0) {
69
    return(ACTION_REMOVE);
72
    return(ACTION_REMOVE);
-
 
73
  } else if (strcasecmp(argv[1], "listfiles") == 0) {
-
 
74
    return(ACTION_LISTFILES);
70
  } else {
75
  } else {
71
    return(ACTION_HELP);
76
    return(ACTION_HELP);
72
  }
77
  }
73
}
78
}
74
 
79
 
Line 132... Line 137...
132
      res = pkginst(argv[2], flags, dosdir, dirlist);
137
      res = pkginst(argv[2], flags, dosdir, dirlist);
133
      break;
138
      break;
134
    case ACTION_REMOVE:
139
    case ACTION_REMOVE:
135
      res = pkgrem(argv[2], dosdir);
140
      res = pkgrem(argv[2], dosdir);
136
      break;
141
      break;
-
 
142
    case ACTION_LISTFILES:
-
 
143
      res = listfilesofpkg(argv[2], dosdir);
-
 
144
      break;
137
    default:
145
    default:
138
      res = showhelp();
146
      res = showhelp();
139
      break;
147
      break;
140
  }
148
  }
141
 
149