diff options
author | Carlo Landmeter <clandmeter@gmail.com> | 2015-03-24 10:11:48 +0000 |
---|---|---|
committer | Carlo Landmeter <clandmeter@gmail.com> | 2015-03-24 10:11:48 +0000 |
commit | ca35a3cf007265e2788c8c78df3e28f2917c89cd (patch) | |
tree | 25307d502b33a7fcfb9f518cc4934316cc10dc59 /apkcontent2sqlite.sh | |
parent | c54567b15f65ff7ba88ffa63233491772cb1ba59 (diff) | |
download | repo-scripts-ca35a3cf007265e2788c8c78df3e28f2917c89cd.tar.bz2 repo-scripts-ca35a3cf007265e2788c8c78df3e28f2917c89cd.tar.xz |
set script path and make csv generation more safe
Diffstat (limited to 'apkcontent2sqlite.sh')
-rwxr-xr-x | apkcontent2sqlite.sh | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/apkcontent2sqlite.sh b/apkcontent2sqlite.sh index e8d1f96..4efdb80 100755 --- a/apkcontent2sqlite.sh +++ b/apkcontent2sqlite.sh @@ -1,11 +1,13 @@ #!/bin/sh -packages="repository" -filelist="filelist" +path=$(readlink -f $0) +path=$(dirname $path) +packages="$path/repository" +filelist="$path/filelist" repos="main testing" archs="x86 x86_64 armhf" -db="db/filelist.db" -csv="csv/filelist.csv" +db="$path/db/filelist.db" +csv="$path/csv/filelist.csv" turbo_db="/var/www/aports-turbo/db/filelist.db" rsync="rsync://nl.alpinelinux.org/alpine/edge" @@ -32,7 +34,9 @@ update_filelist() { local file="${apk##*/}" if [ ! -e "$filelist/$repo/$arch/${file}.csv" ]; then create_apk_csv "$apk" "$repo" "$arch" >> \ - "$filelist/$repo/$arch/${file}.csv" + "$filelist/$repo/$arch/${file}.csv.tmp" + mv "$filelist/$repo/$arch/${file}.csv.tmp" \ + "$filelist/$repo/$arch/${file}.csv" result=1 fi done @@ -94,7 +98,7 @@ mv_db() { } update_apkindex() { - ./apkindex2sqlite.sh + $path/apkindex2sqlite.sh } # just do it |