From owner-freebsd-libh Tue Jul 17 3:55:29 2001 Delivered-To: freebsd-libh@freebsd.org Received: from usw4.freebsd.org (usw4.freebsd.org [209.180.6.228]) by hub.freebsd.org (Postfix) with ESMTP id 62C4937B403 for ; Tue, 17 Jul 2001 03:55:27 -0700 (PDT) (envelope-from alex@usw4.freebsd.org) Received: (from alex@localhost) by usw4.freebsd.org (8.11.3/8.11.1) id f6HAwQi69275 for libh@FreeBSD.org; Tue, 17 Jul 2001 05:58:26 -0500 (CDT) (envelope-from alex) Message-Id: <200107171058.f6HAwQi69275@usw4.freebsd.org> From: Alexander Langer Date: Tue, 17 Jul 2001 05:58:26 -0500 (CDT) To: libh@FreeBSD.org Subject: cvs commit: libh/lib/common Configuration.cc Sender: owner-freebsd-libh@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG alex 2001/07/17 05:58:26 CDT Modified files: lib/common Configuration.cc Log: Use the prefix supplied by packages when installing them and not libh's default prefix in any case (this was probably a development knob). Switch the default prefix from "/tmp/sysinstall2work" to "/usr/local". [And I wondered all the time why it installs the d*mn packages into /tmp *g*] Revision Changes Path 1.5 +2 -2 libh/lib/common/Configuration.cc To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-libh" in the body of the message From owner-freebsd-libh Tue Jul 17 9:18: 8 2001 Delivered-To: freebsd-libh@freebsd.org Received: from usw4.freebsd.org (usw4.freebsd.org [209.180.6.228]) by hub.freebsd.org (Postfix) with ESMTP id 937B637B405 for ; Tue, 17 Jul 2001 09:18:06 -0700 (PDT) (envelope-from alex@usw4.freebsd.org) Received: (from alex@localhost) by usw4.freebsd.org (8.11.3/8.11.1) id f6HGL6569548 for libh@FreeBSD.org; Tue, 17 Jul 2001 11:21:06 -0500 (CDT) (envelope-from alex) Message-Id: <200107171621.f6HGL6569548@usw4.freebsd.org> From: Alexander Langer Date: Tue, 17 Jul 2001 11:21:06 -0500 (CDT) To: libh@FreeBSD.org Subject: cvs commit: libh/lib/sysinstall PackageCreator.cd.cc Sender: owner-freebsd-libh@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG alex 2001/07/17 11:21:06 CDT Modified files: lib/sysinstall PackageCreator.cd.cc Log: Indent this file in a more readable form, I'm going to modify it soon. Revision Changes Path 1.4 +46 -27 libh/lib/sysinstall/PackageCreator.cd.cc To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-libh" in the body of the message From owner-freebsd-libh Tue Jul 17 11:24:55 2001 Delivered-To: freebsd-libh@freebsd.org Received: from usw4.freebsd.org (usw4.freebsd.org [209.180.6.228]) by hub.freebsd.org (Postfix) with ESMTP id 12D9137B403 for ; Tue, 17 Jul 2001 11:24:54 -0700 (PDT) (envelope-from alex@usw4.freebsd.org) Received: (from alex@localhost) by usw4.freebsd.org (8.11.3/8.11.1) id f6HIRs969688 for libh@FreeBSD.org; Tue, 17 Jul 2001 13:27:54 -0500 (CDT) (envelope-from alex) Message-Id: <200107171827.f6HIRs969688@usw4.freebsd.org> From: Alexander Langer Date: Tue, 17 Jul 2001 13:27:53 -0500 (CDT) To: libh@FreeBSD.org Subject: cvs commit: libh/lib/sysinstall PackageCreator.cd.cc Sender: owner-freebsd-libh@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG alex 2001/07/17 13:27:53 CDT Modified files: lib/sysinstall PackageCreator.cd.cc Log: Make write_package_file() accessible from TCL. Fix an obvious typo (I think I introduced that in my last commit). Revision Changes Path 1.5 +7 -2 libh/lib/sysinstall/PackageCreator.cd.cc To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-libh" in the body of the message From owner-freebsd-libh Tue Jul 17 11:26:22 2001 Delivered-To: freebsd-libh@freebsd.org Received: from usw4.freebsd.org (usw4.freebsd.org [209.180.6.228]) by hub.freebsd.org (Postfix) with ESMTP id 1848E37B401 for ; Tue, 17 Jul 2001 11:26:21 -0700 (PDT) (envelope-from alex@usw4.freebsd.org) Received: (from alex@localhost) by usw4.freebsd.org (8.11.3/8.11.1) id f6HITL469727 for libh@FreeBSD.org; Tue, 17 Jul 2001 13:29:21 -0500 (CDT) (envelope-from alex) Message-Id: <200107171829.f6HITL469727@usw4.freebsd.org> From: Alexander Langer Date: Tue, 17 Jul 2001 13:29:21 -0500 (CDT) To: libh@FreeBSD.org Subject: cvs commit: libh/lib/sysinstall PackageCreator.cc PackageCreator.hh Sender: owner-freebsd-libh@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG alex 2001/07/17 13:29:21 CDT Modified files: lib/sysinstall PackageCreator.cc PackageCreator.hh Log: Make write_package_file() public so that it can be called from TCL. Don't call write_package_file() from generate(), so we can actually let libsysinstall generate standard-scripts for us, which we can modify afterwards. generate() was even documented to only do that. Revision Changes Path 1.4 +1 -2 libh/lib/sysinstall/PackageCreator.cc 1.3 +2 -2 libh/lib/sysinstall/PackageCreator.hh To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-libh" in the body of the message From owner-freebsd-libh Tue Jul 17 13:32: 8 2001 Delivered-To: freebsd-libh@freebsd.org Received: from usw4.freebsd.org (usw4.freebsd.org [209.180.6.228]) by hub.freebsd.org (Postfix) with ESMTP id C0E6337B406 for ; Tue, 17 Jul 2001 13:32:06 -0700 (PDT) (envelope-from alex@usw4.freebsd.org) Received: (from alex@localhost) by usw4.freebsd.org (8.11.3/8.11.1) id f6HKZ7X69868 for libh@FreeBSD.org; Tue, 17 Jul 2001 15:35:07 -0500 (CDT) (envelope-from alex) Message-Id: <200107172035.f6HKZ7X69868@usw4.freebsd.org> From: Alexander Langer Date: Tue, 17 Jul 2001 15:35:06 -0500 (CDT) To: libh@FreeBSD.org Subject: cvs commit: libh/lib/file File.cc File.hh Sender: owner-freebsd-libh@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG alex 2001/07/17 15:35:06 CDT Modified files: lib/file File.cc File.hh Log: Introduce FILE * File::mFile. For File::open*() and create(), save the returned FILE* in mFILE. In File::close, close this FILE * if non-NULL. Revision Changes Path 1.5 +9 -4 libh/lib/file/File.cc 1.4 +2 -1 libh/lib/file/File.hh To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-libh" in the body of the message From owner-freebsd-libh Tue Jul 17 13:33:54 2001 Delivered-To: freebsd-libh@freebsd.org Received: from usw4.freebsd.org (usw4.freebsd.org [209.180.6.228]) by hub.freebsd.org (Postfix) with ESMTP id BC6D037B405 for ; Tue, 17 Jul 2001 13:33:52 -0700 (PDT) (envelope-from alex@usw4.freebsd.org) Received: (from alex@localhost) by usw4.freebsd.org (8.11.3/8.11.1) id f6HKarN69905 for libh@FreeBSD.org; Tue, 17 Jul 2001 15:36:53 -0500 (CDT) (envelope-from alex) Message-Id: <200107172036.f6HKarN69905@usw4.freebsd.org> From: Alexander Langer Date: Tue, 17 Jul 2001 15:36:53 -0500 (CDT) To: libh@FreeBSD.org Subject: cvs commit: libh/lib/sysinstall FeaturesProvided.cc Sender: owner-freebsd-libh@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG alex 2001/07/17 15:36:53 CDT Modified files: lib/sysinstall FeaturesProvided.cc Log: Call File::close() rather than ::fclose(), because File cleans up some stuff, such as unlinking the file if specified on create. Revision Changes Path 1.4 +4 -4 libh/lib/sysinstall/FeaturesProvided.cc To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-libh" in the body of the message From owner-freebsd-libh Tue Jul 17 14:16:43 2001 Delivered-To: freebsd-libh@freebsd.org Received: from usw4.freebsd.org (usw4.freebsd.org [209.180.6.228]) by hub.freebsd.org (Postfix) with ESMTP id DE09737B406 for ; Tue, 17 Jul 2001 14:16:41 -0700 (PDT) (envelope-from alex@usw4.freebsd.org) Received: (from alex@localhost) by usw4.freebsd.org (8.11.3/8.11.1) id f6HLJgh69964 for libh@FreeBSD.org; Tue, 17 Jul 2001 16:19:42 -0500 (CDT) (envelope-from alex) Message-Id: <200107172119.f6HLJgh69964@usw4.freebsd.org> From: Alexander Langer Date: Tue, 17 Jul 2001 16:19:41 -0500 (CDT) To: libh@FreeBSD.org Subject: cvs commit: libh/lib/sysinstall PackageStream.cc Sender: owner-freebsd-libh@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG alex 2001/07/17 16:19:41 CDT Modified files: lib/sysinstall PackageStream.cc Log: I think I found a yet unimplemented function: update_features_provided_database() just doesn't do things that make sense. I think it's still in a develop-debugging phase, where it creates a file with the features that need to be updated in a *local* file, which has a const name. Beside the fact that this is a big security issue, it just makes no sense to have the install routine create sucha file in the source directory of the package. I assume this method should do somthing else. I still need to figure, _what_. If it does, what the name implies, the actual code doesn't make any sense to me (what should the database want with a locally created file?). We'll probably find out once people are actually beginning to use it ;-), and then I'll be able to implement it. For now, add a big XXX comment and at least #if 0 the creation of this odd file - everything still works, so I really don't know what this was for. Revision Changes Path 1.3 +14 -1 libh/lib/sysinstall/PackageStream.cc To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-libh" in the body of the message From owner-freebsd-libh Tue Jul 17 14:38: 8 2001 Delivered-To: freebsd-libh@freebsd.org Received: from kawoserv.kawo2.rwth-aachen.de (kawoserv.kawo2.RWTH-Aachen.DE [134.130.180.1]) by hub.freebsd.org (Postfix) with ESMTP id 1F5B437B403 for ; Tue, 17 Jul 2001 14:37:57 -0700 (PDT) (envelope-from alex@big.endian.de) Received: from zerogravity.kawo2.rwth-aachen.de (zerogravity.kawo2.rwth-aachen.de [134.130.181.28]) by kawoserv.kawo2.rwth-aachen.de (8.9.3/8.9.3) with ESMTP id XAA28135 for ; Tue, 17 Jul 2001 23:37:56 +0200 Received: by zerogravity.kawo2.rwth-aachen.de (Postfix, from userid 1001) id 6F9DA14DDD; Tue, 17 Jul 2001 23:37:55 +0200 (CEST) Date: Tue, 17 Jul 2001 23:37:54 +0200 From: Alexander Langer To: libh@FreeBSD.org Subject: packaging stuff Message-ID: <20010717233754.A948@zerogravity.kawo2.rwth-aachen.d> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="SUOF0GtieIMvvwua" Content-Disposition: inline User-Agent: Mutt/1.2.5i X-PGP-Fingerprint: 44 28 CA 4C 46 5B D3 A8 A8 E3 BA F3 4E 60 7D 7F X-PGP-at: finger alex@big.endian.de X-Verwirrung: Dieser Header dient der allgemeinen Verwirrung. Sender: owner-freebsd-libh@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --SUOF0GtieIMvvwua Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi folks! I created an initial part of package tools stuff for my own testing purposes. I want to share them, in case anyone is interested. You have to run them with the statically linked tclh. And you need the latest CVS version, which is not yet in the ports tree. Here is the documentation: create_db.tcl: Creates an empty package database. tclh.static create_db.tcl /tmp/libhdb is what I use. makepackage.sh: Create a package from a port. Doesn't yet respect dependencies. Well, I used this to create the also attached example package. Heh, it's just *BASIC*! You'll probably don't want to use it, only if you want to test your own stuff. pkg_install.tcl: Installs a package. tclh.static pkg_install.tcl /tmp/libhdb xv-packagefile You can get my xv-package from http://people.FreeBSD.org/~alex/libh/packages/ This installs it (in /usr/local, which is actually wrong, because it was build for /usr/X11R6, so you won't be able to use it.) The nice thing is: If you re-install it, it considers it as an upgrade installation and deinstalls the old copy first, respecting the rules documented in sysinstall2.txt. I *BELIEVE* it would also consider packages with a higher version number as such upgrade packages, I just haven't build a real upgrade package with a better version yet (soon to come). file_owners.tcl: Lists all files and all owner-packages of files that are registered in the db. tclh.static file_owners.tcl /tmp/libhdb This is nice, because a) it demonstrates, what libh can actually do already now, and b) you probably want to remove the files from /usr/local again after testing, and I haven't written pkg_deinstall yet ;-) Oh, if you unzip the xv package, you find out how stuff works. You can also manually set the installation prefix manually in SYSINSTALL/structure.tcl. Note that this won't work, because create_db.tcl doesn't allow the safe interpreter to modify /usr/X11R6. For some reason it doesn't respect additional dirs there, yet, probably a bug. Oh, part 2: the xv package doesn't have any dependencies yet, BUT: libh's PackageCreator already stuff manpages and examples in so-called subpackages (this once is the "documentation" subpackage), which is the equivalent for NOPORTDOCS for example. Once I've found out how to disable installation of those subpackages, I'll add stuff to pkg_install.tcl (I just didn't care yet). But yet alone the fact is nice to know :-) Happy testing, I'm kinda impressed already now. More to come. Alex --SUOF0GtieIMvvwua Content-Type: application/x-tcl Content-Disposition: attachment; filename="create_db.tcl" set dbpath [lindex $argv 0] if {$dbpath == ""} { puts stderr "Give path to db as argument" exit 1 } set db [H::null] if [catch {set db [Database $dbpath]} err] { if {![H::is_null $db]} {H::delete $db} set db [H::null] if {[catch {set db [Database::create $dbpath]} err]} { puts stderr "Error: $err" } else { puts "Database created in $dbpath" set allow [[DirectoriesAccess] allow] lappend allow {"$dbpath" "/usr/X11R6"} # XXX remove backslash at end of dir if any [DirectoriesAccess] allow $allow $db save_directories_access [Configuration] prefix "/usr/local" } } else { puts stderr "Database $dbpath already exists. Terminating." exit 1 } exit 0 --SUOF0GtieIMvvwua Content-Type: application/x-tcl Content-Disposition: attachment; filename="file_owners.tcl" set H_automatic_garbage_collection 0 # ---------------------------------------------------------------------- set dbpath [lindex $argv 0] proc usage {} { puts stderr "Usage: file_owners.tcl dbpath filename" } if {$dbpath == ""} { usage exit 1 } set db [H::null] if [catch {set db [Database $dbpath]} err] { puts stderr "Can't open pkg db: $err" exit 1 } set files [$db all_files] foreach file $files { set packages [$db packages_owning [$file pathname]] puts stderr "[$file pathname] [$file length] [H::string_time_t [$file mtime]]" foreach package $packages { puts stderr "\t[$package name]" } } exit 0 # ---------------------------------------------------------------------- --SUOF0GtieIMvvwua Content-Type: application/x-sh Content-Disposition: attachment; filename="makepackage.sh" #!/bin/sh if [ -z $2 ]; then echo " # Simple package creating tool, contains too many hacks # and doesn't respect @exec and stuff # Usage: $0 /path/to/port /path/to/pkg-output-dir/ " exit 1 fi PORTDIR=$1 PKGDIR=$2 TMP=`mktemp -d /tmp/pkgXXXXXXXXX` SCRIPT=`mktemp /tmp/scriptXXXXXXXX` echo "This is the libh package creator." echo "" # Setup tree echo "Installing port." (cd $PORTDIR && make install) echo "Files in package:" PREFIX=`cd $PORTDIR && make -V PREFIX` PLIST=`cd $PORTDIR && make -V TMPPLIST` FILELIST=`cat $PLIST | sed -e 's|^@dirrm ||g' -e 's|^@.*||' | sort | uniq -u` # depends: make package-depends package-depends | ${GREP} -v -E ${PKG_IGNORE_DEPENDS} | sort -u`" echo "Adding files to $TMP" (cd $PREFIX && tar -cpf - $FILELIST) | (cd $TMP && tar -xvpf -) # Some VERSIONING PKGNAME=`cd $PORTDIR && make -V PKGNAME` PORTNAME=`cd $PORTDIR && make -V PORTNAME` PORTVERSION=`cd $PORTDIR && make -V PORTVERSION` PORTREVISION=`cd $PORTDIR && make -V PORTREVISION` SUMMARY=`cat $PORTDIR/pkg-comment` DESCRIPTION=`cat $PORTDIR/pkg-descr` AUTHOR=`cd $PORTDIR && make -V MAINTAINER` if [ ! -e $PKGDIR ]; then mkdir $PKGDIR; fi mkdir $TMP/SYSINSTALL # XXX add dependencies into requires cat > $TMP/SYSINSTALL/features.tcl < $SCRIPT << EOF set creator [PackageCreator::PackageCreator "$PKGNAME" "$PKGDIR" "$TMP"] \$creator generate \$creator write_package_file EOF ../../bin/tclh/tclh.static $SCRIPT rm -f $SCRIPT rm -rf $TMP --SUOF0GtieIMvvwua Content-Type: application/x-tcl Content-Disposition: attachment; filename="pkg_install.tcl" set dbpath [lindex $argv 0] set filename [lindex $argv 1] proc usage {} { puts stderr "Usage: pkg_install.tcl dbpath filename" } if {$dbpath == "" || $filename == ""} { usage exit 1 } set db [H::null] if [catch {set db [Database $dbpath]} err] { puts stderr "Can't open pkg db: $err" exit 1 } if [catch {set stream [Archive::open $filename]} err ] { puts stderr "Can't open $filename: $err" exit 1 } set package_stream [PackageStream::open $stream slave] puts "Package: [$package_stream name]" puts "Summary: [[$package_stream description] summary]" puts "Description:" puts [[$package_stream description] description] puts "Author: [[$package_stream description] author]" proc view_log {} { puts [[Log] text] } proc package_action {package_stream action} { # No set objects_references [H::objects_references] global db set old_log_type [Log::gettype] Log::type "string" if [catch {$package_stream $action $db} err] { puts stderr "Can't $action pkg: $err" exit 1 } else { puts "Package [$package_stream name] ${action}ed, log:" view_log } $db flush [Log] clear Log::type $old_log_type } # XXX Add upgrade vs. install hooks package_action $package_stream install exit 0 --SUOF0GtieIMvvwua-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-libh" in the body of the message From owner-freebsd-libh Tue Jul 17 21:11: 4 2001 Delivered-To: freebsd-libh@freebsd.org Received: from winston.freebsd.org (adsl-64-173-15-98.dsl.sntc01.pacbell.net [64.173.15.98]) by hub.freebsd.org (Postfix) with ESMTP id D418A37B408 for ; Tue, 17 Jul 2001 21:10:57 -0700 (PDT) (envelope-from jkh@freebsd.org) Received: from localhost (jkh@localhost [127.0.0.1]) by winston.freebsd.org (8.11.4/8.11.4) with ESMTP id f6I4Aat67013; Tue, 17 Jul 2001 21:10:36 -0700 (PDT) (envelope-from jkh@freebsd.org) To: alex@usw4.freebsd.org Cc: libh@freebsd.org Subject: Re: cvs commit: libh/lib/sysinstall PackageStream.cc In-Reply-To: <200107172119.f6HLJgh69964@usw4.freebsd.org> References: <200107172119.f6HLJgh69964@usw4.freebsd.org> X-Mailer: Mew version 1.94.1 on Emacs 20.7 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20010717211036H.jkh@freebsd.org> Date: Tue, 17 Jul 2001 21:10:36 -0700 From: Jordan Hubbard X-Dispatcher: imput version 20000228(IM140) Lines: 15 Sender: owner-freebsd-libh@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG From: Alexander Langer Subject: cvs commit: libh/lib/sysinstall PackageStream.cc Date: Tue, 17 Jul 2001 16:19:41 -0500 (CDT) > I assume this method should do somthing else. I still need to figure, > _what_. If it does, what the name implies, the actual code doesn't > make any sense to me (what should the database want with a locally > created file?). Probably, as you've assumed, strictly for debugging. He undoubtedly wanted to see that the basic idea was working before he corrupted the central database with it, but then he didn't get to that bit before disappearing into the Siberian wasteland. :) - Jordan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-libh" in the body of the message