aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_install/lib/file.c
Commit message (Collapse)AuthorAgeFilesLines
* After around 20 years of duty it is time for pkg_install to retireBaptiste Daroussin2013-10-311-436/+0
| | | | Notes: svn path=/head/; revision=257444
* Let pkg_add use the ENV variable PACKAGESUFFIX. ThisJosh Paetzel2012-05-301-1/+1
| | | | | | | | | | | | | can be used to override the default .tbz package extension to .txz .tgz or .tar Submitted by: kmoore Obtained from: PC-BSD Sponsored by: iXsystems MFC after: 3 days Notes: svn path=/head/; revision=236333
* Spelling fixes for usr.sbin/Ulrich Spörlein2011-12-301-1/+1
| | | | Notes: svn path=/head/; revision=228990
* Backout libinstall.a -> libpkg commit.Florent Thoumie2011-05-171-0/+436
| | | | | | | Discussed with: erwin, brooks, bapt Notes: svn path=/head/; revision=222035
* - Take libinstall.a out of pkg_install and make it a proper shared library.Florent Thoumie2010-04-231-436/+0
| | | | | | | | | | | | | | - Rework the wrapper support to check libpkg version as well as pkg_install version. - Add libfetch to _prebuild_libs. - There are no new features introduced. Notes: the API is not stable, so basically, do not use libpkg in your projects for now. Also there's no manpage for libpkg yet, because the API will change drastically. I repeat, do not use libpkg for now. Notes: svn path=/head/; revision=207113
* Various fixes.Florent Thoumie2010-04-011-11/+20
| | | | | | | | | | | | | | | | | | | - Replace hardcoded INDEX version. [1] - Fix a buffer overlap. [2] - Remove empty package when fetching fails and -K is used. [3] - Remove useless chmod2() after mkdtemp(3). [4] - Replace mkdir(1) call with mkdir(2). [5] - Get rid of some vsystem() calls. - Switch from lstat(2) to open(2) in fexists(). - Try rename(2) in move_file() first. - Bump PKG_INSTALL_VERSION to 20100401. PR: bin/145101 [1], bin/139492 [2], bin/144919 [3] bin/144920 [4], bin/144921 [5] Submitted by: gcooper [1,2,3,4,5] Notes: svn path=/head/; revision=206043
* Remove support for RELENG_4 (__FreeBSD_version < 500039).Florent Thoumie2008-06-161-4/+0
| | | | | | | MFC after: 1 day Notes: svn path=/head/; revision=179835
* Use the length modifier 'll' instead of 'q' to print long longs.Stefan Farfeleder2004-07-281-1/+1
| | | | Notes: svn path=/head/; revision=132799
* - pkg_add spawns itself as argv[0] when installing dependent packages, toOliver Eikemeier2004-06-291-8/+11
| | | | | | | | | | | | | | | | | | | | | enable the use as a port on older systems - use absolute paths in all calls to external programs, to account for strange PATH settings - use INDEX or INDEX-5 depending on FreeBSD version, to enable the use on FreeBSD 4.x as a port. - conditionalize all 4.x/5.x differences on __FreeBSD_version, so that the pkg_install tools can be kept in sync on 4.x and 5.x - Bump PKG_INSTALL_VERSION Reviewed by: portmgr (bento run) MFC after: 4 weeks Notes: svn path=/head/; revision=131285
* - pkg_info: flag -r: (show packages this packages depends on (documentation ↵Oliver Eikemeier2004-06-291-2/+4
| | | | | | | | | | | | | | | | | | | change)) - pkg_info: new flag -j (show the requirements script) - pkg_info: fix verbose output when used on packages - better handling of corrupt entries in /var/db/pkg - differ between corrupt entires and packages not installed - various small fixes PR: 56989, 57016, 57029, 26468 Notes: svn path=/head/; revision=131280
* When invoking tar, make sure the mode option (-x) is first.Tim Kientzle2004-04-081-7/+6
| | | | Notes: svn path=/head/; revision=128026
* Prevent buffer overflow in format_cmd() by properly tracking maximumJordan K. Hubbard2003-01-061-13/+21
| | | | | | | | | buffer size. Reported by: Lionnel CHAPTAL <Lionnel.Chaptal@IPricot.com> MFC after: 1 week Notes: svn path=/head/; revision=108778
* Assume that packages passed on stdin are in bzip2 format, not gzip.Bruce A. Mah2002-11-141-1/+2
| | | | | | | | | (sysinstall depends on this feature for package addition.) Comment on hard-coded bzip2 usage in the spirit of rev. 1.58. Notes: svn path=/head/; revision=106923
* Clean up a little. Don't need to include fetch.h any more, and I can'tDavid E. O'Brien2002-11-061-7/+0
| | | | | | | find any consumers of HOSTNAME_MAX. Notes: svn path=/head/; revision=106492
* Break fileGetURL() out into its own file so that pkg_install/lib consumersDavid E. O'Brien2002-11-061-112/+0
| | | | | | | pkg_{create,delete} don't need to needlessly link with libfetch. Notes: svn path=/head/; revision=106491
* Whitespace cleanupDag-Erling Smørgrav2002-10-291-5/+5
| | | | Notes: svn path=/head/; revision=106136
* Grrr.... mumble.... a linger gzip'ism still existed.David E. O'Brien2002-08-261-1/+1
| | | | | | | Submitted by: Craig Rodrigues <rodrigc@attbi.com> Notes: svn path=/head/; revision=102430
* Find remaining hardcoded gzip bits and change to bzip2 bits.David E. O'Brien2002-08-251-5/+8
| | | | | | | | Mark with XXX so someone that cares about being able to handle either bziped or gziped packages knows where the remaining nits are. Notes: svn path=/head/; revision=102383
* Preserve suid/gid permissions when extracting packages remotellyMario Sergio Fujikawa Ferreira2002-08-241-1/+1
| | | | | | | | | | fetched with -r option Reviewed by: will Approved by: will Notes: svn path=/head/; revision=102375
* Another .tbz2 -> .tbz leftover. Properly look for pkgname.tbz.Akinori MUSHA2002-08-041-1/+1
| | | | | | | MFC after: 1 day Notes: svn path=/head/; revision=101339
* replace __FUNCTION__ with standardized __func__.Alfred Perlstein2002-05-111-9/+9
| | | | | | | Requested by: jhb Notes: svn path=/head/; revision=96392
* fix build:Alfred Perlstein2002-05-111-9/+10
| | | | | | | | | | | you may not use string concatination with __FUNCTION__, replace all occurances of: __FUNCTION__ ": error string" with: "%s: error string" Notes: svn path=/head/; revision=96388
* Fix SCM ID's.David E. O'Brien2002-04-011-5/+3
| | | | Notes: svn path=/head/; revision=93520
* WARNS=2 cleanup.Maxim Sobolev2001-10-101-29/+28
| | | | | | | | Tested on: i386, alpha MFC after: 2 weeks Notes: svn path=/head/; revision=84745
* fix for pkg_add to symlinked prefix directories that are more than 1 link deep.Jonathan Chen2001-08-021-1/+1
| | | | | | | | | PR: bin/28274 Submitted by: John Hein <jhein@timing.com> MFC after: 1 month Notes: svn path=/head/; revision=81058
* Fix the type of the NULL arg to execl()Brian Somers2001-07-091-1/+2
| | | | | | | Idea from: Theo de Raadt <deraadt@openbsd.org> Notes: svn path=/head/; revision=79452
* Use getdtablesize() instead of OPEN_MAX.Dag-Erling Smørgrav2001-06-131-1/+1
| | | | | | | Submitted by: bde Notes: svn path=/head/; revision=78162
* Pass on the verbose option to fetchGetURL().Dag-Erling Smørgrav2001-06-111-3/+4
| | | | | | | | | | In the child that's set up to run tar(1), close all file descriptors except stdin, stdout and stderr. PR: bin/27760 Notes: svn path=/head/; revision=78072
* Style policy: reformat multiline comments to conform to style(9).Maxim Sobolev2001-05-171-8/+18
| | | | Notes: svn path=/head/; revision=76739
* - Add ability to handle bzip2-compressed packages;Maxim Sobolev2001-01-221-18/+24
| | | | | | | | | | - fix cosmetics to shut-up compiler in -pedantic mode (axe several unused vars and provide default clause in several switch() statements). No response from: -ports Notes: svn path=/head/; revision=71373
* Insetad of using fileno(ftp) as stdin for tar, use a pipe and have theDag-Erling Smørgrav2000-10-291-17/+39
| | | | | | | parent pass the data received from the server to the child. Notes: svn path=/head/; revision=67886
* Cause fatal error messages to be a little more helpful to the programmerJordan K. Hubbard2000-10-221-11/+11
| | | | | | | | | | | | concerning where they're taking place. Switch from [r]index() to str[r]chr() functions, which are more ISO compliant. Prompted by: Edward Welbourne <eddy@vortigen.demon.co.uk> Notes: svn path=/head/; revision=67429
* Fix symlink-to-a-dir handling in pkg_delete.Maxim Sobolev2000-09-181-4/+21
| | | | | | | | Reviewed by: -ports Tested by: bento Notes: svn path=/head/; revision=66021
* Use libfetch instead of libftpio. This adds support for http and IPv6.Dag-Erling Smørgrav2000-06-271-107/+27
| | | | Notes: svn path=/head/; revision=62154
* Do not preserve UIDs, permissions nor flags of package system files inSheldon Hearn2000-03-151-2/+2
| | | | | | | | | | | | | | | tar files. This fixes clean-up problems during package creation and does not affect the actual files to be included in the package. The fix submitted on the attributed PR was identical to the one obtained from NetBSD. PR: 17386 Reported by: Adrian Filipi-Martin <adrian@ubergeeks.com> Obtained from: NetBSD Notes: svn path=/head/; revision=58092
* 1. If checking for directory-ness, check "dir" and "dir/" to catchJordan K. Hubbard2000-02-191-0/+2
| | | | | | | | | the case where we have a symlink pointing at a dir. 2. Restore stomped character before returning in make_hierarchy() Notes: svn path=/head/; revision=57331
* Use lstat(2) rather than stat(2) in isdir(), so that a symlink to aDavid E. O'Brien2000-02-081-1/+1
| | | | | | | | | | | | directory is not considered a directory. I have a feeling all the other stat(2) calls should instead be lstat(2) calls, but I have not suffiently determined that the current behavior [especially in isfile()] isn't depended upon by someone. Ok'ed by: JKH Notes: svn path=/head/; revision=57034
* Deal with package filenames which contain spaces.Jordan K. Hubbard2000-01-041-1/+1
| | | | | | | | Submitted by: Ming-I Hsieh <mihs@wm28.csie.ncu.edu.tw> PR: 15667 Notes: svn path=/head/; revision=55395
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50479
* Revive the PKG_ADD_BASE stuff a bit.Jordan K. Hubbard1999-05-121-1/+2
| | | | Notes: svn path=/head/; revision=47039
* Fix support for uncompressed (".tar") package types. It's not completelySatoshi Asami1998-12-051-3/+3
| | | | | | | | fixed (chained dependency checking for pkg_add is broken, for one thing) but at least you can now create one package and use it. Notes: svn path=/head/; revision=41530
* Revert 1.33; lstat() is indeed the wrong thing to do here. I'llJordan K. Hubbard1998-10-141-2/+2
| | | | | | | revisit this after release. Notes: svn path=/head/; revision=40354
* Use lstat() rather than stat in determining whether a file exists,Jordan K. Hubbard1998-10-091-2/+2
| | | | | | | | otherwise we'll miss the "symlink exists but points nowhere" case. Submitted by: asami and/or possibly <ru@ucb.crimea.ua> Notes: svn path=/head/; revision=40085
* correct usage of cleanup() everywhere - this became bogus when the warnx/errxJordan K. Hubbard1998-09-111-21/+38
| | | | | | | | stuff was added and nobody seems to have noticed. :) Noticed by: Josh MacDonald <jmacd@paris.CS.Berkeley.EDU> Notes: svn path=/head/; revision=39068
* o Set paths internally for pkg_add for tools we might want to invoke.Jordan K. Hubbard1998-09-081-5/+5
| | | | | | | | | | | o Fix bogus suffix handling. o Tell user when an FTP url is being xferred rather than being silent. This sort of violates "the unix way" but it stops people from whacking ^C when they think it's hung, too. Sometimes visual indication of success is important. Doesn't spit out anything if not on a TTY. Notes: svn path=/head/; revision=38942
* - do string-magic on the right variable when tryingJordan K. Hubbard1997-10-181-3/+4
| | | | | | | | | | | | | to find dependent packages on the local disk (i.e. package given as filename, not URL) - document $PKG_PATH - use -v on pkg_add for dependent packages Submitted by: hubertf@NetBSD.ORG Obtained from: NetBSD Notes: svn path=/head/; revision=30533
* Use err(3). Cosmetics in usage string and man page.Philippe Charnier1997-10-081-14/+18
| | | | Notes: svn path=/head/; revision=30221
* Change the naming conventions for preserve'd files and also documentJordan K. Hubbard1997-07-011-5/+39
| | | | | | | | | | | | the option in pkg_create. Now preserved files start with a . and are named .<filename>.<pkgname>.backup so that their purpose is more clear. Note that just using the preserve option without proper pkg_deps is also foolish since packages being deleted in the incorrect order with preserve on can generate some odd results. Notes: svn path=/head/; revision=27137
* Revert $FreeBSD$ to $Id$Peter Wemm1997-02-221-1/+1
| | | | Notes: svn path=/head/; revision=22997
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-01-141-1/+1
| | | | | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise. Notes: svn path=/head/; revision=21673