pkgusr
3 years agoBetter bash prompt
Steve Youngs [Sat, 17 Apr 2021 12:08:26 +0000 (22:08 +1000)]
Better bash prompt

* etc/pkgusr/git-prompt: New, from the contrib directory in git's
git repo.

* etc/pkgusr/bash_profile: Update the prompt code.
Improve a few comments.

Signed-off-by: Steve Youngs <steve@steveyoungs.com>
3 years agoUpdate less(1) options.
Steve Youngs [Mon, 15 Mar 2021 09:50:19 +0000 (19:50 +1000)]
Update less(1) options.

Remove '--mouse' from the options because it prevents selecting text with
the mouse.

* etc/pkgusr/bash_profile (LESS): Don't include '--mouse'.

Signed-off-by: Steve Youngs <steve@steveyoungs.com>
3 years agoUpdate prune_prefixes
Steve Youngs [Mon, 15 Mar 2021 07:40:03 +0000 (17:40 +1000)]
Update prune_prefixes

* usr/bin/forall_direntries_from (prune_prefixes):
* usr/bin/grep_all_regular_files_for (prune_prefixes):
* usr/bin/list_suspicious_files (prune_prefixes):
Add /var/lib/{portables,private} to the bastard vars.

Signed-off-by: Steve Youngs <steve@steveyoungs.com>
3 years agoUpdate less(1) options
Steve Youngs [Sat, 13 Mar 2021 12:32:42 +0000 (22:32 +1000)]
Update less(1) options

Signed-off-by: Steve Youngs <steve@steveyoungs.com>
3 years agoUpdate -- handy_funcs
Steve Youngs [Thu, 25 Feb 2021 13:06:30 +0000 (23:06 +1000)]
Update -- handy_funcs

* etc/pkgusr/handy_funcs (B-tips): New.
(H-pkg): Mention it.
Nuke a UUOC.

Signed-off-by: Steve Youngs <steve@steveyoungs.com>
3 years agoUpdate -- lesspipe.sh
Steve Youngs [Sat, 20 Feb 2021 05:46:21 +0000 (15:46 +1000)]
Update -- lesspipe.sh

* usr/bin/lesspipe.sh: Redirect stderr to /dev/null once
script-wide instead of for each individual command.
Use the '-b' file(1) option instead of piping through awk.
Process HTML files with 'lynx -dump'
Handle rpm if rpm is installed.
Handle rar if unrar is installed.

Signed-off-by: Steve Youngs <steve@steveyoungs.com>
3 years agoUpdates to the Zsh pkgtools.
Steve Youngs [Thu, 18 Feb 2021 09:26:37 +0000 (19:26 +1000)]
Updates to the Zsh pkgtools.

Mostly this is to do with having groups span multiple lines in
/etc/group.  Toward that end, parsing /etc/group is not done anymore.
To get at the 'install' group members we use groupmems(8) (via sudo).

The output of Lpkg() was cleaned up.  Yup, I just discovered
column(1). :-)

Two new functions:
  dpkg() -- Print a package's short description
  Dpkg() -- Print a package's long description.

The old dpkg() to show a package's dependencies has been renamed to pkgdeps()

* etc/pkgusr/zsh/_zsh-pkgtools (_pkgtools_users): Use groupmems
instead of parsing /etc/group.

