root/main/trunk/package-kits/linux/repos/conf.sh @ 29690

Revision 29690, 0.6 KB (checked in by jts21, 5 years ago)

Created repos folder. This folder contains scripts for managing package repositories for different package managers

Line 
1origin="Greenstone"
2label="greenstone"
3codename="greenstone"
4domain="greenstone.org"
5arch="i386 amd64 source"
6description="Apt repository for Greenstone packages"
7base=$(dirname $0)
8repos=$base/repos
9
10y() {
11    echo "$@? [y|n]..." >&2
12    echo -n "> " >&2
13    read cho
14    test "$cho" = "y" -o "$cho" = "Y"
15    return $?
16}
17
18get() {
19    echo "$1? [$2]..." >&2
20    echo -n "> " >&2
21    read cho
22    test -z $cho && {
23        cho=$2
24        echo "Set to default '$cho'" >&2
25    }
26    echo $cho
27}
28
29write() {
30    file=$1
31    if touch $file 2>/dev/null; then
32        cat - > $file
33    else
34        cat - | sudo tee $file
35    fi
36}
Note: See TracBrowser for help on using the browser.