aboutsummaryrefslogtreecommitdiff
path: root/trunk/src/repos
blob: 191af44f69637f8e74ad7777aa1860868fbc0156 (plain)
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/bin/bash
#
# repos script got from
# http://software.jaos.org/BUILD/slapt-get/FAQ.html#slgFAQ17
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# any later version.
#
# Changes by rhatto at riseup.net to fit http://slack.sarava.org needs
#
# TODO: - config file options
#       - integration with binary repository
#       - package's and CHECKSUMS.md5 signature creation
#

BASENAME="`basename $0`"
REPOS_CONF="/etc/simplepkg/repos.conf"
COMMON="/usr/libexec/simplepkg/common.sh"

if [ -f "$COMMON" ]; then
  source $COMMON
else
  echo "error: file $COMMON found, check your $BASENAME installation"
  exit 1
fi

function usage {

  echo "`basename $0` [pkg [file]|all|new|svnmeta|PACKAGESTXT|FILELIST|MD5]"

}

function do_all {

  for pkg in `find . -type f -name '*.tgz' -print`; do
    gen_meta $pkg
  done
  $0 PACKAGESTXT
  $0 FILELIST
  $0 MD5

}

# ---------------------------------
#              main
# ---------------------------------

case "$1" in
  pkg)
      if [ -n "$2" ]; then
        gen_meta $2
      else
        usage
      fi
    ;;
    all)
      do_all
    ;;
    new)
      for pkg in `find . -type f -name '*.tgz' -print`; do
        if [ ! -f ${pkg%tgz}meta ]; then
          gen_meta $pkg
        fi
      done
    ;;
    svnmeta)
      svn_add_meta
    ;;
    PACKAGESTXT)
      gen_packages_txt
    ;;
    FILELIST)
      gen_filelist
    ;;
    MD5)
      gen_md5_checksums
    ;;
    usage)
      usage
    ;;
    *)
      do_all
      svn_add_meta
    ;;
esac