Fix dummy pseudo-updates being found for some packages

This commit is contained in:
Michael Raskin 2012-12-08 13:05:43 +04:00
parent a9edaf10ed
commit d3e5b8feee
4 changed files with 17 additions and 2 deletions

View File

@ -97,6 +97,12 @@ ensure_name () {
echo "Resulting name: $CURRENT_NAME"
}
ensure_attribute_name () {
echo "Ensuring attribute name. CURRENT_ATTRIBUTE_NAME: $CURRENT_ATTRIBUTE_NAME" >&2
[ -z "$CURRENT_ATTRIBUTE_NAME" ] && attribute_name "$CURRENT_NAME"
echo "Resulting attribute name: $CURRENT_ATTRIBUTE_NAME"
}
ensure_choice () {
echo "Ensuring that choice is made." >&2
echo "NEED_TO_CHOOSE_URL: [$NEED_TO_CHOOSE_URL]." >&2
@ -127,8 +133,13 @@ name () {
echo "CURRENT_NAME: $CURRENT_NAME" >&2
}
attribute_name () {
CURRENT_ATTRIBUTE_NAME="$1"
echo "CURRENT_ATTRIBUTE_NAME: $CURRENT_ATTRIBUTE_NAME" >&2
}
retrieve_version () {
PACKAGED_VERSION="$(nix-instantiate --eval-only '<nixpkgs>' -A "$CURRENT_NAME".meta.version | xargs)"
PACKAGED_VERSION="$(nix-instantiate --eval-only '<nixpkgs>' -A "$CURRENT_ATTRIBUTE_NAME".meta.version | xargs)"
}
directory_of () {
@ -159,7 +170,7 @@ do_write_expression () {
echo "${1}rec {"
echo "${1} baseName=\"$CURRENT_NAME\";"
echo "${1} version=\"$CURRENT_VERSION\";"
echo "${1} name=\"$CURRENT_NAME-$CURRENT_VERSION\";"
echo "${1} name=\"\${baseName}-\${version}\";"
echo "${1} hash=\"$CURRENT_HASH\";"
echo "${1} url=\"$CURRENT_URL\";"
echo "${1} sha256=\"$CURRENT_HASH\";"
@ -219,6 +230,7 @@ process_config () {
BEGIN_EXPRESSION='# Generated upstream information';
source "$CONFIG_DIR/$(basename "$1")"
ensure_name
ensure_attribute_name
retrieve_version
ensure_choice
ensure_version

View File

@ -1 +1,2 @@
attribute_name intltool_standalone
url https://launchpad.net/intltool/+download

View File

@ -1,4 +1,5 @@
target ng.nix
attribute_name lincity_ng
url https://fedorahosted.org/LinCity-NG/wiki/Downloads
version_link tar.bz2
version_link tar.bz2

View File

@ -59,6 +59,7 @@ rec {
'' ["minInit" "addInputs" "doUnpack"];
meta = {
inherit (s) version;
description = "A tool for programming graphics intended to replace Metapost";
maintainers = [
a.lib.maintainers.raskin