Skip to content

Commit

Permalink
Merge pull request #215 from shyim/add-scripts
Browse files Browse the repository at this point in the history
feat: add obsolete file finder script
  • Loading branch information
shyim authored Jun 2, 2024
2 parents 3f8710a + 14ba5aa commit 0382c0b
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 34 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
/*.rsa
/*.pub
/repositories
/public
/public
/remote
33 changes: 0 additions & 33 deletions composer.yaml

This file was deleted.

96 changes: 96 additions & 0 deletions scripts/obsolete-files.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
import { readdir, existsSync } from 'fs';

const archList = ['aarch64', 'x86_64'];
const phpExtensions = [
"bz2",
"curl",
"gd",
"gmp",
"ldap",
"mysqlnd",
"openssl",
"pdo_mysql",
"pdo_sqlite",
"pdo_dblib",
"pdo_pgsql",
"pdo_odbc",
"soap",
"sodium",
"calendar",
"exif",
"gettext",
"intl",
"mbstring",
"opcache",
"pcntl",
"pdo",
"phar",
"sockets",
"xsl",
"bcmath",
"ctype",
"iconv",
"dom",
"pgsql",
"posix",
"shmop",
"sysvmsg",
"sysvsem",
"sysvshm",
"simplexml",
"mysqli",
"xml",
"xmlreader",
"xmlwriter",
"fileinfo",
"zip",
"odbc",
"ftp",
"ffi",
"fpm",
"dev",
"dbg",
'cgi',
'doc',
];

for (const arch of archList) {
readdir(`./remote/${arch}`, (err, files) => {
if (err) {
console.error(err);
return;
}

for (const file of files) {
if (file.endsWith('.apk') === false) {
continue;
}

const packageName = file.replace(/-\d+\.\d+.\d+-r\d+\.apk$/gm, '')

if (packageName.includes('-config')) {
continue;
}

let found = false

for (const extension of phpExtensions) {
if (packageName.endsWith(`-${extension}`)) {
found = true;
continue;
}
}

if (found) {
continue;
}

if (existsSync(`${packageName}.yaml`)) {
continue;
}


console.log(`${arch}/${file} is not maintained anymore`)
}
});
}

0 comments on commit 0382c0b

Please sign in to comment.