,'WHERE version IN (SELECT max(version) FROM database_versions)'))[[1]]))
}
+db_get_base_epoch <- function() {
+ con <- db_start()
+ v <- db_base_epoch(con)
+ db_stop(con)
+ return(v)
+}
+
db_add_version <- function(con, version, epoch) {
dbGetQuery(con,paste('INSERT INTO database_versions (version,version_date,base_epoch)'
,'VALUES (',as.integer(version),',',db_now(),',',as.integer(epoch),')'))
-version_new <- function(rver,debian_revision=1, debian_epoch=0) {
+version_new <- function(rver,debian_revision=1, debian_epoch=db_get_base_epoch()) {
# generate a string representation of the Debian version of an
# R version of a package
pkgver = rver
return(as.integer(sub('^([0-9]+):.*','\\1',pkgver)))
}
# version_epoch . version_new(x,y) = id
-# version_epoch(version_new(x,y)) = 0
+# version_epoch(version_new(x,y)) = base_epoch
version_revision <- function(pkgver) {
# return the Debian revision of a Debian package version