diff options
author | Nicolas Vigier <boklm@mageia.org> | 2011-11-21 19:00:32 +0000 |
---|---|---|
committer | Nicolas Vigier <boklm@mageia.org> | 2011-11-21 19:00:32 +0000 |
commit | ccdf2f2514d2f15c877fb513812a4321c9377bbf (patch) | |
tree | abf5e9b28e5bb42087f7fff412b85e1fc2600d89 | |
parent | 38f7febed0288ff7190c02dedb3dcb18ee40d4b7 (diff) | |
download | repoctl-ccdf2f2514d2f15c877fb513812a4321c9377bbf.tar repoctl-ccdf2f2514d2f15c877fb513812a4321c9377bbf.tar.gz repoctl-ccdf2f2514d2f15c877fb513812a4321c9377bbf.tar.bz2 repoctl-ccdf2f2514d2f15c877fb513812a4321c9377bbf.tar.xz repoctl-ccdf2f2514d2f15c877fb513812a4321c9377bbf.zip |
add get_hdlists_needupdate() and rm_hdlists_needupdate() functions
-rw-r--r-- | functions | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -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 |