aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2011-10-28 17:49:02 +0000
committerNicolas Vigier <boklm@mageia.org>2011-10-28 17:49:02 +0000
commit022e120b53a89aea4eb23f467b9ff677239938c4 (patch)
tree9c01e968af3c4f8b2966a2dd4cdee6d3c91e2313
parent0526dbdae627fbafcfb3c895b7206a7c982c7e05 (diff)
downloadrepoctl-022e120b53a89aea4eb23f467b9ff677239938c4.tar
repoctl-022e120b53a89aea4eb23f467b9ff677239938c4.tar.gz
repoctl-022e120b53a89aea4eb23f467b9ff677239938c4.tar.bz2
repoctl-022e120b53a89aea4eb23f467b9ff677239938c4.tar.xz
repoctl-022e120b53a89aea4eb23f467b9ff677239938c4.zip
add set_hdlists_needupdate, update_hdlists_if_needed functions
-rw-r--r--functions30
-rw-r--r--repoctl.conf1
2 files changed, 31 insertions, 0 deletions
diff --git a/functions b/functions
index 03c4a88..98f9969 100644
--- a/functions
+++ b/functions
@@ -54,6 +54,31 @@ function get_media_path_src()
echo "$distribdir/$distrorelease/SRPMS/$section/$sectionrepo"
}
+function set_hdlists_needupdate()
+{
+ local distrorelease="$1"
+ local section="$2"
+ local sectionrepo="$3"
+ touch "$hdlistsdir/$distrorelease-$section-$sectionrepo"
+}
+
+function update_hdlists_if_needed()
+{
+ for distrorelease in $distroreleases
+ do
+ for section in $distrosections
+ do
+ for sectionrepo in $sectionsrepos
+ do
+ if [ -f "$hdlistsdir/$distrorelease-$section-$sectionrepo" ]
+ then
+ update_hdlists "$distrorelease" "$section" "$sectionrepo"
+ fi
+ done
+ done
+ done
+}
+
function update_hdlist()
{
local repository="$1"
@@ -69,12 +94,15 @@ function update_hdlists()
local sectionrepo="$3"
check_distro_section "$distrorelease" "$section" "$sectionrepo"
+ get_repo_lock "$distrorelease" "$section" "$sectionrepo"
+ rm -f "$hdlistsdir/$distrorelease-$section-$sectionrepo"
for arch in $arches
do
update_hdlist "$distribdir/$distrorelease/$arch/media/$section/$sectionrepo"
update_hdlist "$distribdir/$distrorelease/$arch/media/debug/$section/$sectionrepo"
done
update_hdlist "$distribdir/$distrorelease/SRPMS/$section/$sectionrepo"
+ rm_repo_lock "$distrorelease" "$section" "$sectionrepo"
}
function get_lock()
@@ -221,12 +249,14 @@ function move_pkg_file()
then
local bn=$(basename "$srcfile")
get_repo_lock "$dst_distrorelease" "$dst_section" "$dst_sectionrepo"
+ set_hdlists_needupdate "$dst_distrorelease" "$dst_section" "$dst_sectionrepo"
$dryrun ln -v "$srcfile" "$destdir/$bn" >> "$output"
rm_repo_lock "$dst_distrorelease" "$dst_section" "$dst_sectionrepo"
fi
if [ -n "$src_distrorelease$src_section$src_sectionrepo" ]
then
get_repo_lock "$src_distrorelease" "$src_section" "$src_sectionrepo"
+ set_hdlists_needupdate "$src_distrorelease" "$src_section" "$src_sectionrepo"
$dryrun rm -f -v "$srcfile" >> "$output"
rm_repo_lock "$src_distrorelease" "$src_section" "$src_sectionrepo"
fi
diff --git a/repoctl.conf b/repoctl.conf
index 1c556fa..d54d9dd 100644
--- a/repoctl.conf
+++ b/repoctl.conf
@@ -9,6 +9,7 @@ else
fi
moveupdate_mailfrom="$requestuser <root@mageia.org>"
lockdir=/var/lib/repoctl/locks
+hdlistsdir=/var/lib/repoctl/hdlists
distribdir=/distrib/bootstrap/distrib
finaldistribdir=/distrib/mirror/distrib
distroreleases='1'