Lines 18-24
PORTDIR="${f%%|*}" ; f="${f#*|}"
Link Here
|
18 |
FETCHCOMMAND="${f%%|*}" ; f="${f#*|}" |
18 |
FETCHCOMMAND="${f%%|*}" ; f="${f#*|}" |
19 |
USERLAND="${f%%|*}" ; f="${f#*|}" |
19 |
USERLAND="${f%%|*}" ; f="${f#*|}" |
20 |
DISTDIR="${f%%|*}" ; f="${f#*|}" |
20 |
DISTDIR="${f%%|*}" ; f="${f#*|}" |
21 |
TMPDIR="${f%%|*}/snapshots" |
21 |
TMPDIR="$(mktemp -d "${f%%|*}"/delta-webrsync-XXXXXX)" |
22 |
unset IFS |
22 |
unset IFS |
23 |
|
23 |
|
24 |
source /usr/lib/portage/bin/isolated-functions.sh || exit 1 |
24 |
source /usr/lib/portage/bin/isolated-functions.sh || exit 1 |
Lines 72-80
fi
Link Here
|
72 |
if [[ ! -d $DISTDIR ]] ; then |
72 |
if [[ ! -d $DISTDIR ]] ; then |
73 |
mkdir -p $DISTDIR |
73 |
mkdir -p $DISTDIR |
74 |
fi |
74 |
fi |
75 |
if [[ ! -d $TMPDIR ]]; then |
|
|
76 |
mkdir -p $TMPDIR |
77 |
fi |
78 |
|
75 |
|
79 |
cd "$DISTDIR" |
76 |
cd "$DISTDIR" |
80 |
|
77 |
|
Lines 429-447
else
Link Here
|
429 |
fi |
426 |
fi |
430 |
fi |
427 |
fi |
431 |
|
428 |
|
432 |
# generate tmp dir. |
|
|
433 |
TEMPDIR=$(mktemp -d /tmp/delta-webrsync-XXXXXX) |
434 |
# got our patches. |
429 |
# got our patches. |
435 |
if ! patcher -v "${dfile}" ${patches} "${TEMPDIR}/portage-${final_date}.tar"; then |
430 |
if ! patcher -v "${dfile}" ${patches} "${TMPDIR}/portage-${final_date}.tar"; then |
436 |
echo "reconstruction failed (contact the author with the error from the reconstructor please)" |
431 |
echo "reconstruction failed (contact the author with the error from the reconstructor please)" |
437 |
rm "${TEMPDIR}/portage-${final_date}.tar" |
432 |
rm "${TMPDIR}/portage-${final_date}.tar" |
438 |
rmdir ${TEMPDIR} |
433 |
rmdir ${TMPDIR} |
439 |
full_version_attempt |
434 |
full_version_attempt |
440 |
fi |
435 |
fi |
441 |
verified=0 |
436 |
verified=0 |
442 |
if [[ -n $got_umd5 ]]; then |
437 |
if [[ -n $got_umd5 ]]; then |
443 |
echo "verifying uncompressed md5" |
438 |
echo "verifying uncompressed md5" |
444 |
if ! verify_md5_file "${TEMPDIR}/portage-${final_date}.tar" "${DISTDIR}/portage-${final_date}.tar.bz2.umd5sum"; then |
439 |
if ! verify_md5_file "${TMPDIR}/portage-${final_date}.tar" "${DISTDIR}/portage-${final_date}.tar.bz2.umd5sum"; then |
445 |
echo "uncompressed verification failed. This means either you found a bug in diffball, or something odd is going on" |
440 |
echo "uncompressed verification failed. This means either you found a bug in diffball, or something odd is going on" |
446 |
echo "with upstream patch generation" |
441 |
echo "with upstream patch generation" |
447 |
echo "trying md5sum next, which probably will fail." |
442 |
echo "trying md5sum next, which probably will fail." |
Lines 454-475
unset need_last_sync
Link Here
|
454 |
if [ "$verified" == "1" ]; then |
449 |
if [ "$verified" == "1" ]; then |
455 |
echo "recompressing. (backgrounding)" |
450 |
echo "recompressing. (backgrounding)" |
456 |
need_last_sync="dar" |
451 |
need_last_sync="dar" |
457 |
bzip2 -vk9 "${TEMPDIR}/portage-${final_date}.tar" & |
452 |
bzip2 -vk9 "${TMPDIR}/portage-${final_date}.tar" & |
458 |
|
453 |
|
459 |
echo "beginning update to the tree" |
454 |
echo "beginning update to the tree" |
460 |
sync_local "${TEMPDIR}/portage-${final_date}.tar" |
455 |
sync_local "${TMPDIR}/portage-${final_date}.tar" |
461 |
echo "doing final md5 stuff" |
456 |
echo "doing final md5 stuff" |
462 |
wait |
457 |
wait |
463 |
# bzip2 is finished now. |
458 |
# bzip2 is finished now. |
464 |
rm "${TEMPDIR}/portage-${final_date}.tar" |
459 |
rm "${TMPDIR}/portage-${final_date}.tar" |
465 |
else |
460 |
else |
466 |
echo "recompressing." |
461 |
echo "recompressing." |
467 |
bzip2 -v9 "${TEMPDIR}/portage-${final_date}.tar.bz2" |
462 |
bzip2 -v9 "${TMPDIR}/portage-${final_date}.tar.bz2" |
468 |
fi |
463 |
fi |
469 |
|
464 |
|
470 |
echo "verifying generated tarball" |
465 |
echo "verifying generated tarball" |
471 |
|
466 |
|
472 |
if ! verify_md5_file "${TEMPDIR}/portage-${final_date}.tar.bz2" "${DISTDIR}/portage-${final_date}.tar.bz2.md5sum"; then |
467 |
if ! verify_md5_file "${TMPDIR}/portage-${final_date}.tar.bz2" "${DISTDIR}/portage-${final_date}.tar.bz2.md5sum"; then |
473 |
if [[ -z $verified ]]; then |
468 |
if [[ -z $verified ]]; then |
474 |
echo "couldn't verify the generated tarball. bug, most likely." |
469 |
echo "couldn't verify the generated tarball. bug, most likely." |
475 |
exit 5 |
470 |
exit 5 |
Lines 478-498
if ! verify_md5_file "${TEMPDIR}/portage
Link Here
|
478 |
echo "compressed md5 differs, but uncompressed md5 says it right. bzip2 version incompatability in other words" |
473 |
echo "compressed md5 differs, but uncompressed md5 says it right. bzip2 version incompatability in other words" |
479 |
echo "saving the md5" |
474 |
echo "saving the md5" |
480 |
if type -p md5sum &> /dev/null; then |
475 |
if type -p md5sum &> /dev/null; then |
481 |
md5sum ${TEMPDIR}/portage-${final_date}.tar.bz2 | sed -e "s:${TEMPDIR}/\?::" > \ |
476 |
md5sum ${TMPDIR}/portage-${final_date}.tar.bz2 | sed -e "s:${TMPDIR}/\?::" > \ |
482 |
${STATE_DIR}/portage-${final_date}.tar.bz2.md5sum |
477 |
${STATE_DIR}/portage-${final_date}.tar.bz2.md5sum |
483 |
elif type -p md5 &> /dev/null; then |
478 |
elif type -p md5 &> /dev/null; then |
484 |
echo "$(md5 -q ${TEMPDIR}/portage-${final_date}.tar.bz2) portage-${final_date}.tar.bz2" > \ |
479 |
echo "$(md5 -q ${TMPDIR}/portage-${final_date}.tar.bz2) portage-${final_date}.tar.bz2" > \ |
485 |
${STATE_DIR}/portage-${final_date}.tar.bz2.md5sum |
480 |
${STATE_DIR}/portage-${final_date}.tar.bz2.md5sum |
486 |
else |
481 |
else |
487 |
echo "couldn't find either md5 or md5sum. something is screwed... (bailing, sorry)" |
482 |
echo "couldn't find either md5 or md5sum. something is screwed... (bailing, sorry)" |
488 |
exit 7 |
483 |
exit 7 |
489 |
fi |
484 |
fi |
490 |
mv "${DISTDIR}/portage-${final_date}.tar.bz2.umd5sum" "${TEMPDIR}/portage-${final_date}.tar.bz2" ${STATE_DIR}/ |
485 |
mv "${DISTDIR}/portage-${final_date}.tar.bz2.umd5sum" "${TMPDIR}/portage-${final_date}.tar.bz2" ${STATE_DIR}/ |
491 |
rmdir ${TEMPDIR} |
486 |
rmdir ${TMPDIR} |
492 |
dfile="${STATE_DIR}/portage-${final_date}.tar.bz2" |
487 |
dfile="${STATE_DIR}/portage-${final_date}.tar.bz2" |
493 |
else |
488 |
else |
494 |
dfile="${DISTDIR}/portage-${final_date}.tar.bz2" |
489 |
dfile="${DISTDIR}/portage-${final_date}.tar.bz2" |
495 |
mv "${TEMPDIR}/portage-${final_date}.tar.bz2" ${DISTDIR}/ |
490 |
mv "${TMPDIR}/portage-${final_date}.tar.bz2" ${DISTDIR}/ |
496 |
fi |
491 |
fi |
497 |
|
492 |
|
498 |
if [ -z "${need_last_sync}" ]; then |
493 |
if [ -z "${need_last_sync}" ]; then |