Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: /current, /current/src/db/, /current/src/db/postgres/, /current/src/db/pysqlite/, /current/src/db/shelf/

Project highlights: Stable Version: 1.6.1, Development Version: 1.7.6

current
Discussion topic

Back to topic list

CVS update: /current, /current/src/db/, /current/src/db/postgres/, /current/src/db/pysqlite/, /current/src/db/shelf/

Reply

Author jwbernin
Full name John Berninger
Date 2003-01-28 18:34:44 PST
Message User: jwbernin
Date: 03/01/28 18:34:44

Added
 /current
  testing.conf
 /current/src/db/
  Makefile, currentdb.py
 /current/src/db/postgres/
  Makefile
 /current/src/db/pysqlite/
  Makefile
 /current/src/db/shelf/
  Makefile

Log
 Adding straggler files from post-1.5.2 changes

File Changes:

Directory: /current/
====================

File [added]: testing.conf
Url: http://current.tigri​s.org/source/browse/​current/testing.conf​?rev=1.1&content​-type=text/x-cvsweb-​markup
Added lines: 53
---------------
# Example Current config file
#

[current]
db_type = shelf
db_connect = (what goes here???)

# db_type = postgresql
# db_connect = (host, database, user, password, opt, tty)

log_file = /var/log/httpd/current.log
apache_config_file = /etc/httpd/conf/curr​ent.httpd.conf
access_type = user
access_arg = apache
current_dir = /local/linux/current

#welcome_message = "Welcome to Hunter's up2date server."
#privacy_statement = "Privacy Statement for Hunter's up2date server"

# [redhat-7.3-i386]
# name = Red Hat Linux 7.3
# parent_channel =
# arch = i386
# os_release = 7.3
# description = Red Hat Linux 7.3
# srpm_check = 0
#
# rpm_dirs = /local/linux/redhat-​7.3/RedHat/RPMS
# /local/linux/redhat-​7.3/other-pkgs/rh-up​dates
# /local/linux/redhat-​7.3/other-pkgs/dulug​
# /local/linux/redhat-​7.3/other-pkgs/phy
# /local/linux/redhat-​7.3/other-pkgs/power​tools
# /local/linux/redhat-​7.3/other-pkgs/rawhi​de
#
# src_dirs = /local/linux/redhat-7.3/SRPMS
#
# # Note: since they are NOT included in valid_channels above, these channels
# # won't be created or used. They are just "live" doc.
#
# # The following is an example of what a sub-channel might look like.
# # You leave arch and os_release out of sub-channels, as they must match
# # the parent.
# [biology-7.1-i386]
# name = Duke Biology 7.1
# parent_channel = redhat-7.3-i386
# description = Duke Biology specific package will build upon Red Hat
# srpm_check = 0
#
# rpm_dirs = /local/linux/redhat-​7.3/i386/other-pkgs/​bio
# src_dirs =


## END OF LINE ##

Directory: /current/src/db/
===========================

File [added]: Makefile
Url: http://current.tigri​s.org/source/browse/​current/src/db/Makef​ile?rev=1.1&cont​ent-type=text/x-cvsw​eb-markup
Added lines: 33
---------------
#
# Makefile for installing the database package for current
#

MODULES = current_db __init__
PYFILES = $(addsuffix .py, $(MODULES))
OBJECTS = $(addsuffix .pyc, $(MODULES))

INSTALL_DIRS = $(DATA_DIR)/db

SUBDIRS = pysqlite shelf postgres


# default python rules:
%.pyc: %.py
    python -c "import py_compile; py_compile.compile('$<')"

all:: $(OBJECTS)

files: $(PYFILES)

install:: $(OBJECTS)
    $(INSTALL_DIR) $(INSTALL_ROOT)$(DATA_DIR)/db

    $(INSTALL_DATA) $(PYFILES) $(OBJECTS) $(INSTALL_ROOT)$(DATA_DIR)/db

clean::
    @rm -fv *.pyc *.pyo *~

# Now do the same in the subdirs
all install clean:: $(SUBDIRS)
    @for d in $(SUBDIRS) ; do $(MAKE) -C $$d $@ ; done


File [added]: currentdb.py
Url: http://current.tigri​s.org/source/browse/​current/src/db/curre​ntdb.py?rev=1.1&​content-type=text/x-​cvsweb-markup
Added lines: 72
---------------
""" A single "virtual" interface for all the storage needs.

The api modules (up2date, errata, etc) make calls into the CurrentDB - the
api modules have no knowledge of the storage method itself. Conversely,
CurrentDB knows nothing of xmlrpc, GET methods, or other delusions.

This file provides a "virtual" base class. Its basically the documentation
for what methods each backend class must support.

Copyright (c) 2002 Hunter Matthews Distributed under GPL.

"""

from logger import *

class CurrentDB:
    """ CurrentDB represents the entire data storage capability for
    current.

    This "virtual" class declares the required API and some universal
    helper functions.

    """

