Skip to content

Commit

Permalink
Revert "Look for correct extension to tar and diff files."
Browse files Browse the repository at this point in the history
This reverts commit 2c8654d.
  • Loading branch information
mmoll committed Nov 7, 2016
1 parent 51628b2 commit 8668a82
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions lib/freight/apt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -365,19 +365,26 @@ apt_cache_source() {
VERSION="$(apt_source_version "$PATHNAME")"
ORIG_VERSION="$(apt_source_origversion "$PATHNAME")"
DIRNAME="$(dirname "$PATHNAME")"
DSC_FILENAME="${NAME}_${VERSION##*:}.dsc"

for EXT in gz bz2 xz lzma; do
if [ -z "$ORIG_FILENAME" ] && [ -f "$VARLIB/apt/$DIST/$DIRNAME/${NAME}_${ORIG_VERSION}.orig.tar.$EXT" ]
then ORIG_FILENAME="${NAME}_${ORIG_VERSION}.orig.tar.$EXT"
fi
if [ -z "$DIFF_FILENAME" ] && [ -f "$VARLIB/apt/$DIST/$DIRNAME/${NAME}_${VERSION##*:}.diff.$EXT" ]
then DIFF_FILENAME="${NAME}_${VERSION##*:}.diff.$EXT"
fi
if [ -z "$TAR_FILENAME" ] && [ -f "$VARLIB/apt/$DIST/$DIRNAME/${NAME}_${VERSION##*:}.tar.$EXT" ]
then TAR_FILENAME="${NAME}_${VERSION##*:}.tar.$EXT"
fi
done
DSC_FILENAME="${NAME}_${VERSION%*:}.dsc"
DEBTAR_GZ_FILENAME="${NAME}_${VERSION%*:}.debian.tar.gz"
DEBTAR_BZ2_FILENAME="${NAME}_${VERSION%*:}.debian.tar.bz2"
DEBTAR_XZ_FILENAME="${NAME}_${VERSION%*:}.debian.tar.xz"
DEBTAR_LZMA_FILENAME="${NAME}_${VERSION%*:}.debian.tar.lzma"
DIFFGZ_FILENAME="${NAME}_${VERSION%*:}.diff.gz"
ORIG_FILENAME="${NAME}_${ORIG_VERSION}.orig.tar.gz"
TAR_FILENAME="${NAME}_${VERSION%*:}.tar.gz"

# Find which style of diff they're using.
if [ -f "$VARLIB/apt/$DIST/$DIRNAME/$DEBTAR_GZ_FILENAME" ]
then DIFF_FILENAME=${DEBTAR_GZ_FILENAME}
elif [ -f "$VARLIB/apt/$DIST/$DIRNAME/$DEBTAR_BZ2_FILENAME" ]
then DIFF_FILENAME=${DEBTAR_BZ2_FILENAME}
elif [ -f "$VARLIB/apt/$DIST/$DIRNAME/$DEBTAR_XZ_FILENAME" ]
then DIFF_FILENAME=${DEBTAR_XZ_FILENAME}
elif [ -f "$VARLIB/apt/$DIST/$DIRNAME/$DEBTAR_LZMA_FILENAME" ]
then DIFF_FILENAME=${DEBTAR_LZMA_FILENAME}
else DIFF_FILENAME=${DIFFGZ_FILENAME}
fi

# Verify this package by ensuring the other necessary files are present.
[ -f "$VARLIB/apt/$DIST/$DIRNAME/$ORIG_FILENAME" -a -f "$VARLIB/apt/$DIST/$DIRNAME/$DIFF_FILENAME" -o -f "$VARLIB/apt/$DIST/$DIRNAME/$TAR_FILENAME" ] || {
Expand Down

0 comments on commit 8668a82

Please sign in to comment.