mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-18 10:53:52 +00:00
maint script gnome-latest.sh: rename to gnome.sh, update src.nix
This commit is contained in:
parent
39965bba04
commit
dbdb732849
@ -1,15 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -o pipefail
|
||||
|
||||
GNOME_FTP="ftp.gnome.org/pub/GNOME/sources"
|
||||
|
||||
project=$1
|
||||
|
||||
if [ "$project" == "--help" ]; then
|
||||
echo "Usage: $0 project [major.minor]"
|
||||
usage() {
|
||||
echo "Usage: $0 show|update project [major.minor]" >&2
|
||||
exit 0
|
||||
}
|
||||
|
||||
if [ "$#" -lt 1 ]; then
|
||||
usage
|
||||
fi
|
||||
|
||||
majorVersion=$2
|
||||
action="$1"
|
||||
project="$2"
|
||||
majorVersion="$3"
|
||||
|
||||
if [ "$action" != "show" ] && [ "$action" != "update" ]; then
|
||||
echo "Unknown action $action" >&2
|
||||
usage
|
||||
fi
|
||||
|
||||
if [ -z "$project" ]; then
|
||||
echo "No project specified, exiting"
|
||||
@ -31,6 +42,11 @@ fi
|
||||
if [ -z "$majorVersion" ]; then
|
||||
echo "Looking for available versions..." >&2
|
||||
available_baseversions=( `ls_ftp ftp://${GNOME_FTP}/${project} | grep '[0-9]\.[0-9]' | sort -t. -k1,1n -k 2,2n` )
|
||||
if [ "$?" -ne "0" ]; then
|
||||
echo "Project $project not found" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo -e "The following versions are available:\n ${available_baseversions[@]}" >&2
|
||||
echo -en "Choose one of them: " >&2
|
||||
read majorVersion
|
||||
@ -93,16 +109,30 @@ for ext in ${extensions[@]}; do
|
||||
break
|
||||
fi
|
||||
done
|
||||
sha256=`nix-hash --to-base32 --type sha256 $sha256`
|
||||
echo "Chosen ${ext_pref}, hash is ${sha256}" >&2
|
||||
|
||||
cat <<EOF
|
||||
{
|
||||
name = "${project}-${version}";
|
||||
src="# Autogenerated by maintainers/scripts/gnome-latest.sh
|
||||
|
||||
fetchurl: {
|
||||
name = \"${project}-${version}\";
|
||||
|
||||
src = fetchurl {
|
||||
url = mirror://gnome/sources/${project}/${majorVersion}/${project}-${version}.tar.${ext_pref};
|
||||
sha256 = "${sha256}";
|
||||
sha256 = \"${sha256}\";
|
||||
};
|
||||
}
|
||||
EOF
|
||||
}"
|
||||
|
||||
if [ "$action" == "update" ]; then
|
||||
# find project in nixpkgs tree
|
||||
GNOME_TOP=$(readlink -e $(dirname "${BASH_SOURCE[0]}")"/../../pkgs/desktops/gnome-3/")
|
||||
projectPath=$(find "$GNOME_TOP" -name "$project" -print)
|
||||
if [ -z "$projectPath" ]; then
|
||||
echo "Project $project not found under $GNOME_TOP"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Updating $projectPath/src.nix"
|
||||
echo -e "$src" > "$projectPath/src.nix"
|
||||
else
|
||||
echo -e "\n$src"
|
||||
fi
|
Loading…
Reference in New Issue
Block a user