> 2015-08-11 04:13:01 < dwfreed> so I might have found a bug in something > 2015-08-11 04:13:08 < dwfreed> I haven't quite figured out what yet > 2015-08-11 04:40:10 < dwfreed> okay, so the package is =net-p2p/retroshare-0.6.0_rc2_pre8551 > 2015-08-11 04:40:33 < dwfreed> with the ebuild in its current state, egencache generates the md5-cache, and puts an escape on the ~ in SRC_URI This is due to the following line in the ebuild: MY_PV="${MY_PV/_pre/\~}" Resulting md5-cache SRC_URI, generated by egencache: SRC_URI=mirror://sourceforge/retroshare/retroshare_0.6.0.RC2\~8551_src.tgz > 2015-08-11 04:40:53 < dwfreed> however, md5-cache distributed via rsync does not have this escape > 2015-08-11 04:42:03 < dwfreed> if I run repoman manifest, it tries to download SRC_URI with the escape > 2015-08-11 04:42:10 < dwfreed> >>> Downloading 'http://gentoo.mirrors.tds.net/gentoo/distfiles/retroshare_0.6.0.RC2\~8551_src.tgz' > 2015-08-11 04:42:24 < dwfreed> since that file doesn't exist, it 404s > 2015-08-11 04:43:30 < dwfreed> if I try to generate the manifest myself using the portage API, it complains that DISTDIR/retroshare_0.6.0.RC2\~8551_src.tgz is missing, because retroshare_0.6.0.RC2\~8551_src.tgz is not an existing DIST entry in the thin Manifest > 2015-08-11 04:44:31 < dwfreed> if I fix the ebuild to not escape the ~ and re-run egencache, I get the correct SRC_URI in md5-cache Fixed ebuild line: MY_PV="${MY_PV/_pre/~}" Resulting md5-cache SRC_URI, again generated by egencache: SRC_URI=mirror://sourceforge/retroshare/retroshare_0.6.0.RC2~8551_src.tgz > 2015-08-11 04:46:28 < dwfreed> then running repoman manifest does nothing, because it already has an assumed-correct DIST entry > 2015-08-11 04:47:46 < dwfreed> and the generating the manifest myself works correctly too > 2015-08-11 04:48:03 < dwfreed> so the question is, whose bug is it? Playing around in straight bash, I get this: # PN=retroshare # PV=0.6.0_rc2_pre8551 # MY_PV="${PV/_rc/.RC}" # MY_PV="${MY_PV/_pre/\~}" # SRC_URI="mirror://sourceforge/retroshare/${PN}_${MY_PV}_src.tgz" # echo $SRC_URI mirror://sourceforge/retroshare/retroshare_0.6.0.RC2\~8551_src.tgz # PN=retroshare # PV=0.6.0_rc2_pre8551 # MY_PV="${PV/_rc/.RC}" # MY_PV="${MY_PV/_pre/~}" # difference being not escaping the ~ # SRC_URI="mirror://sourceforge/retroshare/${PN}_${MY_PV}_src.tgz" # echo $SRC_URI mirror://sourceforge/retroshare/retroshare_0.6.0.RC2~8551_src.tgz So perhaps egencache is doing the right thing, and whatever generates the rsync md5-cache needs fixing? And if so, somebody should fix the ebuild (cc pinkbyte, the maintainer).
Long story short, this is behavior dependent on bash version. dwfreed figured out 4.3+ gives '~' while <=4.2 gives '\~'. You can't use that syntax.
And just to be clear, you can't use '~' directly either, since bash 4.3+ will expand that to home directory. Cheap workarounds: 1. prepend more characters before '~' -- can't do here since they vary, 2. put '~' in separate variable, i.e.: tilda='~' MY_PV=${PV/_pre/${tilda}} 3. use versionator.eclass?
@QA: Should we see if it is feasible to put a check in repoman to identify this kind of poorly defined behavior and warn/error as a result?
4. MY_PV="${MY_PV/_pre/\\~}" That appears to work as well for bash-4.2_p53 and 4.3_p39. Probably bash-4.3 cleaned up some operation precedence issues is my guess.
(In reply to Tim Harder from comment #4) > 4. MY_PV="${MY_PV/_pre/\\~}" > > That appears to work as well for bash-4.2_p53 and 4.3_p39. Probably bash-4.3 > cleaned up some operation precedence issues is my guess. That doesn't work with bash-3.2.
(In reply to Michał Górny from comment #5) > (In reply to Tim Harder from comment #4) > > 4. MY_PV="${MY_PV/_pre/\\~}" > > > > That appears to work as well for bash-4.2_p53 and 4.3_p39. Probably bash-4.3 > > cleaned up some operation precedence issues is my guess. > > That doesn't work with bash-3.2. Nor is it produce the desired result. The desired result is a SRC_URI without any escapes in it. (radhermit realized this after discussion on IRC)
Sometimes "ANSI-C quoting" comes in handy: MY_PV="${MY_PV/_pre/$'\x7e'}" will work with bash 3.2, 4.2, and 4.3.
commit c31708b96ab45da8c17fd8dfc546082f13bbba05 Author: Sergey Popov <pinkbyte@gentoo.org> Date: Wed Aug 12 13:15:35 2015 +0300 net-p2p/retroshare: fix MY_PV, which is non-portable across bash versions wrt bug #557276 Reported-by: dwfreed <dwfreed AT mtu.edu> Suggested-by: Ulrich Müller <ulm AT gentoo.org> Package-Manager: portage-2.2.20 Thanks for all suggestions, i was not aware about this