Skip to content
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

Better way of symlinking up to update (rpm) #19

Merged
merged 1 commit into from
Sep 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions install
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,10 @@ Linux)
if command -v update &>/dev/null; then
printf "\n${WHITE}Uninstalling update...${NC}"
$sudo $pkg_manager remove -y update
echo -e "${WHITE}Removing \`${LICYAN}up${WHITE}\` command... (If you have a \`/usr/bin/up\` file that you care about, you might want to copy it somewhere safe!)\n\nWaiting 10 seconds...${NC}"
sudo rm -f /usr/bin/up
printf "\n${GREEN}Done!${NC}"
fi
printf "\n${WHITE}Installing update...${NC}"
$sudo $pkg_manager install ./update-${LATEST}-1.noarch.rpm -y
$sudo chmod +x /usr/bin/update
$sudo chmod +x /usr/bin/up
printf "\n${GREEN}Done!${NC}\n"
rm update-${LATEST}-1.noarch.rpm
;;
Expand Down
2 changes: 0 additions & 2 deletions rpm/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ mkdir -p "${BUILD_DIR}/${NAME}-${VERSION}"
# Create the tarball.
echo "Creating tarball..."
cp -r "${BUILD_DIR}/${NAME}" "${BUILD_DIR}/${NAME}-${VERSION}"
echo "Linking update to up..."
ln -v -s /usr/bin/update "${BUILD_DIR}/${NAME}-${VERSION}/up" || echo "failed to link update to up!"
echo "Done!"; ls "${BUILD_DIR}/${NAME}-${VERSION}/"
tar --create --file "${NAME}-${VERSION}.tar.gz" "${NAME}-${VERSION}"

Expand Down
9 changes: 7 additions & 2 deletions rpm/update.spec
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,17 @@ Updates apps/packages/dependencies from Apt, Pi-Apps, Flatpak, the Snap Store, H
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/%{_bindir}
cp %{name} $RPM_BUILD_ROOT/%{_bindir}
cp up $RPM_BUILD_ROOT/%{_bindir}

%post
[[ -L %{_bindir}/up ]] && rm -rf %{_bindir}/up
ln -v -s %{_bindir}/update %{_bindir}/up

%postun
[[ -L %{_bindir}/up ]] && rm -rf %{_bindir}/up

%clean
rm -rf $RPM_BUILD_ROOT

%files
%{_bindir}/%{name}
%{_bindir}/up