-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add script to rename packages from ignition to gazebo #726
Merged
Merged
Changes from 5 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a0319f3
Add script to rename packages from ignition to gazebo
j-rivero 1bd6ab5
Add instruction to README
j-rivero d4261e2
Use gazebo-release
j-rivero b1754cc
Remove GITHUB_ORG and use gazebosim
j-rivero b12d401
Check for transitional packages and remove debian buster
j-rivero 3734ba8
merged from master
chapulina a32c867
Import changes from 797
j-rivero 657d23b
Custom fixes for changes
j-rivero 595b90b
Merge branch 'master' into rename_ign_to_gz
j-rivero File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,7 +48,7 @@ if ${NIGHTLY_MODE}; then | |
if ${USE_REPO_DIRECTORY_FOR_NIGHTLY}; then | ||
mv ${WORKSPACE}/repo \$REAL_PACKAGE_NAME | ||
else | ||
git clone https://github.com/${GITHUB_ORG}/\$REAL_PACKAGE_NAME -b ${NIGHTLY_SRC_BRANCH} | ||
git clone https://github.com/gazebosim/\$REAL_PACKAGE_NAME -b ${NIGHTLY_SRC_BRANCH} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we still need |
||
fi | ||
PACKAGE_SRC_BUILD_DIR=\$REAL_PACKAGE_NAME | ||
cd \$REAL_PACKAGE_NAME | ||
|
@@ -83,7 +83,7 @@ fi | |
|
||
# Step 4: add debian/ subdirectory with necessary metadata files to unpacked source tarball | ||
rm -rf /tmp/$PACKAGE-release | ||
git clone https://github.com/ignition-release/$PACKAGE-release -b $RELEASE_REPO_BRANCH /tmp/$PACKAGE-release | ||
git clone https://github.com/gazebo-release/$PACKAGE-release -b $RELEASE_REPO_BRANCH /tmp/$PACKAGE-release | ||
cd /tmp/$PACKAGE-release | ||
# In nightly get the default latest version from default changelog | ||
if $NIGHTLY_MODE; then | ||
|
@@ -109,7 +109,7 @@ fi | |
case \${BUILD_METHOD} in | ||
"OVERWRITE_BASE") | ||
# 1. Clone the base branch | ||
git clone https://github.com/ignition-release/\${PACKAGE}-release \\ | ||
git clone https://github.com/gazebo-release/\${PACKAGE}-release \\ | ||
-b \${RELEASE_BASE_BRANCH} \\ | ||
/tmp/base_$PACKAGE-release | ||
# 2. Overwrite the information | ||
|
@@ -190,7 +190,7 @@ fi | |
timeout=0 | ||
# Help to debug race conditions in nightly generation or other problems with versions | ||
if ${NIGHTLY_MODE}; then | ||
apt-cache show *ignition* | ( grep 'Package\\|Version' || true) | ||
apt-cache show *gz-* | ( grep 'Package\\|Version' || true) | ||
# 5 minutes to give time to the uploader | ||
timeout=300 | ||
fi | ||
|
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# 0. Pre checks | ||
find . -name control -type f | while IFS= read -r f; do | ||
if grep "transitional package" "${f}" > /dev/null; then | ||
echo "There are transitional packages declared in ${f}" | ||
echo "Please remove them, probably not needed." | ||
exit 1 | ||
fi | ||
done | ||
|
||
# we don't support buster anymore | ||
if [[ -d debian/buster ]]; then | ||
git rm -fr debian/buster | ||
fi | ||
|
||
# 1. Block: change in the control file | ||
find . -name control -type f | while IFS= read -r f; do | ||
if [[ $f == ./ubuntu/debian/tests/control ]]; then | ||
continue | ||
fi | ||
echo "Processing control file: ${f}" | ||
ignition_pkgs=$(grep-dctrl -sPackage -n '' ${f}) | ||
echo " - Replace ignition ocurrences" | ||
# Rename urls and packages | ||
sed -i -e 's:ignitionrobotics:gazebosim:g' "${f}" | ||
sed -i -e 's:libignition:libgz:g' "${f}" | ||
sed -i -e 's:ignition:gz:g' "${f}" | ||
sed -i -e 's:Ignition:Gazebo:g' "${f}" | ||
sed -i -e 's:ign-:gz-:g' "${f}" | ||
# Inject transitional (alias) packages | ||
echo " - Transitional packages in control file" | ||
for pkg in ${ignition_pkgs}; do | ||
echo " * Processing transitional package for ${pkg}" | ||
new_pkg_name=${pkg/ignition/gz} | ||
cat << EOF >> "${f}" | ||
|
||
Package: ${pkg} | ||
Depends: ${new_pkg_name}, \${misc:Depends} | ||
Architecture: all | ||
Priority: optional | ||
Section: oldlibs | ||
Description: transitional package | ||
This is a transitional package. It can safely be removed. | ||
EOF | ||
done | ||
echo | ||
done | ||
|
||
# 2. Copyright files | ||
find . -name '*copyright*' -type f | while IFS= read -r f; do | ||
echo "Procesing copyright file: ${f}" | ||
sed -i -e 's:bitbucket.org/:github.org/:g' "${f}" | ||
sed -i -e 's:/osrf/:/ignitionrobotics/:g' "${f}" | ||
sed -i -e 's:ignitionrobotics:gazebosim:g' "${f}" | ||
sed -i -e 's:ignition:gz:g' "${f}" | ||
sed -i -e 's:ign_:gz-:g' "${f}" | ||
echo | ||
done | ||
|
||
# 3. Test file if needed | ||
if [[ -f ubuntu/debian/tests/ ]]; then | ||
echo "Procesing copyright tests control" | ||
sed -i -e 's:ignition:gz:g' ubuntu/debian/tests/control | ||
echo | ||
fi | ||
|
||
# 4. Changelog files | ||
find . -name 'changelog' -type f | while IFS= read -r f; do | ||
echo "Bumping changelog file ${f}" | ||
distro=$(dpkg-parsechangelog -l${f} -S distribution) | ||
version=$(dpkg-parsechangelog -l${f} -S Version | sed 's:~.*::g') | ||
version_without_rev=${version/-*} | ||
bump_rev=$(( ${version/*-} + 1 )) | ||
dch --changelog "${f}" \ | ||
--distribution="${distro}" \ | ||
--force-distribution \ | ||
--newversion "${version_without_rev}-${bump_rev}~${distro}" \ | ||
"Change package source name" | ||
sed -i -e '1 s:ignition-gazebo:gz-sim:g' "${f}" | ||
sed -i -e '1 s:ignition:gz:g' "${f}" | ||
done | ||
|
||
echo | ||
|
||
# 5. Rename all ignition symlinks and destinations | ||
find . -name '*ignition*' -type l | while IFS= read -r f; do | ||
echo "Renaming ${f} -> ${f/ignition-/gz-}" | ||
link=$(readlink "$f") | ||
ln -sfT "${link//ignition-/gz-}" "${f}" | ||
git mv "${f}" "${f/ignition-/gz-}" | ||
done | ||
|
||
echo | ||
|
||
# 6. Rename all ignition filenames not symlinks | ||
find . -name '*ignition*' -type f | while IFS= read -r f; do | ||
echo "Renaming ${f} -> ${f/ignition-/gz-}" | ||
git mv "${f}" "${f/ignition-/gz-}" | ||
done | ||
|
||
# 6. watch files | ||
find . -name 'watch' -type f | while IFS= read -r f; do | ||
echo "Changeing watch file ${f}" | ||
sed -i -e 's:/osrf/:/ignitionrobotics/:g' "${f}" | ||
sed -i -e 's:ignitionrobotics:gazebosim:g' "${f}" | ||
sed -i -e 's:ignition:gz:g' "${f}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we also need a |
||
done | ||
|
||
echo | ||
|
||
# 7. Revert Provides, Breaks, Replaces | ||
find . -name control -type f | while IFS= read -r f; do | ||
sed -i -e 's:\(Breaks\:.*\)gz-\(.*\):\1ignition-\2:' "${f}" | ||
sed -i -e 's:\(Provides\:.*\)gz-\(.*\):\1ignition-\2:' "${f}" | ||
sed -i -e 's:\(Replaces\:.*\)gz-\(.*\):\1ignition-\2:' "${f}" | ||
done |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need
osrf
for Gazebo classic?