Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
HANDBOOK: wrong arguments passed to commands!!
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
Mr. T.
Guru
Guru


Joined: 26 Dec 2016
Posts: 477

PostPosted: Tue Jan 02, 2018 12:31 pm    Post subject: HANDBOOK: wrong arguments passed to commands!! Reply with quote

Hi, the following commands use wrong arguments! Could someone (a developer) edit the Handbook, please?

Code:
root # openssl dgst -r -sha512 stage3--<release>.tar.{bz2,xz}

Code:
root # sha512sum stage3--<release>.tar.{bz2,xz}

Code:
root # openssl dgst -r -whirlpool stage3--<release>.tar.{bz2,xz}

Code:
root # gpg --verify stage3--<release>.tar.{bz2,xz}.DIGESTS.asc

Code:
root # tar xpf stage3-*.tar.{bz2,xz} --xattrs-include='*.*' --numeric-owner


Thanks,
helecho.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 41725
Location: 56N 3W

PostPosted: Tue Jan 02, 2018 12:36 pm    Post subject: Reply with quote

helecho,

Post that on the talk page that needs to be edited. The wiki will email all contributors to the page.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Mr. T.
Guru
Guru


Joined: 26 Dec 2016
Posts: 477

PostPosted: Tue Jan 02, 2018 12:37 pm    Post subject: Reply with quote

It's already done but I think it would be good to quickly correct the error.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 41725
Location: 56N 3W

PostPosted: Tue Jan 02, 2018 12:39 pm    Post subject: Reply with quote

helecho,

The people that can fix it know about the problem then.
If they have questions, they will update the talk page and the wiki will email you.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Mr. T.
Guru
Guru


Joined: 26 Dec 2016
Posts: 477

PostPosted: Tue Jan 02, 2018 12:43 pm    Post subject: Reply with quote

Okay, we'll see!
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 6875

PostPosted: Tue Jan 02, 2018 1:31 pm    Post subject: Reply with quote

why not .tar.[bx][z]{2,} ?
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 5327

PostPosted: Tue Jan 02, 2018 1:39 pm    Post subject: Reply with quote

If they're wrong, what error do you get from following those commands?
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 6875

PostPosted: Tue Jan 02, 2018 1:50 pm    Post subject: Reply with quote

Ant P. wrote:
If they're wrong, what error do you get from following those commands?

The issue there is that bash expand it and give it as a file to tar.

So stage3....tar.{bz2,xz} is expand to stage3....tar.bz2 and then stage3...tar.xz
And if user have stage...tar.xz file and not the bz2 version, tar will complain stage3...tar.bz2 doesn't exists.

something my suggest won't solve too :)

I think proper solve would just be tell user to use tab key to expand the file, or change it to .tar.<bz2 or xz>, it's not useful to let user use bash expand for {bz2,xz} when user should type what <release> is already.
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 5327

PostPosted: Tue Jan 02, 2018 2:47 pm    Post subject: Reply with quote

Maybe we should replace it with a curl-pipe-sh script... then users who don't want to think about the commands they're running as root won't have to.
Back to top
View user's profile Send private message
Mr. T.
Guru
Guru


Joined: 26 Dec 2016
Posts: 477

PostPosted: Tue Jan 02, 2018 3:08 pm    Post subject: Reply with quote

It is better a guide does not make mistakes.

Code:
root # shopt -s extglob
root # ls stage3-*.tar.?(bz2|xz)


helecho
Back to top
View user's profile Send private message
Naib
Watchman
Watchman


Joined: 21 May 2004
Posts: 5490
Location: Removed by Neddy

PostPosted: Tue Jan 02, 2018 4:00 pm    Post subject: Reply with quote

krinn wrote:
why not .tar.[bx][z]{2,} ?

