Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 426628 - sys-apps/gawk: eselect awk if unset
Summary: sys-apps/gawk: eselect awk if unset
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 418473
  Show dependency tree
 
Reported: 2012-07-14 18:41 UTC by Christoph Junghans (RETIRED)
Modified: 2012-10-16 15:03 UTC (History)
0 users

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


Attachments
patch for gawk-4.0.1.ebuild (gawk-4.0.1-r1.ebuild.patch,928 bytes, patch)
2012-07-14 18:41 UTC, Christoph Junghans (RETIRED)
Details | Diff
patch for gawk-4.0.1.ebuild (gawk-4.0.1-r1.ebuild.patch,764 bytes, patch)
2012-07-16 01:29 UTC, Christoph Junghans (RETIRED)
Details | Diff
patch for gawk-4.0.1.ebuild (gawk-4.0.1.ebuild.patch,895 bytes, patch)
2012-08-26 03:24 UTC, Christoph Junghans (RETIRED)
Details | Diff
patch for gawk-4.0.1.ebuild (gawk-4.0.1.ebuild.patch,935 bytes, patch)
2012-08-27 16:38 UTC, Christoph Junghans (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Junghans (RETIRED) gentoo-dev 2012-07-14 18:41:25 UTC
Created attachment 318172 [details, diff]
patch for gawk-4.0.1.ebuild

1.) In the case that gawk is the only installed awk interpreter, it should select itself as the default one. (At this point, nothing will change as gawk is pulled in by the system set.)

2.) move gawk binary back to /usr/bin as baselayout-2 does not depend on awk being in /bin anymore. (@openrc: please comment if needed)

3.) this patch is more a RFC as we still need to wait for the keywords from bug #419559.
Comment 1 SpanKY gentoo-dev 2012-07-15 22:38:34 UTC
Comment on attachment 318172 [details, diff]
patch for gawk-4.0.1.ebuild

not interested in moving gawk at this time out of /bin
Comment 2 Christoph Junghans (RETIRED) gentoo-dev 2012-07-16 01:29:40 UTC
Created attachment 318270 [details, diff]
patch for gawk-4.0.1.ebuild

(In reply to comment #1)
> not interested in moving gawk at this time out of /bin
Ok, let's wait with the /usr/bin move.

What about the rest of the patch?
Comment 3 SpanKY gentoo-dev 2012-08-18 21:33:46 UTC
have it check for eselect existing first:
  type eselect >&/dev/null && eselect awk update ifunset

gawk really shouldn't be requiring eselect, but we don't have the DEPEND system to support this yet
Comment 4 Christoph Junghans (RETIRED) gentoo-dev 2012-08-23 16:11:25 UTC
(In reply to comment #3)
> gawk really shouldn't be requiring eselect, but we don't have the DEPEND
> system to support this yet
That make sense. How about a build-in replacement for eselect-awk:
pkg_postinst() {
  #symlink creation here as the links do not belong to gawk, but to any awk
  if has_version eselect && has_version eselect-awk ; then
    eselect awk update ifunset
  else
    for l in /bin/awk /usr/bin/awk /usr/share/man/man1/awk.1 ; do
      [[ ! -e ${EROOT}$l ]] && dosym ${l##*/} $l
    done
  fi
}
   
pkg_postrm() {
   has_version eselect && has_version eselect-awk && eselect awk update ifunset
}
Comment 5 SpanKY gentoo-dev 2012-08-23 17:04:49 UTC
(In reply to comment #4)
>   #symlink creation here as the links do not belong to gawk, but to any awk

space between "#" and "symlink"

>     for l in /bin/awk /usr/bin/awk /usr/share/man/man1/awk.1 ; do

local l

>       [[ ! -e ${EROOT}$l ]] && dosym ${l##*/} $l

i don't think dosym works in pkg_* funcs.  you'll need to use `ln -s` and $EROOT
Comment 6 Christoph Junghans (RETIRED) gentoo-dev 2012-08-26 03:24:08 UTC
Created attachment 322214 [details, diff]
patch for gawk-4.0.1.ebuild

(In reply to comment #5)
> space between "#" and "symlink"
> local l
> i don't think dosym works in pkg_* funcs.  you'll need to use `ln -s` and
> $EROOT
Done.
Comment 7 William Hubbs gentoo-dev 2012-08-26 18:19:48 UTC
(In reply to comment #0)
> 2.) move gawk binary back to /usr/bin as baselayout-2 does not depend on awk
> being in /bin anymore. (@openrc: please comment if needed)

OpenRC does not use awk, so from our pov there is no reason for it to be on /; it should be moved to /usr.

(In reply to comment #1)
> not interested in moving gawk at this time out of /bin

Why? does something else use it in early boot?
Comment 8 SpanKY gentoo-dev 2012-08-27 03:18:58 UTC
(In reply to comment #6)

the has_version checks should include a CATEGORY in the packages

(In reply to comment #7)

baselayout-1 used it for the longest time, and awk scripts can be specified in shebangs (#!/bin/awk), and i see no need to change right now.  nothing needs it.
Comment 9 Christoph Junghans (RETIRED) gentoo-dev 2012-08-27 16:38:30 UTC
Created attachment 322378 [details, diff]
patch for gawk-4.0.1.ebuild

(In reply to comment #8)
> (In reply to comment #6)
> 
> the has_version checks should include a CATEGORY in the packages
Done

> (In reply to comment #7)
> 
> baselayout-1 used it for the longest time, and awk scripts can be specified
> in shebangs (#!/bin/awk), and i see no need to change right now.  nothing
> needs it.
Could be done with a symlink as well
ln -s ../usr/bin/gawk ${EROOT}bin/awk
The advantage would be that we can get rid of the whole "if use userland_GNU" block. The only thing, which would go missing is /bin/gawk, /bin/awk is still there and gets created by eselect-awk as well.
Comment 10 SpanKY gentoo-dev 2012-10-05 05:55:12 UTC
(In reply to comment #9)

ok, add this with gawk-4.0.1-r1 and let's see what blows up
Comment 11 Christoph Junghans (RETIRED) gentoo-dev 2012-10-06 12:26:37 UTC
(In reply to comment #10)
> (In reply to comment #9)
> 
> ok, add this with gawk-4.0.1-r1 and let's see what blows up
Added unkeyworded.
Comment 12 Christoph Junghans (RETIRED) gentoo-dev 2012-10-16 15:03:58 UTC
Re-added keywords, let's sse what blows up.