Bug 193003 - [PATCH] sysutils/bsdadminscripts: fix some scripts
Summary: [PATCH] sysutils/bsdadminscripts: fix some scripts
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Rene Ladan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-26 01:02 UTC by Carlos J Puga Medina
Modified: 2014-08-26 18:59 UTC (History)
2 users (show)

See Also:


Attachments
bsdadminscripts.diff (4.66 KB, patch)
2014-08-26 01:02 UTC, Carlos J Puga Medina
no flags Details | Diff
bsdadminscripts.diff (94.46 KB, patch)
2014-08-26 11:23 UTC, Carlos J Puga Medina
no flags Details | Diff
bsdadminscripts.diff (94.46 KB, patch)
2014-08-26 11:55 UTC, Carlos J Puga Medina
no flags Details | Diff
bsdadminscripts.diff (94.46 KB, patch)
2014-08-26 12:00 UTC, Carlos J Puga Medina
no flags Details | Diff
bsdadminscripts.diff (94.46 KB, patch)
2014-08-26 13:00 UTC, Carlos J Puga Medina
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos J Puga Medina 2014-08-26 01:02:04 UTC
Created attachment 146283 [details]
bsdadminscripts.diff

Fix the following scripts which failed to run: pkg_libchk, pkg_upgrade and uma.

Build logs via redports:

https://redports.org/buildarchive/20140826005336-26170/
Comment 1 John Marino freebsd_committer freebsd_triage 2014-08-26 06:54:41 UTC
Hardcoded replacements for variables is not the correct fix.

Use FILE_SUB mechanism.

You don't know that PREFIX is /usr/local.  That's only a default and it could be anything. You need to replace %%PREFIX%% with the required value.
Comment 2 Carlos J Puga Medina 2014-08-26 11:23:20 UTC
Created attachment 146299 [details]
bsdadminscripts.diff

- Use SUB_FILES and SUB_LIST variables.
- Remove ${FILESDIR}/patch-pkg_libchk.

Build logs via redports:

https://redports.org/buildarchive/20140826110101-58968/
Comment 3 John Marino freebsd_committer freebsd_triage 2014-08-26 11:47:23 UTC
should it be TMP?=/tmp etc?
Comment 4 Carlos J Puga Medina 2014-08-26 11:55:23 UTC
Created attachment 146301 [details]
bsdadminscripts.diff

Yes, you're right. I changed it to TMP=/tmp VAR=/tmp

Now portlint doesn't complain:

% portlint -ac
WARN: Makefile: possible direct use of "scripts" "COMMENT=	Collection of administration scripts" found. if so, use ${SCRIPTDIR} instead.
WARN: Consider to set DEVELOPER=yes in /etc/make.conf
0 fatal errors and 2 warnings found.
Comment 5 Carlos J Puga Medina 2014-08-26 11:56:02 UTC
Sorry, changed to TMP=/tmp and VAR=/var
Comment 6 John Marino freebsd_committer freebsd_triage 2014-08-26 11:58:20 UTC
actually i literally meant "TMP?= /tmp" which means it defaults to /tmp but somebody could pre-define tmp "e.g. make TMP=/puthereinstead install" and change the scripts.

Otherwise it's locked into /tmp and /var and the user can't pick anything else.
Comment 7 Carlos J Puga Medina 2014-08-26 12:00:47 UTC
Created attachment 146302 [details]
bsdadminscripts.diff

Ok, changed to TMP?=/tmp and VAR?=/var
Comment 8 Carlos J Puga Medina 2014-08-26 12:15:45 UTC
Also I checked and compared it with previous scripts. No differences at all :)
Comment 9 John Marino freebsd_committer freebsd_triage 2014-08-26 12:44:43 UTC
the only issue is cosmetic (needs tab after ?=)

I'll let the commit worry about that.
Comment 10 Carlos J Puga Medina 2014-08-26 12:47:36 UTC
(In reply to John Marino from comment #9)
> the only issue is cosmetic (needs tab after ?=)
> 
> I'll let the commit worry about that.

Well, in this case portlint complains as follows:

portlint -ac
WARN: Makefile: possible use of absolute pathname "/tmp".
WARN: Makefile: possible use of absolute pathname "/var".
WARN: Makefile: possible direct use of "scripts" "COMMENT=	Collection of administration scripts" found. if so, use ${SCRIPTDIR} instead.
WARN: Consider to set DEVELOPER=yes in /etc/make.conf
0 fatal errors and 4 warnings found.
Comment 11 John Marino freebsd_committer freebsd_triage 2014-08-26 12:53:46 UTC
you can ignore the first 3 warnings.

You should fix the 4th though. :)
Comment 12 Carlos J Puga Medina 2014-08-26 13:00:09 UTC
Created attachment 146306 [details]
bsdadminscripts.diff

Add cosmetic touch to the patch :)
Comment 13 commit-hook freebsd_committer freebsd_triage 2014-08-26 18:58:10 UTC
A commit references this bug:

Author: rene
Date: Tue Aug 26 18:57:58 UTC 2014
New revision: 366248
URL: http://svnweb.freebsd.org/changeset/ports/366248

Log:
  sysutils/bsdadminscripts: fix scripts at runtime.

  Previously, pkg_libchk, pkg_upgrade, and uma failed to run.
  Bump PORTREVISION

  PR:		193003
  Submitted by:	Carlos Jacobo Puga Medina <cpm@fbsd.es>
  Reviewed by:	marino

Changes:
  head/sysutils/bsdadminscripts/Makefile
  head/sysutils/bsdadminscripts/files/patch-pkg_libchk
  head/sysutils/bsdadminscripts/files/pkg_libchk.in
  head/sysutils/bsdadminscripts/files/pkg_upgrade.in
  head/sysutils/bsdadminscripts/files/uma.in