Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 100 lines (77 sloc) 1.686 kB
9178c83 @milkypostman Merge everything.
milkypostman authored
1 #!/bin/bash
2
63213c4 @milkypostman Completion of reorganization.
milkypostman authored
3 BASEDIR=`dirname $0`
4
2d6dcf4 @milkypostman Further updates to directory changing problems.
milkypostman authored
5 cd ${BASEDIR} || exit 1
6
9178c83 @milkypostman Merge everything.
milkypostman authored
7 function melpa_update_epkgs {
8 echo "Updating epkgs..."
2d6dcf4 @milkypostman Further updates to directory changing problems.
milkypostman authored
9 cd epkgs || return 1
9178c83 @milkypostman Merge everything.
milkypostman authored
10 git pull
2d6dcf4 @milkypostman Further updates to directory changing problems.
milkypostman authored
11 cd ..
9178c83 @milkypostman Merge everything.
milkypostman authored
12 echo
13 }
14
63213c4 @milkypostman Completion of reorganization.
milkypostman authored
15 function melpa_clear_packages {
16 echo "*** Clearing the packages folder..."
7d8563f @milkypostman Fixed bug in deleting packages.
milkypostman authored
17 rm packages/*
9178c83 @milkypostman Merge everything.
milkypostman authored
18 echo
19 }
20
21
22 function melpa_build_pkglist {
23 echo "*** Building all packages..."
56a5161 @milkypostman fix melpa script to use buildlist file
milkypostman authored
24 for pkg in `cat buildlist`; do
63213c4 @milkypostman Completion of reorganization.
milkypostman authored
25 ./buildpkg $pkg
26 echo
27 echo
9178c83 @milkypostman Merge everything.
milkypostman authored
28 done
29 echo
30 }
31
32 function melpa_build_archive {
33 echo "Building package: $pkg"
34 emacs --batch -l package-build.el -u dcurtis --eval "(package-build-archive \"$1\")"
35 echo
36 }
37
38 function melpa_sync {
39 echo "*** Pushing changes to the server..."
63213c4 @milkypostman Completion of reorganization.
milkypostman authored
40 rsync -avz --delete packages webpage/index.html milkbox.net:webapps/melpa/
9178c83 @milkypostman Merge everything.
milkypostman authored
41 echo
42 }
43
44 function melpa_generate_html {
45 echo "*** Building webpage..."
2d6dcf4 @milkypostman Further updates to directory changing problems.
milkypostman authored
46 cd webpage || return 1
9a2e122 @milkypostman Fix the index update process
milkypostman authored
47 erb index.erb > index.md
8211113 @milkypostman Webpage published.
milkypostman authored
48 pandoc -s --mathml -t html --smart index.md > index.html
2d6dcf4 @milkypostman Further updates to directory changing problems.
milkypostman authored
49 cd ..
9178c83 @milkypostman Merge everything.
milkypostman authored
50 echo
51 }
52
be8ed00 @milkypostman Better option handling.
milkypostman authored
53 function print_usage {
54 echo "usage: $0 [-h | -?] [update | clear | build | html | sync]"
55 }
56
57 args=`getopt h $*`
58 errcode=$?
59
60 if [[ "$errcode" > 0 ]]; then
61 print_usage
62 exit $errcode
63 fi
64
65 set -- $args
66
67 for i; do
68 case "$i" in
d6811f8 @milkypostman error with the pattern matching ?
milkypostman authored
69 -h | -\?) print_usage
be8ed00 @milkypostman Better option handling.
milkypostman authored
70 shift
71 exit
72 ;;
73 --) shift
74 break
75 ;;
76 esac
77 done
78
63213c4 @milkypostman Completion of reorganization.
milkypostman authored
79
80 if [[ "$#" == "0" ]]; then
be8ed00 @milkypostman Better option handling.
milkypostman authored
81 set -- update clear build index sync
63213c4 @milkypostman Completion of reorganization.
milkypostman authored
82 fi
83
be8ed00 @milkypostman Better option handling.
milkypostman authored
84 for i; do
85 case $i in
63213c4 @milkypostman Completion of reorganization.
milkypostman authored
86 update ) melpa_update_epkgs ;;
87 clear ) melpa_clear_packages ;;
88 build ) melpa_build_pkglist ;;
b1d3db4 @milkypostman Fix problems with changing directories.
milkypostman authored
89 html | index ) melpa_generate_html ;;
90 sync ) melpa_sync ;;
63213c4 @milkypostman Completion of reorganization.
milkypostman authored
91 esac
92 shift
93 done
94
be8ed00 @milkypostman Better option handling.
milkypostman authored
95 exit 1
96
97
98
9178c83 @milkypostman Merge everything.
milkypostman authored
99
Something went wrong with that request. Please try again.