From ccdf2f2514d2f15c877fb513812a4321c9377bbf Mon Sep 17 00:00:00 2001 From: Nicolas Vigier Date: Mon, 21 Nov 2011 19:00:32 +0000 Subject: add get_hdlists_needupdate() and rm_hdlists_needupdate() functions --- functions | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/functions b/functions index dae66bc..e5a6caf 100644 --- a/functions +++ b/functions @@ -71,6 +71,22 @@ function set_hdlists_needupdate() touch "$hdlistsdir/$distrorelease-$section-$sectionrepo" } +function get_hdlists_needupdate() +{ + local distrorelease="$1" + local section="$2" + local sectionrepo="$3" + test -f "$hdlistsdir/$distrorelease-$section-$sectionrepo" +} + +function rm_hdlists_needupdate() +{ + local distrorelease="$1" + local section="$2" + local sectionrepo="$3" + rm -f "$hdlistsdir/$distrorelease-$section-$sectionrepo" +} + function update_hdlists_if_needed() { for distrorelease in $distroreleases @@ -79,8 +95,9 @@ function update_hdlists_if_needed() do for sectionrepo in $sectionsrepos do - if [ -f "$hdlistsdir/$distrorelease-$section-$sectionrepo" ] + if get_hdlists_needupdate "$distrorelease" "$section" "$sectionrepo" then + rm_hdlists_needupdate "$distrorelease" "$section" "$sectionrepo" update_hdlists "$distrorelease" "$section" "$sectionrepo" fi done -- cgit v1.2.1