* etc/pkgusr/zsh/zsh-pkgtools: Whitespace reformat.  Tabs are 8
chars wide, but in shell-scripts I like 4 char indents.
(pkgdeps): New, renamed from 'dpkg'.
(dpkg): Now prints a package's short description.
(Dpkg): New, print a package's long description.
(pkglst): New.  Saves package list to a var, $PKGLST
(fpkg): Use $PKGLST. Add `-E' grep option.
(lpkg): Parse $PKGLST instead of /etc/group.
(Lpkg): Parse $PKGLST instead of /etc/group, use column(1) for
cleaner output.
(pkg_install): Call pkglst() to update $PKGLST
(pkgwant): Use $PKGLST instead of calling lpkg()

Signed-off-by: Steve Youngs <steve@steveyoungs.com>
3 years agoUpdate pkgusr.el to deal with multi-line install group.
Steve Youngs [Fri, 12 Feb 2021 06:22:57 +0000 (16:22 +1000)]
Update pkgusr.el to deal with multi-line install group.

* lisp/pkgusr.el (pkgusr-all-pkgs): Allow for the install
  group being split across multiple lines.

Signed-off-by: Steve Youngs <steve@steveyoungs.com>
3 years agoEnable bash-completion in bash_profile
Steve Youngs [Tue, 9 Feb 2021 05:07:54 +0000 (15:07 +1000)]
Enable bash-completion in bash_profile

Signed-off-by: Steve Youngs <steve@steveyoungs.com>
3 years agoFix checkupdates()
Steve Youngs [Mon, 8 Feb 2021 13:04:05 +0000 (23:04 +1000)]
Fix checkupdates()

Signed-off-by: Steve Youngs <steve@steveyoungs.com>
3 years agoFix for multi-line groups
Steve Youngs [Mon, 8 Feb 2021 12:19:38 +0000 (22:19 +1000)]
Fix for multi-line groups

Signed-off-by: Steve Youngs <steve@steveyoungs.com>
3 years agoSet LANG and LC_CTYPE in bash_profile
Steve Youngs [Sun, 7 Feb 2021 05:53:22 +0000 (15:53 +1000)]
Set LANG and LC_CTYPE in bash_profile

Signed-off-by: Steve Youngs <steve@steveyoungs.com>
3 years agoCurrent FHS compliance
Steve Youngs [Sat, 6 Feb 2021 06:44:56 +0000 (16:44 +1000)]
Current FHS compliance

This changeset updates everything to allow for an "unsplit /usr"
filesystem hierarchy.  The current FHS policy states that
 /bin /sbin /lib /lib64 should all be symlinks into the corresponding
directories under /usr

Signed-off-by: Steve Youngs <steve@steveyoungs.com>
3 years agoUpdate pkgsu() to set DISPLAY env var if it is set in the calling env.
Steve Youngs [Fri, 29 Jan 2021 10:18:57 +0000 (20:18 +1000)]
Update pkgsu() to set DISPLAY env var if it is set in the calling env.

* etc/pkgusr/zsh/zsh-pkgtools (pkgsu): Maybe set $DISPLAY

Signed-off-by: Steve Youngs <steve@steveyoungs.com>
3 years agoTurn on LS_COLORS for pkgusrs
Steve Youngs [Mon, 25 Jan 2021 11:06:45 +0000 (21:06 +1000)]
Turn on LS_COLORS for pkgusrs

Signed-off-by: Steve Youngs <steve@steveyoungs.com>
3 years agoLots of juicy updates
Steve Youngs [Mon, 25 Jan 2021 07:16:02 +0000 (17:16 +1000)]
Lots of juicy updates

Updated the various scripts to deal with /usr/lib/deprecated in a
better way (I hope).  Deprecated libs are given special mention at the
bottom of a package's .project.

Re-wrote lesspipe.sh so that now it doesn't rely on filenames to
decide how to process a file.

vtar(), xtar() are now shell aliases in zsh-pkgtools.

* usr/lib/pkgusr/uninstall_package (dry_run,run): Deal with stuff
that might be in /usr/lib/deprecated

* etc/pkgusr/zsh/zsh-pkgtools (vtar,xtar): Replace with shell
aliases.

* usr/lib/pkgusr/update-pkg-project (upd_pkg_deps): Guard against
xargs getting no input.
(list_deprecated): New.

* usr/bin/list_suspicious_files (prune_prefixes): Update the
bastard copy, adding /usr/lib/deprecated, and sorting the list.

* usr/bin/lesspipe.sh: Complete re-write, eliminating the use of
filenames to determine how to process a file.

* usr/bin/grep_all_regular_files_for (prune_prefixes): Update the
bastard copy, adding /usr/lib/deprecated, and sorting the list.
If running as root, set prune_prefixes to something minimal.

* usr/bin/forall_direntries_from (prune_prefixes): Update the
bastard copy, adding /usr/lib/deprecated, and sorting the list
because I'm anal like that.

Signed-off-by: Steve Youngs <steve@steveyoungs.com>
3 years agoMisc updates to header-symbol-search and handy_funcs
Steve Youngs [Sun, 24 Jan 2021 05:32:04 +0000 (15:32 +1000)]
Misc updates to header-symbol-search and handy_funcs

header-symbol-search had broken, grep's '--mmap' option no longer
exists.  This patch fixes that, as well as getting rid of an obnoxious
loop.

In handy_funcs, the vtar and xtar functions have been replaced with
far simpler shell aliases.  See:

  vtar is aliased to 'less'
  xtar is aliased to 'tar xf'

* usr/bin/header-symbol-search (all_headers): Removed.
Forget slow-as-fuck looping, just recurse.

* etc/pkgusr/handy_funcs (xtar,vtar): Replaced with simpler
aliases.

Signed-off-by: Steve Youngs <steve@steveyoungs.com>
3 years agoTry to eliminate false-positives from patches alias.
Steve Youngs [Sat, 23 Jan 2021 07:45:08 +0000 (17:45 +1000)]
Try to eliminate false-positives from patches alias.

It should also now be possible to use this to copy the patches with

  'cp -v $(patches) .'

* etc/pkgusr/handy_funcs: Improve 'patches' alias.

Signed-off-by: Steve Youngs <steve@steveyoungs.com>
3 years agoImprove patches alias
Steve Youngs [Thu, 21 Jan 2021 05:32:28 +0000 (15:32 +1000)]
Improve patches alias

Signed-off-by: Steve Youngs <steve@steveyoungs.com>
3 years agoFix previous commit
Steve Youngs [Thu, 21 Jan 2021 00:14:31 +0000 (10:14 +1000)]
Fix previous commit

Signed-off-by: Steve Youngs <steve@steveyoungs.com>
3 years agoMake it a little easier to check for Slackware patches.
Steve Youngs [Thu, 21 Jan 2021 00:11:51 +0000 (10:11 +1000)]
Make it a little easier to check for Slackware patches.

* etc/pkgusr/handy_funcs: New alias, 'patches'. To check for
Slackware patches.

Signed-off-by: Steve Youngs <steve@steveyoungs.com>
3 years agoAdd a shortcut to a local Slackware repo.
Steve Youngs [Wed, 20 Jan 2021 05:37:13 +0000 (15:37 +1000)]
Add a shortcut to a local Slackware repo.

Just a convenient way to get to Slackware patches.

* etc/pkgusr/bash_profile (SLACKPKG): New.  It points to a local
Slackware source repo.

Signed-off-by: Steve Youngs <steve@steveyoungs.com>
3 years agoSome long overdue updates
Steve Youngs [Wed, 20 Jan 2021 04:14:32 +0000 (14:14 +1000)]
Some long overdue updates

* overdue-updates:
  Update library symbol searching.
  Update a few things in handy_funcs.
  Better git config

3 years agoUpdate library symbol searching.
Steve Youngs [Wed, 20 Jan 2021 04:13:19 +0000 (14:13 +1000)]
Update library symbol searching.

* usr/bin/library-symbol-search (all_libs): Don't include the
deprecated directory.
Redirect objdump's stderr to /dev/null to avoid unnecessarily
spamming stdout.

Signed-off-by: Steve Youngs <steve@steveyoungs.com>
3 years agoUpdate a few things in handy_funcs.
Steve Youngs [Wed, 20 Jan 2021 03:54:32 +0000 (13:54 +1000)]
Update a few things in handy_funcs.

* etc/pkgusr/handy_funcs: Default the editing aliases to use vi
instead of nano.
(chkg,makeg): Check, and make counterparts to instg().
(showinst): Rename to ipkg. Remove the alias.
(showgen): Rename to gpkg. Remove the alias.
(prep_git): Convenience function to set up nicer git config.
(H-pkg): Update to reflect these changes.

Signed-off-by: Steve Youngs <steve@steveyoungs.com>
3 years agoBetter git config
Steve Youngs [Wed, 20 Jan 2021 02:38:55 +0000 (12:38 +1000)]
Better git config

Signed-off-by: Steve Youngs <steve@steveyoungs.com>
4 years agoAdd /etc/mail/auth to prune_prefixes for bastard
Steve Youngs [Fri, 7 Feb 2020 11:11:20 +0000 (21:11 +1000)]
Add /etc/mail/auth to prune_prefixes for bastard

* usr/bin/forall_direntries_from (prune_prefixes): Add
/etc/mail/auth in bastard section

* usr/bin/list_suspicious_files (prune_prefixes): Ditto.

Signed-off-by: Steve Youngs <steve@steveyoungs.com>
6 years agoAdd '/var/lib/colord/.cache' to Bastard prune_prefixes
Steve Youngs [Sat, 10 Jun 2017 01:23:36 +0000 (11:23 +1000)]
Add '/var/lib/colord/.cache' to Bastard prune_prefixes

* usr/bin/forall_direntries_from (Bastard prune_prefixes): Add
/var/lib/colord/.cache

* usr/bin/list_suspicious_files (Bastard prune_prefixes): Ditto.

* usr/bin/grep_all_regular_files_for (Bastard prune_prefixes):
Ditto.

Signed-off-by: Steve Youngs <steve@steveyoungs.com>
8 years agoPipe ipkg/gpkg through less for Zsh pkgtools as well
Steve Youngs [Wed, 4 May 2016 06:58:45 +0000 (16:58 +1000)]
Pipe ipkg/gpkg through less for Zsh pkgtools as well

Signed-off-by: Steve Youngs <steve@steveyoungs.com>
8 years agoUse less(1) options to negate the need for a useless and lame shell func.
Steve Youngs [Wed, 4 May 2016 01:33:27 +0000 (11:33 +1000)]
Use less(1) options to negate the need for a useless and lame shell func.

* etc/pkgusr/bash_profile (LESS): Add 'F' and 'X' which will allow
getting rid of that silly less-or-cat() shell function.

* etc/pkgusr/handy_funcs (less-or-cat): Removed.
Update all functions/aliases to use less instead of less-or-cat.
(showinst,showgen,instg): Pipe output through less.

Signed-off-by: Steve Youngs <steve@steveyoungs.com>
8 years agoAdd /etc/mail/spamassassin to prune prefixes
Steve Youngs [Mon, 7 Dec 2015 01:46:38 +0000 (11:46 +1000)]
Add /etc/mail/spamassassin to prune prefixes

* usr/bin/forall_direntries_from (prune_prefixes): Add
'/etc/mail/spamassassin' to the bastard settings.

* usr/bin/list_suspicious_files (prune_prefixes): Ditto.

* usr/bin/grep_all_regular_files_for (prune_prefixes): Ditto

Signed-off-by: Steve Youngs <steve@steveyoungs.com>
8 years agoHave pkgusrs run ldconfig on logout.
Steve Youngs [Fri, 26 Jun 2015 13:34:57 +0000 (23:34 +1000)]
Have pkgusrs run ldconfig on logout.

All too often a package installation doesn't include running ldconfig,
this takes care of that by running it whenever a pkgusr logs out.

Also, add a .gitconfig

* etc/pkgusr/zsh/zsh-pkgtools (pkgsu): Ensure a login shell.

* etc/pkgusr/bash_logout: New.  Just runs ldconfig on logout.

* etc/pkgusr/skel-package/.gitconfig: New.

Signed-off-by: Steve Youngs <steve@steveyoungs.com>
8 years agoAdd /etc/pam.d to bastard prune_prefixes
Steve Youngs [Sun, 24 May 2015 13:20:50 +0000 (23:20 +1000)]
Add /etc/pam.d to bastard prune_prefixes

* script_updates:
  Add a couple of dirs to prune_prefixes for bastard settings

8 years agoAdd a couple of dirs to prune_prefixes for bastard settings
Steve Youngs [Sun, 24 May 2015 13:14:57 +0000 (23:14 +1000)]
Add a couple of dirs to prune_prefixes for bastard settings

IMO /etc/pam.d should be 0700 root:root, with the files therein being 0600
root:root.  So that is how I have it.  Pruning it out in the pkgusr
scripts.

* usr/bin/forall_direntries_from (prune_prefixes): Add /etc/pam.d
to the bastard settings.

* usr/bin/list_suspicious_files (prune_prefixes): Ditto.

Signed-off-by: Steve Youngs <steve@steveyoungs.com>
9 years agoUpdate uninstall script.
Steve Youngs [Tue, 21 Apr 2015 12:48:27 +0000 (22:48 +1000)]
Update uninstall script.

With this changeset the uninstall script should be a lot more
robust. "sub-packages" are handled, directories are only removed if they
are empty, and something more proactive is done about setuid files.

* usr/lib/pkgusr/uninstall_package (usage): Reword it, taking into
account needing pkgname arg.
(check_suid): New.
(dry_run): Use it.
(run): Ditto.
Handle empty directories more intelligently.
Don't wipe out the .project file if uninstalling a "sub-pkg".

Signed-off-by: Steve Youngs <steve@steveyoungs.com>
9 years agoAdd another dir to prune out
Steve Youngs [Tue, 21 Apr 2015 12:23:10 +0000 (22:23 +1000)]
Add another dir to prune out

Signed-off-by: Steve Youngs <steve@steveyoungs.com>
9 years agoUpdate prune_prefixes for bastard settings
Steve Youngs [Sat, 13 Sep 2014 00:27:26 +0000 (10:27 +1000)]
Update prune_prefixes for bastard settings

Signed-off-by: Steve Youngs <steve@steveyoungs.com>
10 years agoSupport sub-groups in pkgusr.el
Steve Youngs [Mon, 17 Mar 2014 13:09:39 +0000 (23:09 +1000)]
Support sub-groups in pkgusr.el

* sxe-update:
  Support pkg sub-groups in pkgusr-cmd-pkg/pkgusr-file-pkg

10 years agoSupport pkg sub-groups in pkgusr-cmd-pkg/pkgusr-file-pkg
Steve Youngs [Mon, 17 Mar 2014 13:09:02 +0000 (23:09 +1000)]
Support pkg sub-groups in pkgusr-cmd-pkg/pkgusr-file-pkg

* lisp/pkgusr.el (pkgusr-cmd-pkg): Use the new #'user-group-name
from latest SXEmacs.  This fixes the issue of a pkgusr sub-group
being displayed as "nil".
(pkgusr-file-pkg): Ditto.

* usr/lib/pkgusr/update-pkg-project: Always exit zero.

Signed-off-by: Steve Youngs <steve@steveyoungs.com>
10 years agoSXEmacs related updates
Steve Youngs [Sat, 15 Mar 2014 15:15:22 +0000 (01:15 +1000)]
SXEmacs related updates

* sxe-fixes:
  Pretty decent overhaul of the elisp tools.

10 years agoPretty decent overhaul of the elisp tools.
Steve Youngs [Sat, 15 Mar 2014 15:14:11 +0000 (01:14 +1000)]
Pretty decent overhaul of the elisp tools.

Most interactive defuns can now optionally insert their results into the
current buffer at point.

The list of packages is now only evaled at load time to reduce
processing.  Relevant defuns can re-eval explicitly via prefix arg.

* etc/pkgusr/bash_profile (CHECKUPDATES): Don't checkupdates if
$TERM is "dumb".  This allows TRAMP to still function if a pkgusr
would have gotten the update message on a normal login.

* lisp/pkgusr.el (pkgusr-all-pkgs): New variable to hold list of
installed packages so we don't have to calculate it every time it
is used.
(pkgusr-all-pkgs-update): New.  Updates above, to be optionally
used in the rest of pkgusr.el.
(pkgusr-pkgs-count): Use it.
(pkgusr-list-pkgs-regexp): Ditto.  Also optionally insert result
into current buffer at point.
(pkgusr-pkg-details): Pop to a buffer displaying a package's
filelist and other details.
(pkgusr-show-pkg): Remove its argument, it was never intended to
be called non-interactively.  Update the packages list via prefix
arg.  Use #'pkgusr-pkg-details
(pkgusr-pkg-install-notes): Ditto.
(pkgusr-pkg-general-notes): Ditto.
(pkgusr-cmd-pkg): Insert into buffer with prefix arg.
Error out if the file owner or group isn't a pkgusr
(pkgusr-file-pkg): Ditto.
(pkgusr-project-file): New.
(pkgusr-pkg-url): Use it.  Optionally insert into buffer.
Optionally force update of packages list.
(pkgusr-pkg-repo): Ditto.
(pkgusr-pkg-version): Ditto.
(pkgusr-pkg-description): Ditto.
(pkgusr-pkg-deps): Ditto.
(pkgusr-find-file): Force update of packages list via prefix arg.
(pkgusr-pkg-rdeps): New.  Returns a list of reverse dependencies
of a package. IOW, what packages need a package.

* lisp/bld-update.el: Typo fix.

Signed-off-by: Steve Youngs <steve@bastard.steveyoungs.com>
10 years agoUpdate script fix
Steve Youngs [Sat, 15 Mar 2014 00:56:59 +0000 (10:56 +1000)]
Update script fix

* upp-fix:
  Prevent update-pkg-project returning false-positives

10 years agoPrevent update-pkg-project returning false-positives
Steve Youngs [Sat, 15 Mar 2014 00:56:33 +0000 (10:56 +1000)]
Prevent update-pkg-project returning false-positives

* usr/lib/pkgusr/pkgawk.awk: New.

* usr/lib/pkgusr/update-pkg-project (pkgawk): The new awk script
file for the hairy dependency extractor.  This is a slightly
modified version of the "one-liner" that is more robust and
doesn't catch false-positives.
(upd_pkg_deps): Use it.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
10 years agoFix update-pkg-project script
Steve Youngs [Thu, 13 Mar 2014 00:53:32 +0000 (10:53 +1000)]
Fix update-pkg-project script

* upp-fix:
  Prevent update-pkg-project from needlessly spamming stderr

10 years agoPrevent update-pkg-project from needlessly spamming stderr
Steve Youngs [Thu, 13 Mar 2014 00:52:41 +0000 (10:52 +1000)]
Prevent update-pkg-project from needlessly spamming stderr

* usr/lib/pkgusr/update-pkg-project (upd_pkg_deps): Prevent stderr
getting spammed.
(TIMESTAMP,DEPS): New.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
10 years agoA truck load of updates/fixes/tweaks
Steve Youngs [Wed, 12 Mar 2014 08:05:16 +0000 (18:05 +1000)]
A truck load of updates/fixes/tweaks

* fixes/updates:
  A few more minor tweaks.
  Fix nasty bug in chmod, plus minor fixes.
  Fix a bug that was exposed by the SXEmacs configure script.
  Try to make it easier for when I update the build script template.
  Fix a bunch of little things from the previous changeset.
  Major overhaul -- most scripts rewritten or updated.

10 years agoA few more minor tweaks.
Steve Youngs [Wed, 12 Mar 2014 08:03:54 +0000 (18:03 +1000)]
A few more minor tweaks.

* etc/pkgusr/skel-package/build (update_commands): Just use
update-pkg-project.

* etc/pkgusr/handy_funcs (find_pkg_deps): Removed.  Wasn't all
that handy.

* etc/pkgusr/handy_funcs (build-update): Copy the new build script
into ${HOME}/build-YYYYmmdd if SXEmacs isn't installed to allow
for manual update.

* usr/bin/forall_direntries_from (IGNORE_READDIR_RACE): For use
primarily in the uninstall script.

* usr/lib/pkgusr/uninstall_package (run): The -ignore_readdir_race
option can't be used here directly.  It is now in
forall_direntries_from and activated via env varibable set in this
script.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
10 years agoFix nasty bug in chmod, plus minor fixes.
Steve Youngs [Wed, 12 Mar 2014 04:05:17 +0000 (14:05 +1000)]
Fix nasty bug in chmod, plus minor fixes.

* usr/lib/pkgusr/chmod: My idea for converting symbolic chmods
into numeric was completely wrong.  Rewrite to work on the
symbolic directly without converting them.

Only reset $@ if it is necessary.

Don't call $DAISY_CHAIN via exec.

* usr/lib/pkgusr/chgrp: Don't use exec.

* usr/lib/pkgusr/chown: Ditto.

* usr/lib/pkgusr/mkdir: Ditto.

* usr/lib/pkgusr/install (_perms): Fix as per chmod.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
10 years agoFix a bug that was exposed by the SXEmacs configure script.
Steve Youngs [Tue, 11 Mar 2014 04:16:31 +0000 (14:16 +1000)]
Fix a bug that was exposed by the SXEmacs configure script.

Under certain conditions a directory could be created with no execute bit
set (600 instead of 700).  When the chmod wrapper (and install) encounter
symbolic permissions they are converted to octal by stat'ing a temp file
that was chmod'd with the symbolic perm.  Because of the obnoxious and
convoluted way that autoconf does things, that chmod had to be called
under an exec.

This changeset cares for that plus a couple of other tiny things like
always testing for root with `id -u' instead of $UID.

