Skip to content

Commit

Permalink
Let the package manager handle with the symlink for rpms (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonVanAssche authored Sep 2, 2022
1 parent 91b4a22 commit f011325
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
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

0 comments on commit f011325

Please sign in to comment.