public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/gnome-commander] rawhide: 2.0.3
@ 2026-08-10 4:54 Mamoru TASAKA
0 siblings, 0 replies; only message in thread
From: Mamoru TASAKA @ 2026-08-10 4:54 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/gnome-commander
Branch : rawhide
Commit : 40a99702ec196b82b8e373cf926f7643fbff9e4a
Author : Mamoru TASAKA <mtasaka@fedoraproject.org>
Date : 2026-08-10T13:54:43+09:00
Stats : +149/-620 in 8 file(s)
URL : https://src.fedoraproject.org/rpms/gnome-commander/c/40a99702ec196b82b8e373cf926f7643fbff9e4a?branch=rawhide
Log:
2.0.3
---
diff --git a/.gitignore b/.gitignore
index 852717d..0e283c5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
/gnome-commander-*.tar.gz
/gnome-commander-*.tar.xz
+/gnome-commander-2.0.3.tar.bz2
diff --git a/gnome-commander-1.6.0-path-fedora-specific.patch b/gnome-commander-1.6.0-path-fedora-specific.patch
deleted file mode 100644
index cf41058..0000000
--- a/gnome-commander-1.6.0-path-fedora-specific.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- gnome-commander-1.6.0/src/utils.cc.path 2016-10-03 05:27:02.000000000 +0900
-+++ gnome-commander-1.6.0/src/utils.cc 2016-10-16 15:14:16.638827912 +0900
-@@ -112,7 +112,7 @@
-
- if (gnome_cmd_data.use_gcmd_block)
- {
-- gchar *s = g_strdup_printf ("bash -c \"%s; %s/bin/gcmd-block\"", in_command, PREFIX);
-+ gchar *s = g_strdup_printf ("bash -c \"%s; /usr/libexec/%s/gcmd-block\"", in_command, PACKAGE);
- arg = g_shell_quote (s);
- g_free (s);
- }
diff --git a/gnome-commander-pr203-rust-gtk4-change-revert.patch b/gnome-commander-pr203-rust-gtk4-change-revert.patch
new file mode 100644
index 0000000..2ea17c2
--- /dev/null
+++ b/gnome-commander-pr203-rust-gtk4-change-revert.patch
@@ -0,0 +1,30 @@
+--- gnome-commander-2.0.3/src/application.rs.debug 2026-06-13 18:48:31.000000000 +0900
++++ gnome-commander-2.0.3/src/application.rs 2026-08-10 00:21:50.263327176 +0900
+@@ -139,7 +139,7 @@ mod imp {
+ self.parent_shutdown();
+ }
+
+- fn handle_local_options(&self, options: &glib::VariantDict) -> ControlFlow<glib::ExitCode> {
++ fn handle_local_options(&self, options: &glib::VariantDict) -> glib::ExitCode {
+ let debug_flags = get_string_option(options, "debug").map(|flags| {
+ if flags.contains('a') {
+ "giklmnpstuvwyzx".to_owned()
+--- gnome-commander-2.0.3/src/utils.rs.debug 2026-06-13 18:48:31.000000000 +0900
++++ gnome-commander-2.0.3/src/utils.rs 2026-08-10 00:19:53.974168496 +0900
+@@ -634,14 +634,8 @@ impl GnomeCmdFileExt for gio::File {
+ };
+ let close_result = enumerator.close(cancellable);
+ result?;
+- match close_result {
+- (true, None) => Ok(vec),
+- (false, None) => Err(glib::Error::new(
+- gio::IOErrorEnum::Failed,
+- &gettext("Closing of a file enumerator failed"),
+- )),
+- (_, Some(error)) => Err(error),
+- }
++ close_result?;
++ Ok(vec)
+ }
+ }
+
diff --git a/gnome-commander.sh b/gnome-commander.sh
deleted file mode 100644
index 9e5b2e9..0000000
--- a/gnome-commander.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-
-export PATH=/usr/libexec/gnome-commander:$PATH
-exec gnome-commander $@
diff --git a/gnome-commander.spec b/gnome-commander.spec
index db1f296..671893f 100644
--- a/gnome-commander.spec
+++ b/gnome-commander.spec
@@ -2,11 +2,11 @@
%undefine _strict_symbol_defs_build
%global EXIV2_REQ 0.14
-%global GLIB_REQ 2.70.0
-%global LIBGSF_REQ 1.14.26
-%global POPPLER_REQ 0.18
+%global GLIB_REQ 2.80.0
+%global GTK_REQ 4.14.0
+%global LIBGSF_REQ 1.14.46
%global TAGLIB_REQ 1.4
-%global UNIQUE_REQ 0.9.3
+%global VTE_REQ 0.76
%global if_pre 0
@@ -37,8 +37,8 @@
%global clamp_mtime_to_source_date_epoch 0
%endif
-%global shortver 1.18
-%global fullver %{shortver}.5
+%global shortver 2.0
+%global fullver %{shortver}.3
%if 0%{?use_release} >= 1
%global fedoraver %{fullver}
@@ -51,97 +51,78 @@ Name: gnome-commander
# Downgrade 3 times, sorry...
Epoch: 4
Version: %{fedoraver}
-Release: 2%{?dist}%{flagrel}
-Summary: A nice and fast file manager for the GNOME desktop
-Summary(pl): Menadżer plików dla GNOME oparty o Norton Commander'a (TM)
-Summary(sv): GNOME Commander är en snabb och smidig filhanderare för GNOME
+Release: 1%{?dist}%{flagrel}
+Summary: Fast and powerful twin-panel file manager for the Linux desktop
-# Overall GPL-2.0-or-later
+# Overall GPL-3.0-or-later
# data/org.gnome.gnome-commander.appdata.xml.in CC0-1.0
# doc/C/legal.xml GFDL-1.1-or-later
# SPDX confirmed
-License: GPL-2.0-or-later AND GFDL-1.1-or-later AND CC0-1.0
-URL: http://gcmd.github.io/
+License: %{shrink:
+ GPL-3.0-or-later AND
+ GFDL-1.3-or-later AND
+ CC0-1.0
+ }
+URL: https://gnome.pages.gitlab.gnome.org/gnome-commander/
%if 0%{?use_release}
-Source0: http://ftp.gnome.org/pub/GNOME/sources/%{name}/%{shortver}/%{name}-%{version}%{?extratag:-%extratag}.tar.xz
+Source0: https://gitlab.gnome.org/GNOME/%{name}/-/archive/%{version}/%{name}-%{version}%{?extratag:-%extratag}.tar.bz2
%endif
%if 0%{?use_gitbare}
Source0: %{name}-%{gittardate}T%{gittartime}.tar.gz
%endif
-Source1: gnome-commander.sh
-# Source0 is created from Source2
-Source2: create-gcmd-git-bare-tarball.sh
-Patch1: gnome-commander-1.6.0-path-fedora-specific.patch
+# https://gitlab.gnome.org/GNOME/gnome-commander/-/merge_requests/331/diffs?commit_id=b7bbb1d7d792a523e7b3a58e96dadc9db4c5152e
+# As currently we use old rust-gtk4, some changes in the above MR
+# has to be reverted.
+Patch0: gnome-commander-pr203-rust-gtk4-change-revert.patch
+# meson.build
+BuildRequires: meson
+BuildRequires: gcc
BuildRequires: gcc-c++
%if 0%{?use_gcc_strict_sanitize}
BuildRequires: libasan
BuildRequires: libubsan
%endif
-BuildRequires: desktop-file-utils
-BuildRequires: gettext
-BuildRequires: intltool
-
-BuildRequires: pkgconfig(exiv2) >= %{EXIV2_REQ}
+BuildRequires: pkgconfig(gobject-2.0) >= %{GLIB_REQ}
+BuildRequires: pkgconfig(glib-2.0) >= %{GLIB_REQ}
+BuildRequires: pkgconfig(gmodule-2.0)
BuildRequires: pkgconfig(gio-2.0)
-BuildRequires: pkgconfig(glib-2.0)
-BuildRequires: pkgconfig(gtk+-3.0)
-BuildRequires: pkgconfig(gnome-vfs-2.0)
+BuildRequires: pkgconfig(gtk4) >= %{GTK_REQ}
+BuildRequires: pkgconfig(vte-2.91-gtk4) >= %{VTE_REQ}
+BuildRequires: pkgconfig(gdk-pixbuf-2.0)
+BuildRequires: pkgconfig(exiv2) >= %{EXIV2_REQ}
BuildRequires: pkgconfig(libgsf-1) >= %{LIBGSF_REQ}
-BuildRequires: pkgconfig(poppler-glib) >= %{POPPLER_REQ}
-BuildRequires: pkgconfig(taglib) >= %{TAGLIB_REQ}
-BuildRequires: pkgconfig(unique-1.0) >= %{UNIQUE_REQ}
+BuildRequires: pkgconfig(taglib) >= %{TAGLIB_REQ}
+BuildRequires: pkgconfig(poppler-glib)
+BuildRequires: cargo-rpm-macros
-BuildRequires: libICE-devel
-BuildRequires: libSM-devel
+# data/meson.build
+BuildRequires: /usr/bin/appstream-util
+BuildRequires: desktop-file-utils
-BuildRequires: meson
-BuildRequires: flex
-BuildRequires: intltool
+# doc/meson.build
BuildRequires: yelp-tools
+BuildRequires: pkgconfig(gobject-introspection-1.0)
+
+# libgcmd/meson.build
+BuildRequires: /usr/bin/gi-docgen
+# po/meson.build
+BuildRequires: gettext
+BuildRequires: intltool
+
+# etc
BuildRequires: /usr/bin/git
-BuildRequires: /usr/bin/appstream-util
# %%check
-BuildRequires: xorg-x11-server-Xvfb
-BuildRequires: pkgconfig(gtest)
-
-Requires: meld
-Requires: gnome-icon-theme-legacy
-%if 0%{?fedora} >= 41
-BuildRequires: gdk-pixbuf2-modules-extra
-Requires: gdk-pixbuf2-modules-extra%{?_isa}
-%endif
+# etc
+Requires: meld
+Requires: gnome-icon-theme-legacy
%description
-GNOME Commander is a nice and fast file manager for the GNOME desktop.
-In addition to performing the basic filemanager functions the program is
-also an FTP-client and it can browse SMB-networks.
-
-%description -l cs
-GNOME Commander je pěkný a rychlý správce souborů pro GNOME desktop.
-Kromě základních funkcí správy souborů je program také
-FTP klient a umí procházet SMB sítěmi.
-
-%description -l pl
-GNOME Commander to niewielki i wydajny menadżer plików umożliwiający
-wykonywanie za pomocą klawiatury wszystkich standardowych operacji na plikach.
-Dostępne są również dodatkowe funkcje jak np. obsługa FTP, czy też obsługa
-sieci SMB.
-
-%description -l ru
-Быстро работающий файловый менеджер для GNOME. Может выполнять большинство
-типовых операций с файлами, умеет обнаруживать изменения, внесенные в файлы
-другими программами, и автоматически обновлять отображаемый список файлов.
-Поддерживает описания файловых структур в формате DND и кодировки MIME.
-Реализует на базовом уровне поддержку FTP через GnomeVFS.
-
-%description -l sv
-GNOME Commander är en snabb och smidig filhanderare för GNOME.
-Utöver att kunna hantera filer på din egen dator så kan programmet även
-ansluta till FTP-servrar och SMB-nätverk.
+Gnome Commander is a fast and powerful twin-panel file manager for
+the Linux desktop.
%prep
%if 0%{?use_release}
@@ -189,34 +170,27 @@ git add .
git commit -m "base" -q
%endif
-%patch -P1 -p1 -b .path
-git commit -m "Apply Fedora specific path configuration" -a
-%if 0%{?use_release}
-%endif
+# Tweak rpath to move library to project specific directory
+sed -i.rpath src/meson.build \
+ -e "\@rpath =@s|^.*$|rpath = '%{_libdir}/%{name}'|"
+git commit -m "tweak rpath" -a
-# Tweak samba detection
-sed -i meson.build \
- -e 's|^\(samba = dependency\)|# \1|' \
- -e 's|^\(have_samba = .*\)$|have_samba = true|' \
- %{nil}
-git commit -m "Tweak samba detection" -a
+# Relax Cargo deps for vte for now
+# ... and adjust other deps
+sed -i Cargo.toml \
+ -e '\@vte =.*vte4@s|0.10.0|0.8.0|' \
+ -e '\@glib =.*@s|0.22|0.20|' \
+ -e '\@gtk =.*gtk4@s|0.11|0.9|' \
+ %{nil}
+git commit -m "relax Cargo deps" -a
-# Don't install unneeded files
-sed -i doc/meson.build \
- -e '\@install_data@,\@^)$@s|^\(.*\)$|# \1|' \
- %{nil}
-git commit -m "Don't install header files, static archives, documentation" -a
+%patch -P0 -p1
+git commit -m "revert some rust-gtk4 related changes" -a
-%if 0%{?use_gitbare}
-pushd ..
-%endif
+%cargo_prep
-# gzip
-#gzip -9 ChangeLog-*
-
-%if 0%{?use_gitbare}
-popd
-%endif
+%generate_buildrequires
+%cargo_generate_buildrequires -a -t
%build
export BUILD_TOP_DIR=$(pwd)
@@ -231,14 +205,13 @@ export CXX="${CXX} -fsanitize=address -fsanitize=undefined"
pushd %{name}
%endif
-# Install wrapper script, and move binaries to
-# %%{_libexecdir}/%%{name}
-%meson \
- --bindir=%{_libexecdir}/%{name} \
- %{nil}
-
+%meson
%meson_build --ninja-args "-k 0"
+%cargo_license_summary
+%{cargo_license} > $BUILD_TOP_DIR/LICENSE.dependencies
+
+
%if 0%{?use_gitbare}
popd
%endif
@@ -250,28 +223,26 @@ pushd %{name}
%meson_install
-# Install wrapper
-%{__mkdir_p} %{buildroot}%{_bindir}
-%{__install} -cpm 0755 %SOURCE1 %{buildroot}%{_bindir}/%{name}
-
%if 0%{?use_gitbare}
popd
%endif
+# Move library to project specific directory
+pushd %{buildroot}
+mv ./%{_libdir}/libgcmd.so ./%{_libdir}/%{name}/
+
+popd
+
%find_lang %{name}
%check
desktop-file-validate %{buildroot}%{_datadir}/applications/org.gnome.%{name}.desktop
-appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/org.gnome.%{name}.appdata.xml
+appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/org.gnome.%{name}.metainfo.xml
%if 0%{?use_gitbare}
pushd %{name}
%endif
-export ASAN_OPTIONS=detect_leaks=0
-xvfb-run sh -c \
- "%meson_test -v"
-
%if 0%{?use_gitbare}
popd
%endif
@@ -280,32 +251,57 @@ popd
%defattr(-,root,root,-)
%doc AUTHORS
%doc BUGS
+%doc CONTRIBUTING.md
%license COPYING
+%license LICENSES/
+%license LICENSE.dependencies
+%doc MAINTAINERS
%doc NEWS
%doc README.md
-%doc TODO
-%doc doc/*.txt
-
-%{_bindir}/*
-%{_libexecdir}/%{name}/
-%{_libdir}/%{name}/
-%{_mandir}/man1/%{name}.1*
-%{_datadir}/glib-2.0/schemas/org.gnome.*xml
%dir %{_datadir}/%{name}
-#%%{_datadir}/%{name}/*.txt
-%{_datadir}/%{name}/icons/
+# data/meson.build
+%{_metainfodir}/org.gnome.%{name}.metainfo.xml
%{_datadir}/applications/org.gnome.%{name}.desktop
-%{_metainfodir}/org.gnome.%{name}.appdata.xml
+%{_datadir}/glib-2.0/schemas/org.gnome.%{name}.*.xml
+# doc/meson.build
+%{_mandir}/man1/%{name}.1*
%{_datadir}/help/*/%{name}/
+# libgcmd/meson.build
+%dir %{_libdir}/%{name}/
+%{_libdir}/%{name}/libgcmd.so
+%dir %{_libdir}/girepository-1.0
+%{_libdir}/girepository-1.0/GnomeCmd-1.0.typelib
+%dir %{_datadir}/gir-1.0/
+%{_datadir}/gir-1.0/GnomeCmd-1.0.gir
+%doc %{_defaultdocdir}/libgcmd-1.0/
-%{_datadir}/icons/hicolor/scalable/apps/%{name}*.svg
+# pixmaps/*/meson.build
%{_datadir}/pixmaps/%{name}/
+%{_datadir}/icons/hicolor/scalable/apps/
+
+# pixmaps/file-type-icons/meson.build
+%{_datadir}/%{name}/icons/*.png
+
+# pixmaps/meson.build
+%dir %{_datadir}/%{name}/icons/
+%{_datadir}/%{name}/icons/hicolor/
+
+# plugins/*/meson.build
+%dir %{_libdir}/%{name}/plugins/
+%{_libdir}/%{name}/plugins/lib*plugin.so
+%{_libdir}/%{name}/plugins/*.png
+
+# src/meson.build
+%{_bindir}/%{name}
%changelog
+* Mon Aug 10 2026 Mamoru TASAKA <mtasaka@fedoraproject.org> - 4:2.0.3-1
+- 2.0.3
+
* Thu Jul 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 4:1.18.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
diff --git a/mimeedit-svn1958.diff b/mimeedit-svn1958.diff
deleted file mode 100644
index 40f820d..0000000
--- a/mimeedit-svn1958.diff
+++ /dev/null
@@ -1,107 +0,0 @@
-Index: mimeedit.sh
-===================================================================
---- mimeedit.sh (revision 1962)
-+++ mimeedit.sh (working copy)
-@@ -63,11 +63,13 @@
- # Build a list with registered apps for this mimetype.
- #
- function deflist (){
-- if [ -e "$UTMP.avail" ]; then cleanup;fi
-+ TMP_AVAIL="`mktemp /tmp/gnome-commander.XXXXXX`"
-+ TMP_CHOSEN="`mktemp /tmp/gnome-commander.XXXXXX`"
-+ # if [ -e "$UTMP.avail" ]; then cleanup;fi
- # Create the list in "$UTMP.avail" to be used by the zenity list-box
- if [ "$NONEW" == 1 ]
- then
-- echo "FALSE Add_New_App New" > "$UTMP.avail"
-+ echo "FALSE Add_New_App New" > $TMP_AVAIL
- fi
- # Get all sub-mimetypes, one per row.
- SUB="$(grep -hs "^$MTPE" $SUBC $G_CACHE $U_CACHE | awk -F= '{print $1}' | sed 's/ /\n/g')"
-@@ -77,14 +79,14 @@
- then
- for i in $(echo "$MTPEs" | sort -u); do
- echo "FALSE $i $(grep -hs "^Name=" $GDATA_DIR/$i $DATA_DIR/$i | \
-- sed 's/Name=//;s/ /_/g')" >> "$UTMP.avail"
-+ sed 's/Name=//;s/ /_/g')" >> $TMP_AVAIL
- done
- fi
- # Change FALSE to TRUE for the default app.
-- if grep -q "desktop" "$UTMP.avail"
-+ if grep -q "desktop" $TMP_AVAIL
- then
- DEF_APP=$(gnomevfs-info -s "$ARGU" | grep "Default app" | sed 's/.*: //')
-- sed -i "s|FALSE $DEF_APP|TRUE $DEF_APP|" "$UTMP.avail"
-+ sed -i "s|FALSE $DEF_APP|TRUE $DEF_APP|" $TMP_AVAIL
- fi
- # Show the list
- zenity --height="350" --width="550" --list --radiolist --text \
-@@ -99,17 +101,17 @@
-
- Please select" \
- --column "Pick" --column ".desktop file" --column "Application" \
-- $(cat "$UTMP.avail") > "$UTMP.chosen"
-+ $(cat $TMP_AVAIL ) > $TMP_CHOSEN
- retval=$?
-- choice=$(cat "$UTMP.chosen")
-+ choice=$(cat $TMP_CHOSEN )
- if grep -q "$MTPE=$choice" $U_DEF
- then
- retval=2
- fi
- case $retval in
- 0)
-- DEF_CH=$(grep -s "$choice" "$UTMP.avail" | awk '{print $2}')
-- DEF_NME=$(grep -s "$choice" "$UTMP.avail" | awk '{print $3}')
-+ DEF_CH=$(grep -s "$choice" $TMP_AVAIL | awk '{print $2}')
-+ DEF_NME=$(grep -s "$choice" $TMP_AVAIL | awk '{print $3}')
- if [ "$DEF_CH" = Add_New_App ]
- then
- newmime
-@@ -305,8 +307,8 @@
- # Remove tempfiles.
- #
- function cleanup (){
-- rm -f "$UTMP.avail"
-- rm -f "$UTMP.chosen"
-+ rm -f $TMP_AVAIL
-+ rm -f $TMP_CHOSEN
- }
-
- #
-@@ -342,6 +344,7 @@
- # The .desktop file editor
- #
- function dtfedit (){
-+ TMPFILE=`mktemp /tmp/gnome-commander.XXXXXX`
- USER_DTF="$DT_FILE-$EXT"
- if [ -n "$DT_FILE" ]
- then
-@@ -350,15 +353,22 @@
- then
- TO_EDIT="$DATA_DIR/$USER_DTF"
- else
-- TO_EDIT="$GDATA_DIR/$DT_FILE.desktop"
-+ DT_FILE_PREFIX=$(echo $DT_FILE | sed -e 's|-[0-9][0-9]*||')
-+ DT_FILE_SUFFIX=$(echo $DT_FILE | sed -n -e 's|^.*-\([0-9][0-9]*\)$|\1|p')
-+ if [ -e $DATA_DIR/${DT_FILE_PREFIX}-usercreated-$DT_FILE_SUFFIX.desktop ]
-+ then
-+ TO_EDIT="$DATA_DIR/${DT_FILE_PREFIX}-usercreated-$DT_FILE_SUFFIX.desktop"
-+ else
-+ TO_EDIT="$GDATA_DIR/$DT_FILE.desktop"
-+ fi
- fi
- cat "$TO_EDIT" | zenity --height="350" --width="550" --text-info --editable \
-- --title "Edititng the file: $USER_DTF" > $UTMP.$USER_DTF
-- if [ -s $UTMP.$USER_DTF ]
-+ --title "Edititng the file: $USER_DTF" > $TMPFILE
-+ if [ -s $TMPFILE ]
- then
-- mv $UTMP.$USER_DTF $DATA_DIR/$USER_DTF
-+ mv $TMPFILE $DATA_DIR/$USER_DTF
- else
-- rm -f $UTMP.$USER_DTF
-+ rm -f $TMPFILE
- DT_FILE=""
- fi
- fi
diff --git a/mimeedit-svn1958.sh b/mimeedit-svn1958.sh
deleted file mode 100644
index 06b42af..0000000
--- a/mimeedit-svn1958.sh
+++ /dev/null
@@ -1,376 +0,0 @@
-#!/bin/bash
-#
-# gnome-file-types-properties -
-# A zenity-script for chosing preferred applications.
-# Written by Magnus Stålnacke (jemamo at telia.com)
-# Version 0.8.4 Nov. 30 2007
-#
-export LANG=en_US.utf8
-
-ARGU="$1"
-UTMP="/tmp/$(whoami)"
-DATA_DIR="$HOME/.local/share/applications"
-GDATA_DIR="/usr/share/applications"
-G_CACHE="$GDATA_DIR/mimeinfo.cache"
-U_CACHE="$DATA_DIR/mimeinfo.cache"
-SUBC="/usr/share/mime/subclasses"
-U_DEF="$DATA_DIR/defaults.list"
-EXT="usercreated.desktop"
-NONEW=1
-
-#
-# Create dirs in users home if missing.
-#
-if [ -e "$DATA_DIR" ]; then :; else mkdir $DATA_DIR;fi
-if [ -e "$U_DEF" ]
-then :;
-else
- echo "[Default Applications]" > $DATA_DIR/defaults.list
-fi
-
-#
-# Check how we got started.
-#
-function checkarg (){
- if [ -n "$ARGU" ]
- then
- if [ -e "$ARGU" ]
- then
- chkmtpe
- deflist
- else
- showhelp
- fi
- else
- selfile
- dtfedit
- if [ -n "$DT_FILE" ]
- then
- update
- fi
- fi
-}
-
-#
-# Mimetype check.
-#
-function chkmtpe (){
- MTPE=$(gnomevfs-info -s "$ARGU" | grep "MIME type" | sed 's/.*: //')
- echo "The mimetype is: $MTPE"
-}
-
-#
-# Build a list with registered apps for this mimetype.
-#
-function deflist (){
- if [ -e "$UTMP.avail" ]; then cleanup;fi
- # Create the list in "$UTMP.avail" to be used by the zenity list-box
- if [ "$NONEW" == 1 ]
- then
- echo "FALSE Add_New_App New" > "$UTMP.avail"
- fi
- # Get all sub-mimetypes, one per row.
- SUB="$(grep -hs "^$MTPE" $SUBC $G_CACHE $U_CACHE | awk -F= '{print $1}' | sed 's/ /\n/g')"
- # Get all .desktopfiles for the above mimetypes
- MTPEs=$(grep -hs "$SUB" $U_CACHE $G_CACHE | sed 's/.*=//g;s/;$//g;s/;/\n/g;')
- if [ -n "$SUB" ]
- then
- for i in $(echo "$MTPEs" | sort -u); do
- echo "FALSE $i $(grep -hs "^Name=" $GDATA_DIR/$i $DATA_DIR/$i | \
- sed 's/Name=//;s/ /_/g')" >> "$UTMP.avail"
- done
- fi
- # Change FALSE to TRUE for the default app.
- if grep -q "desktop" "$UTMP.avail"
- then
- DEF_APP=$(gnomevfs-info -s "$ARGU" | grep "Default app" | sed 's/.*: //')
- sed -i "s|FALSE $DEF_APP|TRUE $DEF_APP|" "$UTMP.avail"
- fi
- # Show the list
- zenity --height="350" --width="550" --list --radiolist --text \
-"The list below show applications that already have an entry for the mimetype:
-$MTPE on your system, meaning they are registered to be able
-to deal with this mimetype. You can choose your preferred default application
-by checking the radiobutton. The script will adjust the mimetype settings in
-your local home directory, thus not changing anything systemwide.
-
-If you wish you can add an application that is not in the list by checking the first
-option in list named Add_New_App
-
-Please select" \
- --column "Pick" --column ".desktop file" --column "Application" \
- $(cat "$UTMP.avail") > "$UTMP.chosen"
- retval=$?
- choice=$(cat "$UTMP.chosen")
- if grep -q "$MTPE=$choice" $U_DEF
- then
- retval=2
- fi
- case $retval in
- 0)
- DEF_CH=$(grep -s "$choice" "$UTMP.avail" | awk '{print $2}')
- DEF_NME=$(grep -s "$choice" "$UTMP.avail" | awk '{print $3}')
- if [ "$DEF_CH" = Add_New_App ]
- then
- newmime
- fi
- if [ -z "$NOCH" ]
- then
- if grep -q "$MTPE" $U_DEF
- then
- # Set the users chosen default app for the existing mime.
- sed -i "s|$MTPE=.*|$MTPE=$DEF_CH|" $U_DEF
- else
- # If no user default for this mimetype, add it.
- echo "$MTPE=$DEF_CH" >> $U_DEF
- fi
- update
- zenity --info --text "Default application to handle $MTPE is set to $DEF_NME"
- fi;;
- 1)
- echo "Cancel pressed.";;
- -1)
- echo "ESC pressed.";;
- 2)
- zenity --info --text "Default was not changed.";;
- esac
- cleanup
-}
-
-#
-# Show an input box for new app to handle the mimetype.
-#
-function newmime (){
- NEWAPP=$(zenity --entry --text \
-"Fill in the Name and command for the application you want to handle the
-mimetype: $MTPE separate them with a colon (:)
-
-Separate Name and Command with a colon. If you omit the command, or
-type something that is not in your path, you will get the chance to
-provide the command with full path by a file chooser dialog.")
-
- case $? in
- 0)
- if echo "$NEWAPP" | grep -q ":"
- then
- NAME=$(echo "$NEWAPP" | awk -F: '{print $1}')
- CMD=$(echo "$NEWAPP" | awk -F: '{print $2}')
- if [ -n "$NAME" ]
- then
- check
- usercreate
- else
- zenity --error --text "Application name is missing"
- newmime
- fi
- else
- zenity --error --text "Separator missing"
- newmime
- fi
- ;;
- 1)
- deflist
- ;;
- -1)
- deflist
- ;;
- esac
- NOCH=yes
-}
-
-#
-# Check if the command exists in path, if not give the
-# user a filechooser.
-#
-function check (){
- if which $CMD >&/dev/null
- then
- CMD=`which $CMD`
- else
- CMD=$(zenity --file-selection --filename=/ --title="Chose application")
- if [ -z $CMD ]
- then
- newmime
- fi
- fi
-}
-
-#
-# Create a new *.desktop file for the added app that can handle
-# the mimetype in question.
-#
-function usercreate(){
- APP=$(basename "$CMD")
- USER_APP="$DATA_DIR/$APP-$EXT"
- if cat $G_CACHE $U_CACHE | grep "$MTPE" | grep -q "$APP"
- then
- zenity --error --text "The mime type: $MTPE is alredy assigned to: $APP"
- NOCH=yes
- else
- if [ -e "$USER_APP" ]
- then
- sed -i "s|MimeType=|MimeType=$MTPE;|g" $USER_APP
- update
- zenity --info --text \
- "The mime type: $MTPE is now registered to be handled by: $APP"
- else
- cat <<EOF >$USER_APP
-[Desktop Entry]
-Encoding=UTF-8
-Name=$NAME
-Exec=$CMD
-Type=Application
-Terminal=false
-NoDisplay=true
-MimeType=$MTPE;
-EOF
- fi
- fi
- if [ -z "$NOCH" ]
- then
- zenity --question --text \
-"The created $(basename "$USER_APP") can now be edited manually, to add, remove or change options, do you want to do this now?
-
-This file should work as is, so you can safely cancel this operation, but advanced users may want to edit options to their liking. But due to a bug this editor cannot handle '%' charachters and replaces them with garbage."
- VAL=$?
- if [ "$VAL" == 0 ]
- then
- DT_FILE="$APP"
- dtfedit
- update
- else
- update
- fi
- zenity --info --text "$APP is now registered to handle: $MTPE"
- fi
- NONEW=2
- deflist
-}
-
-#
-# Update the users mime chache and set the defaults
-# first from the defaults.list file
-#
-function update (){
- update-desktop-database $DATA_DIR
- for i in $(sed '/\[.*\]/d' $U_DEF); do
- MTYPE=$(echo "$i" | awk -F= '{print $1}')
- M_FIL=$(echo "$i" | awk -F= '{print $2}')
- if grep -q "$MTYPE" $U_CACHE
- then
- sed -i "\|$MTYPE|s|$M_FIL||;s|$MTYPE=|$i;|;s|;;|;|" $U_CACHE
- else
- echo "$i" >> $U_CACHE
- fi
- done
- # If there are rows with empty mimetypes, delete them.
- sed -i '/.*=$/d' $U_CACHE
-}
-
-#
-# Give the user a helping hand.
-#
-function showhelp (){
-echo
-echo "Usage: $(basename $0) [ARGUMENT]"
-echo '''
- -h, -?, --help Show this help and exit.
-
-DESCRIPTION
- This script is dependent on zenity for creating its GUI. It is
- to be used as a tool for choosing the default application or to
- run for different type of files (mimetypes). It modifies or add
- files in "$HOME/.local/share/applications"
-
- When passed a valid filename it checks its mimetype as interpreted
- by gnomevfs, it will show a list of already registered applications
- able to handle the mimetype in question, the user can change default
- application in this list. The list also contains an option to add
- the Name and command of a program that is not registered to be able
- to open files of the mimetype. After any changes this script will
- run the update-desktop-database to update the users mime cache.
-
- When executed without any argument, the script will list all
- applications associated with a mimetype. When selecting an item from
- this list, the user will be able to edit the options for the selected
- application. The edited file will be saved in the above path and the
- update-desktop-database is executed.
-
- When given an invalid argument or any of the options -h -? --help,
- this text is shown.
-'''
-}
-
-#
-# Remove tempfiles.
-#
-function cleanup (){
- rm -f "$UTMP.avail"
- rm -f "$UTMP.chosen"
-}
-
-#
-# The .desktop file selector
-#
-function selfile (){
- DT_FILE=$(for i in $GDATA_DIR/*.desktop $DATA_DIR/*.desktop; do
- if grep -q "MimeType" $i
- then
- BNME=$(basename $i | sed 's/\.desktop//;s/-usercreated//')
- if [ -e $DATA_DIR/$BNME-$EXT ]
- then
- i="$DATA_DIR/$BNME-$EXT"
- fi
- CMD=$(grep -m 1 "^Exec" $i | sed "s/^Exec=//")
- NME=$(grep -m 1 "^Name=" $i | sed 's/^Name=//')
- echo "$BNME---$NME---\"$CMD\""
- fi
- done | sort -u | sed 's/---/\n/g' | zenity --list --width="550" --height="400" \
- --column="Base name" --column="Program name" --column="Program command" \
- --print-column="1" --text "Select item below.
-
-By selecting an item in this list and klick OK, you will get another window where
-you can edit the file that contains the options of the selected application. The
-edited file will end up in your: $DATA_DIR
-
-Pressing "Esc", click Cancel or use the window close (X) button will close without
-any changes in this or the following editor window. Be aware that the editor do
-have problems with the (%)percent charachter and may replace it by garbage.")
-}
-
-#
-# The .desktop file editor
-#
-function dtfedit (){
- USER_DTF="$DT_FILE-$EXT"
- if [ -n "$DT_FILE" ]
- then
- # Chose to edit users own file if exist
- if [ -e $DATA_DIR/$USER_DTF ]
- then
- TO_EDIT="$DATA_DIR/$USER_DTF"
- else
- TO_EDIT="$GDATA_DIR/$DT_FILE.desktop"
- fi
- cat "$TO_EDIT" | zenity --height="350" --width="550" --text-info --editable \
- --title "Edititng the file: $USER_DTF" > $UTMP.$USER_DTF
- if [ -s $UTMP.$USER_DTF ]
- then
- mv $UTMP.$USER_DTF $DATA_DIR/$USER_DTF
- else
- rm -f $UTMP.$USER_DTF
- DT_FILE=""
- fi
- fi
-}
-
-#
-# Check if we have zenity installed then start this mess.
-#
-if which zenity >&/dev/null
-then
- checkarg
-else
- echo "Error: zenity not found!"
-fi
-
diff --git a/sources b/sources
index 2067379..806432b 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (gnome-commander-1.18.5.tar.xz) = 34c7058adcec9c6e74f21b2e0d3f5c666859f5401a360e7e845ba34d58a083197cc405ea3f51f5bc3d5f8c7392be49ae3268b8c4f0898d356d538e473af5e7ba
+SHA512 (gnome-commander-2.0.3.tar.bz2) = e58660f110e7ef8448894c7499bfa435bd1aeeb0e7083e0c40f4e7ff60560ea8a8ab9d6519bf66ff74c72f478ffa780790ce2ae0822a9bf53f02a70ea63be839
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-08-10 4:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-10 4:54 [rpms/gnome-commander] rawhide: 2.0.3 Mamoru TASAKA
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox