Subversion Repositories SvarDOS

Rev

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

Rev 738 Rev 739
Line 161... Line 161...
161
    continue;
161
    continue;
162
  }
162
  }
163
 
163
 
164
  // validate the files present in the archive
164
  // validate the files present in the archive
165
  $listoffiles = read_list_of_files_in_zip($pkgfullpath);
165
  $listoffiles = read_list_of_files_in_zip($pkgfullpath);
-
 
166
  $pkgdir = $pkgnam;
-
 
167
 
-
 
168
  // special rule for djgpp_* packages: they put their files in djgpp
-
 
169
  if (str_head_is($pkgnam, 'djgpp_')) $pkgdir = 'djgpp';
-
 
170
 
166
  foreach ($listoffiles as $f) {
171
  foreach ($listoffiles as $f) {
167
    $f = strtolower($f);
172
    $f = strtolower($f);
168
    // LSM file is ok
173
    // LSM file is ok
169
    if ($f === "appinfo/{$pkgnam}.lsm") continue;
174
    if ($f === "appinfo/{$pkgnam}.lsm") continue;
170
    if ($f === "appinfo/") continue;
175
    if ($f === "appinfo/") continue;
171
    // CORE packages are premium citizens and can do a little more
176
    // CORE packages are premium citizens and can do a little more
172
    if (array_search($pkgnam, $core_packages_list) !== false) {
177
    if (array_search($pkgnam, $core_packages_list) !== false) {
173
      if (str_head_is($f, 'bin/')) continue;
178
      if (str_head_is($f, 'bin/')) continue;
174
    }
179
    }
175
    // well-known dirs are okay
180
    // well-known dirs are okay
176
    if (str_head_is($f, "doc/{$pkgnam}/")) continue;
181
    if (str_head_is($f, "doc/{$pkgdir}/")) continue;
177
    if ($f === 'doc/') continue;
182
    if ($f === 'doc/') continue;
178
    if (str_head_is($f, "nls/{$pkgnam}.")) continue;
183
    if (str_head_is($f, "nls/{$pkgdir}.")) continue;
179
    if ($f === 'nls/') continue;
184
    if ($f === 'nls/') continue;
180
    if (str_head_is($f, "progs/{$pkgnam}/")) continue;
185
    if (str_head_is($f, "progs/{$pkgdir}/")) continue;
181
    if ($f === 'progs/') continue;
186
    if ($f === 'progs/') continue;
182
    if (str_head_is($f, "devel/{$pkgnam}/")) continue;
187
    if (str_head_is($f, "devel/{$pkgdir}/")) continue;
183
    if ($f === 'devel/') continue;
188
    if ($f === 'devel/') continue;
184
    if (str_head_is($f, "games/{$pkgnam}/")) continue;
189
    if (str_head_is($f, "games/{$pkgdir}/")) continue;
185
    if ($f === 'games/') continue;
190
    if ($f === 'games/') continue;
186
    if (str_head_is($f, "drivers/{$pkgnam}/")) continue;
191
    if (str_head_is($f, "drivers/{$pkgdir}/")) continue;
187
    if ($f === 'drivers/') continue;
192
    if ($f === 'drivers/') continue;
188
    echo "WARNING: pkg {$fname} contains a file in an illegal location: {$f}\n";
193
    echo "WARNING: pkg {$fname} contains a file in an illegal location: {$f}\n";
189
  }
194
  }
190
 
195
 
191
  $meta['fname'] = $fname;
196
  $meta['fname'] = $fname;