<farkuhar>
r0ni's report of broken option parsing in pkgmk prompted me to go hunting for other typos. At least two mistakes appear in connection with the -rs option, including https://git.crux.nu/tools/pkgutils/src/branch/master/pkgmk.in#L806 (misspelled "refresh")
serpente has quit [Remote host closed the connection]
SiFuh has quit [Remote host closed the connection]
SiFuh has joined #crux-social
remiliascarlet has quit [Ping timeout: 252 seconds]
remiliascarlet has joined #crux-social
ppetrov^ has joined #crux-social
zorz has joined #crux-social
<ppetrov^>
farkuhar, what would be the difference between -us and -rs option for pkgmk?
<ppetrov^>
also, are we getting rid of md5sum stuff for good?
aardo has joined #crux-social
ardo has quit [Ping timeout: 244 seconds]
<farkuhar>
ppetrov^: `pkgmk -us` recalculates the checksums for all the sources (a computationally-expensive operation for large tarballs), but `pkgmk -rs` relies on the checksums in an existing signature, and regenerates .signature using a different signify(1) private key.
<ppetrov^>
aha, ok
<farkuhar>
Perhaps the envisioned use-case is: someone like SiFuh wants to move a bunch of ports from the yenjie repo to the unmaintained repo (each repo has its own signify private key). Using `pkgmk -rs --recursive` in the unmaintained directory, he could quickly regenerate the signatures so that line 1 no longer refers to yenjie.pub
ppetrov^ has quit [Quit: Leaving]
<farkuhar>
It would be a supported use-case, except for the pkgmk parsing error that sees --recursive, and sends "$ARGS" through sed 's/-r//g', thereby nullifying the -rs flag.
ppetrov^ has joined #crux-social
<farkuhar>
Because of the greedy sed match, --recursive -rs leads to the error message "pkgmk: invalid option s", printed for each directory in which a child pkgmk process was started.
<farkuhar>
Similar error messages arise with longopts: --recursive --refresh-signature or --recursive --referesh-signature (the latter misspelling an attempt to match what appears in pkgmk line 806).
<farkuhar>
The easiest fix is to send " $ARGS " through sed 's/ -r / /g; s/ --recursive / /g;' so that it only tries to replace -r or --recursive when those strings appear as isolated arguments (not substrings within an argument).
<farkuhar>
Some maintainers have been known to unleash an avalanche of commits like "w3m: moved to contrib", when the original repo containing those ports is no longer considered a suitable home. By orchestrating `pkgmk -rs` and `git commit` through a custom script, they remove the need for `pkgmk --recursive`, and so the bugs on line 806 and 649 remained undiscovered.
<farkuhar>
therealfun anticipated that pkgmk processes would eventually need to be launched by some wrapper script with custom logic, so in his "micro-pkgmk" he deliberately dropped support for all command-line flags except -c: https://gitlab.com/therealfun/oprt/-/blob/master/src/upkgmk?ref_type=heads
<farkuhar>
The upkgmk line count is just below the threshold of 100, which some people cite as the maximum length of a bash script before long-term maintainability is jeopardized (or before it becomes worthwhile to rewrite it in Perl).
<farkuhar>
The current pkgmk line count is only about 10 times as much as that of upkgmk (not a million times), so the "micro" prefix is a bit of an exaggeration (or was never meant to be taken literally). But even 1000 lines of bash are enough to keep bugs well-hidden, despite the countless invocations the script has seen by CRUX users over the years.
<farkuhar>
ukky: According to https://github.com/git/git/blob/master/Documentation/i18n.txt Simon could have put "logOutputEncoding = ISO-8859-1" into an [i18n] section of his opt/.git/config, and then his commits with 0xDF would have been normalized to UTF-8.
SiFuh-Tokyo has joined #crux-social
<SiFuh-Tokyo>
Land full of robots
<SiFuh-Tokyo>
Can't wait to tell remiliascarlett
<SiFuh-Tokyo>
About the clowns at the restaurant
SiFuh-Tokyo has quit [Quit: Client closed]
SiFuh-Tokyo has joined #crux-social
SiFuh has quit [Remote host closed the connection]
SiFuh has joined #crux-social
SiFuh-Tokyo has quit [Quit: Client closed]
SiFuh-Tokyo has joined #crux-social
<SiFuh-Tokyo>
remiliascarlet That Asahi Super dey is super wet. It keeps explosing when I open it. remiliascarlet
<SiFuh-Tokyo>
Explosing
<SiFuh-Tokyo>
Dry* Exploding
serpente has joined #crux-social
SiFuh-Tokyo has quit [Quit: Client closed]
SiFuh-Tokyo has joined #crux-social
<SiFuh-Tokyo>
Biru O kudasai
<SiFuh-Tokyo>
O biru kudasai
<farkuhar>
Two common flags that trigger an early exit are --help and --version. When you pass both of them to pkgmk, only the first one has any effect. When you pass both of them to gcc (in either order), --help prevails and --version has no effect.
<farkuhar>
Ideally the command should respect both flags, printing the version string and the usage summary in the order requested, and then exit.
<SiFuh-Tokyo>
Arigato gozaimasu
<farkuhar>
What possible use am I imagining for respecting both --help and --version in a single invocation? Maybe the UX of the tool is rapidly evolving, and someone wants to document how the usage summary changed between versions. By redirecting the output of `gcc --version --help` to a file, you get a self-documenting record of the usage at that version, without needing to invoke two sequential gcc
<farkuhar>
processes.
<SiFuh-Tokyo>
I am on holidaysdude
<SiFuh-Tokyo>
I had to find warm clothes. I kept getting strange looks for wearing long sleeves shirts eolleyd up
<SiFuh-Tokyo>
Rolled*
<SiFuh-Tokyo>
Like a qeirdo doesn't know it os cold
<SiFuh-Tokyo>
weirdo
SiFuh-Tokyo has quit [Quit: Client closed]
SiFuh-Tokyo has joined #crux-social
<farkuhar>
In-person interactions enable tactful feedback like strange looks, when someone's behaviour doesn't conform to the norms of that space. In a virtual space like IRC, subtle cues are harder to convey; to indicate someone's norm-violating behaviour you choose between two extremes: ignoring or banning.
SiFuh-Tokyo has quit [Quit: Client closed]
SiFuh-Tokyo has joined #crux-social
<SiFuh-Tokyo>
Is that so?
<SiFuh-Tokyo>
Linkin Park is playing on Japanese TV
<farkuhar>
I should see what the Art of Unix Programming has to say about command-line flags that trigger an early exit, and how the tool should handle a combination of such flags appearing in the same command. Maybe gcc is following a well-established practice of setting up a hierarchy of such flags, and ignoring all but the highest-priorty flag.
<SiFuh-Tokyo>
The unix way is dead bro
<farkuhar>
SiFuh-Tokyo: Care to elaborate?
<SiFuh-Tokyo>
Look at Linux is doing
<SiFuh-Tokyo>
This keyboard os tiny
<SiFuh-Tokyo>
We had a strict set of rules that made sense
<SiFuh-Tokyo>
Linux came along and followed them
<SiFuh-Tokyo>
but the retards came in and decided they can do better
<SiFuh-Tokyo>
Actually they asked the driver about me and if i can handle alcohol
<SiFuh-Tokyo>
he laughed
<SiFuh-Tokyo>
He said i have never seen this guy drunk
<zorz>
hehehe
<SiFuh-Tokyo>
but i have never seen him without a beer
<zorz>
tell them soviet russia beer was a refreshment
<SiFuh-Tokyo>
morning until night always drinking
<zorz>
pro soviet
<SiFuh-Tokyo>
I have been telling them that I am illegal moonshiner and teating theor falvoues
<SiFuh-Tokyo>
testing
<SiFuh-Tokyo>
flavours
<zorz>
when fentanyl?
<SiFuh-Tokyo>
Yuck
<remiliascarlet>
SiFuh-Tokyo: "Did you hear that story where a 74 year olf American man went to the police station and asked directions to the book store? The police asked him if he had a enough and he spent 9 days in lock up?" Nope.
<SiFuh-Tokyo>
Check it out
<remiliascarlet>
SiFuh-Tokyo: "I will pass a phone number for Japan later, when I figure out what it actually is." Tourist SIM cards are always data-only.
<remiliascarlet>
SiFuh-Tokyo: "no phone. SIM not working here" As expected.
<SiFuh-Tokyo>
i domt have. i three it alreaddy
<SiFuh-Tokyo>
useless to me sonce i have heavily hacked my phone snd have insane ssecurity
<remiliascarlet>
SiFuh-Tokyo: "The people outside the city are way nicer and more social than the pricka in Tokyo" Correct.
<SiFuh-Tokyo>
yes
<SiFuh-Tokyo>
Wife asks me to break them
<SiFuh-Tokyo>
I have broken all except that cunt at the restaurant
<remiliascarlet>
SiFuh-Tokyo: "Also so many dead people here" && "I go walk alone in the forrest and mountains and always xome across graves" Hope you won't pull a Logan Paul there.
<SiFuh-Tokyo>
What is that?
<remiliascarlet>
SiFuh-Tokyo: "Where is remiliascarlet?" I'm here, just a little busy.
<SiFuh-Tokyo>
there are cemetaries than Lawsons hee
<SiFuh-Tokyo>
there are MORE
<SiFuh-Tokyo>
remoliaacarlet
<remiliascarlet>
Logan Paul is a YouTuber who caused lots of disturbance when he visited Japan in 2018, and got the most well known for laughing at a dead body in the suicide forest.
<SiFuh-Tokyo>
remiliascarlet everyone is aixkk except me
<SiFuh-Tokyo>
sixk
<SiFuh-Tokyo>
sick
<remiliascarlet>
Why can't you type?
<SiFuh-Tokyo>
phone
<remiliascarlet>
Oh, I see.
<SiFuh-Tokyo>
i cannot see what i type on libera web chat
<SiFuh-Tokyo>
The keyboard is tiny but it xovers the imput box
<remiliascarlet>
I notice.
<remiliascarlet>
Though I got a very large phone, and still can't type on it.
<SiFuh-Tokyo>
covers
<SiFuh-Tokyo>
mine is a 4 inch screen
<remiliascarlet>
Actual keyboards are far better, and mechanical ones are the best.
<remiliascarlet>
If you're into keyboards, there's a nice DIY shop dedicated to custom keyboards.
<SiFuh-Tokyo>
type writers
<remiliascarlet>
I tried a type writer when I was still a little girl, and one of my fingers ended up bleeding.
<SiFuh-Tokyo>
I am amcienty in your eyes i guess
<SiFuh-Tokyo>
ancient
<SiFuh-Tokyo>
I gaveup on your coins in Japanese
<remiliascarlet>
If you consider how many elderly people there are in Japan, you're technically still young in comparison.
<SiFuh-Tokyo>
I just give it to them in apile and wait for them to select it
<remiliascarlet>
No idea what you mean.
<SiFuh-Tokyo>
I get along with them well
<SiFuh-Tokyo>
The coins in Japan. I just dump a pile onto the counter.
<SiFuh-Tokyo>
Let them select them much faster
<remiliascarlet>
Oh, you mean the cassier doing the counting for you?
<SiFuh-Tokyo>
And no beer at truxkatops!!!!!!!!
<remiliascarlet>
Truxkatops?
<SiFuh-Tokyo>
truck stops
<remiliascarlet>
That small phone of yours is great for inventing new words.
<SiFuh-Tokyo>
O teied Asahi 0.0000%
<SiFuh-Tokyo>
my piss was orange
<remiliascarlet>
Good to know, I guess.
<SiFuh-Tokyo>
i tried
<SiFuh-Tokyo>
Fucki g horrible
<remiliascarlet>
And did your hairy legs turn blond in the sun next?
<SiFuh-Tokyo>
Huh? No
<remiliascarlet>
Good.
<SiFuh-Tokyo>
Idon't even own shorts
<SiFuh-Tokyo>
I was walking around in a T ahirt in the snow? and i was getting weird kooks?
<remiliascarlet>
Shorts are cancer, I prefer regular videos.
<SiFuh-Tokyo>
Duxk
<SiFuh-Tokyo>
fuck
<SiFuh-Tokyo>
I went to castle 1400 to enter
<SiFuh-Tokyo>
mt brother in law said you ahould do llike ninja and fo in qithout paying
<SiFuh-Tokyo>
So 30 minutes later asked where i was. I said in castle
<SiFuh-Tokyo>
They said you paid 1400 and I sad nope. I went into the castle through atock service entrance
<SiFuh-Tokyo>
My wife was laughing only SiFuh can hahaha
<SiFuh-Tokyo>
I said 2025 and stull have ninja sneaking into the Daemeyos castle hahaha
<SiFuh-Tokyo>
Now we stay Royal Park Hotel
<farkuhar>
Art of Unix Programming, Chapter 10, has a section called "The a-z of Command-Line Options" where the near-universal meanings of -h and -v are presented. But the "help" meaning of -h is said to be "less common than one might expect ... developers tended to think of on-line help as a memory-footprint overhead they couldn't afford."
<farkuhar>
Because this meaning of -h was considered less common, ESR didn't bother to say that exiting immediately was among the expected effects of -h. Only under the -v and -V entries does he explicitly document the "exit immediately" behaviour.
zorz has quit [Quit: leaving]
<farkuhar>
Without explicitly endorsing an "exit immediately" expectation for the -h flag, ESR opens up the possibility that the tool offers *interactive* help.
<SiFuh-Tokyo>
You sacted Or
<SiFuh-Tokyo>
zorz
<SiFuh-Tokyo>
scared
zorz has joined #crux-social
<farkuhar>
On the question of whether the tool should treat the -h and -v flags orthogonally, if each of them triggers an early exit when used on its own, TAOUP doesn't offer much guidance. I should survey some other tools besides gcc, to see how they exit when both --help and --version are passed.
<SiFuh-Tokyo>
They are foing ro some pile of eoxk called Fuji tomorrow
<SiFuh-Tokyo>
I will not fo. I will stay inRokyo. I fot my own ahit to so here
<SiFuh-Tokyo>
Tokyo
<farkuhar>
SiFuh-Tokyo: get yourself a real keyboard, and stop trying to use the touchscreen for typing.
<SiFuh-Tokyo>
They are going to some pile of rocks
<SiFuh-Tokyo>
My typing is fine. Think you need new flasses :-P
<SiFuh-Tokyo>
glasses
<SiFuh-Tokyo>
And I have no choice
<SiFuh-Tokyo>
Only way to talk to remiliascaelet
SiFuh-Tokyo has quit [Quit: Client closed]
SiFuh-Tokyo has joined #crux-social
SiFuh-Tokyo has quit [Client Quit]
SiFuh-Tokyo92 has joined #crux-social
<farkuhar>
Hmm, TAOUP is surprisingly dismissive about the practice of inspecting $0 to see the exact filename by which the program was invoked (Chapter 10, section "How to Choose among the Methods"). That's the very technique employed in CRUX pkgutils (pkginfo and pkgrm are both symlinks to pkgadd).
<farkuhar>
If you're curious about his actual phrasing, ESR writes that inspecting $0 is "generally considered unclean and seldom used."
<farkuhar>
In the Chapter 10 case study of fetchmail, ESR is refreshingly self-deprecating to admit the mistake of expanding the set of command-line options in tandem with the increasing complexity of .fetchmailrc. "Most of the command-line options are never used ... they bulk up the fetchmail code a bit without accomplishing anything very useful."
<SiFuh-Tokyo92>
Was Then retards turned up in Linux
<farkuhar>
The set of command-line options supported by pkgmk has been relatively stable in contrast to fetchmail's, but why did it take so long for someone like r0ni to discover the unexpectedly low priority given to command-line options when the corresponding setting is uncommented in the global config file?
<farkuhar>
If I had to guess, the unintuitive interaction between command-line options and global config has been repeatedly discovered over the years by various CRUX users, but not many of them were in a position like r0ni's, to feel empowered to open a bug report or drop a comment in #crux-devel, and so their discoveries remained private.
<farkuhar>
I hope nobody takes r0ni's bug report as motivation to run pkgmk through shellcheck, though. All the warnings about unquoted variable expansions might inspire someone like beerman to start inserting double-quotes everywhere, diminishing readability (at best) or introducing new bugs like that of rc.single (at worst).
<zorz>
farkuhar: fun fact crux is as good as beerman is... meaning crux nowdays is the mirror of beerman.
<zorz>
heh
<ppetrov^>
beerman = olutmies
<ppetrov^>
биренмъж
<ppetrov^>
ölman
<ppetrov^>
bjórmaður
<ppetrov^>
biergoolmmoš
<ppetrov^>
gee, that's fun
<zorz>
suka!
<zorz>
:P
<zorz>
bliat
<ppetrov^>
in Bulgaria, we don't say this
<zorz>
:P
<ppetrov^>
i am as much Russian as you are Albanian, my friend
<ppetrov^>
μπυραρίας
<ppetrov^>
?
<ppetrov^>
njeribirrë
<ppetrov^>
ლუდისკაცი
<ppetrov^>
Georgian alphabet rocks, that's for sure
<farkuhar>
Okay, gcc is definitely the outlier when it comes to parsing --help and --version together. Most utilities I've tested give priority to the first such option encountered, rather than prioritizing --help as gcc seems to do.
<farkuhar>
Tested just now: jpegtran, oggenc, zstd, pkgadd, pkginfo. Hardly a random sample, and maybe too small to draw any firm conclusions, but I'll keep you all posted if a larger sample starts to indicate that gcc is not alone in its behaviour.
<farkuhar>
The good news is that we can leave that part of pkgmk's parse_options() alone if we don't want the early-exiting options to be handled orthogonally. The present pkgmk behaviour is entirely consistent with the way other tools respond to the --version --help combination.
<farkuhar>
I'm surprised I haven't yet found any precedent for handling the two options orthogonally (printing both the version and the usage summary, in the requested order). For a tool whose UX undergoes major changes between versions, it would be super-helpful to support a one-liner invocation that generates a self-contained record of the options recognized by that version.
<farkuhar>
Maybe this counts as a major change: for the next version of pkg-get, I want to have pkg-repgen treat its first non-option argument (if any) as a directory, not the name of an individual package. This behaviour mimics the way httpup-repgen interprets its (non-mandatory) argument, so that users won't need to second-guess their muscle memory every time they type a command ending in "repgen".
<farkuhar>
Note that pkg-repgen currently only supports the --help flag, not the --version flag. So there's no lack of orthogonality in its option parsing here, just a lack of convenience if you wanted to generate a self-contained history of the options supported at each version.