## API ##

    def __init__(self):
        """ Create a database object. """
        __api__ = 1

        pass


    def initdb(self, config):
        """ Create a new database.
    
        Called by the cinstall program, ONCE, per database.

        Config should be a dictionary of required keys (or something
        that acts like a dictionary).
        """
        
        # create the web dir, which is used by ALL the backends
        # side effect is to create the current dir if it doesn't exist
        web_dir = os.path.join(config[​'current_dir'], 'www')
        os.system("mkdir -p %s" % web_dir)


    def addRpmDir(self, dirname):
        """ Add an entire directory of rpms all at once """
    
        if not os.path.isdir(dirname):
            print "Warning: %s was not a valid dir" % dirname
            return
    
        for file in os.listdir(dirname):
            pathname = os.path.join(dirname, file)
            addRpmPackage(pathname)
    
    
    def addRpmPackage(self, pathname):
        """ Add a single Rpm to the channel. """
        
        # I thought this would be generic, but its not...
        pass


## HELPER FUNCTIONS - NOT PART OF THE CURRENTDB API ##

                    
## END OF LINE ##
                        

Directory: /current/src/db/postgres/
====================​================

File [added]: Makefile
Url: http://current.tigri​s.org/source/browse/​current/src/db/postg​res/Makefile?rev=1.1​&content-type=te​xt/x-cvsweb-markup
Added lines: 32
---------------
#
# Makefile for installing the database package for current
#

MODULES = __init__ postgres schema
PYFILES = $(addsuffix .py, $(MODULES))
OBJECTS = $(addsuffix .pyc, $(MODULES))

INSTALL_DIRS = $(DATA_DIR)/db/postgres

SUBDIRS =

# default python rules:
%.pyc: %.py
    python -c "import py_compile; py_compile.compile('$<')"

all:: $(OBJECTS)

files: $(PYFILES)

install:: $(OBJECTS)
    $(INSTALL_DIR) $(INSTALL_ROOT)$(D​ATA_DIR)/db/postgres​

    $(INSTALL_DATA) $(PYFILES) $(OBJECTS) $(INSTALL_ROOT)$(D​ATA_DIR)/db/postgres​

clean::
    @rm -fv *.pyc *.pyo *~

# Now do the same in the subdirs
all install clean:: $(SUBDIRS)
    @for d in $(SUBDIRS) ; do $(MAKE) -C $$d $@ ; done


Directory: /current/src/db/pysqlite/
====================​================

File [added]: Makefile
Url: http://current.tigri​s.org/source/browse/​current/src/db/pysql​ite/Makefile?rev=1.1​&content-type=te​xt/x-cvsweb-markup
Added lines: 32
---------------
#
# Makefile for installing the database package for current
#

MODULES = __init__ pysqlite schema
PYFILES = $(addsuffix .py, $(MODULES))
OBJECTS = $(addsuffix .pyc, $(MODULES))

INSTALL_DIRS = $(DATA_DIR)/db/pysqlite

SUBDIRS =

# default python rules:
%.pyc: %.py
    python -c "import py_compile; py_compile.compile('$<')"

all:: $(OBJECTS)

files: $(PYFILES)

install:: $(OBJECTS)
    $(INSTALL_DIR) $(INSTALL_ROOT)$(D​ATA_DIR)/db/pysqlite​

    $(INSTALL_DATA) $(PYFILES) $(OBJECTS) $(INSTALL_ROOT)$(D​ATA_DIR)/db/pysqlite​

clean::
    @rm -fv *.pyc *.pyo *~

# Now do the same in the subdirs
all install clean:: $(SUBDIRS)
    @for d in $(SUBDIRS) ; do $(MAKE) -C $$d $@ ; done


Directory: /current/src/db/shelf/
====================​=============

File [added]: Makefile
Url: http://current.tigri​s.org/source/browse/​current/src/db/shelf​/Makefile?rev=1.1​&content-type=text/​x-cvsweb-markup
Added lines: 32
---------------
#
# Makefile for installing the database package for current
#

MODULES = __init__ channel shelf
PYFILES = $(addsuffix .py, $(MODULES))
OBJECTS = $(addsuffix .pyc, $(MODULES))

INSTALL_DIRS = $(DATA_DIR)/db/shelf

SUBDIRS =

# default python rules:
%.pyc: %.py
    python -c "import py_compile; py_compile.compile('$<')"

all:: $(OBJECTS)

files: $(PYFILES)

install:: $(OBJECTS)
    $(INSTALL_DIR) $(INSTALL_ROOT)$(D​ATA_DIR)/db/shelf

    $(INSTALL_DATA) $(PYFILES) $(OBJECTS) $(INSTALL_ROOT)$(D​ATA_DIR)/db/shelf

clean::
    @rm -fv *.pyc *.pyo *~

# Now do the same in the subdirs
all install clean:: $(SUBDIRS)
    @for d in $(SUBDIRS) ; do $(MAKE) -C $$d $@ ; done





--------------------​--------------------​--------------------​---------
To unsubscribe, e-mail: cvs-unsubscribe@curr​ent.tigris.org
For additional commands, e-mail: cvs-help at current dot tigris dot org

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

CVS update: /current, /current/src/db/, /current/src/db/postgres/, /current/src/db/pysqlite/, /current/src/db/shelf/ jwbernin John Berninger 2003-01-28 18:34:44 PST
Messages per page: