httpTwoLevelsUpdater: init
This commit is contained in:
parent
ba59355e81
commit
005ac63a19
19
pkgs/common-updater/http-two-levels-updater.nix
Normal file
19
pkgs/common-updater/http-two-levels-updater.nix
Normal file
@ -0,0 +1,19 @@
|
||||
{ lib
|
||||
, genericUpdater
|
||||
, common-updater-scripts
|
||||
}:
|
||||
|
||||
{ pname
|
||||
, version
|
||||
, attrPath ? pname
|
||||
, ignoredVersions ? ""
|
||||
, rev-prefix ? ""
|
||||
, odd-unstable ? false
|
||||
, patchlevel-unstable ? false
|
||||
, url ? null
|
||||
}:
|
||||
|
||||
genericUpdater {
|
||||
inherit pname version attrPath ignoredVersions rev-prefix odd-unstable patchlevel-unstable;
|
||||
versionLister = "${common-updater-scripts}/bin/list-archive-two-levels-versions ${lib.optionalString (url != null) "--url=${url}"}";
|
||||
}
|
@ -2,9 +2,9 @@
|
||||
|
||||
# lists all available versions listed for a package in a site (http)
|
||||
|
||||
archive="$1" # archive url
|
||||
pname="$2" # package name
|
||||
file="$3" # file for writing debugging information
|
||||
archive="" # archive url
|
||||
pname="" # package name
|
||||
file="" # file for writing debugging information
|
||||
|
||||
while (( $# > 0 )); do
|
||||
flag="$1"
|
||||
@ -17,7 +17,7 @@ while (( $# > 0 )); do
|
||||
pname="${flag#*=}"
|
||||
;;
|
||||
--file=*)
|
||||
version="${flag#*=}"
|
||||
file="${flag#*=}"
|
||||
;;
|
||||
*)
|
||||
echo "$0: unknown option ‘${flag}’"
|
||||
@ -26,13 +26,19 @@ while (( $# > 0 )); do
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z "$archive" ]; then
|
||||
echo "$scriptName: Missing archive url"
|
||||
exit 1
|
||||
# by default set url to the base dir of the first url in src.urls
|
||||
if [[ -z "$archive" ]]; then
|
||||
archive="$(nix-instantiate $systemArg --eval -E \
|
||||
"with import ./. {}; dirOf (dirOf (lib.head $UPDATE_NIX_ATTR_PATH.src.urls))" \
|
||||
| tr -d '"')"
|
||||
fi
|
||||
|
||||
if [[ -z "$pname" ]]; then
|
||||
pname="$UPDATE_NIX_ATTR_PATH"
|
||||
fi
|
||||
|
||||
# print a debugging message
|
||||
if [ -n "$file" ]; then
|
||||
if [[ -n "$file" ]]; then
|
||||
echo "# Listing versions for '$pname' at $archive" >> $file
|
||||
fi
|
||||
|
@ -7,10 +7,9 @@ let
|
||||
|
||||
# Update script tailored to mate packages from git repository
|
||||
mateUpdateScript = { pname, version, odd-unstable ? true, url ? "https://pub.mate-desktop.org/releases" }:
|
||||
pkgs.genericUpdater {
|
||||
inherit pname version odd-unstable;
|
||||
pkgs.httpTwoLevelsUpdater {
|
||||
inherit pname version odd-unstable url;
|
||||
attrPath = "mate.${pname}";
|
||||
versionLister = "${pkgs.common-updater-scripts}/bin/list-archive-two-level-versions --url=${url}";
|
||||
};
|
||||
|
||||
atril = callPackage ./atril { };
|
||||
|
@ -38,10 +38,9 @@ stdenv.mkDerivation rec {
|
||||
})
|
||||
];
|
||||
|
||||
passthru.updateScript = xfce.genericUpdater {
|
||||
passthru.updateScript = xfce.archiveUpdater {
|
||||
category = "apps";
|
||||
inherit pname version;
|
||||
attrPath = "xfce.${pname}";
|
||||
versionLister = xfce.archiveLister "apps" pname;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
|
@ -28,11 +28,7 @@ stdenv.mkDerivation rec {
|
||||
|
||||
dontDropIconThemeCache = true;
|
||||
|
||||
passthru.updateScript = xfce.genericUpdater {
|
||||
inherit pname version;
|
||||
attrPath = "xfce.${pname}";
|
||||
versionLister = xfce.archiveLister category pname;
|
||||
};
|
||||
passthru.updateScript = xfce.archiveUpdater { inherit category pname version; };
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://www.xfce.org/";
|
||||
|
@ -13,11 +13,7 @@ stdenv.mkDerivation rec {
|
||||
sha256 = "sha256-MhTV8A6XA7XoyefDKH1gbe3scoXOtNXbMy6TraZv1XU=";
|
||||
};
|
||||
|
||||
passthru.updateScript = xfce.genericUpdater {
|
||||
inherit pname version;
|
||||
attrPath = "xfce.${pname}";
|
||||
versionLister = xfce.archiveLister category pname;
|
||||
};
|
||||
passthru.updateScript = xfce.archiveUpdater { inherit category pname version; };
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://www.xfce.org/";
|
||||
|
@ -5,8 +5,12 @@ lib.makeScope pkgs.newScope (self: with self; {
|
||||
|
||||
genericUpdater = pkgs.genericUpdater;
|
||||
|
||||
archiveLister = category: name:
|
||||
"${pkgs.common-updater-scripts}/bin/list-archive-two-level-versions --url=https://archive.xfce.org/src/${category}/${name}";
|
||||
archiveUpdater = { category, pname, version }:
|
||||
pkgs.httpTwoLevelsUpdater {
|
||||
inherit pname version;
|
||||
attrPath = "xfce.${pname}";
|
||||
url = "https://archive.xfce.org/src/${category}/${pname}";
|
||||
};
|
||||
|
||||
mkXfceDerivation = callPackage ./mkXfceDerivation.nix { };
|
||||
|
||||
|
@ -45,11 +45,7 @@ in stdenv.mkDerivation rec {
|
||||
hicolor-icon-theme
|
||||
];
|
||||
|
||||
passthru.updateScript = xfce.genericUpdater {
|
||||
inherit pname version;
|
||||
attrPath = "xfce.${pname}";
|
||||
versionLister = xfce.archiveLister category pname;
|
||||
};
|
||||
passthru.updateScript = xfce.archiveUpdater { inherit category pname version; };
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://docs.xfce.org/panel-plugins/xfce4-cpugraph-plugin";
|
||||
|
@ -33,11 +33,7 @@ in stdenv.mkDerivation rec {
|
||||
gtk2
|
||||
];
|
||||
|
||||
passthru.updateScript = xfce.genericUpdater {
|
||||
inherit pname version;
|
||||
attrPath = "xfce.${pname}";
|
||||
versionLister = xfce.archiveLister category pname;
|
||||
};
|
||||
passthru.updateScript = xfce.archiveUpdater { inherit category pname version; };
|
||||
|
||||
meta = with lib;{
|
||||
homepage = "https://docs.xfce.org/panel-plugins/xfce4-embed-plugin";
|
||||
|
@ -35,11 +35,7 @@ in stdenv.mkDerivation rec {
|
||||
gtk3
|
||||
];
|
||||
|
||||
passthru.updateScript = xfce.genericUpdater {
|
||||
inherit pname version;
|
||||
attrPath = "xfce.${pname}";
|
||||
versionLister = xfce.archiveLister category pname;
|
||||
};
|
||||
passthru.updateScript = xfce.archiveUpdater { inherit category pname version; };
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://docs.xfce.org/panel-plugins/xfce4-eyes-plugin";
|
||||
|
@ -35,11 +35,7 @@ in stdenv.mkDerivation rec {
|
||||
gtk3
|
||||
];
|
||||
|
||||
passthru.updateScript = xfce.genericUpdater {
|
||||
inherit pname version;
|
||||
attrPath = "xfce.${pname}";
|
||||
versionLister = xfce.archiveLister category pname;
|
||||
};
|
||||
passthru.updateScript = xfce.archiveUpdater { inherit category pname version; };
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://docs.xfce.org/panel-plugins/xfce4-fsguard-plugin";
|
||||
|
@ -33,11 +33,7 @@ in stdenv.mkDerivation rec {
|
||||
gtk3
|
||||
];
|
||||
|
||||
passthru.updateScript = xfce.genericUpdater {
|
||||
inherit pname version;
|
||||
attrPath = "xfce.${pname}";
|
||||
versionLister = xfce.archiveLister category pname;
|
||||
};
|
||||
passthru.updateScript = xfce.archiveUpdater { inherit category pname version; };
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://docs.xfce.org/panel-plugins/xfce4-genmon-plugin";
|
||||
|
@ -27,11 +27,7 @@ stdenv.mkDerivation rec {
|
||||
libgcrypt
|
||||
];
|
||||
|
||||
passthru.updateScript = xfce.genericUpdater {
|
||||
inherit pname version;
|
||||
attrPath = "xfce.${pname}";
|
||||
versionLister = xfce.archiveLister category pname;
|
||||
};
|
||||
passthru.updateScript = xfce.archiveUpdater { inherit category pname version; };
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://docs.xfce.org/panel-plugins/xfce4-mailwatch-plugin";
|
||||
|
@ -27,11 +27,7 @@ stdenv.mkDerivation rec {
|
||||
exo
|
||||
];
|
||||
|
||||
passthru.updateScript = xfce.genericUpdater {
|
||||
inherit pname version;
|
||||
attrPath = "xfce.${pname}";
|
||||
versionLister = xfce.archiveLister category pname;
|
||||
};
|
||||
passthru.updateScript = xfce.archiveUpdater { inherit category pname version; };
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://docs.xfce.org/panel-plugins/xfce4-mpc-plugin";
|
||||
|
@ -31,11 +31,7 @@ in stdenv.mkDerivation rec {
|
||||
xfconf
|
||||
];
|
||||
|
||||
passthru.updateScript = xfce.genericUpdater {
|
||||
inherit pname version;
|
||||
attrPath = "xfce.${pname}";
|
||||
versionLister = xfce.archiveLister category pname;
|
||||
};
|
||||
passthru.updateScript = xfce.archiveUpdater { inherit category pname version; };
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://docs.xfce.org/panel-plugins/xfce4-notes-plugin";
|
||||
|
@ -38,11 +38,7 @@ stdenv.mkDerivation rec {
|
||||
"--with-pathnetcat=${netcat-gnu}/bin/netcat"
|
||||
];
|
||||
|
||||
passthru.updateScript = xfce.genericUpdater {
|
||||
inherit pname version;
|
||||
attrPath = "xfce.${pname}";
|
||||
versionLister = xfce.archiveLister category pname;
|
||||
};
|
||||
passthru.updateScript = xfce.archiveUpdater { inherit category pname version; };
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://docs.xfce.org/panel-plugins/xfce4-sensors-plugin";
|
||||
|
@ -31,11 +31,7 @@ in stdenv.mkDerivation rec {
|
||||
xfconf
|
||||
];
|
||||
|
||||
passthru.updateScript = xfce.genericUpdater {
|
||||
inherit pname version;
|
||||
attrPath = "xfce.${pname}";
|
||||
versionLister = xfce.archiveLister category pname;
|
||||
};
|
||||
passthru.updateScript = xfce.archiveUpdater { inherit category pname version; };
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://docs.xfce.org/panel-plugins/xfce4-systemload-plugin";
|
||||
|
@ -28,11 +28,7 @@ stdenv.mkDerivation rec {
|
||||
|
||||
hardeningDisable = [ "format" ];
|
||||
|
||||
passthru.updateScript = xfce.genericUpdater {
|
||||
inherit pname version;
|
||||
attrPath = "xfce.${pname}";
|
||||
versionLister = xfce.archiveLister category pname;
|
||||
};
|
||||
passthru.updateScript = xfce.archiveUpdater { inherit category pname version; };
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://docs.xfce.org/panel-plugins/xfce4-timer-plugin";
|
||||
|
@ -31,11 +31,7 @@ stdenv.mkDerivation rec {
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
passthru.updateScript = xfce.genericUpdater {
|
||||
inherit pname version;
|
||||
attrPath = "xfce.${pname}";
|
||||
versionLister = xfce.archiveLister category pname;
|
||||
};
|
||||
passthru.updateScript = xfce.archiveUpdater { inherit category pname version; };
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://docs.xfce.org/panel-plugins/xfce4-weather-plugin";
|
||||
|
@ -109,6 +109,8 @@ with pkgs;
|
||||
|
||||
gitUpdater = callPackage ../common-updater/git-updater.nix { };
|
||||
|
||||
httpTwoLevelsUpdater = callPackage ../common-updater/http-two-levels-updater.nix { };
|
||||
|
||||
unstableGitUpdater = callPackage ../common-updater/unstable-updater.nix { };
|
||||
|
||||
nix-update-script = callPackage ../common-updater/nix-update.nix { };
|
||||
|
Loading…
Reference in New Issue
Block a user