7 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

* 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

Signed-off-by: Steve Youngs <>
7 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 <>
7 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 <>
7 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 <>
7 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

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

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

Signed-off-by: Steve Youngs <>
7 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.

* 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/ 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
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 <>
7 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

7 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 <>
7 years agooh crap... Typo
Steve Youngs [Thu, 13 Feb 2014 11:29:56 +0000 (21:29 +1000)]
oh crap... Typo

7 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.

7 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

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

Signed-off-by: Steve Youngs <>
8 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.

8 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 <>
8 years agominor updates
Steve Youngs [Wed, 19 Dec 2012 00:55:29 +0000 (10:55 +1000)]
minor updates

Signed-off-by: Steve Youngs <>
8 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.

8 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 <>
10 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 <>