Skip to main content
Engineering LibreTexts

6.6: Kinds of Repositories

  • Page ID
    43824
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    Several kinds of repositories are supported by Monticello, each with different characteristics and uses. Repositories can be read-only, write-only or read-write. Access rights may be defined globally or can be tied to a particular user (as in SmalltalkHub, for example).

    HTTP. HTTP repositories are probably the most popular kind of repository since this is the kind supported by SmalltalkHub.

    The nice thing about HTTP repositories is that it is easy to link directly to specific versions from web sites. With a little configuration work on the HTTP server, HTTP repositories can be made browsable by ordinary web browsers, WebDAV clients, and so on.

    HTTP repositories may be used with an HTTP server other than SmalltalkHub. For example, a simple configuration1 turns Apache into a Monticello repository with restricted access rights:

    "My apache2 install worked as a Monticello repository right out of the box on my
    RedHat 7.2 server. For posterity's sake, here's all I had to add to my apache2 config:"
    Alias /monticello/ /var/monticello/
    <Directory /var/monticello>
        DAV on
        Options indexes
        Order allow,deny
        Allow from all
        AllowOverride None
        # Limit write permission to list of valid users.
        <LimitExcept GET PROPFIND OPTIONS REPORT>
            AuthName "Authorization Realm"
            AuthUserFile /etc/monticello-auth
            AuthType Basic
            Require valid-user
        </LimitExcept>
    </Directory>
    "This gives a world-readable, authorized-user-writable Monticello repository in
    /var/monticello. I created /etc/monticello-auth with htpasswd and off I went.
    I love Monticello and look forward to future improvements."
    

    FTP. This is similar to an HTTP repository, except that it uses an FTP server instead. An FTP server may also offer restricted access right and different FTP clients may be used to browse such a Monticello repository.

    GOODS. This repository type stores versions in a GOODS object database. GOODS is a fully distributed object-oriented database management system that uses an active client model2. It’s a read-write repository, so it makes a good “working” repository where versions can be saved and retreived. Because of the transaction support, journaling and replication capabilities offered by GOODS, it is suitable for large repositories used by many clients.

    Directory. A directory repository stores versions in a directory in the local file system. Since it requires very little work to set up, it’s handy for private projects. Because it requires no network connection, it’s the only option for disconnected development. The package-cache we have been using in the exercises for this chapter is an example of this kind of repository. Versions in a directory repository may be copied to a public or shared repository at a later time. SmalltalkHub supports this feature by allowing package versions (.mcz files) to be imported for a given project. Simply log in to SmalltalkHub, navigate to the project, and click on the Import Versions link.

    Directory with Subdirectories. A “directory with subdirectories” is very similar to “directory” except that it looks in subdirectories to retrieve lists of available packages. Instead of having a flat directory that contains all package versions, such as repository may be hierarchically structured with subdirectories.

    SMTP. SMTP repositories are useful for sending versions by mail. When creating an SMTP repository, you specify a destination email address. This could be the address of another developer — the package’s maintainer, for example — or a mailing list such as pharo-project. Any versions saved in such a repository will be emailed to that address. SMTP repositories are write-only.

    Programatically adding repositories. For particular purposes, it may be necessary to programmatically add new repositories. This happens when managing configurations and large set of distributed monticello packages or simply customizing the entries available in the Monticello browser. For example, the following code snippet programmatically adds new directory repositories

    {'/path/to/repositories/project-1/'.
    '/path/to/repositories/project-2/'.
    '/path/to/repositories/project-3/'. } do:
    [ :path |
        repo := MCDirectoryRepository new directory:
            (path asFileReference).
        MCRepositoryGroup default addRepository: repo ].
    

    Using SmalltalkHub

    SmalltalkHub is a online repository that you can use to store your Monticello packages. An instance is running and accessible from http://smalltalkhub.com/.

    SmalltalkHub.
    Figure \(\PageIndex{1}\): SmalltalkHub, the online Monticello code repository.

    \(\bigstar\) Use a web browser to visit the main page http://smalltalkhub.com/. When you select a project, you should see this kind of repository expression:

    MCHttpRepository
        location: 'http://smalltalkhub.com/mc/PharoExtras/Phexample/main'
        user: ''
        password: ''
    

    Add this repository to Monticello by clicking +Repository, and then selecting HTTP. Fill out the template with the URL corresponding to the project — you can copy the above repository expression from the web page and paste it into the template. Since you are not going to commit new versions of this package, you do not need to fill in the user and password. Open the repository, select the latest version of Phexample and click Load.

    Pressing the Join link on the SmalltalkHub home page will probably be your first step if you do not have a SmalltalkHub account. Once you are a member, + New Project allows you to create a new project.

    Configuring a SmalltalkHub repository.
    Figure \(\PageIndex{2}\): Repositories under SmalltalkHub are configurable.

    SmalltalkHub offers options (cf. Figure \(\PageIndex{2}\)) to configure a project repository: tags may be assigned, a license may be chosen with access for people who are not part of the project may be restricted (private, public), and users may be defined to be members of the project. You also can create a team that shares projects.


    1. http://www.visoracle.com/squeak/faq/monticello-1.html
    2. http://www.garret.ru/goods.html

    This page titled 6.6: Kinds of Repositories is shared under a CC BY-SA 3.0 license and was authored, remixed, and/or curated by Alexandre Bergel, Damien Cassou, Stéphane Ducasse, Jannik Laval (Square Bracket Associates) via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.