* usr/lib/pkgusr/chmod: Use id to check for root because $UID
cannot be guaranteed to exist.

Only remove real options to guard against accidently removing a
symbolic perm that begins with a dash.  I don't even know if that
is possible, I've never used symbolic perms, never will, they're a
stupid idea.

Create the hack-o-matic file with mktemp and call $DAISY_CHAIN
there via exec.

* usr/lib/pkgusr/chgrp: Use id for root check.

* usr/lib/pkgusr/chown: Ditto.

* usr/lib/pkgusr/mkdir: Ditto.

* usr/lib/pkgusr/install: Ditto.
(_perms): Use mktemp, the same as in the chmod wrapper.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
10 years agoTry to make it easier for when I update the build script template.
Steve Youngs [Mon, 10 Mar 2014 09:09:43 +0000 (19:09 +1000)]
Try to make it easier for when I update the build script template.

It's most likely incredibly hacky, but this changeset gives a pkgusr a way
to incrementally and interactively apply updates to their build script
when the central template script in /etc/pkgusr/skel-package is updated.

If the central template script is newer than the pkgusr's a notice is
printed to their stdout on login that contains further instructions of how
to proceed.

The actual updating is done via #'ediff-files in an interactive SXEmacs
session.  That way the pkgusr can "cherrypick" the changes.

