From 045e10c94ec9399b55562388869990588787df60 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Fri, 19 Dec 2008 21:44:00 +0100 Subject: [PATCH] genindex: added "filename-sha256" obj in pkgdict. --HG-- extra : convert_revision : d443575b681c408bb357027fcc46f1e19022bd87 --- doc/BINPKG_REPOSITORY | 7 ++++++- utils/sh/binpkg-genindex.sh | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/doc/BINPKG_REPOSITORY b/doc/BINPKG_REPOSITORY index 5fb2e8a764b..72359065041 100644 --- a/doc/BINPKG_REPOSITORY +++ b/doc/BINPKG_REPOSITORY @@ -17,7 +17,10 @@ a remote location specified with "location-remote". The package dictionary will be the same than the one available in package's metadata directory "/var/cache/xbps/$pkgname/props.plist", but some additional objects are added to provide enough info for -the repository itself. +the repository itself: + + - filename: name (and path) for the binary package. + - filename-sha256: SHA256 hash of the binary package. Here's how the package index plist file shall look like in a repository: @@ -39,6 +42,8 @@ Here's how the package index plist file shall look like in a repository: 1.5.17 filename klibc-1.5.17.x86_64.xbps + filename-sha256 + 7b0de0521983037107cc33f2b1514126432f86ac2be1ef9b9dc51a1e959ea777 architecture x86_64 installed_size diff --git a/utils/sh/binpkg-genindex.sh b/utils/sh/binpkg-genindex.sh index 6f4f9f94007..6e91b10746a 100644 --- a/utils/sh/binpkg-genindex.sh +++ b/utils/sh/binpkg-genindex.sh @@ -139,6 +139,7 @@ write_repo_pkgindex_dict() local binpkgf="$3" local first_dict= local tmpdictf= + local binpkg="$XBPS_PACKAGESDIR/$binpkgf" [ -z "$pkgf" -o -z "$indexf" -o -z "$binpkgf" ] && return 1 @@ -149,9 +150,12 @@ write_repo_pkgindex_dict() if $(echo $line|grep -q ""); then first_dict=yes echo "$line" >> $tmpdictf - # Write the binary pkg filename before. + # Write binpkg props. echo "filename" >> $tmpdictf echo "$binpkgf" >> $tmpdictf + echo "filename-sha256" >> $tmpdictf + echo "$($XBPS_DIGEST_CMD $binpkg)" \ + >> $tmpdictf continue # Continue until found. elif [ -z "$first_dict" ]; then