summaryrefslogtreecommitdiffstats
path: root/tupkg
diff options
context:
space:
mode:
authorpjmattal <pjmattal>2005-04-10 04:19:19 +0200
committerpjmattal <pjmattal>2005-04-10 04:19:19 +0200
commitb78a20c3359fab4cf042e6e5e56bb9d5d3c0449a (patch)
tree67c6e2a4dc6e89e4f0009acb1492fdd3f27c8c55 /tupkg
parent108dc557ba9f5043494264c1ff3b71a4bc77bc01 (diff)
downloadaur-b78a20c3359fab4cf042e6e5e56bb9d5d3c0449a.tar.gz
aur-b78a20c3359fab4cf042e6e5e56bb9d5d3c0449a.tar.xz
fixed bugs in tupkgupdate
made link to CVS for package files in community go to CURRENT tag
Diffstat (limited to 'tupkg')
-rwxr-xr-xtupkg/update/tupkgupdate17
1 files changed, 11 insertions, 6 deletions
diff --git a/tupkg/update/tupkgupdate b/tupkg/update/tupkgupdate
index d38583b9..9b85c9f8 100755
--- a/tupkg/update/tupkgupdate
+++ b/tupkg/update/tupkgupdate
@@ -55,17 +55,20 @@ class PackageDatabase:
row = q.fetchone()
return row[0]
return None
- def insert(self, package, locationId):
- warning("DB: Inserting package: " + package.name)
- category_id = lookupCategory(package.category)
+ def getCategoryID(self, package):
+ category_id = self.lookupCategory(package.category)
if (category_id == None):
category_id = 1
+ warning("DB: Got category ID '" + str(category_id) + "' for package '" + package.name + "'")
+ return category_id
+ def insert(self, package, locationId):
+ warning("DB: Inserting package: " + package.name)
global repo_dir
q = self.cursor()
q.execute("INSERT INTO Packages " +
"(Name, CategoryID, Version, FSPath, LocationID, Description, URL) VALUES ('" +
MySQLdb.escape_string(package.name) + "', " +
- str(category_id) + ", '" +
+ str(self.getCategoryID(package)) + ", '" +
MySQLdb.escape_string(package.new.version) + "', '" +
MySQLdb.escape_string(
os.path.join(repo_dir, os.path.basename(package.new.file))) + "', " +
@@ -80,6 +83,7 @@ class PackageDatabase:
q = self.cursor()
q.execute("UPDATE Packages SET " +
"Version = '" + MySQLdb.escape_string(package.new.version) + "', " +
+ "CategoryID = " + str(self.getCategoryID(package)) + ", " +
"FSPath = '" + MySQLdb.escape_string(
os.path.join(repo_dir, os.path.basename(package.new.file))) + "', " +
"Description = '" + MySQLdb.escape_string(str(package.desc)) + "', " +
@@ -187,8 +191,9 @@ def infoFromPackageFile(filename):
def infoFromPkgbuildFile(filename):
# first grab the category based on the file path
- directory = os.path.dirname(os.path.abspath(filename))
- m = re.match(r".*/([^/]+)$", directory)
+ pkgdirectory = os.path.dirname(filename)
+ catdirectory = os.path.dirname(pkgdirectory)
+ m = re.match(r".*/([^/]+)$", catdirectory)
if (m):
category = m.group(1)
else: