Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#37926 - [arch-install-scripts] output to stderr function won't output to stderr

Attached to Project: Arch Linux
Opened by Daniel YC Lin (dlin) - Wednesday, 27 November 2013, 08:09 GMT
Last edited by Dave Reisner (falconindy) - Thursday, 28 November 2013, 18:02 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

I just review the source code.

I guess this line was wrong (on 'common')

error() { out "==> ERROR:" "$@"; } >&2

It maybe correct to

error() { out "==> ERROR:" "$@" >&2 ; }

Additional info:
* package version(s)
11-1

* config and/or log files etc.


Steps to reproduce:
This task depends upon

Closed by  Dave Reisner (falconindy)
Thursday, 28 November 2013, 18:02 GMT
Reason for closing:  Not a bug
Additional comments about closing:  Working as intended.
Comment by Dave Reisner (falconindy) - Wednesday, 27 November 2013, 13:50 GMT
No, this works and always has. Is this some faulty human-based static analysis or is there some actual problem here that you aren't actually reporting?
Comment by Daniel YC Lin (dlin) - Wednesday, 27 November 2013, 14:05 GMT
Let me use a simple script to test. And you are right. I'm wrong.
But, I don't know why these two statement is equal.

$ cat 1.sh
#!/bin/bash

out() { printf "$1 $2\n" "${@:3}"; }
error1() { out "==> ERROR:" "$@"; } >&2
error2() { out "==> ERROR:" "$@" >&2 ; }
error1 hi > a1.log 2> b1.log
error2 hi > a2.log 2> b2.log

$ chmod +x 1.sh
$ ./1.sh
$ ls -l ??.log
-rw-r--r-- 1 dlin dlin 0 Nov 27 22:02 a1.log
-rw-r--r-- 1 dlin dlin 0 Nov 27 22:02 a2.log
-rw-r--r-- 1 dlin dlin 14 Nov 27 22:02 b1.log
-rw-r--r-- 1 dlin dlin 14 Nov 27 22:02 b2.log
Comment by Dave Reisner (falconindy) - Wednesday, 27 November 2013, 14:12 GMT
Because a function is just a label attached to a command block. It works for the same reason that this code works:

https://projects.archlinux.org/pacman.git/tree/scripts/repo-add.sh.in#n353

Loading...