Skip to content

Commit

Permalink
Merge pull request #136 from Soviet-Linux/origin/PKD667-patch-1
Browse files Browse the repository at this point in the history
new CI + cleanup
  • Loading branch information
PKD667 authored Jul 24, 2024
2 parents dab42e0 + 2fddbc8 commit d959f0d
Show file tree
Hide file tree
Showing 10 changed files with 103 additions and 209 deletions.
25 changes: 0 additions & 25 deletions .github/workflows/autorebuilddb.yml

This file was deleted.

27 changes: 27 additions & 0 deletions .github/workflows/build-db.yaml
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
29 changes: 29 additions & 0 deletions .github/workflows/check-pkg.yml
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' _ {} \;
23 changes: 0 additions & 23 deletions .github/workflows/ourcustomci.yml

This file was deleted.

38 changes: 0 additions & 38 deletions .gitlab-ci.yml

This file was deleted.

Binary file added all.db
Binary file not shown.
122 changes: 0 additions & 122 deletions build.sh

This file was deleted.

1 change: 0 additions & 1 deletion cccp-test

This file was deleted.

1 change: 1 addition & 0 deletions generated.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Wed Jul 24 15:22:06 UTC 2024
46 changes: 46 additions & 0 deletions mkall
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()


0 comments on commit d959f0d

Please sign in to comment.