* lisp/bld-update.el: New.  Update build scripts via ediff.

* etc/pkgusr/handy_funcs (build-update): New.  Calls SXEmacs with
ediff-files on ~/build and /etc/pkgusr/skel-package/build
(checkupdates): Checks to see if the build script in
/etc/pkgusr/skel-package is newer than the one in $HOME

* etc/pkgusr/bash_profile (CHECKUPDATES): New.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
10 years agoFix a bunch of little things from the previous changeset.
Steve Youngs [Mon, 10 Mar 2014 03:27:58 +0000 (13:27 +1000)]
Fix a bunch of little things from the previous changeset.

* usr/lib/pkgusr/chgrp: Fix shell quoting.
Better test for GIDs vs names

* usr/lib/pkgusr/chmod: Fix shell quoting.
Fix inf-loop in symbol->octal conversion.

* usr/lib/pkgusr/chown: Fix shell quoting.
Fix logic in user test.
Better tests for UID/GID vs names.

* usr/lib/pkgusr/install: Re-factor getopts cmdline parsing.
(_dirs): Use $pristinecmd instead of $@,
exit if not creating directory.
(_leading_dirs): Removed, not needed.
(_perms): Better test for symbol vs octal.
Call /bin/chmod directly in the hack-o-matic.
(_group): Better test for GID vs name
(_owner): Better test for UID vs name

