Subversion Repositories SvarDOS

Rev

Rev 293 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 293 Rev 296
Line 33... Line 33...
33
#include "kprintf.h"
33
#include "kprintf.h"
34
#include "libunzip.h"
34
#include "libunzip.h"
35
#include "pkginst.h"
35
#include "pkginst.h"
36
#include "pkgrem.h"
36
#include "pkgrem.h"
37
#include "showinst.h"
37
#include "showinst.h"
-
 
38
#include "unzip.h"
38
#include "version.h"
39
#include "version.h"
39
 
40
 
40
 
41
 
41
enum ACTIONTYPES {
42
enum ACTIONTYPES {
42
  ACTION_INSTALL,
43
  ACTION_INSTALL,
43
  ACTION_UPDATE,
44
  ACTION_UPDATE,
44
  ACTION_REMOVE,
45
  ACTION_REMOVE,
45
  ACTION_LISTFILES,
46
  ACTION_LISTFILES,
46
  ACTION_LISTLOCAL,
47
  ACTION_LISTLOCAL,
-
 
48
  ACTION_UNZIP,
47
  ACTION_HELP
49
  ACTION_HELP
48
};
50
};
49
 
51
 
50
 
52
 
51
static int showhelp(void) {
53
static int showhelp(void) {
Line 56... Line 58...
56
  kitten_puts(1, 20, "Usage: pkg install package.zip");
58
  kitten_puts(1, 20, "Usage: pkg install package.zip");
57
  kitten_puts(1, 21, "       pkg update package.zip");
59
  kitten_puts(1, 21, "       pkg update package.zip");
58
  kitten_puts(1, 22, "       pkg remove package");
60
  kitten_puts(1, 22, "       pkg remove package");
59
  kitten_puts(1, 23, "       pkg listfiles package");
61
  kitten_puts(1, 23, "       pkg listfiles package");
60
  kitten_puts(1, 24, "       pkg listlocal [filter]");
62
  kitten_puts(1, 24, "       pkg listlocal [filter]");
-
 
63
  kitten_puts(1, 27, "       pkg unzip file.zip");
61
  puts("");
64
  puts("");
62
  kitten_puts(1, 25, "PKG is published under the MIT license.");
65
  kitten_puts(1, 25, "PKG is published under the MIT license.");
63
  kitten_puts(1, 26, "It is configured through %DOSDIR%\\CFG\\PKG.CFG");
66
  kitten_puts(1, 26, "It is configured through %DOSDIR%\\CFG\\PKG.CFG");
64
  return(1);
67
  return(1);
65
}
68
}
Line 75... Line 78...
75
    return(ACTION_REMOVE);
78
    return(ACTION_REMOVE);
76
  } else if ((argc == 3) && (strcasecmp(argv[1], "listfiles") == 0)) {
79
  } else if ((argc == 3) && (strcasecmp(argv[1], "listfiles") == 0)) {
77
    return(ACTION_LISTFILES);
80
    return(ACTION_LISTFILES);
78
  } else if ((argc >= 2) && (argc <= 3) && (strcasecmp(argv[1], "listlocal") == 0)) {
81
  } else if ((argc >= 2) && (argc <= 3) && (strcasecmp(argv[1], "listlocal") == 0)) {
79
    return(ACTION_LISTLOCAL);
82
    return(ACTION_LISTLOCAL);
-
 
83
  } else if ((argc == 3) && (strcasecmp(argv[1], "unzip") == 0)) {
-
 
84
    return(ACTION_UNZIP);
80
  } else {
85
  } else {
81
    return(ACTION_HELP);
86
    return(ACTION_HELP);
82
  }
87
  }
83
}
88
}
84
 
89
 
Line 157... Line 162...
157
      res = listfilesofpkg(argv[2], dosdir);
162
      res = listfilesofpkg(argv[2], dosdir);
158
      break;
163
      break;
159
    case ACTION_LISTLOCAL:
164
    case ACTION_LISTLOCAL:
160
      res = showinstalledpkgs((argc == 3)?argv[2]:NULL, dosdir);
165
      res = showinstalledpkgs((argc == 3)?argv[2]:NULL, dosdir);
161
      break;
166
      break;
-
 
167
    case ACTION_UNZIP:
-
 
168
      res = unzip(argv[2]);
-
 
169
      break;
162
    default:
170
    default:
163
      res = showhelp();
171
      res = showhelp();
164
      break;
172
      break;
165
  }
173
  }
166
 
174