Bug 232315 - [NEW PORT] shells/poshinit : portable way of using the same shell environment with Bash / Zsh across FreeBSD / Linux / Cygwin
Summary: [NEW PORT] shells/poshinit : portable way of using the same shell environment...
Status: In Progress
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Mateusz Piotrowski
URL:
Keywords: feature, patch
Depends on:
Blocks:
 
Reported: 2018-10-16 11:03 UTC by bourne.identity@hotmail.com
Modified: 2018-12-07 16:10 UTC (History)
3 users (show)

See Also:


Attachments
shar archive for poshinit (5.21 KB, text/plain)
2018-10-16 11:03 UTC, bourne.identity@hotmail.com
no flags Details
portlint log for poshinit (318 bytes, text/plain)
2018-10-16 11:04 UTC, bourne.identity@hotmail.com
no flags Details
poudriere log for poshinit (13.38 KB, text/plain)
2018-10-16 11:05 UTC, bourne.identity@hotmail.com
no flags Details
Revised portlint log for poshinit (236 bytes, text/plain)
2018-10-16 15:30 UTC, bourne.identity@hotmail.com
no flags Details
Revised poudriere log for poshinit (13.01 KB, text/plain)
2018-10-16 15:30 UTC, bourne.identity@hotmail.com
no flags Details
Revised shar archive for poshinit (12.64 KB, text/plain)
2018-10-16 15:34 UTC, bourne.identity@hotmail.com
no flags Details
Revised shar archive for poshinit (14.90 KB, text/plain)
2018-10-16 19:48 UTC, bourne.identity@hotmail.com
no flags Details
Revised portlint log for poshinit (340 bytes, text/plain)
2018-10-16 19:48 UTC, bourne.identity@hotmail.com
no flags Details
Revised poudriere log for poshinit (12.90 KB, text/plain)
2018-10-16 19:49 UTC, bourne.identity@hotmail.com
no flags Details
Revised shar archive for poshinit (attempt# 3) (14.90 KB, text/plain)
2018-10-16 23:51 UTC, bourne.identity@hotmail.com
no flags Details
Revised portlint log for poshinit (attempt# 3) (340 bytes, text/plain)
2018-10-16 23:52 UTC, bourne.identity@hotmail.com
no flags Details
Revised poudriere log for poshinit (attempt# 3) (12.90 KB, text/plain)
2018-10-16 23:53 UTC, bourne.identity@hotmail.com
no flags Details
Revised shar archive for poshinit (attempt# 4) (14.87 KB, text/plain)
2018-10-17 17:35 UTC, bourne.identity@hotmail.com
no flags Details
Revised portlint log for poshinit (attempt# 4) (340 bytes, text/plain)
2018-10-17 17:36 UTC, bourne.identity@hotmail.com
no flags Details
Revised poudriere log for poshinit (attempt# 4) (12.90 KB, text/plain)
2018-10-17 17:36 UTC, bourne.identity@hotmail.com
no flags Details
Revised shar archive for poshinit (attempt# 5) (14.89 KB, text/plain)
2018-10-17 20:07 UTC, bourne.identity@hotmail.com
no flags Details
Revised portlint log for poshinit (attempt# 5) (340 bytes, text/plain)
2018-10-17 20:07 UTC, bourne.identity@hotmail.com
no flags Details
Revised poudriere log for poshinit (attempt# 5) (12.90 KB, text/plain)
2018-10-17 20:08 UTC, bourne.identity@hotmail.com
no flags Details
Revised shar archive for poshinit (attempt# 6) (14.86 KB, text/plain)
2018-10-18 12:45 UTC, bourne.identity@hotmail.com
no flags Details
Revised portlint log for poshinit (attempt# 6) (340 bytes, text/plain)
2018-10-18 12:46 UTC, bourne.identity@hotmail.com
no flags Details
Revised poudriere log for poshinit (attempt# 6) (12.90 KB, text/plain)
2018-10-18 12:47 UTC, bourne.identity@hotmail.com
no flags Details
Revised shar archive for poshinit (attempt# 7) (15.14 KB, text/plain)
2018-10-18 20:08 UTC, bourne.identity@hotmail.com
no flags Details
Revised shar archive for poshinit (attempt# 8) (15.50 KB, text/plain)
2018-10-18 21:22 UTC, bourne.identity@hotmail.com
no flags Details
Revised shar archive for poshinit (attempt# 9) (15.55 KB, text/plain)
2018-10-25 15:33 UTC, bourne.identity@hotmail.com
no flags Details
Revised shar archive for poshinit (attempt# 10) (15.72 KB, text/plain)
2018-10-26 20:10 UTC, bourne.identity@hotmail.com
no flags Details
Revised shar archive for poshinit (attempt# 11) (15.95 KB, text/plain)
2018-10-28 00:03 UTC, bourne.identity@hotmail.com
no flags Details
Revised shar archive for poshinit (attempt# 12) (15.96 KB, text/plain)
2018-10-28 01:23 UTC, bourne.identity@hotmail.com
no flags Details
Revised shar archive for poshinit (attempt# 13) (15.91 KB, text/plain)
2018-10-30 14:57 UTC, bourne.identity@hotmail.com
no flags Details
Revised shar archive for poshinit (attempt# 14) (16.34 KB, text/plain)
2018-10-31 22:24 UTC, bourne.identity@hotmail.com
no flags Details
Revised shar archive for poshinit (attempt# 15) (16.41 KB, text/plain)
2018-11-01 20:09 UTC, bourne.identity@hotmail.com
no flags Details
Revised shar archive for poshinit (attempt# 16) (16.92 KB, text/plain)
2018-11-03 17:11 UTC, bourne.identity@hotmail.com
no flags Details
Revised shar archive for poshinit (attempt# 17) (17.61 KB, text/plain)
2018-11-05 23:52 UTC, bourne.identity@hotmail.com
no flags Details
Revised shar archive for poshinit (attempt# 18) (17.68 KB, text/plain)
2018-11-06 05:05 UTC, bourne.identity@hotmail.com
no flags Details
Revised shar archive for poshinit (attempt# 19) (17.77 KB, text/plain)
2018-11-11 23:34 UTC, bourne.identity@hotmail.com
no flags Details
Revised shar archive for poshinit (attempt# 20) (17.99 KB, text/plain)
2018-11-13 01:33 UTC, bourne.identity@hotmail.com
no flags Details
Revised shar archive for poshinit (attempt# 21) (36.11 KB, text/plain)
2018-11-19 15:15 UTC, bourne.identity@hotmail.com
no flags Details
Revised shar archive for poshinit (attempt# 22) (18.00 KB, text/plain)
2018-11-19 16:58 UTC, bourne.identity@hotmail.com
no flags Details
Revised shar archive for poshinit (attempt# 23) (36.11 KB, text/plain)
2018-11-21 15:09 UTC, bourne.identity@hotmail.com
no flags Details
Revised shar archive for poshinit (attempt# 24) (2.44 KB, text/plain)
2018-12-06 16:51 UTC, bourne.identity@hotmail.com
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description bourne.identity@hotmail.com 2018-10-16 11:03:11 UTC
Created attachment 198201 [details]
shar archive for poshinit

poshinit (Portable Shell Initialization) is a portable way of using the same shell environment with Bash / Zsh across FreeBSD / Linux / Cygwin
Comment 1 bourne.identity@hotmail.com 2018-10-16 11:04:16 UTC
Created attachment 198202 [details]
portlint log for poshinit
Comment 2 bourne.identity@hotmail.com 2018-10-16 11:05:33 UTC
Created attachment 198203 [details]
poudriere log for poshinit
Comment 3 Nathan 2018-10-16 11:28:42 UTC
Looks like MASTERSITES is empty
Comment 4 bourne.identity@hotmail.com 2018-10-16 11:45:27 UTC
Hi Nathan/others, I put all the port files in the sub-directory 'files'. Is there a problem ? My understanding is that MASTER_SITES can be empty if the port only uses file/*
Comment 5 bourne.identity@hotmail.com 2018-10-16 11:46:25 UTC
Sorry, I meant files/*
Comment 6 w.schwarzenfeld freebsd_triage 2018-10-16 12:01:46 UTC
portlint:

pkg-descr: exceeds 24 lines, make it shorter if possible.(currently 87 lines)
FATAL: Makefile: [3]: use a tab (not space) after a variable name
FATAL: Makefile: [4]: use a tab (not space) after a variable name
FATAL: Makefile: [5]: use a tab (not space) after a variable name
FATAL: Makefile: [8]: use a tab (not space) after a variable name
FATAL: Makefile: [9]: use a tab (not space) after a variable name
FATAL: Makefile: [11]: use a tab (not space) after a variable name
FATAL: Makefile: [12]: use a tab (not space) after a variable name
FATAL: Makefile: [14]: use a tab (not space) after a variable name
FATAL: Makefile: [15]: use a tab (not space) after a variable name
FATAL: Makefile: [16]: use a tab (not space) after a variable name
FATAL: Makefile: [17]: use a tab (not space) after a variable name
FATAL: Makefile: extra item "MASTER_SITES " placed in the PORTNAME section.
WARN: Makefile: no MASTER_SITES found. is it ok?
FATAL: Makefile: extra item "MAINTAINER " placed in the MAINTAINER section.
FATAL: Makefile: extra item "COMMENT " placed in the MAINTAINER section.
Comment 7 w.schwarzenfeld freebsd_triage 2018-10-16 12:04:41 UTC
Oh sorry, this was my error (with TAB) - was result of copying the shar - sorry.
Comment 8 Tobias Kortkamp freebsd_committer 2018-10-16 12:06:04 UTC
(In reply to bourne.identity@hotmail.com from comment #4)

- files/ is empty in the shar.  Also distinfo exists with has
  a tarball in it.  How do you expect people to get it?
  We do not commit binary files to the ports tree.  It must
  be hosted externally.

- pkg-descr is a description of what the port does.  It should not
  be abused as a manual.  If you need to explain how to use the
  port put it in pkg-message.

- The DATA1, DATA2, DATA3 variables are an anti-pattern.  Just
  use constant strings in do-install instead of inventing new
  variables.

- Port layout is off.  Please format it like all the other ports.
Comment 9 bourne.identity@hotmail.com 2018-10-16 15:30:02 UTC
Created attachment 198216 [details]
Revised portlint log for poshinit
Comment 10 bourne.identity@hotmail.com 2018-10-16 15:30:56 UTC
Created attachment 198217 [details]
Revised poudriere log for poshinit
Comment 11 bourne.identity@hotmail.com 2018-10-16 15:34:21 UTC
Created attachment 198218 [details]
Revised shar archive for poshinit

Tobias: really sorry for having screwed up the initial submission. I think I have fixed all the issues, but am not sure whether my stuff is good. Can you please quickly have a look ?
Comment 12 Tobias Kortkamp freebsd_committer 2018-10-16 16:27:05 UTC
(In reply to bourne.identity@hotmail.com from comment #11)
- The formatting is still off.  See one of the examples
  in the Porter's Handbook [1, 2].

- The shar now contains a binary file (poshinit.8.gz).  This is a
  no go.  Remember how I said that we do not commit binary files
  to the ports tree? :p

- You need to remove distinfo and set

DISTFILES=

  or nobody will be able to build the port that doesn't have
  poshinit-1.0.tar.gz in DISTDIR (the framework will try to extract
  it).

  The port will also currently fail to build for everyone else
  because you try to install the files from WRKDIR (extracted from
  poshinit-1.0.tar.gz) instead of FILESDIR.

[1] https://www.freebsd.org/doc/en/books/porters-handbook/quick-porting.html#porting-makefile
[2] https://www.freebsd.org/doc/en/books/porters-handbook/porting-samplem.html
Comment 13 bourne.identity@hotmail.com 2018-10-16 18:49:18 UTC
Can someone please help me fix my Makefile  such that it starts installing files/poshinit.1 as the man page ?

Currently, I just keep getting this error :

pkg-static: Unable to access file /usr/ports/shells/poshinit/work/stage/usr/local/man/man1/poshinit.1:No such file or directory
*** Error code 74


It appears that makefile auto-compresses poshinit.1 /usr/ports/shells/poshinit/work/stage/usr/local/man/man1/poshinit.1.gz

Thanks for any help.
Here is what my Makefile currently looks like :

PORTNAME=       poshinit
PORTVERSION=        1.0
CATEGORIES=     shells
MASTER_SITES=

MAINTAINER=     bourne.identity@hotmail.com
COMMENT=        Portable shell environment across Bash/Zsh & across FreeBSD/Linux/Cygwin

NO_BUILD=       yes
NO_ARCH=        yes

PLIST_FILES=        bin/${PORTNAME} man/man1/${PORTNAME}.1
DISTFILES=

do-install:
        ${INSTALL_SCRIPT} ${FILESDIR}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/
        ${INSTALL_MAN} ${FILESDIR}/${PORTNAME}.1 ${STAGEDIR}${MANPREFIX}/man/man1/${PORTNAME}.1

.include <bsd.port.mk>
Comment 14 bourne.identity@hotmail.com 2018-10-16 19:44:08 UTC
Got it !

Uploading the new shar / logs
Comment 15 bourne.identity@hotmail.com 2018-10-16 19:48:17 UTC
Created attachment 198230 [details]
Revised shar archive for poshinit

Makefile fixed :

MAN page now works.
Swapped in FILESDIR for WRKDIR.
Formatting is better.

Tobias, I request you to please quickly have a look and tell me if anything is still bonkers.
Comment 16 bourne.identity@hotmail.com 2018-10-16 19:48:59 UTC
Created attachment 198231 [details]
Revised portlint log for poshinit
Comment 17 bourne.identity@hotmail.com 2018-10-16 19:49:48 UTC
Created attachment 198232 [details]
Revised poudriere log for poshinit
Comment 18 bourne.identity@hotmail.com 2018-10-16 23:51:51 UTC
Created attachment 198245 [details]
Revised shar archive for poshinit (attempt# 3)
Comment 19 bourne.identity@hotmail.com 2018-10-16 23:52:31 UTC
Created attachment 198246 [details]
Revised portlint log for poshinit (attempt# 3)
Comment 20 bourne.identity@hotmail.com 2018-10-16 23:53:15 UTC
Created attachment 198247 [details]
Revised poudriere log for poshinit (attempt# 3)
Comment 21 bourne.identity@hotmail.com 2018-10-17 17:35:16 UTC
Created attachment 198278 [details]
Revised shar archive for poshinit (attempt# 4)
Comment 22 bourne.identity@hotmail.com 2018-10-17 17:36:02 UTC
Created attachment 198279 [details]
Revised portlint log for poshinit (attempt# 4)
Comment 23 bourne.identity@hotmail.com 2018-10-17 17:36:41 UTC
Created attachment 198280 [details]
Revised poudriere log for poshinit (attempt# 4)
Comment 24 bourne.identity@hotmail.com 2018-10-17 20:07:02 UTC
Created attachment 198282 [details]
Revised shar archive for poshinit (attempt# 5)
Comment 25 bourne.identity@hotmail.com 2018-10-17 20:07:49 UTC
Created attachment 198283 [details]
Revised portlint log for poshinit (attempt# 5)
Comment 26 bourne.identity@hotmail.com 2018-10-17 20:08:30 UTC
Created attachment 198284 [details]
Revised poudriere log for poshinit (attempt# 5)
Comment 27 bourne.identity@hotmail.com 2018-10-18 12:45:48 UTC
Created attachment 198295 [details]
Revised shar archive for poshinit (attempt# 6)
Comment 28 bourne.identity@hotmail.com 2018-10-18 12:46:39 UTC
Created attachment 198296 [details]
Revised portlint log for poshinit (attempt# 6)
Comment 29 bourne.identity@hotmail.com 2018-10-18 12:47:25 UTC
Created attachment 198297 [details]
Revised poudriere log for poshinit (attempt# 6)
Comment 30 Mateusz Piotrowski freebsd_committer 2018-10-18 12:50:55 UTC
Hi,

please do not upload log files unless asked requested. It fills up the database and serves little purpose since committers are going to run portlint and poudriere tests themselves as well.

It's better to just say that portlint produces no errors and which FreeBSD versions and architectures you've tested with poudriere.

Cheers
Comment 31 bourne.identity@hotmail.com 2018-10-18 15:03:53 UTC
Hi Mateusz,

Tx for the note. I will only upload shar in future.

MJ
Comment 32 bourne.identity@hotmail.com 2018-10-18 20:08:25 UTC
Created attachment 198321 [details]
Revised shar archive for poshinit (attempt# 7)

As suggested by Mateusz, I am uploading the new shar only (for a few minor modifications in poshinit and its man page). portlint/poudriere logs are available, in case needed.
Comment 33 bourne.identity@hotmail.com 2018-10-18 21:22:06 UTC
Created attachment 198329 [details]
Revised shar archive for poshinit (attempt# 8)

I think the port is final now
Comment 34 bourne.identity@hotmail.com 2018-10-25 15:33:06 UTC
Created attachment 198625 [details]
Revised shar archive for poshinit (attempt# 9)

A minor but important scope-for-improvement was spotted (exports processed ahead of aliases/functions)
Comment 35 bourne.identity@hotmail.com 2018-10-26 20:10:54 UTC
Created attachment 198679 [details]
Revised shar archive for poshinit (attempt# 10)

'man poshinit' now mentions the command 'alias' too.
Comment 36 bourne.identity@hotmail.com 2018-10-28 00:03:04 UTC
Created attachment 198705 [details]
Revised shar archive for poshinit (attempt# 11)

Man page now lists a couple of bugs.
Comment 37 bourne.identity@hotmail.com 2018-10-28 01:23:33 UTC
Created attachment 198707 [details]
Revised shar archive for poshinit (attempt# 12)

A minor fix
Comment 38 bourne.identity@hotmail.com 2018-10-30 14:57:30 UTC
Created attachment 198772 [details]
Revised shar archive for poshinit (attempt# 13)

aliases L2 and L3 made unconditionally available
Comment 39 bourne.identity@hotmail.com 2018-10-31 22:24:35 UTC
Created attachment 198825 [details]
Revised shar archive for poshinit (attempt# 14)

poshinit documentation now stresses more L2 (FreeBSD/Linux/Cygwin) and less L3 (Linux-distro).
Comment 40 bourne.identity@hotmail.com 2018-11-01 20:09:36 UTC
Created attachment 198870 [details]
Revised shar archive for poshinit (attempt# 15)

Minor update: pkg-descr now bundles in WWW link
Comment 41 bourne.identity@hotmail.com 2018-11-03 17:11:48 UTC
Created attachment 198916 [details]
Revised shar archive for poshinit (attempt# 16)

Setup script now prompts for bundling in KSH_ARRAYS for Z shell configuration (to make it Bash-compatible - array indexing begins at 0)
Comment 42 bourne.identity@hotmail.com 2018-11-05 23:52:36 UTC
Created attachment 198995 [details]
Revised shar archive for poshinit (attempt# 17)

poshinit now caters to logout facility too for Bash/Zsh.
Comment 43 bourne.identity@hotmail.com 2018-11-06 05:05:17 UTC
Created attachment 198999 [details]
Revised shar archive for poshinit (attempt# 18)

Minor fix in documentation re logout functionality
Comment 44 bourne.identity@hotmail.com 2018-11-11 23:34:37 UTC
Created attachment 199152 [details]
Revised shar archive for poshinit (attempt# 19)

Minor fixes : shell variables now exported upon being set; logout symlinks created early.
Comment 45 bourne.identity@hotmail.com 2018-11-13 01:33:43 UTC
Created attachment 199189 [details]
Revised shar archive for poshinit (attempt# 20)

poshinit update to incorporate alias pig <List all installed packages + grep>
Comment 46 bourne.identity@hotmail.com 2018-11-13 20:56:52 UTC
Hi,

I would like poshinit to be available for download via pkg.

I used poudriere to create a package (TXZ) for poshinit. Where can I submit the package ?


Tx
Manish Jain
Comment 47 Mateusz Piotrowski freebsd_committer 2018-11-19 14:05:16 UTC
(In reply to bourne.identity@hotmail.com from comment #46)

Could you set LICENSE and LICENSE_FILE?
Comment 48 bourne.identity@hotmail.com 2018-11-19 15:15:51 UTC
Created attachment 199343 [details]
Revised shar archive for poshinit (attempt# 21)

LICENSE/LICENSE_FILE now included
Comment 49 Mateusz Piotrowski freebsd_committer 2018-11-19 15:22:39 UTC
(In reply to bourne.identity@hotmail.com from comment #48)

Would it be possible to upstream the LICENSE file? It doesn't feel correct to store the software license in the files directory. It should be distributed with the source code.
Comment 50 bourne.identity@hotmail.com 2018-11-19 16:58:56 UTC
Created attachment 199349 [details]
Revised shar archive for poshinit (attempt# 22)

Mateusz,

I have removed the LICENSE file entirely and set LICENSE to BSD3CLAUSE. portlint finds this acceptable. I do as well.

1) Is the above okay with you ?
2) I am getting a portlint warning for MASTER_SITES being empty. I have no idea what is MASTER_SITES, and I just set it as empty because the poshinit project is hosted via files/ (and not via any internet URL)

Perhaps you could advise me on fixing/removing MASTER_SITES too.

Thanks.
Manish Jain
Comment 51 bourne.identity@hotmail.com 2018-11-21 15:09:11 UTC
Created attachment 199424 [details]
Revised shar archive for poshinit (attempt# 23)

LICENSE reverted to GPL with explicit file
Comment 52 Mateusz Piotrowski freebsd_committer 2018-12-05 15:28:24 UTC
Hello,

the source code of a port should not be stored in the "files" directory. Upstream should offer a way to download a tarball instead. A lot of different people with various use-cases use the FreeBSD ports tree and it is not polite to make them download more files unless absolutely necessary.

Also, please consider uploading new revisions when they are tested and considered stable. Otherwise, Bugzilla's database fills up quickly with half-backed solutions. ;)

Cheers,
Mateusz
Comment 53 bourne.identity@hotmail.com 2018-12-06 16:51:19 UTC
Created attachment 199900 [details]
Revised shar archive for poshinit (attempt# 24)

poshinit now moved to GitHub.
poshinit now accepts --bare mode and --editor preset.
Comment 54 bourne.identity@hotmail.com 2018-12-07 16:10:58 UTC
Please put poshinit on hold.

I am adding a major new facility to poshinit -

To extract the current environment into poshinit's setup.

Will upload shar once --extract is working (and fully tested)