diff options
-rwxr-xr-x | db-sync | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -19,9 +19,11 @@ VERBOSE=${V} ${VERBOSE} && extra="-v" +WORKDIR=$(mktemp -dt "${0##*/}.XXXXXXXXXX") +trap "rm -rf -- $(printf '%q' "${WORKDIR}")" EXIT + # Returns contents of a repo get_repos() { - mkdir -p ${TMPDIR}/$0.$$.cache # Exclude everything but db files rsync ${extra} -mrtlH --no-p --include="*/" \ --include="*.db" \ @@ -30,7 +32,7 @@ get_repos() { --include="*${FILESEXT}" \ --exclude="*" \ --delete-after \ - rsync://${mirror}/${mirrorpath}/ ${TMPDIR}/$0.$$.cache + rsync://${mirror}/${mirrorpath}/ "$WORKDIR" } get_repo_content() { @@ -48,7 +50,7 @@ get_blacklist() { # repo # arch get_repo_file() { - echo "${TMPDIR}/$0.$$.cache/${1}/os/${2}/${1}" + echo "${WORKDIR}/${1}/os/${2}/${1}" } # Process the databases and get the libre packages @@ -118,7 +120,7 @@ init() { rsync ${extra} -rtlH \ --delay-updates \ --safe-links \ - ${TMPDIR}/$0.$$.cache/${_repo}/os/${_arch}/ \ + "${WORKDIR}/${_repo}/os/${_arch}/" \ ${FTP_BASE}/${_repo}/os/${_arch}/ # Cleanup @@ -188,5 +190,3 @@ trap 'trap_exit "$(gettext "Aborted by user! Exiting...")"' INT trap 'trap_exit "$(gettext "An unknown error has occurred. Exiting...")"' ERR init - -rm -r ${TMPDIR}/$0.$$.cache |