[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnu-arch-users] Swap-mirrors update
From: |
John Meinel |
Subject: |
[Gnu-arch-users] Swap-mirrors update |
Date: |
Thu, 16 Sep 2004 20:37:13 -0500 |
User-agent: |
Mozilla Thunderbird 0.8 (Windows/20040913) |
I recently had a colleague who wanted to use an offline mirror. I found
the "swap-mirrors" script in tlacontrib, but I noticed that it didn't
handle signed archives.
So I went ahead and updated it. Attached is the patch. (Yeah, I could
set up an arch repo, but it isn't worth it for this one change)
Basically, I just check to see if there is a signing rule for the
"-SOURCE" repository, and move it around so that it stays the same (in
case there is a custom rule)
Then I keep the -MIRROR always pointing at whatever -SOURCE is currently
registered as, so tla archive-mirror should always work.
Also, small fix to set the default archive when not in a tree to the
actual default archive.
Let me know if this makes it into tlacontrib so that I can just "tla
replay" instead of keeping my own changes.
John
=:->
--- orig/swap-mirrors
+++ mod/swap-mirrors
@@ -12,7 +12,7 @@
# purposes.
#
-archive="address@hidden"
+archive=`tla my-default-archive`
tla tree-version > /dev/null 2>&1
if [ $? -eq 0 ]
then
@@ -43,6 +43,16 @@
tla register-archive -f $archive "$s"
tla register-archive -f $archive_m "$b"
tla register-archive -d $archive_s
+
+ # This should cause the -MIRROR to use the signature from the
source
+ if [ -f "$HOME/.arch-params/signing/$archive" ]; then
+ echo "$archive" >
"$HOME/.arch-params/signing/$archive_m"
+ rm -f "$HOME/.arch-params/signing/$archive"
+ fi
+ if [ -f "$HOME/.arch-params/signing/$archive_s" ]; then
+ mv -f "$HOME/.arch-params/signing/$archive_s"
"$HOME/.arch-params/signing/$archive"
+ fi
+
echo "$archive is now remote (rw)"
fi
else
@@ -50,5 +60,15 @@
tla register-archive -f $archive "$m"
tla register-archive -f $archive_s "$b"
tla register-archive -d $archive_m
+
+ # This should keep the local copy signed from -SOURCE
+ if [ -f "$HOME/.arch-params/signing/$archive" ]; then
+ mv "$HOME/.arch-params/signing/$archive"
"$HOME/.arch-params/signing/$archive_s"
+ fi
+ if [ -f "$HOME/.arch-params/signing/$archive_m" ]; then
+ echo "$archive_s" > $HOME/.arch-params/signing/$archive
+ rm -f "$HOME/.arch-params/signing/$archive_m"
+ fi
+
echo "$archive is now in local (ro)"
fi
signature.asc
Description: OpenPGP digital signature
- [Gnu-arch-users] Swap-mirrors update,
John Meinel <=