aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2011-11-21 19:00:32 +0000
committerNicolas Vigier <boklm@mageia.org>2011-11-21 19:00:32 +0000
commitccdf2f2514d2f15c877fb513812a4321c9377bbf (patch)
treeabf5e9b28e5bb42087f7fff412b85e1fc2600d89
parent38f7febed0288ff7190c02dedb3dcb18ee40d4b7 (diff)
downloadrepoctl-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--functions19
1 files changed, 18 insertions, 1 deletions
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