summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--database.py4
-rw-r--r--portage_processor.py3
-rw-r--r--schema.sql1
3 files changed, 5 insertions, 3 deletions
diff --git a/database.py b/database.py
index 5202876..79ae693 100644
--- a/database.py
+++ b/database.py
@@ -11,9 +11,9 @@ class DatabaseConnection:
self.conn.commit()
return c.lastrowid
- def insert_group(self, name, provider, date):
+ def insert_group(self, hostname, name, provider, date):
with closing(self.conn.cursor()) as c:
- c.execute("insert into `groups` (`name`, `provider`, `date`) values (%s, %s, %s)", (name, provider, date))
+ c.execute("insert into `groups` (`hostname`, `name`, `provider`, `date`) values (%s, %s, %s, %s)", (hostname, name, provider, date))
self.conn.commit()
return c.lastrowid
diff --git a/portage_processor.py b/portage_processor.py
index 66fb970..32ca9c4 100644
--- a/portage_processor.py
+++ b/portage_processor.py
@@ -14,7 +14,8 @@ class PortageProcessor:
self.storage = storage
def process(self, request, source, db):
- group_id = db.insert_group(request.group_name, 'portage', int(time.time()))
+ group_id = db.insert_group(source, request.group_name, 'portage', int(time.time()))
+
for f in request.files:
matches = 0
pkg_failed = False
diff --git a/schema.sql b/schema.sql
index 564385e..6b418a8 100644
--- a/schema.sql
+++ b/schema.sql
@@ -6,6 +6,7 @@ create table if not exists `files` (
create table if not exists `groups` (
`id` int primary key auto_increment,
+ `hostname` varchar(255) not null,
`name` text not null,
`provider` varchar(16) not null,
`date` int not null