Created
April 5, 2017 06:49
-
-
Save JosephKiranBabu/7ecb25c2ccca682136cf6b32d61df32e to your computer and use it in GitHub Desktop.
Script to analyze dependencies of Mastodon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
import sys | |
lang = sys.argv[1] | |
def find_unmet_dependencies(): | |
unmet_dependencies=[] | |
dependencies=[] | |
if lang == 'ruby': | |
dependencies = ['rails', 'sass-rails', 'uglifier', 'coffee-rails', 'jquery-rails', 'jbuilder', 'sdoc', 'puma', 'hamlit-rails', 'pg', 'pghero', 'dotenv-rails', 'font-awesome-rails', 'best_in_place', 'paperclip', 'paperclip-av-transcoder', 'aws-sdk', 'http', 'httplog', 'addressable', 'nokogiri', 'link_header', 'ostatus2', 'goldfinger', 'devise', 'devise-two-factor', 'doorkeeper', 'rabl', 'rqrcode', 'twitter-text', 'oj', 'hiredis', 'redis', 'fast_blank', 'htmlentities', 'simple_form', 'will_paginate', 'rack-attack', 'rack-cors', 'sidekiq', 'sidekiq-unique-jobs', 'rails-settings-cached', 'simple-navigation', 'statsd-instrument', 'ruby-oembed', 'rack-timeout', 'tzinfo-data', 'react-rails', 'browserify-rails', 'autoprefixer-rails'] | |
elif lang == 'node': | |
dependencies = [ "axios", "babel-cli", "babel-plugin-react-transform", "babel-plugin-transform-decorators-legacy", "babel-plugin-transform-object-rest-spread", "babel-preset-es2015", "babel-preset-react", "babel-preset-stage-2", "babelify", "browserify", "browserify-incremental", "bufferutil", "chai", "chai-enzyme", "css-loader", "dotenv", "emojione", "emojione-picker", "enzyme", "es6-promise", "escape-html", "eventsource", "express", "http-link-header", "immutable", "intl", "jsdom", "mocha", "node-sass", "npmlog", "pg", "react", "react-addons-perf", "react-addons-pure-render-mixin", "react-addons-shallow-compare", "react-addons-test-utils", "react-autosuggest", "react-decoration", "react-dom", "react-imageloader", "react-immutable-proptypes", "react-intl", "react-motion", "react-notification", "react-proxy", "react-redux", "react-redux-loading-bar", "react-router", "react-router-scroll", "react-simple-dropdown", "react-storybook-addon-intl", "react-toggle", "redis", "redux", "redux-immutable", "redux-thunk", "reselect", "sass-loader", "sinon", "style-loader", "utf-8-validate", "uuid", "webpack", "websocket.js", "ws"] | |
for dep in dependencies: | |
try: | |
subprocess.check_call(['apt', 'show', dep]) | |
except subprocess.CalledProcessError as ex: | |
try: | |
subprocess.check_call(['apt', 'show', '{}-{}'.format(lang, dep)]) | |
except subprocess.CalledProcessError as ex: | |
unmet_dependencies.append(dep) | |
return unmet_dependencies | |
deps = find_unmet_dependencies() | |
print(deps) | |
print(len(deps)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment