Re: [gentoo-user] ls config file?

2016-02-02 Thread David Haller
Hello,

On Tue, 02 Feb 2016, Raffaele BELARDI wrote:
>Andrew Tselischev wrote:
>> On Tue, Feb 02, 2016 at 09:54:37AM +0100, Raffaele BELARDI wrote:
>>> The option that controls this is --quoting-style, so
>>> can alias 'ls' to include this option but was wondering if there is a
>>> global configuration file controlling such behaviour.
>>
>> There is no configuration file for ls(1), but we can still solve the
>> problem. It is free software, after all!
>>
>> Put the file fix.patch in /etc/portage/patches/sys-apps/coreutils-8.25/
>> and apply the following changes to the ebuild (in the function src_prepare):
>
>fantastic!
>
>but I think I'll stick with the alias approach ;-)

Whatever happened to LS_OPTIONS?

But:

# ltrace -e getenv ls >/dev/null
ls->getenv("QUOTING_STYLE")  = nil
ls->getenv("COLUMNS")= nil
ls->getenv("TABSIZE")= nil
ls->getenv("LS_BLOCK_SIZE")  = nil
ls->getenv("BLOCK_SIZE") = nil
ls->getenv("BLOCKSIZE")  = nil
ls->getenv("POSIXLY_CORRECT")= nil
ls->getenv("BLOCK_SIZE") = nil

And there we go:

$ for f in *; do echo ">>$f<<"; done
>>foo *" '
 bar*<<
>>foo *" ' bar*<<
>>foo" ' bar<<
>>more<<
$ QUOTING_STYLE=literal ls -1
foo *" '? bar*
foo *" ' bar*
foo" ' bar
more
$ QUOTING_STYLE=shell ls -1
'foo *" '\''? bar*'
'foo *" '\'' bar*'
'foo" '\'' bar'
more
$ QUOTING_STYLE=c ls -1
"foo *\" '\n bar*"
"foo *\" ' bar*"
"foo\" ' bar"
"more"
$ QUOTING_STYLE=escape ls -1
foo\ *"\ '\n\ bar*
foo\ *"\ '\ bar*
foo"\ '\ bar
more

Where and how you set QUOTING_STYLE (/etc/*, ~/.*) is up to you. Or
use an alias.

HTH,
-dnh, who consideres strace and ltrace as _basic_ tools ;)

-- 
Bored? Want hours of entertainment? Just set the initdefault to 6! Whee!



[gentoo-user] ls config file?

2016-02-02 Thread Raffaele BELARDI
After a recent update of coreutils to version 8.25, 'ls -l' started 
displaying names containing spaces enclosed in single quotes, e.g.:

drwxr-xr-x  6 belardi users 4096 May 21  2012 'Audio Libraries'
drwxr-xr-x  2 belardi users 4096 Jun 10  2014 Brochure

The option that controls this is --quoting-style, so 
--quoting-style=literal returns to the old behaviour (which I prefer). I 
can alias 'ls' to include this option but was wondering if there is a 
global configuration file controlling such behaviour.

thanks,

raffaele

Re: [gentoo-user] ls config file?

2016-02-02 Thread Andrew Tselischev
On Tue, Feb 02, 2016 at 09:54:37AM +0100, Raffaele BELARDI wrote:
> The option that controls this is --quoting-style, so 
> --quoting-style=literal returns to the old behaviour (which I prefer). I 
> can alias 'ls' to include this option but was wondering if there is a 
> global configuration file controlling such behaviour.

There is no configuration file for ls(1), but we can still solve the
problem. It is free software, after all!

Put the file fix.patch in /etc/portage/patches/sys-apps/coreutils-8.25/
and apply the following changes to the ebuild (in the function src_prepare):


--- old/sys-apps/coreutils/coreutils-8.25.ebuild2016-01-30 
15:56:16.0 +
+++ new/sys-apps/coreutils/coreutils-8.25.ebuild2016-02-02 
10:18:38.985961581 +
@@ -72,6 +72,8 @@
touch src/dircolors.h
touch ${@/%x/1}
fi
+
+   epatch_user
 }


Don't forget to regenerate the manifest

ebuild .../sys-apps/coreutils/coreutils-8.25.ebuild manifest

and recompile!


;-)
diff a/src/ls.c b/src/ls.c
--- a/src/ls.c
+++ b/src/ls.c
@@ -1581,7 +1581,6 @@ decode_switches (int argc, char **argv)
   if (isatty (STDOUT_FILENO))
 {
   format = many_per_line;
-  set_quoting_style (NULL, shell_escape_quoting_style);
   /* See description of qmark_funny_chars, above.  */
   qmark_funny_chars = true;
 }


Re: [gentoo-user] ls config file?

2016-02-02 Thread Andrew Tselischev
On Tue, Feb 02, 2016 at 10:47:04AM +, Andrew Tselischev wrote:
> [...]
> Don't forget to regenerate the manifest
> 
>   ebuild .../sys-apps/coreutils/coreutils-8.25.ebuild manifest
> 
> and recompile!
> [...]

I forgot to mention, that if you seriously want to take that approach,
you'd need to mirror coreutils' ebuilds in your own portage overlay. The
changes to the ebuild (and Manifest) will get overwritten next time you
sync the tree.



Re: [gentoo-user] ls config file?

2016-02-02 Thread covici
Neil Bothwick  wrote:

> On Tue, 2 Feb 2016 11:07:02 +, Andrew Tselischev wrote:
> 
> > I forgot to mention, that if you seriously want to take that approach,
> > you'd need to mirror coreutils' ebuilds in your own portage overlay. The
> > changes to the ebuild (and Manifest) will get overwritten next time you
> > sync the tree.
> > 
> 
> There's no need for that. Just create /etc/env/portage/sys-apps/coreutils
> containing
> 
> post_src_unpack() {
>   cd "${S}"
>   epatch_user
> }

Is it not /etc/portage/env instead?


-- 
Your life is like a penny.  You're going to lose it.  The question is:
How do
you spend it?

 John Covici
 cov...@ccs.covici.com



Re: [gentoo-user] ls config file?

2016-02-02 Thread Neil Bothwick
On Tue, 2 Feb 2016 11:07:02 +, Andrew Tselischev wrote:

> I forgot to mention, that if you seriously want to take that approach,
> you'd need to mirror coreutils' ebuilds in your own portage overlay. The
> changes to the ebuild (and Manifest) will get overwritten next time you
> sync the tree.
> 

There's no need for that. Just create /etc/env/portage/sys-apps/coreutils
containing

post_src_unpack() {
cd "${S}"
epatch_user
}


-- 
Neil Bothwick

WinErr 001: Windows loaded - System in danger


pgpHnza2dyZdh.pgp
Description: OpenPGP digital signature


Re: [gentoo-user] ls config file?

2016-02-02 Thread Raffaele BELARDI
Andrew Tselischev wrote:
> On Tue, Feb 02, 2016 at 09:54:37AM +0100, Raffaele BELARDI wrote:
>> The option that controls this is --quoting-style, so
>> --quoting-style=literal returns to the old behaviour (which I prefer). I
>> can alias 'ls' to include this option but was wondering if there is a
>> global configuration file controlling such behaviour.
>
> There is no configuration file for ls(1), but we can still solve the
> problem. It is free software, after all!
>
> Put the file fix.patch in /etc/portage/patches/sys-apps/coreutils-8.25/
> and apply the following changes to the ebuild (in the function src_prepare):
>

fantastic!

but I think I'll stick with the alias approach ;-)

raffaele

Re: [gentoo-user] ls config file?

2016-02-02 Thread Neil Bothwick
On Tue, 02 Feb 2016 06:55:31 -0500, cov...@ccs.covici.com wrote:

