Subversion Repositories SvarDOS

Rev

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

Rev 237 Rev 238
Line 1... Line 1...
1
/*
1
/*
2
 * PKGINST - lightweigth SvarDOS package installer
2
 * PKGINST - SvarDOS package installer
3
 * Copyright (C) 2015-2021 Mateusz Viste
3
 * Copyright (C) 2015-2021 Mateusz Viste
4
 *
4
 *
5
 * Permission is hereby granted, free of charge, to any person obtaining a
5
 * Permission is hereby granted, free of charge, to any person obtaining a
6
 * copy of this software and associated documentation files (the "Software"),
6
 * copy of this software and associated documentation files (the "Software"),
7
 * to deal in the Software without restriction, including without limitation
7
 * to deal in the Software without restriction, including without limitation
Line 24... Line 24...
24
 
24
 
25
#include <stdio.h>    /* printf() */
25
#include <stdio.h>    /* printf() */
26
#include <stdlib.h>   /* malloc() and friends */
26
#include <stdlib.h>   /* malloc() and friends */
27
#include <string.h>   /* strcasecmp() */
27
#include <string.h>   /* strcasecmp() */
28
 
28
 
-
 
29
#include "kprintf.h"
29
#include "libunzip.h"
30
#include "libunzip.h"
30
#include "pkginst.h"
31
#include "pkginst.h"
31
#include "pkgrem.h"
32
#include "pkgrem.h"
32
#include "readenv.h"
-
 
33
#include "version.h"
33
#include "version.h"
34
 
34
 
35
 
35
 
36
enum ACTIONTYPES {
36
enum ACTIONTYPES {
37
  ACTION_INSTALL,
37
  ACTION_INSTALL,
Line 109... Line 109...
109
  struct customdirs *dirlist;
109
  struct customdirs *dirlist;
110
 
110
 
111
  action = parsearg(argc, argv);
111
  action = parsearg(argc, argv);
112
  if (action == ACTION_HELP) return(showhelp());
112
  if (action == ACTION_HELP) return(showhelp());
113
 
113
 
114
  /* read all necessary environment variables */
114
  /* read the DOSDIR environment variable */
-
 
115
  dosdir = getenv("DOSDIR");
115
  if (readenv(&dosdir) != 0) return(1);
116
  if (dosdir == NULL) {
-
 
117
    kitten_puts(2, 2, "%DOSDIR% not set! You should make it point to the FreeDOS main directory.");
-
 
118
    kitten_puts(2, 3, "Example: SET DOSDIR=C:\\FDOS");
-
 
119
    return(-1);
-
 
120
  }
116
 
121
 
117
  /* load configuration */
122
  /* load configuration */
118
  flags = 0;
123
  flags = 0;
119
  dirlist = NULL;
124
  dirlist = NULL;
120
  if (loadconf(dosdir, &dirlist, &flags) != 0) return(5);
125
  if (loadconf(dosdir, &dirlist, &flags) != 0) return(5);