Compare commits

...
10 Commits
Author SHA1 Message Date
pancake daeba4ebcf Release 0.5.9 2024-08-31 00:03:48 +02:00
Eli Array Minkoff 5578bee417 Attempt to pull new tags if fetching a tag fails 2024-05-08 00:48:38 +02:00
pancake ab6cce7008 Release 0.5.8 2024-04-30 19:13:06 +02:00
pancake d501129500 Add r2yara for the profiles 2024-04-30 19:12:27 +02:00
pancake 51c1b2ca2c Do not register as installed packages that doesn't exist 2024-04-30 18:59:41 +02:00
pancake 743812b653 More checks 2024-04-30 17:18:34 +02:00
pancake ac3b695012 Add python -m r2env 2024-04-30 17:08:29 +02:00
pancake 00a3db509c Check for a valid package name 2024-04-30 17:07:48 +02:00
pancake ccd7231065 Use updated twine pub oneliner 2024-04-30 16:56:45 +02:00
semgrep.dev on behalf of @trufae 3b8716ea1d Add Semgrep CI 2023-03-29 10:36:34 +00:00
6 changed files with 59 additions and 18 deletions

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
on:
pull_request: {}
push:
branches:
- main
- master
paths:
- .github/workflows/semgrep.yml
schedule:
# random HH:MM to avoid a load spike on GitHub Actions at 00:00
- cron: 34 10 * * *
name: Semgrep
jobs:
semgrep:
name: Scan
runs-on: ubuntu-20.04
env:
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
container:
image: returntocorp/semgrep
steps:
- uses: actions/checkout@v3
- run: semgrep ci
+3 -1
View File
@@ -7,7 +7,9 @@ all:
pub:
rm -rf dist
$(PYTHON) setup.py sdist
twine upload --repository=pypi --verbose dist/*
twine check dist/*
twine upload -u __token__ --repository-url https://upload.pypi.org/legacy/ --verbose dist/*
#twine upload --repository=pypi --verbose dist/*
install:
$(PIP) install .
+3
View File
@@ -0,0 +1,3 @@
from r2env.repl import main
main()
+23 -15
View File
@@ -122,6 +122,10 @@ class PackageManager:
'source': 'https://github.com/wargio/r2dec-js',
'versions': [{'id': 'git', 'packages': {}}]
},
'r2yara': {
'source': 'https://github.com/radareorg/r2yara',
'versions': [{'id': 'git', 'packages': {}}]
},
'r2ghidra': {
'source': 'https://github.com/radareorg/r2ghidra',
'versions': [{'id': 'git', 'packages': {}}]
@@ -152,11 +156,17 @@ class PackageManager:
os.makedirs(source_path)
if not os.path.isdir(dst_dir):
os.makedirs(dst_dir)
self._exit_if_package_not_available(profile, version)
if self._if_package_not_available(profile, version):
if os.path.isdir(dst_dir):
shutil.rmtree(dst_dir)
raise PackageManagerException(
f"{profile}@{version} package not available. Use 'list' command to see available packages.")
if use_dist:
if self._install_from_dist(profile, version):
print_console(f"[*] Binary package {profile}@{version} installed successfully")
else:
if os.path.isdir(dst_dir):
shutil.rmtree(dst_dir)
raise PackageManagerException(f"[x] Failed to install {profile}@{version}.")
else:
if self._build_from_source(profile, version, source_path, dst_dir, logfile, use_meson=use_meson):
@@ -188,11 +198,12 @@ class PackageManager:
raise PackageManagerException(f"[x] Unable to find installed package {package_name}")
def _get_pkgname(self, profile, version, cos):
for pkgv in self._packages[profile]["versions"]:
if pkgv["id"] == version:
for pkgd in pkgv["packages"].keys():
if pkgd == cos:
return pkgv["packages"][pkgd]
if profile in self._packages:
for pkgv in self._packages[profile]["versions"]:
if pkgv["id"] == version:
for pkgd in pkgv["packages"].keys():
if pkgd == cos:
return pkgv["packages"][pkgd]
return None
def _get_disturl(self, profile, version, cos):
@@ -317,12 +328,9 @@ class PackageManager:
print_console(f"Executing {cmd}")
return os.system(cmd) == 0
def _exit_if_package_not_available(self, profile, version):
pkg_found = False
for available_version in self._packages[profile]["versions"]:
if available_version['id'] == version:
pkg_found = True
break
if not pkg_found:
raise PackageManagerException(
f"{profile}@{version} package not available. Use 'list' command to see available packages.")
def _if_package_not_available(self, profile, version):
if profile in self._packages:
for available_version in self._packages[profile]["versions"]:
if available_version['id'] == version:
return False
return True
+6 -1
View File
@@ -81,7 +81,12 @@ def git_fetch(url, version, source_path):
f"Verify the source path is not dirty. Error: {err}") \
from err
if version != "git":
repo.git.checkout(version)
try:
repo.git.checkout(version)
except git.GitCommandError:
# try again after pulling new tags from origin
repo.git.fetch("origin", "--tags")
repo.git.checkout(version)
sms = repo.submodules
for sm in sms:
if not sm.module_exists():
+1 -1
View File
@@ -1 +1 @@
0.5.6
0.5.9