* usr/lib/pkgusr/mkdir:  Remove spurious `fi'.
Logged 'install cmd suggestion' had incorrect -g option.

* usr/bin/forall_direntries_from (prune_prefixes): Add
/usr/lib/pkgusr.  Non-pkgusrs are not allowed in this directory
anymore.

* usr/bin/grep_all_regular_files_for (prune_prefixes): Ditto.

* etc/pkgusr/bash_profile (SUPPRESSLOCALEDIR): Typo.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
10 years agoMajor overhaul -- most scripts rewritten or updated.
Steve Youngs [Sun, 9 Mar 2014 06:33:48 +0000 (16:33 +1000)]
Major overhaul -- most scripts rewritten or updated.

* etc/pkgusr/bash_profile (LESSCHARSET): Everything's god-damned
UTF-8 these days
(PKG_CONFIG_PATH): More readable.
(SUPPRESSLOCALEDIR): Add.

* etc/pkgusr/handy_funcs (find_pkg_deps): New.
(instg): New, for grepping install logs for '*** msg'.
(less-or-cat): New, for log viewing, does what it says.
(H-pkg): Much nicer format, pipe through less.
General tidy up.  Convert a lot of tiny functions to aliases, plus
added a couple of new ones... ipkg->showinst, gpkg->showgen

* etc/pkgusr/skel-package/build (SRCTREE): New.
(configure_commands): Use $SRCTREE
(update_commands): Use find_pkg_deps()

* etc/pkgusr/zsh/zsh-pkgtools (pkgwant): Use grep -w to eliminate
false positives.

* etc/sudoers.d/99-pkgusr: New.  Sudo config to allow pkgusrs to
run ldconfig as root.

* usr/bin/forall_direntries_from: Update Bastard settings.
Make -noleaf optional, default off.
Update comments.

* usr/bin/grep_all_regular_files_for: Ditto.

* usr/bin/list_suspicious_files: Ditto.

* usr/bin/header-symbol-search: Update Bastard settings.

* usr/bin/library-symbol-search: Ditto.

* usr/bin/lesspipe.sh: Get charset from `file -i' to see if
strings can be used.

