mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fixed bugs in tupkgupdate
made link to CVS for package files in community go to CURRENT tag
This commit is contained in:
parent
108dc557ba
commit
b78a20c335
2 changed files with 16 additions and 7 deletions
|
@ -55,17 +55,20 @@ class PackageDatabase:
|
||||||
row = q.fetchone()
|
row = q.fetchone()
|
||||||
return row[0]
|
return row[0]
|
||||||
return None
|
return None
|
||||||
def insert(self, package, locationId):
|
def getCategoryID(self, package):
|
||||||
warning("DB: Inserting package: " + package.name)
|
category_id = self.lookupCategory(package.category)
|
||||||
category_id = lookupCategory(package.category)
|
|
||||||
if (category_id == None):
|
if (category_id == None):
|
||||||
category_id = 1
|
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
|
global repo_dir
|
||||||
q = self.cursor()
|
q = self.cursor()
|
||||||
q.execute("INSERT INTO Packages " +
|
q.execute("INSERT INTO Packages " +
|
||||||
"(Name, CategoryID, Version, FSPath, LocationID, Description, URL) VALUES ('" +
|
"(Name, CategoryID, Version, FSPath, LocationID, Description, URL) VALUES ('" +
|
||||||
MySQLdb.escape_string(package.name) + "', " +
|
MySQLdb.escape_string(package.name) + "', " +
|
||||||
str(category_id) + ", '" +
|
str(self.getCategoryID(package)) + ", '" +
|
||||||
MySQLdb.escape_string(package.new.version) + "', '" +
|
MySQLdb.escape_string(package.new.version) + "', '" +
|
||||||
MySQLdb.escape_string(
|
MySQLdb.escape_string(
|
||||||
os.path.join(repo_dir, os.path.basename(package.new.file))) + "', " +
|
os.path.join(repo_dir, os.path.basename(package.new.file))) + "', " +
|
||||||
|
@ -80,6 +83,7 @@ class PackageDatabase:
|
||||||
q = self.cursor()
|
q = self.cursor()
|
||||||
q.execute("UPDATE Packages SET " +
|
q.execute("UPDATE Packages SET " +
|
||||||
"Version = '" + MySQLdb.escape_string(package.new.version) + "', " +
|
"Version = '" + MySQLdb.escape_string(package.new.version) + "', " +
|
||||||
|
"CategoryID = " + str(self.getCategoryID(package)) + ", " +
|
||||||
"FSPath = '" + MySQLdb.escape_string(
|
"FSPath = '" + MySQLdb.escape_string(
|
||||||
os.path.join(repo_dir, os.path.basename(package.new.file))) + "', " +
|
os.path.join(repo_dir, os.path.basename(package.new.file))) + "', " +
|
||||||
"Description = '" + MySQLdb.escape_string(str(package.desc)) + "', " +
|
"Description = '" + MySQLdb.escape_string(str(package.desc)) + "', " +
|
||||||
|
@ -187,8 +191,9 @@ def infoFromPackageFile(filename):
|
||||||
|
|
||||||
def infoFromPkgbuildFile(filename):
|
def infoFromPkgbuildFile(filename):
|
||||||
# first grab the category based on the file path
|
# first grab the category based on the file path
|
||||||
directory = os.path.dirname(os.path.abspath(filename))
|
pkgdirectory = os.path.dirname(filename)
|
||||||
m = re.match(r".*/([^/]+)$", directory)
|
catdirectory = os.path.dirname(pkgdirectory)
|
||||||
|
m = re.match(r".*/([^/]+)$", catdirectory)
|
||||||
if (m):
|
if (m):
|
||||||
category = m.group(1)
|
category = m.group(1)
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -323,7 +323,11 @@ function package_details($id=0) {
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
print "<tr>\n";
|
print "<tr>\n";
|
||||||
print " <td colspan='2'><span class='f3'>";
|
print " <td colspan='2'><span class='f3'>";
|
||||||
print "<a href='".$row['URLPath']."'>Tarball</a> :: <a href='".dirname($row['URLPath'])."/".$row['Name']."'>Files</a></span></td>";
|
if ($row["LocationID"] == 2) {
|
||||||
|
print "<a href='".$row['URLPath']."'>Tarball</a> :: <a href='".dirname($row['URLPath'])."/".$row['Name']."'>Files</a></span></td>";
|
||||||
|
} elseif ($row["LocationID"] == 3) {
|
||||||
|
print "<a href='http://cvs.archlinux.org/cgi-bin/viewcvs.cgi/" . $row["Category"] . "/" . $row["Name"] . "/?cvsroot=AUR&only_with_tag=CURRENT'>CVS</td>";
|
||||||
|
}
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
print "<tr>\n";
|
print "<tr>\n";
|
||||||
print " <td colspan='2'><img src='/images/pad.gif' height='30'></td>";
|
print " <td colspan='2'><img src='/images/pad.gif' height='30'></td>";
|
||||||
|
|
Loading…
Add table
Reference in a new issue