@@ -40,6 +40,7 @@ WORK_DIR="$HOME"
4040NEW_LEAPP_NAME=" leapp-repository-$BRANCH "
4141NEW_LEAPP_DIR=" $WORK_DIR /$NEW_LEAPP_NAME /"
4242LEAPP_PATH=' /usr/share/leapp-repository/repositories/'
43+ LEAPP_GPG_PATH=' /etc/leapp/repos.d/system_upgrade/common/files/rpm-gpg'
4344EXCLUDE_PATH='
4445/usr/share/leapp-repository/repositories/system_upgrade/el7toel8/files/bundled-rpms
4546/usr/share/leapp-repository/repositories/system_upgrade/el7toel8/files
@@ -56,6 +57,11 @@ echo "RHEL_MAJOR_VERSION=$RHEL_MAJOR_VERSION"
5657echo " WORK_DIR=$WORK_DIR "
5758echo " EXCLUDED_PATHS=$EXCLUDE_PATH "
5859
60+ echo " Preserve GPG keys if any"
61+ for major in 8 9; do
62+ test -e ${LEAPP_GPG_PATH} /${major} && mv ${LEAPP_GPG_PATH} /${major} ${WORK_DIR} /
63+ done
64+
5965
6066echo ' Remove old files'
6167for dir in $( find $LEAPP_PATH -type d) ;
7379 fi
7480done
7581
76- echo " Download new tarball from https://github.com/$USER /leapp-repository/archive/$BRANCH /leapp-repository-$BRANCH .tar.gz"
77- curl -s -L https://github.com/$USER /leapp-repository/archive/$BRANCH /leapp-repository-$BRANCH .tar.gz | tar -xz -C $WORK_DIR /
82+ echo " Download new tarball from https://github.com/$USER /leapp-repository/archive/$BRANCH /leapp-repository-$BRANCH .tar.gz"
83+ curl -s -L https://github.com/$USER /leapp-repository/archive/$BRANCH /leapp-repository-$BRANCH .tar.gz | tar -xmz -C $WORK_DIR / || exit 1
7884
7985echo ' Deleting files as in spec file'
8086rm -rf $NEW_LEAPP_DIR /repos/common/actors/testactor
8995fi
9096
9197echo ' Copy new data to system'
92- cp -r $NEW_LEAPP_DIR /repos/* $LEAPP_PATH
98+ cp -r $NEW_LEAPP_DIR /repos/* $LEAPP_PATH || exit 1
9399
94100for DIRECTORY in $( find $LEAPP_PATH -mindepth 1 -maxdepth 1 -type d) ;
95101do
96102 REPOSITORY=$( basename $DIRECTORY )
97103 if ! [ -e /etc/leapp/repos.d/$REPOSITORY ]; then
98104 echo " Enabling repository $REPOSITORY "
99- ln -s $LEAPP_PATH /$REPOSITORY /etc/leapp/repos.d/$REPOSITORY
105+ ln -s $LEAPP_PATH /$REPOSITORY /etc/leapp/repos.d/$REPOSITORY || exit 1
100106 fi
101107done
102108
109+ echo " Restore GPG keys if any"
110+ for major in 8 9; do
111+ rm -rf ${LEAPP_GPG_PATH} /${major}
112+ test -e ${WORK_DIR} /${major} && mv ${WORK_DIR} /${major} ${LEAPP_GPG_PATH} /
113+ done
114+
103115rm -rf $NEW_LEAPP_DIR
116+
117+ exit 0
0 commit comments