#1 Add default-editor subpackage (#1854444)
Merged 3 years ago by kdudka. Opened 3 years ago by ngompa.

@@ -0,0 +1,5 @@ 

+ # Ensure GNU nano is set as EDITOR if it isn't already set

+ 

+ if ( ! ($?EDITOR) ) then

+ 	setenv EDITOR "/usr/bin/nano"

+ endif

@@ -0,0 +1,8 @@ 

+ # Ensure GNU nano is set as EDITOR if it isn't already set

+ # This is set as a universal variable so that any other definition

+ # by the user would win

+ # Cf. https://fishshell.com/docs/current/index.html#variables-scope

+ 

+ if ! set -q EDITOR;

+ 	set -Ux EDITOR /usr/bin/nano

+ end

@@ -0,0 +1,5 @@ 

+ # Ensure GNU nano is set as EDITOR if it isn't already set

+ 

+ if [ -z "$EDITOR" ]; then

+ 	export EDITOR="/usr/bin/nano"

+ fi

file modified
+30 -1
@@ -1,12 +1,17 @@ 

  Summary:         A small text editor

  Name:            nano

  Version:         4.9.3

- Release:         1%{?dist}

+ Release:         2%{?dist}

  License:         GPLv3+

  URL:             https://www.nano-editor.org

  Source:          https://www.nano-editor.org/dist/latest/%{name}-%{version}.tar.xz

  Source2:         nanorc

  

+ # Shell snippets for default-editor setup

+ Source11:        nano-default-editor.sh

+ Source12:        nano-default-editor.csh

+ Source13:        nano-default-editor.fish

+ 

  BuildRequires:   file-devel

  BuildRequires:   gettext-devel

  BuildRequires:   gcc
@@ -20,6 +25,15 @@ 

  %description

  GNU nano is a small and friendly text editor.

  

+ %package default-editor

+ Summary:         Sets GNU nano as the default editor

+ Requires:        nano = %{version}-%{release}

+ BuildArch:       noarch

+ 

+ %description default-editor

+ This package ensures the EDITOR shell variable

+ is set in common shells to GNU nano.

+ 

  %prep

  %autosetup -S git

  
@@ -53,6 +67,11 @@ 

  

  %find_lang %{name}

  

+ # install nano-default-editor snippets

+ install -Dpm 0644 %{SOURCE11} %{buildroot}%{_sysconfdir}/profile.d/%{basename:%{S:11}}

+ install -Dpm 0644 %{SOURCE12} %{buildroot}%{_sysconfdir}/profile.d/%{basename:%{S:12}}

+ install -Dpm 0644 %{SOURCE13} %{buildroot}%{_datadir}/fish/vendor_conf.d/%{basename:%{S:13}}

+ 

  %files -f build/%{name}.lang

  %doc AUTHORS COPYING ChangeLog INSTALL NEWS README THANKS TODO

  %doc build/doc/sample.nanorc
@@ -63,7 +82,17 @@ 

  %{_infodir}/nano.info*

  %{_datadir}/nano

  

+ %files default-editor

+ %dir %{_sysconfdir}/profile.d

+ %config(noreplace) %{_sysconfdir}/profile.d/nano-default-editor.*

+ %dir %{_datadir}/fish/vendor_conf.d

+ %{_datadir}/fish/vendor_conf.d/nano-default-editor.fish

+ 

+ 

  %changelog

+ * Thu Jul 16 2020 Neal Gompa <ngompa13@gmail.com> - 4.9.3-2

+ - Add default-editor subpackage (#1854444)

+ 

  * Mon May 25 2020 Kamil Dudka <kdudka@redhat.com> - 4.9.3-1

  - new upstream release

  

There should be the then keyword after if condition. I wonder how you tested the code...

The summary is misleading. It should not be identical to the summary of the main package.

I did it by not actually committing the updated version. D'oh!

rebased onto cf1ce68

3 years ago

@kdudka This should all be fixed now. :wine_glass:

Pull-Request has been merged by kdudka

3 years ago