source: main/trunk/package-kits/linux/repos/apt@ 29690

Last change on this file since 29690 was 29690, checked in by Jeremy Symon, 9 years ago

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

  • Property svn:executable set to *
File size: 1.6 KB
Line 
1#!/bin/sh
2
3. $(dirname $0)/conf.sh
4
5reprepro_check() {
6 cd $repos/apt/ || {
7 echo "Repository not found. Have you set it up?" >&2
8 exit 1
9 }
10 test -x `which reprepro` || {
11 echo "Must install reprepro to add packages" >&2
12 exit 1
13 }
14}
15
16help="Options:
17 setup
18 add </path/to/1.deb> ..."
19
20case $1 in
21 setup)
22 mkdir -p $repos || exit 1
23 echo
24 conf=$repos/apt/conf
25 echo "Making reprepro conf dir '$conf'"
26 mkdir -p $conf || exit 1
27 echo
28 if test -f $base/gpg.key.id; then
29 keyid=$(cat $base/gpg.key.id)
30 else
31 gpg --list-keys
32 echo "Enter the keyid of the GPG key to use:"
33 while test -z $keyid; do
34 echo -n "> "
35 read keyid
36 done
37 echo
38 fi
39 echo "Making reprepro distributions file"
40 echo "\
41Origin: $origin
42Label: $label
43Codename: $codename
44Architectures: $arch
45Components: main
46Description: $description
47SignWith: $keyid" | write $conf/distributions
48 echo
49 echo "Making reprepro options file"
50 echo "\
51verbose
52ask-passphrase" | write $conf/options
53 echo
54 echo "Making sources.list file"
55 echo "deb http://$domain/repos/apt $codename main" | write "$repos/apt/sources.list"
56 ;;
57 add)
58 reprepro_check
59 shift
60 reprepro includedeb $codename $@
61 ;;
62 -h|--help|help)
63 echo "$help"
64 ;;
65 *)
66 if test -z "$*"; then
67 echo "$help"
68 else
69 reprepro_check
70 reprepro $@
71 fi
72 ;;
73esac
Note: See TracBrowser for help on using the repository browser.