melpa/melpa

75 lines
1.4 KiB
Text
Raw Normal View History

2011-12-11 00:53:39 +00:00
#!/bin/bash
2011-12-14 03:04:08 +00:00
BASEDIR=`dirname $0`
2011-12-11 00:53:39 +00:00
function melpa_update_epkgs {
echo "Updating epkgs..."
2011-12-14 03:04:08 +00:00
pushd ${BASEDIR}/epkgs
2011-12-11 00:53:39 +00:00
git pull
2011-12-14 03:04:08 +00:00
popd
2011-12-11 00:53:39 +00:00
echo
}
2011-12-14 03:04:08 +00:00
function melpa_clear_packages {
echo "*** Clearing the packages folder..."
rm $BASEDIR/packages/*
2011-12-11 00:53:39 +00:00
echo
}
function melpa_build_pkglist {
echo "*** Building all packages..."
2011-12-14 03:04:08 +00:00
pushd ${BASEDIR}
for pkg in `cat pkglist`; do
echo "Building package: $pkg"
./buildpkg $pkg
echo
echo
2011-12-11 00:53:39 +00:00
done
2011-12-14 03:04:08 +00:00
popd
2011-12-11 00:53:39 +00:00
echo
}
function melpa_build_archive {
echo "Building package: $pkg"
emacs --batch -l package-build.el -u dcurtis --eval "(package-build-archive \"$1\")"
echo
}
function melpa_sync {
echo "*** Pushing changes to the server..."
2011-12-14 03:04:08 +00:00
rsync -avz --delete packages webpage/index.html milkbox.net:webapps/melpa/
2011-12-11 00:53:39 +00:00
echo
}
function melpa_generate_html {
echo "*** Building webpage..."
2011-12-14 03:04:08 +00:00
pushd ${BASENAME}/webpage
2011-12-11 00:53:39 +00:00
awk '{ if(/<!--list-of-packages-->/)
2011-12-13 14:22:02 +00:00
while((getline < "../pkglist")>0)
2011-12-11 00:53:39 +00:00
print "* " $0
else print}' index.tmpl > index.md
2011-12-13 14:22:02 +00:00
pandoc -s --mathml -t html --smart index.md > index.html
2011-12-14 03:04:08 +00:00
popd
2011-12-11 00:53:39 +00:00
echo
}
2011-12-14 03:04:08 +00:00
args=$@
if [[ "$#" == "0" ]]; then
args="update clear build html sync"
fi
for task in $args; do
case $task in
update ) melpa_update_epkgs ;;
clear ) melpa_clear_packages ;;
build ) melpa_build_pkglist ;;
html ) melpa_generate_html ;;
sync ) melpa_sync ;;
esac
shift
done
2011-12-11 00:53:39 +00:00