why not just tar xpf stage3-*.tar.* I mean there is already a wildcard check for all files in the pwd starting with stage3... this would explode nicely if you had a number... in practice the user should only have one, the one they just downloaded, thus a wildcard on the final compression extension is too wide
_________________
The best argument against democracy is a five-minute conversation with the average voter
Great Britain is a republic, with a hereditary president, while the United States is a monarchy with an elective king
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 5327

PostPosted: Tue Jan 02, 2018 4:17 pm    Post subject: Reply with quote

Problem with that is there's also .tar.*.DIGESTS and tar.*.DIGESTS.asc, though I guess the guide could tell users to rm those before extracting and it'd all work out.
Back to top
View user's profile Send private message
Naib
Watchman
Watchman


Joined: 21 May 2004
Posts: 5490
Location: Removed by Neddy

PostPosted: Tue Jan 02, 2018 5:48 pm    Post subject: Reply with quote

Ant P. wrote:
Problem with that is there's also .tar.*.DIGESTS and tar.*.DIGESTS.asc, though I guess the guide could tell users to rm those before extracting and it'd all work out.

true, if the user makes use of the optional step to validate the download (which they should). unless the handbook keep instep with the latest compression the dev's use (what if they choose to use the reported superior zstd) this will always be an issue.

A part of me thinks users should know what they are doing, thus correct for the specific command (iirc my 1st install had instructions like: whatever the archive is called), another part of me is thinking provide a fool-proof command and just let the user copy-paste it ...

for f in stage3-*.tar.*; do [[ $(file "$f") =~ "compressed" ]] && tar xpf "$f"; done
_________________
The best argument against democracy is a five-minute conversation with the average voter
Great Britain is a republic, with a hereditary president, while the United States is a monarchy with an elective king
Back to top
View user's profile Send private message
Mr. T.
Guru
Guru


Joined: 26 Dec 2016
Posts: 477

PostPosted: Tue Jan 02, 2018 6:09 pm    Post subject: Reply with quote

hum!

Code:
root # updatedb
root # tar xpf $(locate -e stage3-*.tar.{bz2,xz})


Edit: it does not work!

Edit n°2: It seems to work! I searched the filename in the /tmp directory. :oops:

helecho


Last edited by Mr. T. on Tue Jan 02, 2018 8:11 pm; edited 1 time in total
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 6875

PostPosted: Tue Jan 02, 2018 7:00 pm    Post subject: Reply with quote

I really think user should be instruct to use tab key, or just type the file name.

Even Naib solution looks correct, you'll always find an user having stage3 as bz2 and xz at the same time and complain tar was run twice
I'm kidding Naib's solve look the best
Back to top
View user's profile Send private message
Naib
Watchman
Watchman


Joined: 21 May 2004
Posts: 5490
Location: Removed by Neddy

PostPosted: Tue Jan 02, 2018 7:07 pm    Post subject: Reply with quote

krinn wrote:
I really think user should be instruct to use tab key, or just type the file name.


That is the real solution, or ... we don't rely on the extension (this is linux afterall :) ). My one-liner checks for the compressed file so the other option would be the files are named: stage3-*.tar.compressed and let tar pick the correct decompression routine
_________________
The best argument against democracy is a five-minute conversation with the average voter
Great Britain is a republic, with a hereditary president, while the United States is a monarchy with an elective king
Back to top
View user's profile Send private message
Mr. T.
Guru
Guru


Joined: 26 Dec 2016
Posts: 477

PostPosted: Tue Jan 02, 2018 7:46 pm    Post subject: Reply with quote

Anyway, it's interesting! Thanks!
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2968
Location: Germany

PostPosted: Tue Jan 02, 2018 7:55 pm    Post subject: Reply with quote

These commands are obviously meant to be hand edited (<release> etc.). Someone changed the extension to {} recently which looks like it should be expanded by the shell (but it's not in a way that works).

If the stages are compressed xz now, just change bz2 to xz directly. Keep the commands simple - to be hand edited as it were, no problem with that, if you can't even provide a filename on your own, Gentoo is not the right choice.
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Sat Jan 06, 2018 12:34 pm    Post subject: Reply with quote

Naib wrote:
A part of me thinks users should know what they are doing, thus correct for the specific command (iirc my 1st install had instructions like: whatever the archive is called), another part of me is thinking provide a fool-proof command and just let the user copy-paste it ... for f in stage3-*.tar.*; do [[ $(file "$f") =~ "compressed" ]] && tar xpf "$f"; done
Hmm bit inefficient. Before we get into extglob vs case, consider:
Code:
select f in stage3-*.tar.*; do [[ $f ]] || continue; tar xpf "$f"; break; done
(put 'echo' before 'tar' to test.)

Though, wrt the handbook, it already uses <release> so I'd just use .<ext> and add a note that "ext" is bz2, xz or whatever.
I agree that it's a bug to use bash bracing.
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Sat Jan 06, 2018 12:37 pm    Post subject: Reply with quote

frostschutz wrote:
If the stages are compressed xz now, just change bz2 to xz directly. Keep the commands simple - to be hand edited as it were, no problem with that, if you can't even provide a filename on your own, Gentoo is not the right choice.
++ to both aspects.
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 6875

PostPosted: Sat Jan 06, 2018 1:00 pm    Post subject: Reply with quote

Must be why KISS is so good, because as stupid and simple as it is, it's just better to let user type the filename, than trying a complicate expansion or commands that are prone to errors, and made it worst than good.
He might also not be that good that a new user (which you don't know the level of knowledge) is already facing {} | && or whatever you use in the command (as he may type this without knowing what this do). Must look cryptic and magic for him.
Back to top
View user's profile Send private message
Mr. T.
Guru
Guru


Joined: 26 Dec 2016
Posts: 477

PostPosted: Tue Jan 09, 2018 6:56 am    Post subject: Reply with quote

The mistakes have been reported. Why are they not corrected yet? :x
Back to top
View user's profile Send private message
Naib
Watchman
Watchman


Joined: 21 May 2004
Posts: 5490
Location: Removed by Neddy

PostPosted: Tue Jan 09, 2018 7:51 am    Post subject: Reply with quote

Because of priorities... This will be right down at the bottom when we have you know...profile 17, PIE, spectre, meltdown related concerns.

It will get updated, just give them time
_________________
The best argument against democracy is a five-minute conversation with the average voter
Great Britain is a republic, with a hereditary president, while the United States is a monarchy with an elective king
Back to top
View user's profile Send private message
Mr. T.
Guru
Guru


Joined: 26 Dec 2016
Posts: 477

PostPosted: Tue Jan 09, 2018 9:37 am    Post subject: Reply with quote

It takes barely two minutes to correct these mistakes.
Back to top
View user's profile Send private message
Naib
Watchman
Watchman


Joined: 21 May 2004
Posts: 5490
Location: Removed by Neddy

PostPosted: Tue Jan 09, 2018 9:59 am    Post subject: Reply with quote

That maybe the case, but there are priorities and equally Gentoo developers are volunteer's.
On the grand scale of things this is more of an inconvenience. Had the command resulted in wiping your information it would be fixed immediately.

Its the typical impact-effort trade-off which anyone with workloads will utilize, whether they know it or not as it is a way to view the 80-20 rule.
Take where I am at the moment... I have mandatory "training modules" which take 15min to do & I have to do them YET I also have some control loops to stabilize, reports to review, problem reports to negotiate with the customer. ALL have to be done

Customer is a 5-5
problem reports is a 5-5
review is a 2-5
control loops is a 5-2
modules is a 1-1

Guess which one I am not bothering to consider, even though I get daily reminders

The impact of this manual entry is 1, the effort is 1. Could it be done in 5min sure... will it be done in the next 5? no
_________________
The best argument against democracy is a five-minute conversation with the average voter
Great Britain is a republic, with a hereditary president, while the United States is a monarchy with an elective king
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum