All content is developed by the authors mentioned in the comments of the files.
I am keeping this copy for personal research purposes. Contact me if you are the author and wish for this to be removed.
/* Copyright (C) 2000 */
/* Antoine Lefebvre <[email protected]> */
/* Mark Pinese <[email protected]> */
/* Geoff O'Callaghan <[email protected]> */
/* Licensed under the GPLv2 */
In my rocket propulsion studies I encountered a nifty tool called cpropep and have been fascinated by it ever since.
This fascination started with me developing a MatLab API to the compiled tool (which can be found at thrust-team/mpropep) and ended up in the rabbit hole of me trying to reverse engineer the original source code and learn bash, git and ANSI C.
The following is a sort of log diary of the steps taken to create this repo.
At first I downloaded the the full repository (following the instructions on the SourceForge rocketworkbench repository with the use of cvs), removed all CVS folders and tried to compile it loading the folders in MS Visual Studio. After some tricks and moving source and library files around the folders, the executable was working but the process was not scriptable and I did not learn much from it.
To do these tasks I suggest a Unix environment. If you are on Windows I suggest WSL or a Virtual Machine.
To install WSL easily open an Admin Powershell Win+X+A, enable WSL and install for instance Debian:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
Invoke-WebRequest -Uri https://aka.ms/wsl-debian-gnulinux -OutFile Debian.appx -UseBasicParsing
Add-AppxPackage .\Debian.appx Open the bash shell (open start menu and search "Debian") then install git and git cvs
sudo apt install git git-cvsMake sure you have curl and gpg, add GitHub as a repository for apps, and then install gh
sudo apt install curl gpg
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo gpg --dearmor -o /usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install ghLogin to your GitHub account
gh auth loginI started looking for alternative ways to import a CVS repository into git, and found a way
git cvsimport -C target-cvs -r cvs -k -vA authors-file.txt -d $CVSROOT modulewhich, if adapted to my case, becomes
mkdir rocketworkbench
cd rocketworkbench
git cvsimport -v -d :pserver:[email protected]:/cvsroot/rocketworkbench $module -C $module
cd ..where $modules are all the libraries needed to compile cpropep, listed in the Makefile:
cpropeplibcpropeplibnumlibthermolibcompat
Each folder of these modules has become a separate git repository, which are to be merged following Eric Lee's advice, although his mv commands did not work well for me.
I started by creating a new repo which would include all repos to be merged
mkdir cpropep-git
cd crpopep-git
git initand by making a first commit with a dummy file
dir > deleteme.txt
git add .
git commit -m "Initial dummy commit"Now, for every $module, a git remote will be added to the cpropep-git repo
for module in cpropep libnum libthermo libcpropep libcompat
do
[...]
doneInside the loop, I will do the following steps.
Add modules as remotes
git remote add -f $module ../rocketworkbench/$moduleMerge the module history with the current repository source
git merge $module/master --allow-unrelated-histories --no-editCreate subfolders to move the files to, move them and delete the starting empty folders
mkdir $module $module/doc/ $module/src/ $module/include/
mv doc/* $module/doc/
mv src/* $module/src/
mv include/* $module/include/
mv Makefile $module/Makefile
mv Makefile.win $module/Makefile.win
find . -type d -empty -deleteCommit the new module to the main repo:
git add .
git commit -m "Import $module files"The data folder has a different structure and will be treated separately:
git remote add -f data ../rocketworkbench/data
git merge data/master --allow-unrelated-histories --no-edit
mkdir data
mv propellant.dat data/propellant.dat
mv thermo.dat data/thermo.dat
mv references.txt data/references.txt
git add .
git commit -m "Import data files"Clean the dummy file inserted at the start
git rm ./deleteme.txt
git commit -m "Clean dummy file"Create a GitHub repository and push the commit history source
gh repo create cpropep-git
git push --set-upstream origin masterThe entire script is then:
mkdir rocketworkbench
cd rocketworkbench
for module in cpropep libnum libthermo libcpropep libcompat
do
git cvsimport -v -d :pserver:[email protected]:/cvsroot/rocketworkbench $module -C $module
done
cd ..
mkdir cpropep-git
cd cpropep-git
git init
dir > deleteme.txt
git add .
git commit -m "Initial dummy commit"
for module in cpropep libnum libthermo libcpropep libcompat
do
git remote add -f $module ../rocketworkbench/$module
git merge $module/master --allow-unrelated-histories --no-edit
mkdir $module $module/doc/ $module/src/ $module/include/
mv doc/* $module/doc/
mv src/* $module/src/
mv include/* $module/include/
mv Makefile $module/Makefile
mv Makefile.win $module/Makefile.win
find . -type d -empty -delete
git add .
git commit -m "Import $module files"
done
git remote add -f data ../rocketworkbench/data
git merge data/master --allow-unrelated-histories --no-edit
mkdir data
mv propellant.dat data/propellant.dat
mv thermo.dat data/thermo.dat
mv references.txt data/references.txt
git add .
git commit -m "Import data files"
git rm ./deleteme.txt
git commit -m "Clean dummy file"
gh repo create cpropep-git
git push --set-upstream origin masteralthough running all commands together is not advised.
This is the new and final procedure I used to have the most updated and traceable history.
sudo apt update
sudo apt install -y wget unzip tar python2 cvs git
wget -O rocketworkbench.zip https://sourceforge.net/code-snapshots/cvs/r/ro/rocketworkbench.zip
wget -qO- https://github.com/mhagger/cvs2svn/releases/download/2.5.0/cvs2svn-2.5.0.tar.gz | tar -xz
unzip -q rocketworkbench.zip && rm rocketworkbench.zip
mv rocketworkbench rocketworkbench-cvs
python2 ./cvs2svn-2.5.0/cvs2git -q --blobfile=git-blob.dat --dumpfile=git-dump.dat rocketworkbench-cvs
mkdir rocketworkbench-git
cd rocketworkbench-git
git init
cat ../git-{blob,dump}.dat | git fast-import
rm ../git-{blob,dump}.dat
git reset --hard
git branch -m cvs2git
git checkout 885d7941f094508f6d79f7b26682ccab4cb10f07^
git checkout -b main
mkdir rocketworkbench
mkdir rocketworkbench/source
mkdir rocketworkbench/source/executables
mkdir rocketworkbench/source/libraries
mv data rocketworkbench
mv lib* rocketworkbench/source/libraries
mv {analyser,cpropep,cpropep-web,prop,rockflight} rocketworkbench/source/executables
git add data lib* analyser cpropep cpropep-web prop rockflight rocketworkbench
git commit -m "Moved some files for history reconstruction."
git cherry-pick -X theirs 885d7941f094508f6d79f7b26682ccab4cb10f07
git add rocketworkbench
git cherry-pick --continue --no-edit
git cherry-pick -X theirs d8b46c5601a3d9e5a0c59dd2484a2c4f8159421a^..cvs2git
mv rocketworkbench/* .
rmdir rocketworkbench
rm -r CVSROOT
git add * CVSROOT rocketworkbench
git commit -m "Removed CVSROOT and root rocketworkbench folder."