Skip to content

Commit

Permalink
Trac #18344: fix some case issues in sage-fix-pkg-checksums
Browse files Browse the repository at this point in the history
The Sage developer's guide insists that the directories in `build/pkgs`
should be all lowercase. At the same time, we have started allowing
tarballs in `upstream` which have mixed case (e.g., Pillow and Sphinx).
The script `sage-fix-pkg-checksums` should allow for this, converting
the tarball name to lowercase before looking for the corresponding
directory.

URL: http://trac.sagemath.org/18344
Reported by: jhpalmieri
Ticket author(s): John Palmieri
Reviewer(s): Leif Leonhardy
  • Loading branch information
Release Manager authored and vbraun committed May 2, 2015
2 parents f27ad60 + 02ba704 commit 649918e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/bin/sage-fix-pkg-checksums
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,17 @@ for upstream in "$@"
do
tarball=`basename "$upstream"`
pkg_name=${tarball%%-*}
# Convert to lowercase for the directory name:
pkg_name_lc=`echo $pkg_name | tr '[:upper:]' '[:lower:]'`
pkg_compression=${tarball#*.tar} # gz or bz2
if [ -d "$SAGE_ROOT/build/pkgs/$pkg_name" ]; then
sage_version=`cat "$SAGE_ROOT/build/pkgs/$pkg_name/package-version.txt" | sed 's/\.p[0-9][0-9]*$//'`
if [ -d "$SAGE_ROOT/build/pkgs/$pkg_name_lc" ]; then
sage_version=`cat "$SAGE_ROOT/build/pkgs/$pkg_name_lc/package-version.txt" | sed 's/\.p[0-9][0-9]*$//'`
if [ ${tarball%.tar*} = "$pkg_name-$sage_version" ]; then
echo >&2 $tarball
checksums="$SAGE_ROOT/build/pkgs/$pkg_name/checksums.ini"
if [ "$pkg_name" != "$pkg_name_lc" ]; then
echo >&2 " ** Note: case mismatch between upstream/$tarball and build/pkgs/$pkg_name_lc. **"
fi
checksums="$SAGE_ROOT/build/pkgs/$pkg_name_lc/checksums.ini"
echo "tarball=$pkg_name-VERSION.tar$pkg_compression" > $checksums

echo -n "sha1=" >> $checksums
Expand Down

0 comments on commit 649918e

Please sign in to comment.