* usr/bin/uninstall_package (run): Only remove directories if they
are empty.
Do NOT let root use this script.

* usr/lib/pkgusr/chgrp: Handle cases where chgrp options are used
and also where the user is not a member of the group trying to be
changed to.  Handle both names and GIDs
Don't let root use this script.

* usr/lib/pkgusr/chmod: Handle cases where chmod options are used
and also all set{uid,gid,sticky} bit operations.
Don't let root use this script.

* usr/lib/pkgusr/chown: Rewrite.  Handle all chown scenarios.
Don't let root use this script.

* usr/lib/pkgusr/mkdir: Comment about the irrelevance to my
needs.
Don't let root use this script.

* usr/lib/pkgusr/update-pkg-project (upd_pkg_deps): New, use it,
does what it says.

* usr/lib/pkgusr/install: Complete rewrite.
Don't let root use this script.

* usr/lib/pkgusr/ldconfig: New. Wrapper to run ldconfig via sudo.

* installdir.lst: Update.

* README: Update.

* LFS-pkgusr-hint.txt: Updated to current version of the
LFS hint.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
10 years agoFix Zsh completion
Steve Youngs [Fri, 14 Feb 2014 03:39:51 +0000 (13:39 +1000)]
Fix Zsh completion

* zsh-completion:
  Rewrite Zsh completion

