5 print "Cannot import cx_Oracle:", e
8 pattern = re.compile(
"^CMSSW_(\d+)_(\d+)_(\d+|\D)(_pre(\d+)|_patch(\d+))?")
9 matching = pattern.match(release)
14 if(g[4]
is not None and g[4].isdigit()):
15 version = int(g[0]) * 1000000 + int(g[1]) * 10000 + int(g[2]) * 100 + int(g[4])
17 version = int(g[0]) * 1000000 + int(g[1]) * 10000 + int(g[2]) * 100
19 version = int(g[0]) * 1000000 + int(g[1]) * 10000 +9999
20 if(version
is not None):
28 curs = self.conn.cursor()
29 sqlstr =
"CREATE TABLE VERSION_TABLE (ID NUMBER, RELEASE VARCHAR2(50), ARCH VARCHAR2(30), PATH VARCHAR(255), CONSTRAINT PK_ID PRIMARY KEY(RELEASE, ARCH) )"
32 print 'REFERENCE RELEASE TABLE CREATED'
34 curs = self.conn.cursor()
35 sqlstr =
"DROP TABLE VERSION_TABLE"
38 print 'REFERENCE RELEASE TABLE DROPPED'
40 curs = self.conn.cursor()
41 sqlstr =
"DELETE FROM VERSION_TABLE WHERE RELEASE = :rel AND ARCH = :arc"
43 curs.execute(sqlstr, rel = release, arc = arch)
45 print 'RELEASE ENTRY DELETED'
47 curs = self.conn.cursor()
48 sqlstr =
"SELECT ID, RELEASE, ARCH, PATH FROM VERSION_TABLE ORDER BY ID, RELEASE, ARCH"
51 print 'ID RELEASE ARCH PATH'
55 curs = self.conn.cursor()
57 print "relID "+str(relID)
58 sqlstr =
"INSERT INTO VERSION_TABLE(ID, RELEASE, ARCH, PATH) VALUES(:rid, :rel, :arc, :pat)"
59 curs.execute(sqlstr, rid = relID, rel = release, arc = arch, pat = path)
61 print 'RELEASE ENTRY ADDED.'
64 curs = self.conn.cursor()
65 sqlstr =
"SELECT RELEASE, ARCH, PATH FROM VERSION_TABLE WHERE ID < :rid"
67 curs.execute(sqlstr, rid = relID)
70 r = ( row[0], row[1], row[2] )
perl if(1 lt scalar(@::datatypes))