-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #136 from Soviet-Linux/origin/PKD667-patch-1
new CI + cleanup
- Loading branch information
Showing
10 changed files
with
103 additions
and
209 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Automatic rebuild of the db | ||
on: push | ||
|
||
jobs: | ||
run: | ||
name: Rebuild db | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Build | ||
run: ./mkall | ||
|
||
- name: Configure GitHub Authentication | ||
run: | | ||
git config user.name "github-actions" | ||
git config user.email "[email protected]" | ||
- name: Commit and push changes | ||
run: | | ||
date > generated.txt | ||
git add -A | ||
git commit -m "Rebuilt Automatically DB" | ||
git push |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Check ECMP files | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
|
||
jobs: | ||
build: | ||
|
||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install libcurl | ||
run: sudo apt-get install libcurl4-gnutls-dev -y | ||
|
||
- name: configure libspm | ||
run: | | ||
git clone https://github.com/Soviet-Linux/libspm --recurse-submodules | ||
make -C libspm all | ||
make -C libspm test | ||
sudo make -C libspm install | ||
- name: Try .ecmp files | ||
run: | | ||
find -name "*.ecmp" -exec sh -c './libspm/bin/package-test "$1" || exit 255' _ {} \; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Wed Jul 24 15:22:06 UTC 2024 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
# vim: set fileencoding=utf-8 : | ||
# vim: set et ts=4 sw=4 sts=4 : | ||
# vim: set ai : | ||
|
||
#write a ECMP parser | ||
import sqlite3 | ||
import os | ||
import glob | ||
if os.path.exists('all.db'): | ||
os.remove('all.db') | ||
|
||
def parse_ecmp(ecmp_file,ecmp_values): | ||
with open(ecmp_file, 'r') as f: | ||
for line in f: | ||
line = line.strip() | ||
if line.startswith('#'): | ||
continue | ||
if '=' not in line: | ||
continue | ||
key, value = line.split('=', 1) | ||
key = key.strip() | ||
value = value.strip() | ||
if key in ecmp_values: | ||
ecmp_values[key] = value | ||
return ecmp_values | ||
|
||
conn = sqlite3.connect('all.db') | ||
c = conn.cursor() | ||
c.execute('''CREATE TABLE IF NOT EXISTS Packages (Name TEXT, Version TEXT, Type TEXT, Format TEXT,Section TEXT)''') | ||
|
||
#get recursively all the .ecmp fils in the current directory without './' | ||
ecmp_files = glob.glob('**/*.ecmp', recursive=True) | ||
|
||
# get the first dir of the path | ||
for ecmp_file in ecmp_files: | ||
ecmp_values = {'name': '', 'version': '', 'type': '', 'format': 'ecmp', 'section': os.path.dirname(ecmp_file).split('/')[0]} | ||
ecmp_values = parse_ecmp(ecmp_file,ecmp_values) | ||
print(ecmp_values) | ||
c.execute("INSERT INTO Packages VALUES (?,?,?,?,?)", (ecmp_values['name'],ecmp_values['version'],ecmp_values['type'],ecmp_values['format'],ecmp_values['section'])) | ||
conn.commit() | ||
|
||
conn.close() | ||
|
||
|