summaryrefslogtreecommitdiffstats
path: root/apkindex2sqlite.sh
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@gmail.com>2015-03-24 10:11:48 +0000
committerCarlo Landmeter <clandmeter@gmail.com>2015-03-24 10:11:48 +0000
commitca35a3cf007265e2788c8c78df3e28f2917c89cd (patch)
tree25307d502b33a7fcfb9f518cc4934316cc10dc59 /apkindex2sqlite.sh
parentc54567b15f65ff7ba88ffa63233491772cb1ba59 (diff)
downloadrepo-scripts-ca35a3cf007265e2788c8c78df3e28f2917c89cd.tar.bz2
repo-scripts-ca35a3cf007265e2788c8c78df3e28f2917c89cd.tar.xz
set script path and make csv generation more safe
Diffstat (limited to 'apkindex2sqlite.sh')
-rwxr-xr-xapkindex2sqlite.sh11
1 files changed, 6 insertions, 5 deletions
diff --git a/apkindex2sqlite.sh b/apkindex2sqlite.sh
index bbceb27..c865a03 100755
--- a/apkindex2sqlite.sh
+++ b/apkindex2sqlite.sh
@@ -1,10 +1,12 @@
#!/bin/sh
-packages="repository"
+path=$(readlink -f $0)
+path=$(dirname $path)
+packages="$path/repository"
repos="main testing"
archs="x86 x86_64 armhf"
-db="db/apkindex.db"
-csv="csv/apkindex.csv"
+db="$path/db/apkindex.db"
+csv="$path/csv/apkindex.csv"
turbo_db="/var/www/aports-turbo/db/apkindex.db"
read_line() {
@@ -64,8 +66,7 @@ rm -f $csv
for repo in $repos; do
for arch in $archs; do
- rm -f /tmp/APKINDEX
- #curl -s "$aports/$repo/$arch/APKINDEX.tar.gz" | tar -zx -C /tmp APKINDEX
+ rm -f /tmp/APKINDEX
tar -C /tmp -zxf $packages/$repo/$arch/APKINDEX.tar.gz APKINDEX
IFS=$'\n'
while read line; do