10 years agoRewrite Zsh completion
Steve Youngs [Fri, 14 Feb 2014 03:39:20 +0000 (13:39 +1000)]
Rewrite Zsh completion

* etc/pkgusr/zsh/_zsh-pkgtools: Rewrite.  User completion is done
on _JUST_ the package users and not all users.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
10 years agooh crap... Typo
Steve Youngs [Thu, 13 Feb 2014 11:29:56 +0000 (21:29 +1000)]
oh crap... Typo

10 years agoMinor zsh updates
Steve Youngs [Thu, 13 Feb 2014 11:08:00 +0000 (21:08 +1000)]
Minor zsh updates

* minor_tweaks:
  Update the Zsh pkgtools.

10 years agoUpdate the Zsh pkgtools.
Steve Youngs [Thu, 13 Feb 2014 11:07:29 +0000 (21:07 +1000)]
Update the Zsh pkgtools.

Added a function to find reverse dependencies and fixed a couple of minor
niggling things.

* etc/pkgusr/zsh/zsh-pkgtools (pkgwant): New function that lists
packages that depend on a certain pkg.

* etc/pkgusr/zsh/zsh-pkgtools (H-pkg): Mention pkgwant().

* etc/pkgusr/zsh/zsh-pkgtools (xtar,vtar): Fix bug where xz files
weren't being detected.

* etc/pkgusr/zsh/zsh-pkgtools (pkg_ldconfig): Prevent spurious
output.

* etc/pkgusr/zsh/_zsh-pkgtools: Tab-complete users for pkgwant.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
11 years agoAdd rudimentary dep tracking
Steve Youngs [Sun, 3 Feb 2013 02:41:03 +0000 (12:41 +1000)]
Add rudimentary dep tracking

* pkgdeps:
  Add some rudimentary dependency tracking.

11 years agoAdd some rudimentary dependency tracking.
Steve Youngs [Sun, 3 Feb 2013 02:39:46 +0000 (12:39 +1000)]
Add some rudimentary dependency tracking.

"tracking" is probably an over-statement.  What this does is to store a
package's run-time so deps (gleaned from ldd) in its .project.  The build
script template has been updated to find/store them, and functions have
been added to handy_funcs to view them.

I've also gotten rid of most of the uses of pinky in the aux functions and
simplified them.

* etc/pkgusr/skel-package/.project (Deps): New.

* etc/pkgusr/skel-package/build (update_commands): Add magic to
find the run-time deps.

* etc/pkgusr/handy_funcs (deps): Show the dependencies.

* etc/pkgusr/handy_funcs (H-pkg): Add `deps'.

* etc/pkgusr/handy_funcs (showinst,showgen,srepo,trepo,web):
Remove unnecessary use of pinky.

* etc/pkgusr/zsh/_zsh-pkgtools: Add `dpkg'.

* etc/pkgusr/zsh/zsh-pkgtools (H-pkg): Add `dpkg'.

* etc/pkgusr/zsh/zsh-pkgtools (dpkg): New.

* etc/pkgusr/zsh/zsh-pkgtools (upkg,Lpkg,vpkg,ipkg,gpkg,wpkg,pkgrepo):
        Remove unnecessary use of pinky, sed, etc to simplify.

* lisp/pkgusr.el (pkgusr-pkg-deps): New.  Bind `H-c D' to it.

* lisp/pkgusr.el (pkgusr-pkg-url): Remove unnecessary use of pinky.

* lisp/pkgusr.el (pkgusr-pkg-repo): Ditto.

* lisp/pkgusr.el (pkgusr-pkg-version): Ditto.

* lisp/pkgusr.el (pkgusr-pkg-description): Ditto.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
11 years agominor updates
Steve Youngs [Wed, 19 Dec 2012 00:55:29 +0000 (10:55 +1000)]
minor updates

Signed-off-by: Steve Youngs <steve@sxemacs.org>
11 years agoFix Tramp usage
Steve Youngs [Sat, 23 Jun 2012 04:06:55 +0000 (14:06 +1000)]
Fix Tramp usage

* tramp-fix:
  Fix Tramp usage.

11 years agoFix Tramp usage.
Steve Youngs [Sat, 23 Jun 2012 04:05:07 +0000 (14:05 +1000)]
Fix Tramp usage.

The Tramp in XEmacs packages is a gazillion years out of date, things have
changed... Most notably, the multi-hop syntax.

* lisp/pkgusr.el (pkgusr-find-file): Update for latest Tramp.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
13 years agoInitial git import v0.5
Steve Youngs [Tue, 30 Nov 2010 15:25:40 +0000 (01:25 +1000)]
Initial git import

Signed-off-by: Steve Youngs <steve@sxemacs.org>