- Init the Lineage manifest:
repo init -u ssh://[email protected]/LineageOS/android.git -b cm-14.1
(or cm-13.0 if you prefer that) - Update your local manifest (.repo/local_manifests/roomservice.xml), if it exists - find and replace "CyanogenMod" with "LineageOS" globally.
- Move the git objects:
mv .repo/project-objects/CyanogenMod .repo/project-objects/LineageOS
curl https://gist.github.com/fourkbomb/0d94e286dc6f173eb9053c0d75e84783/raw/cc1bb94337eab5e30efa689fe1d050db25a1124a/fixlinks.sh > ~/fixlinks.sh
chmod +x ~/fixlinks.sh
cd .repo/projects
find . -name '*.git' -exec ~/fixlinks.sh {} \;
- And finally, fix the actual tree:
cd ../..
find * -name '.git' -exec ~/fixlinks.sh {} \;
repo sync
- profit
- You might wish to manually check for any remaining broken links (as suggested by @mdmower):
cd .repo/projects && find . -xtype l
Last active
December 22, 2018 15:11
-
-
Save fourkbomb/0d94e286dc6f173eb9053c0d75e84783 to your computer and use it in GitHub Desktop.
switch from CM to Lineage non-destructively
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
DIR=$1 | |
echo $DIR | |
cd $DIR | |
for i in config description info logs objects packed-refs refs rr-cache shallow svn hooks; do | |
orig=$(readlink $i) | |
dest=$(echo $orig | sed 's/CyanogenMod/LineageOS/') | |
if [ "$dest" '!=' "$orig" ]; then | |
echo "Updated $i" | |
rm $i | |
ln -s $dest $i | |
else | |
echo "Skipping $i (not CM)" | |
fi | |
done |
Thanks, updated.
This resulted in a bunch of corrupted .git repos for me, had to manually rm -rf each one then repo sync again to get the next list to remove. Depending on your download speed it may be faster to sync from scratch as repeating the sync and delete process took a number of hours.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your script didn't catch all the symlinks for me. Updated:
You might also suggest users manually look for broken symlinks in
.repo/projects
withfind . -xtype l
.