From abfda5efc8b34cd50d66e6454a06b4223307a754 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Sat, 20 Jul 2024 15:34:38 -0400 Subject: [PATCH] misc/yubioath-desktop: Do not write to $CWD. Signed-off-by: B. Watson Signed-off-by: Willy Sudiarto Raharjo --- .../yubioath-desktop.SlackBuild | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/misc/yubioath-desktop/yubioath-desktop.SlackBuild b/misc/yubioath-desktop/yubioath-desktop.SlackBuild index 0ab3dc8cf0..361eb27ab6 100644 --- a/misc/yubioath-desktop/yubioath-desktop.SlackBuild +++ b/misc/yubioath-desktop/yubioath-desktop.SlackBuild @@ -22,6 +22,10 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# 20240720 bkw: Modified by SlackBuilds.org: +# Do not write to $CWD. Not only was there a chmod +x, but mounting +# the file loopback without "-o ro" was updating its timestamp. + cd $(dirname $0) ; CWD=$(pwd) PRGNAM=yubioath-desktop @@ -68,28 +72,30 @@ mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf $PRGNAM-$VERSION -# Make the Appimage executable -chmod 755 $CWD/$PRGNAM-$VERSION-linux.AppImage +mkdir -p $PRGNAM-$VERSION/mnt +cd $PRGNAM-$VERSION +cp $CWD/$PRGNAM-$VERSION-linux.AppImage . +chmod +x $PRGNAM-$VERSION-linux.AppImage # Get appimage mount offset -MOUNT_OFFSET=$( $CWD/$PRGNAM-$VERSION-linux.AppImage --appimage-offset ) +MOUNT_OFFSET=$( ./$PRGNAM-$VERSION-linux.AppImage --appimage-offset ) # Mount the appimage so we can extract the .desktop and icon files. -mkdir $PRGNAM-$VERSION -mount -o loop -o offset=$MOUNT_OFFSET $CWD/$PRGNAM-$VERSION-linux.AppImage $TMP/$PRGNAM-$VERSION +mount -o ro,loop -o offset=$MOUNT_OFFSET $CWD/$PRGNAM-$VERSION-linux.AppImage $TMP/$PRGNAM-$VERSION/mnt # Add .desktop and icon to KDE/XFCE-menus mkdir -p $PKG/usr/share/applications/ $PKG/usr/share/pixmaps/ -cp $PRGNAM-$VERSION/com.yubico.yubioath.desktop ${PKG}/usr/share/applications/${PRGNAM}.desktop -cp $PRGNAM-$VERSION/com.yubico.yubioath.svg ${PKG}/usr/share/pixmaps/com.yubico.yubioath.svg +cp mnt/com.yubico.yubioath.desktop ${PKG}/usr/share/applications/${PRGNAM}.desktop +cp mnt/com.yubico.yubioath.svg ${PKG}/usr/share/pixmaps/com.yubico.yubioath.svg # Unmount appimage -umount $TMP/$PRGNAM-$VERSION -rmdir $TMP/$PRGNAM-$VERSION +umount mnt +cd $TMP +rm -rf $TMP/$PRGNAM-$VERSION # Copy appimage to package-location mkdir -p $PKG/usr/bin/ -cp $CWD/$PRGNAM-$VERSION-linux.AppImage $PKG/usr/bin/$PRGNAM +install -m0755 -oroot -groot $CWD/$PRGNAM-$VERSION-linux.AppImage $PKG/usr/bin/$PRGNAM mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc