Dear everyone,
a day late and I must admit the first version of the script really
wasn't what it was supposed to be, but here is the final version now.
Verified and tested on a small reproduction of FGData, example repo has
been uploaded[1].
The instructions have changed, no more tmpfs is required. Just browse
into your FGDATA, make sure the working dir is clean, and run the script
(which necessarily lies outside of the FGDATA dir).
There is one tiny problem which I was not entirely able to solve, that
is that not all tags appear to be sucessfully transfered. I must insist
though, that this is a negligible issue and given the project at hand,
clearly acceptable. In the worst case we will have to reset the few tags
on FGDATA were required.
In order to run the script on the example repo instead of the real
fgdata to check for yourself, you will have to change the settings
ac_dir and canonical as indicated in the first lines of the script to
the commented-out versions.
[1] http://ompldr.org/vYWZydg
#!/bin/bash
iodir="/tmp/fgsplit"
final_ac="../split_airplanes_result/"
final_fg="../split_fgdata_result/"
ac_dir="Aircraft"
canonical="origin/master"
#canonical="master"
#ac_dir="Aircrafts"
#dornot2d="-d $iodir"
bare="--bare"
echo "
Splitting FGDATA in 10 Seconds - Press Ctrl-C to cancel!
!!!! WARNINGS !!!!
Make _ABSOLUTELY SURE_ that you are in the right repository
Running this script in a wrong repository will have unpredictable
results!
Make sure to have $iodir mounted as tmpfs with all the storage
that you can spare, at least the size of the tree, which is 6GB
All data in the following directories will be purged, if they
already exist:
$final_ac $final_fg
==== NOTE ====
_NO_ irreversible changes will be made to your local repository
The resulting 'split' repositories after the spit can be found in
$final_ac
and
$final_fg
If satisfied with the results you can then delete this very repo
Which will, of course, seal the deal and make it irreversible"
sleep 10;
if ! git status ; then
echo "ERROR - Please navigate into the root of the FGDATA repository"
exit
fi
echo "Removing $final_ac $final_fg and $iodir"
rm -RI "$final_ac" "$final_fg" "$iodir"
mkdir -p "$final_ac" "$final_fg"
origin=$(pwd)
sleep 1
echo "Bringing up to date"
git pull
echo "Going onto canonical master"
git checkout "$canonical"
echo "Creating branches for all aircrafts"
for acf in "./$ac_dir/"* ; do
ac=${acf#"./$ac_dir/"}
acbn=SPLIT-$ac
if [[ "$ac" == "Generic" || "$ac" == "Instruments" || "$ac" ==
"Instruments-3d" ]] ; then
echo "Skipping $ac"
continue ;
fi
echo "Going onto canonical master"
git checkout "$canonical"
echo "Branching for $ac" ;
git branch "$acbn"
echo "Switching to new branch";
git checkout "$acbn"
echo "Isolating, please wait";
git filter-branch -f $dornot2d --subdirectory-filter "$ac_dir/$ac"
(
echo "Extracting into new repository"
cd "$final_ac"
mkdir "$ac"
cd "$ac"
git init $bare
git fetch "$origin" "$acbn"
git branch master FETCH_HEAD
)
done
echo Going onto canonical master
git checkout "$canonical"
echo "Branching for reduced FGDATA"
git branch SPLIT-CORE
git checkout SPLIT-CORE
echo "Isolating, please wait"
git filter-branch -f $dornot2d --index-filter "git rm --cached --ignore-unmatch
$ac_dir/*"
cd $final_fg
echo "Extracting into new repository"
git init $bare
git fetch "$origin" SPLIT-CORE
git branch master FETCH_HEAD
echo "Done. Please verify the results."
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel