[Nix-dev] Re: git-gui: require not using ttk

Marc Weber marco-oweber at gmx.de
Thu May 27 15:40:30 CEST 2010


reposting this to the list because I posted it to David privately only 3
hours ago by accident.

Hi David,

> +# Syntax: wrapProgramKeepName <PROGRAM> <MAKE-WRAPPER FLAGS...>
> +wrapProgramKeepName() {
> +    local prog="$1"
> +    local hidden="$(dirname "$prog")/.wrapped/$(basename "$prog")"
> +    mkdir "$(dirname "$hidden")" || true
> +    mv $prog $hidden
> +    makeWrapper $hidden $prog "$@"
> +}

These lines

  mv $prog $hidden
  makeWrapper $hidden $prog "$@"

will be duplicated by this patch.
That's why I introduced doMakeWrapper.

If you want to use yet another hidden location for whatever reason you
have to duplicate those lines again.

> +    mkdir "$(dirname "$hidden")" || true
will still print ugly lines - so I'd vote for mkdir -p - Nix builders
usually use the alias name ensureDir.

I didn't care about seeing my function names *KeepName - only about
moving the duplicated code into a function such as doMakeWrapper -
because I duplicated it once in the past.

Also as I said earlier $prog can be removed because it will be passed
twice. $1 also contains the value of prog and is not unshifted.
> +    makeWrapper $hidden $prog "$@"

> But I don't know how to check how much will be rebuild by this patch...
I'll prepare a script which will do exactly that - because I don't know
either yet.

Probbaly it'll be based on the release tarball - because taking into account
everything is too much (?)

If you don't mind I'll merge doWrapper into your patch and repost it
here along with the output of the script finding out howm will be
rebuilt.

I already put the (empty) repository online:
http://wiki.nixos.org/wiki/Nix(OS)_related_repositories_and_work
Follow "nixpkgs-dev-utilities"

Marc Weber



More information about the nix-dev mailing list