Tag Archives: repository

Ubuntu: Create own repository

mkdir -p /opt/repository/ubuntu/
mkdir -p /opt/repository/ubuntu/{conf,dists,incoming,indices,logs,pool,project,tmp}
cd /opt/repository/ubuntu/
vim conf/distributions

1
2
3
4
5
6
7
Origin: packages.localdomain                                                                                                                                      
Label: My Own Repository                                                                                                                                          
Codename: precise                                                                                                                                            
Architectures: amd64                                                                                                                                          
Components: main
Description: Allods Team repository
Version: 12.04

Codename should contain name of OS branch.

First initializing of repository:
Continue reading Ubuntu: Create own repository

Script for downloading repositories from redmine

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
This script may be like a [b]template[/b] for you.
I've used it for downloading git projects from redmine's storage.
Before starting that script you have to authorize on the resource and save cookies in the file.


#!/bin/bash
URLBASE='https://domaint.tld/projects/1/repository/sql/revisions/master/raw/'
debug=0

# Function parses page and greps files names for next downloading
# This function get 1 parameter as a name of folder in which it'll download files
# Btw, this folder will be in the parent folder of that
function getfiles {
    for file in `egrep -o 'changes/.*\?rev=master\" ' index.html|sed -e 's/changes\///g' | sed -e 's/\?rev=master\"\ //g'`
    do
        echo $file
        echo "$URLBASE/$file"
        wget --no-check-certificate --load-cookies cookies-redmine.txt $URLBASE/$file -P ../$1
    done
}

# Function parses page and greps folders names for next downloading files in them.
function getfolders {
    for folder in `egrep -o 'show.*/?depth=1' index.html|sed -e 's/show\///g'|sed -e 's/\?depth=1//g'`
    do
        echo $folder
        mkdir -p ../$folder
        rm -rf index.html
        URL="$URLBASE"
        URL="$URL/$folder"
        wget --no-check-certificate --load-cookies cookies-redmine.txt $URL/
        if [ "$debug" == "1" ]; then
            exit
        fi
                #change this option to 1 for exit on the next turn, but before removing index.html
        debug=0
        getfiles $folder
        getfolders
    done
}

#Get listing of '/'
rm -rf index.html
mkdir -p ../$1
wget --no-check-certificate --load-cookies cookies-redmine.txt $URLBASE/$1/
getfiles $1
getfolders