> > There's no need for that. Just
> > create /etc/env/portage/sys-apps/coreutils containing
> > 
> > post_src_unpack() {
> > cd "${S}"
> > epatch_user
> > }  
> 
> Is it not /etc/portage/env instead?

Of course it is. I was just checking if anyone was paying attention, as I
clearly was not.


-- 
Neil Bothwick

The best things in life are free, but the
expensive ones are still worth a look.


pgp6H74_GoqM1.pgp
Description: OpenPGP digital signature


[gentoo-user] ls of /

2005-12-22 Thread Martin S
Back to Gentoo. And battling my own errors... 

LOL

Perhaps I shouldn't have written that :)

I have a problem, I can't do ls / as that produces the error: ls: .: Permission denied
I can however, cd to the root directory and I can list all other
directories (that I've tried anyway). So I got the brilliant idea of
adding user to the root directory in fstab.

For those with similar inclinations I can now, from my own hard earned
experience, tell you: don't. It is *not* a good idea! The box won't
boot...

I got cannot execute /sbin/agetty and Id cN respawning too fast
(where N is number 1-6) and the boot process is stuck. Not even
ctrl-alt-delete works.

BUT, the problem remains: how do I fix ls-right to the root? My fstab look OK
/dev/hda1 / ext3 noatime 0 1
/dev/hda2 none swap sw 0 0
/dev/hda3 /home ext3 noatime 0 2
/dev/hda4 /stuff reiserfs noatime 0 2
/dev/cdroms/cdrom0 /mnt/cdrom iso9660 noauto,ro,user 0 0
#/dev/fd0 /mnt/floppy auto noauto 0 0

# NOTE: The next line is critical for boot!
proc /proc proc defaults 0 0

# glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for
# POSIX shared memory (shm_open, shm_unlink).
# (tmpfs is a dynamically expandable/shrinkable ramdisk, and will
# use almost no memory if not populated with files)
shm /dev/shm tmpfs nodev,nosuid,noexec $

I did a search on the forums, but haven't found anything really relevant.
Regards,Martin S


Re: [gentoo-user] ls of /

2005-12-22 Thread Martin S
/dev/hda1  / ext3  defaults0 1
I still get: ls: .: Permission deniedwhen doing ls on the root directoryRegards,Martin S


Re: [gentoo-user] ls of /

2005-12-22 Thread Ralph Slooten
On 23/12/05, Martin S [EMAIL PROTECTED] wrote:



   /dev/hda1   /ext3defaults0 1
 

 I still get: ls: .: Permission denied
 when doing ls on the root directory

Hi Martin. I had a problem like this a while ago, except my problem
was purely related to the fact that *all* users could write to / ;-)
It turned out that the permissions of / were wrong. Try:

$ ls -ld /
drwxr-xr-x  19 root root 432 Nov 27 11:38 /

You will probably find that your permissions of / are wrong, something
like drwx--x--x  19 root root 432 Nov 27 11:38 /

The solution is simply to change those permissions as root to drwxr-xr-x

Greetings
Ralph

-- 
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] ls of /

2005-12-22 Thread Martin S
Of course, that simple.How it happened to get incorrect permissions I don't know. Thanks anyway!Martin S2005/12/23, Ralph Slooten 
[EMAIL PROTECTED]:On 23/12/05, Martin S 
[EMAIL PROTECTED] wrote: /dev/hda1 /ext3defaults0 1  I still get: ls: .: Permission denied when doing ls on the root directory
Hi Martin. I had a problem like this a while ago, except my problemwas purely related to the fact that *all* users could write to / ;-)It turned out that the permissions of / were wrong. Try:$ ls -ld /
drwxr-xr-x19 root root 432 Nov 27 11:38 /You will probably find that your permissions of / are wrong, somethinglike drwx--x--x19 root root 432 Nov 27 11:38 /The solution is simply to change those permissions as root to drwxr-xr-x
GreetingsRalph--gentoo-user@gentoo.org mailing list-- Regards,Martin S