diff options
author | Nicolás Reynolds <fauno@kiwwwi.com.ar> | 2011-11-23 13:43:04 -0300 |
---|---|---|
committer | Nicolás Reynolds <fauno@kiwwwi.com.ar> | 2011-11-23 13:43:04 -0300 |
commit | 4a31562deb872713acae3d17f0f638edd0c4158e (patch) | |
tree | e92cbb514fe405056d8ecbc1f6a13bad1c90279a | |
parent | ee7bba114de818df23196edb7d0d785217b7a332 (diff) |
Fixed errors in logic
-rwxr-xr-x | db-cleanup | 8 | ||||
-rwxr-xr-x | db-sync | 10 |
2 files changed, 9 insertions, 9 deletions
@@ -28,8 +28,8 @@ trap 'trap_exit "$(gettext "An unknown error has occurred. Exiting...")"' ERR ${CLEANUP_DRYRUN} && EXTRAFLAGS+=" --dry-run" -for _repo in ${ARCHREPOS[@]}; do - for _arch in ${ARCHARCHES[@]}; do +for _repo in ${PKGREPOS[@]}; do + for _arch in ${ARCHES[@]}; do msg "Getting ${_repo}-${_arch} database" dbfile="${FTP_BASE}/${_repo}/os/${_arch}/${_repo}${DBEXT}" @@ -43,7 +43,7 @@ for _repo in ${ARCHREPOS[@]}; do bsdtar tf "${dbfile}" | \ cut -d'/' -f1 | \ sort -u | \ - sed "s|$|*|" >> /tmp/$0.$PID.filter + sed "s|$|*|" >> /tmp/$0.$$.filter done done @@ -54,7 +54,7 @@ for POOL in ${PKGPOOLS[@]} ${SRCPOOLS[@]}; do msg2 "${POOL}" rsync ${EXTRAFLAGS} -va --delete-excluded \ - --include-from="${dbfile}" \ + --include-from="/tmp/$0.$$.filter" \ --exclude="*" \ ${FTP_BASE}/${POOL}/ \ ${FTP_BASE}/${POOL}/ @@ -18,14 +18,14 @@ # Returns contents of a repo get_repos() { - mkdir -p ${TMPDIR}/${PID}.cache + mkdir -p ${TMPDIR}/$0.$$.cache # Exclude everything but db files rsync -vmrtlH --no-p --include="*/" \ --include="*.db" \ --include="*${DBEXT}" \ --exclude="*" \ --delete-after \ - rsync://${mirror}/${mirrorpath}/ ${TMPDIR}/${PID}.cache + rsync://${mirror}/${mirrorpath}/ ${TMPDIR}/$0.$$.cache } get_repo_content() { @@ -45,7 +45,7 @@ get_blacklist() { get_repo_file() { # shopt -s nullglob - echo "${TMPDIR}/${PID}.cache/${1}/os/${2}/${1}${DBEXT}" + echo "${TMPDIR}/$0.$$.cache/${1}/os/${2}/${1}${DBEXT}" } # Process the databases and get the libre packages @@ -104,7 +104,7 @@ init() { rsync -vrtlH \ --delay-updates \ --safe-links \ - ${TMPDIR}/${PID}.cache/${_repo}/os/${_arch}/ \ + ${TMPDIR}/$0.$$.cache/${_repo}/os/${_arch}/ \ ${FTP_BASE}/${_repo}/os/${_arch}/ # Cleanup @@ -175,4 +175,4 @@ trap 'trap_exit "$(gettext "An unknown error has occurred. Exiting...")"' ERR init -rm -r ${TMPDIR}/${PID}.cache +rm -r ${TMPDIR}/$0.$$.cache |