Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 513190 - readme.gentoo.eclass should allow to define custom name for "README.gentoo"
Summary: readme.gentoo.eclass should allow to define custom name for "README.gentoo"
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Pacho Ramos
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-14 09:09 UTC by Justin Lecher (RETIRED)
Modified: 2014-06-24 18:37 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
1.patch (1.patch,741 bytes, patch)
2014-06-24 09:43 UTC, Pacho Ramos
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Lecher (RETIRED) gentoo-dev 2014-06-14 09:09:10 UTC
I am facing the problem that the README.gentoo needs to be different for a new release which is in the same slot.

Please allow to define a custom name for README.gentoo.
Comment 1 Pacho Ramos gentoo-dev 2014-06-16 08:17:29 UTC
I remember we added a logic for slots:
        elif [[ -f "${FILESDIR}/README.gentoo-${SLOT%/*}" ]]; then
                cp "${FILESDIR}/README.gentoo-${SLOT%/*}" "${T}"/README.gentoo

But, indeed, it will collide, what do you think about simply modifying the cp to:
cp "${FILESDIR}/README.gentoo-${SLOT%/*}" "${T}"/README.gentoo-${SLOT%/*}
?
Comment 2 Justin Lecher (RETIRED) gentoo-dev 2014-06-16 11:12:21 UTC
That's not the problem.

Version 1-5 SLOT=0 has version 1 of README.gentoo

but due to changes in version 6 I need to adopt the README.gentoo.

so 

Version 6-10 SLOT=0 has version 2 of README.gentoo

But I cannot have different README.gentoo for the same SLOT.
Comment 3 Pacho Ramos gentoo-dev 2014-06-17 07:10:53 UTC
(In reply to Justin Lecher from comment #2)
[...]
> But I cannot have different README.gentoo for the same SLOT.

Well, the original idea was to include messages that were placed as elog messages before in the README.gentoo file and, then, I didn't think on any case needing different README.gentoo for the same SLOT :/
Comment 4 Justin Lecher (RETIRED) gentoo-dev 2014-06-17 11:20:57 UTC
aufs provides additional patches which are installed into docdir, so that you can apply manually to your kernel sources if wanted. I am pointing to those patches in the README.gentoo. Now upstream renamed one of those patches, which in turn needs the README.gentoo to be adopted.
Comment 5 Pacho Ramos gentoo-dev 2014-06-17 21:42:36 UTC
I guess I am missing something. Looking to sys-kernel/aufs-sources I would only change eclass to:
cp "${FILESDIR}/README.gentoo-${SLOT%/*}" "${T}"/README.gentoo-${SLOT%/*}

and, then, you would only need to have REAME.gentoo-3.15.0 showing updated patch, the 3.14.7 showing the older one... :/
Comment 6 Justin Lecher (RETIRED) gentoo-dev 2014-06-18 07:01:36 UTC
But this would mean I need to create a new README.gentoo-${SLOT} for every new SLOT with the same content as before, as long as one SLOT still uses the old patch name.

Wouldn't it be simpler to allow specifying the name via a variable.
Comment 7 Pacho Ramos gentoo-dev 2014-06-18 08:35:34 UTC
Ah, you are true. I would opt for a variable to append a suffix to README.gentoo then (to keep the "README.gentoo" pattern). Will work on it as soon as I am able to (I am really busy now in real life looking for a new lab :/, sorry for the delays :( )
Comment 8 Pacho Ramos gentoo-dev 2014-06-24 09:43:21 UTC
Created attachment 379564 [details, diff]
1.patch

Sorry for the delay, try this one please. Looks to work ok for me :)
Comment 9 Justin Lecher (RETIRED) gentoo-dev 2014-06-24 11:44:45 UTC
My idea was this

$ cvs diff readme.gentoo.eclass 
Index: readme.gentoo.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/readme.gentoo.eclass,v
retrieving revision 1.8
diff -u -B -r1.8 readme.gentoo.eclass
--- readme.gentoo.eclass	17 Mar 2014 08:17:27 -0000	1.8
+++ readme.gentoo.eclass	24 Jun 2014 11:43:16 -0000
@@ -48,6 +48,11 @@
 # @DESCRIPTION:
 # If non-empty this variable forces elog messages to be printed.
 
+# @ECLASS-VARIABLE: FILE_SUFFIX
+# @DESCRIPTION:
+# If you want to specify a suffix for README.gentoo file please export it.
+: ${FILE_SUFFIX:=""}
+
 # @FUNCTION: readme.gentoo_create_doc
 # @DESCRIPTION:
 # Create doc file with ${DOC_CONTENTS} variable (preferred) and, if not set,
@@ -68,9 +73,9 @@
 		fi
 		eshopts_pop
 	elif [[ -f "${FILESDIR}/README.gentoo-${SLOT%/*}" ]]; then
-		cp "${FILESDIR}/README.gentoo-${SLOT%/*}" "${T}"/README.gentoo
+		cp "${FILESDIR}/README.gentoo-${SLOT%/*}" "${T}"/README.gentoo || die
 	elif [[ -f "${FILESDIR}/README.gentoo" ]]; then
-		cp "${FILESDIR}/README.gentoo" "${T}"/README.gentoo
+		cp "${FILESDIR}/README.gentoo${FILE_SUFFIX}" "${T}"/README.gentoo || die
 	else
 		die "You are not specifying README.gentoo contents!"
 	fi


We don't need to save it with a suffix because *doc function install into /usr/share/doc/${PF}, so there will be no clash.
Comment 10 Pacho Ramos gentoo-dev 2014-06-24 12:20:02 UTC
Ah, ok, we don't need suffixed file in install filesystem because we have a /usr/share/doc per revision ;)

Feel free to commit your patch if you have time (if not, I will try to commit this afternoon :))
Comment 11 Pacho Ramos gentoo-dev 2014-06-24 18:37:05 UTC
+  24 Jun 2014; Pacho Ramos <pacho@gentoo.org> readme.gentoo.eclass:
+  Allow to handle more README.gentoo files (#513190 by Justin Lecher)
+