Subversion Repositories SvarDOS

Rev

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

Rev 754 Rev 768
Line 163... Line 163...
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;
166
  $pkgdir = $pkgnam;
167
 
167
 
168
  // special rule for djgpp_* packages: they put their files in djgpp
168
  // special rule for "parent and children" packages
169
  if (str_head_is($pkgnam, 'djgpp_')) $pkgdir = 'djgpp';
169
  if (str_head_is($pkgnam, 'djgpp_')) $pkgdir = 'djgpp'; // djgpp_* packages put their files in djgpp
170
  if ($pkgnam == 'fbc_help') $pkgdir = 'fbc'; // FreeBASIC help goes to the FreeBASIC dir
170
  if ($pkgnam == 'fbc_help') $pkgdir = 'fbc'; // FreeBASIC help goes to the FreeBASIC dir
171
 
171
 
-
 
172
  // array used to detect duplicated entries after lower-case conversion
-
 
173
  $duparr = array();
-
 
174
 
172
  foreach ($listoffiles as $f) {
175
  foreach ($listoffiles as $f) {
173
    $f = strtolower($f);
176
    $f = strtolower($f);
-
 
177
    $path_array = explode('/', $f);
-
 
178
    // emit a warning when non-8+3 filenames are spotted and find duplicates
-
 
179
    foreach ($path_array as $item) {
-
 
180
      if (empty($item)) continue; // skip empty items at end of paths (eg. appinfo/)
-
 
181
      if (!preg_match("/[a-z0-9!#$%&'()@^_`{}~-]{1,8}(\.[a-z0-9!#$%&'()@^_`{}~-]{1,3}){0,1}/", $item)) {
-
 
182
        echo "WARNING: {$fname} contains a non-8+3 path (or weird char): {$item} (in $f)\n";
-
 
183
      }
-
 
184
    }
-
 
185
    // look for dups
-
 
186
    if (array_search($f, $duparr) !== false) {
-
 
187
      echo "WARNING: {$fname} contains a duplicated entry: '{$f}'\n";
-
 
188
    } else {
-
 
189
      $duparr[] = $f;
-
 
190
    }
174
    // LSM file is ok
191
    // LSM file is ok
175
    if ($f === "appinfo/{$pkgnam}.lsm") continue;
192
    if ($f === "appinfo/{$pkgnam}.lsm") continue;
176
    if ($f === "appinfo/") continue;
193
    if ($f === "appinfo/") continue;
177
    // CORE packages are premium citizens and can do a little more
194
    // CORE packages are premium citizens and can do a little more
178
    if (array_search($pkgnam, $core_packages_list) !== false) {
195
    if (array_search($pkgnam, $core_packages_list) !== false) {
Line 189... Line 206...
189
    if ($f === 'devel/') continue;
206
    if ($f === 'devel/') continue;
190
    if (str_head_is($f, "games/{$pkgdir}/")) continue;
207
    if (str_head_is($f, "games/{$pkgdir}/")) continue;
191
    if ($f === 'games/') continue;
208
    if ($f === 'games/') continue;
192
    if (str_head_is($f, "drivers/{$pkgdir}/")) continue;
209
    if (str_head_is($f, "drivers/{$pkgdir}/")) continue;
193
    if ($f === 'drivers/') continue;
210
    if ($f === 'drivers/') continue;
194
    echo "WARNING: pkg {$fname} contains a file in an illegal location: {$f}\n";
211
    echo "WARNING: {$fname} contains a file in an illegal location: {$f}\n";
195
  }
212
  }
196
 
213
 
197
  $meta['fname'] = $fname;
214
  $meta['fname'] = $fname;
198
  $meta['desc'] = $lsmarray['description'];
215
  $meta['desc'] = $lsmarray['description'];
199
 
216