Created
August 19, 2012 06:36
-
-
Save ato/3392757 to your computer and use it in GitHub Desktop.
clojars data feed scripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Clojars data feeds. This needs integrating into current master branch. | |
# See: https://github.com/ato/clojars-web/blob/no-db/src/clojars/feed.clj | |
# | |
set -e | |
cd /home/clojars/repo | |
find . -name '*.pom' | grep -v '/\.' | sort > all-poms.txt.new | |
cat all-poms.txt.new | gzip > all-poms.txt.gz.new | |
python /home/ato/list_artifacts.py < all-poms.txt.new | uniq | tee all-jars.clj.new | gzip > all-jars.clj.gz.new | |
mkdir -p ../tmp | |
java -cp ../tmp/c2/src:../bin/clojars2-standalone.jar clojars.feed /home/clojars/repo ../tmp 2> /dev/null | |
mv all-poms.txt.new all-poms.txt | |
mv all-poms.txt.gz.new all-poms.txt.gz | |
mv all-jars.clj.new all-jars.clj | |
mv all-jars.clj.gz.new all-jars.clj.gz | |
mv ../tmp/feed.clj.gz . | |
md5sum feed.clj.gz > feed.clj.gz.md5.new | |
mv feed.clj.gz.md5{.new,} | |
sha1sum feed.clj.gz > feed.clj.gz.sha1.new | |
mv feed.clj.gz.sha1{.new,} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os, sys | |
for line in sys.stdin: | |
line = line.strip() | |
bits = line.split('/') | |
version = bits[-2] | |
jarname = bits[-3] | |
group = '.'.join(bits[1:-3]) | |
if group != jarname: | |
print '[' + group + '/' + jarname, '"' + version + '"]' | |
else: | |
print '[' + jarname, '"' + version + '"]' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment