Check-in [9f4f082fef]
Overview
Comment:Added zlib package and support for checking hash and storing archive
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | packages
Files: files | file ages | folders
SHA1: 9f4f082fefc3a28c866b0da510dc3d3577fe54a4
User & Date: rkeene on 2014-11-03 23:35:07
Other Links: branch diff | manifest | tags
Context
2014-11-03
23:49
Updated to use package data from Fossil, which is more reliable check-in: 77faad55ab user: rkeene tags: packages
23:35
Added zlib package and support for checking hash and storing archive check-in: 9f4f082fef user: rkeene tags: packages
23:20
Emptied old ignore glob check-in: 286b0eb815 user: rkeene tags: packages
Changes

Modified .fossil-settings/ignore-glob from [da39a3ee5e] to [171004757d].

            1  +workdir-*
            2  +ARCHIVE

Modified build from [9250a4fcfd] to [4cb097f703].

   105    105   if [ -d "pkgs/${pkg}" ]; then
   106    106   	pkgdir="pkgs/${pkg}"
   107    107   	pkgfile="${pkgdir}/info"
   108    108   else
   109    109   	pkgfile="pkgs/${pkg}"
   110    110   	pkgdir="${pkgfile}"
   111    111   fi
   112         -pkgdate="$(find "${pkgdir}" -type f -printf '%TY%Tm%Td%TH%TM.%TS\n' | cut -f 1-2 -d '.' | sort -n | tail -n 1)"
          112  +
          113  +if [ ! -e "${pkgfile}" ]; then
          114  +	echo "Invalid package." >&2
          115  +
          116  +	exit 1
          117  +fi
          118  +
          119  +pkgdate="$(find "${pkgdir}" -type f -printf '%TY%Tm%Td%TH%TM.%TS\n' 2>/dev/null | cut -f 1-2 -d '.' | sort -n | tail -n 1)"
   113    120   
   114    121   . "${pkgfile}"
   115    122   
   116    123   archivedir="$(pwd)/ARCHIVE"
   117    124   workdir="workdir-$$${RANDOM}${RANDOM}${RANDOM}"
   118         -mkdir "${workdir}" "${archivedir}"
          125  +srcfile="${archivedir}/${pkg}"
          126  +mkdir "${archivedir}" >/dev/null 2>/dev/null
          127  +mkdir "${workdir}" || exit 1
   119    128   cd "${workdir}" || exit 1
   120    129   workdir="$(pwd)"
   121    130   
   122         -# Download
   123         -## Cleanup
   124         -rm -f src.new src
          131  +if [ ! -e "${srcfile}" ]; then
          132  +	# Download
          133  +	## Cleanup
          134  +	rm -f src.new src
   125    135   
   126         -## Fetch file
   127         -wget -O src.new "${url}" || exit 1
          136  +	## Fetch file
          137  +	wget -O src.new "${url}" || exit 1
   128    138   
   129         -## Verify signature
   130         -### XXX:TODO
          139  +	## Verify signature
          140  +	src_sha256="$(openssl sha256 'src.new' | sed 's@^.*= @@')"
          141  +	if [ "${src_sha256}" != "${sha256}" ]; then
          142  +		echo "SHA256 mismatch:  Downloaded: ${src_sha256} != Expected: ${sha256}" >&2
   131    143   
   132         -## Move file into place
   133         -mv src.new src
          144  +		exit 1
          145  +	fi
          146  +
          147  +	## Move file into place
          148  +	mv src.new "${archivedir}/${pkg}"
          149  +fi
   134    150   
   135    151   # Decompress archive
   136    152   ## Determine type of archive
   137    153   case "${url}" in
   138    154   	*.tar.xz|*.tar.xz'?'*|*.txz)
   139    155   		decompress='xz'
   140    156   		;;
................................................................................
   153    169   		exit 1
   154    170   		;;
   155    171   esac
   156    172   
   157    173   ## Do decompression
   158    174   case "${decompress}" in
   159    175   	unzip)
   160         -		unzip 'src' || die 'Unable to uncompress archive'
          176  +		unzip "${srcfile}" || die 'Unable to uncompress archive'
   161    177   		;;
   162    178   	*)
   163         -		"${decompress}" -dc src | tar -xf - || die 'Unable to uncompress archive'
          179  +		"${decompress}" -dc "${srcfile}" | tar -xf - || die 'Unable to uncompress archive'
   164    180   		;;
   165    181   esac
   166    182   
   167    183   ## Cleanup source
   168    184   rm -f src
   169    185   
   170    186   # If we just have one directory, use that directory

Modified pkgs/glibc from [1517e291c9] to [a1708aed89].

     1      1   #! /usr/bin/env bash
     2      2   
     3      3   version=2.20
     4      4   url="http://ftp.gnu.org/gnu/glibc/glibc-${version}.tar.xz"
     5      5   domain=core.appfs.rkeene.org
     6         -sha256=''
            6  +sha256='f84b6d42aecc288d593c397b0a3d02260a33ee686bce0c634eb9b32798f36ba5'
     7      7   
     8      8   function configure() {
     9      9   	mkdir BUILD
    10     10   	cd BUILD
    11     11   
    12     12   	../configure --prefix="${prefix}" --sysconfdir=/etc --localstatedir=/var || return 1
    13     13   
    14     14   	echo '# Ignore: DESTDIR' >> Makefile
    15     15   }

Modified pkgs/readline from [28079f5c74] to [4f5b78a41f].

     1      1   #! /usr/bin/env bash
     2      2   
     3      3   version=6.3
     4      4   url="https://ftp.gnu.org/gnu/readline/readline-${version}.tar.gz"
     5      5   domain=core.appfs.rkeene.org
     6         -sha256=''
            6  +sha256='56ba6071b9462f980c5a72ab0023893b65ba6debb4eeb475d7a563dc65cafd43'

Added pkgs/zlib version [e788328143].

            1  +#! /usr/bin/env bash
            2  +
            3  +version=1.2.8
            4  +url="http://zlib.net/zlib-${version}.tar.gz"
            5  +domain=core.appfs.rkeene.org
            6  +sha256='36658cb768a54c1d4dec43c3116c27ed893e88b02ecfcb44f2166f9c0b7f2a0d'