Subversion Repositories SvarDOS

Rev

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

Rev 1599 Rev 1600
Line 1... Line 1...
1
/*
1
/*
2
 * This file is part of pkg (SvarDOS)
2
 * This file is part of pkg (SvarDOS)
3
 * Copyright (C) 2012-2022 Mateusz Viste
3
 * Copyright (C) 2012-2023 Mateusz Viste
4
 */
4
 */
5
 
5
 
6
#include <ctype.h>     /* toupper() */
6
#include <ctype.h>     /* toupper() */
7
#include <stdio.h>
7
#include <stdio.h>
8
#include <stdlib.h>    /* system() */
8
#include <stdlib.h>    /* system() */
Line 110... Line 110...
110
   * of course this must not be done if we are in the process of upgrading said package */
110
   * of course this must not be done if we are in the process of upgrading said package */
111
  if (((flags & PKGINST_UPDATE) == 0) && (validate_package_not_installed(pkgname, dosdir) != 0)) {
111
  if (((flags & PKGINST_UPDATE) == 0) && (validate_package_not_installed(pkgname, dosdir) != 0)) {
112
    return(NULL);
112
    return(NULL);
113
  }
113
  }
114
 
114
 
-
 
115
  /* copy zip filename into fname */
-
 
116
  strcpy(fname, zipfile);
-
 
117
 
-
 
118
  /* append an .SVP extension if not present */
-
 
119
  {
-
 
120
    int slen = strlen(fname);
-
 
121
    if ((slen > 3) && (fname[slen - 4] != '.')) strcat(fname, ".SVP");
-
 
122
  }
-
 
123
 
115
  /* Now let's check the content of the zip file */
124
  /* Now let's check the content of the zip file */
116
 
125
 
117
  *zipfd = fopen(zipfile, "rb");
126
  *zipfd = fopen(fname, "rb");
118
  if (*zipfd == NULL) {
127
  if (*zipfd == NULL) {
119
    puts(svarlang_str(3, 8)); /* "ERROR: Invalid zip archive! Package not installed." */
128
    puts(svarlang_str(3, 8)); /* "ERROR: Invalid zip archive! Package not installed." */
120
    goto RAII;
129
    goto RAII;
121
  }
130
  }
122
  ziplinkedlist = zip_listfiles(*zipfd);
131
  ziplinkedlist = zip_listfiles(*zipfd);