Commit Graph

1169 Commits

Author SHA1 Message Date
Juan RP
7ca13ee7df xbps-uhelper: new bin that combines xbps-cmpver, xbps-digest,
xbps-fetch and xbps-pkgdb in one utility.

Bump XBPS_RELVER to 20091124-1.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091124115947-hb9cp7vp3tyhq64o
2009-11-24 11:59:47 +00:00
Juan RP
ea882fca0b xbps-repo: make xbps_repo_addpkg_index() static.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091124111123-1e8hxb9ry42oq9wr
2009-11-24 11:11:23 +00:00
Juan RP
3a65c45de3 Refactored shared code between xbps-bin(8) and xbps-repo(8).
- xbps-repo: move protos to defs.h and remove index.h and util.h.
- xbps-bin: move code that belongs to it from xbps-repo to show-info-files.c.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091124110539-nsdjp0ajr7nn8pa3
2009-11-24 11:05:39 +00:00
Juan RP
164c661bcf xbps-repo: added 'show-deps' target to mimic xbps-bin(8).
As consequence of this, remove xbps_callback_array_iter_in_repolist().
Nowadays to iter over the repository pool we have a SIMPLEQ, this
allowed to simplify the code and remove some now unneeed stuff.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091124104704-oyvrmb3tmd59w4e7
2009-11-24 10:47:04 +00:00
Juan RP
c676622869 Some changes to know if a file was downloaded successfully or not.
Improved xbps-repo sync/add and xbps-fetch to print informative
messages when a transfer was not necessary because local/remote size
and/or mtime matched.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091124050326-owez7140fdxwepuk
2009-11-24 05:03:26 +00:00
Juan RP
4502155554 xbps-repo: explain in the manpage that outdated package files will
be removed automatically for the 'genindex' target.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091124031605-q9yaklspw504ordq
2009-11-24 03:16:05 +00:00
Juan RP
d7987e8e32 xbps-repo genindex: fix use after free, remove outdated binpkg files
by default.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091124030606-3y34svrtnad21kgk
2009-11-24 03:06:06 +00:00
Juan RP
fe468b2e90 xbps-bin: fix one more for previous commit.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091124003052-u6rkvnblvb83hrkv
2009-11-24 00:30:52 +00:00
Juan RP
01cbe9a63b xbps-bin: fix download local dir when fetching binpkgs from remote repos.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091123235632-vbpn1br170fv73l3
2009-11-23 23:56:32 +00:00
Juan RP
bf82b6512d Extensively verified that all functions have its return value
checked for any spurious error, this should make the core more safer :-)

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091123094651-5prw0bkqmt3y8h23
2009-11-23 09:46:51 +00:00
Juan RP
13706cf0a5 xbps-repo: changed the 'sync' target to update from all registered
remote repositories, so remove its argument.

xbps_sync_repository_pkg_index:
 - create the local repo dir in XBPS_META_PATH.
 - also add the uri scheme (http://, https://, ftp://) in the created
   local directory and subst ':' also with an underscore.
 - do not create local repo directories unless the download pkg-index
   plist file is verified to be fetched correctly.

xbps_check_is_repo_string_remote:
  New function to check if a repo string is a remote repository, use
  it in all places where it was used before.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091123042316-rmu4w3ehoxwh3iz8
2009-11-23 04:23:16 +00:00
Juan RP
12cec6e707 xbps-pkgdb: don't forget to add the pkgver object in register target.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091123002857-ntwcf91swcol7m9d
2009-11-23 00:28:57 +00:00
Juan RP
4f80bddbb2 xbps-repo: print error if pkg-index file cannot be fetched.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091122060446-sc4na9qa2k2bk5f6
2009-11-22 07:04:46 +01:00
Juan RP
3d24672e58 Improve dependency matching via repos and use the "pkgver" object
in pkg dictionary to improve performance in some cases.

Bumped XBPS_RELVER to 20091121.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091122041547-oywx4db75j8uttl3
2009-11-22 05:15:47 +01:00
Juan RP
db9ae90dd4 Improve make output similar to what recent GNU configure scripts do.
Also always build the static bins so that it's done in one pass,
that means that objects are PIC and built with SSP.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091119050337-hkdksjqxy9n7vy7m
2009-11-19 06:03:37 +01:00
Juan RP
9e062cec4f xbps-repo: do the right thing in some error paths.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091118231106-xxbg5oyvnojv1ykd
2009-11-19 00:11:06 +01:00
Juan RP
bc14a026a5 Improve download code, as well as fixing refetching when syncing to a
remote package index. Bump XBPS_RELVER to 20091118.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091118062814-3pqbs9n1797einhm
2009-11-18 07:28:14 +01:00
Juan RP
d5f9366bfc xbps-repo: fix previous, writing a dangling string and a leak in exit path.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091118061745-xirdogil114siw2c
2009-11-18 07:17:45 +01:00
Juan RP
f859663a4b xbps-repo: made 'genindex' code run ~60% faster than before!
Rather than externalizing the package index plist file to storage every
time a package is registered, only do it one time once all packages
have been processed. Creating an index with 700 pkgs now takes 14s
in a VM, where before it took 39s. As consequence of this, the 'add-pkgidx'
target is no longer relevant or useful, remove it.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091118053439-ct1chn4hdeir1pdo
2009-11-18 06:34:39 +01:00
Juan RP
cc6417b9bf Fix a typo in xbps-bin/repo manpages.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091117164309-vwq47eaniu6udn9p
2009-11-17 17:43:09 +01:00
Juan RP
2b790a4c2f xbps-bin: rename 'show-manual' target to 'list-manual', it's a better
name IMHO :-)

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091109015919-fl3jr6eehyy1ff1v
2009-11-09 02:59:19 +01:00
Juan RP
adbd3d727c Added support for shell (and csh as well) patterns for required
dependencies, as specified in blueprint "improved-version-matching".

It's possible now to require greater, greater or equal than,
less, less or equal than, and equal pkg versions, as well as using
'{}' and '[^!]' csh patterns in dependencies.

Code lifted from FreeBSD, thanks! :-)

Change XBPS_RELVER to 20091107 to match latest additions.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091107035620-3051wcwrirqn2g14
2009-11-07 04:56:20 +01:00
Juan RP
dce1283e88 xbps-bin: improve 'check all' target output.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091101063206-s6kl51gqfugiapkl
2009-11-01 07:32:06 +01:00
Juan RP
4c4f5eebef xbps-repo: add a sync target, to sync the pkg index file from a
remote repository.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091031105740-xdqqsjqymc9rty5j
2009-10-31 11:57:40 +01:00
Juan RP
3905c2106c Properly build shared/static libxbps and utils.
xbps-fetch: added -v flag to see verbose messages in libfetch.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091030111726-axf9paz2k01ntqzz
2009-10-30 12:17:26 +01:00
Juan RP
79f9f34775 libxbps: added xbps_fetch_error_string(), that returns libfetch
fetchLastErrString.

Hook xbps-fetch to the tree and use the new function to print errors.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091030021303-6wu9sri5o8kgvfwl
2009-10-30 03:13:03 +01:00
Juan RP
e479879e9f xbps-bin: use exit(2) rather than _exit(2).
This was causing premature exiting when piping the program!

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091030004257-l94g3e88qroulfym
2009-10-30 01:42:57 +01:00
Juan RP
db58e48822 Added xbps-bin(8) and xbps-repo(8) manpages in asciidoc format.
That means that asciidoc is required to build/install XBPS.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091028153222-ljgdfqqe1ea74xs7
2009-10-28 16:32:22 +01:00
Juan RP
3a2f421109 xbps-bin: added "show-manual" target.
This targets shows the list of packages that were installed manually,
i.e not as dependencies.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091028023913-i4qh7ky1puezyhrt
2009-10-28 03:39:13 +01:00
Juan RP
4b99264063 xbps-repo: sanitize uri provided to the add target also for remote
repositories.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091027142504-ezcqy2z7fuxz9j1z
2009-10-27 15:25:04 +01:00
Juan RP
dc258f4e20 Use xbps_get_root() directly where appropiate.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091027111547-tb38qz51ejakn3jc
2009-10-27 12:15:47 +01:00
Juan RP
7aebea684b Implemented support for working with remote repositories.
libfetch from NetBSD's pkgsrc has been imported into lib/fetch, but
the objects are embedded into libxbps. Only a public function to fetch
files has been implemented: xbps_fetch_file().

The library now is built with -fvisibility=hidden by default, and
exported symbols are the ones that use the SYMEXPORT macro.

The code works well enough, but will need many more cleanups.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091027004600-0lq9aao67lisbzxv
2009-10-27 01:46:00 +01:00
Juan RP
b689725270 xbps-bin: use a single point to cleanup resources.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091023120154-wj4937kmu6ryacpk
2009-10-23 14:01:54 +02:00
Juan RP
ca39d1667e xbps-bin: use a signal handler for SIGINT, SIGTERM and SIGQUIT to
free resources used by libxbps.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091023092025-gav4w23f1oc7mgjy
2009-10-23 11:20:25 +02:00
Juan RP
1e792e62f8 xbps-bin: use HN_B and HN_DECIMAL when using humanize_number for a more
detailed output.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091023064559-b91xhoveq6qcpfpp
2009-10-23 08:45:59 +02:00
Juan RP
b2197be315 Do not use private sha256.h header file in the public exported
API header file (xbps_api.h).

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091022124921-nvy2x07ibxjqtt50
2009-10-22 14:49:21 +02:00
Juan RP
96c501b5cc xbps-bin: while updating a package that needs a new dependent package
the automatic-install object wasn't set correctly, fix this.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091022123221-46rya21xjy1mp8nb
2009-10-22 14:32:21 +02:00
Juan RP
bc3eeeec58 xbps-pkgdb: always set rootdir as an empty string, otherwise if -r
is not specified it will fail to get the regpkgdb plist file.

Bug found by pancake.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091019214947-cv57nebkpo48spce
2009-10-19 23:49:47 +02:00
Juan RP
c72f3a1a3c Remove xbps-src and its associated code. This is required for the
upcoming 0.3 version.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091018091539-4f7ynscyvsqt3st4
2009-10-18 11:15:39 +02:00
Juan RP
fdc561dfb2 xbps-{bin,repo,pkgdb}: added -V flag that prints the current XBPS
release version as defined in xbps_api.h.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091018084204-1xzyptqkjm5dwfjc
2009-10-18 10:42:04 +02:00
Juan RP
ba1c8971a5 Fix "autoupdate" target when no new packages are available.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091017041820-tj61sfbw5nz50ioh
2009-10-17 06:18:20 +02:00
Juan RP
3ddf276437 Fixed bug #453422: "xbps shouldn't depend on LZMA utils"
Do not link to libzmadec, rather to liblzma provided by xz.
Pointed by ojab in the bug, thanks!

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091017030101-1cw1b11l923hy8cw
2009-10-17 05:01:01 +02:00
Juan RP
058b882037 Fix previous, so that only tries to replace packages if they
are installed! heh

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091017025959-4k8ciftjglkbao91
2009-10-17 04:59:59 +02:00
Juan RP
cacb34147a Added support to replace packages with another one. Package metadata
uses an array of strings that lists the packages that should be
removed before new package can be installed.

In the build templates one can use: replaces="foo foo-blah foo-libs".

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091017022643-rdyrp9kvmx3m0p0h
2009-10-17 04:26:43 +02:00
Juan RP
4ef0fbcada Multiple changes to xbps-src and shutils:
* Added XBPS_FETCH_CMD to xbps-src.conf, this will be used to fetch
  distfiles. Please note that it will be copied to the chroot, so
  it should be statically linked or with only libc required.

* Removed libtool_func.sh and associated vars, it's unneeded currently.

* Added keep_empty_dirs, keep_libtool_archives and nostrip. By default
  all empty dirs and libtool archives are removed, and executables and
  libraries stripped, respectively. One can use set the var in a build
  template to change the behaviour.

* Explain in README what are the requirements to build XBPS.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091017005836-uifiof32ndy0wmd8
2009-10-17 02:58:36 +02:00
Juan RP
f7689695d1 xbps-bin/install.c: use only a function for install/update/autoupdate.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091016153732-gbcr30fahvveu2u9
2009-10-16 17:37:32 +02:00
Juan RP
cb1f10d415 xbps-bin: don't initialize repolist data unless we want to update.
xbps_find_new_pkg: always initialize repolist data.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091016150435-wpjfd453hpwr5k89
2009-10-16 17:04:35 +02:00
Juan RP
651a4e6254 xbps-bin/xbps_install_pkg(): only sort pkg deps in update mode.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091016135513-w4yc413l3i1pwdkm
2009-10-16 15:55:13 +02:00
Juan RP
e1f2a8b7bd xbps-bin: multiple fixes to update packages.
* Fix 'autoupdate' target to look for new packages in ALL repos, not
  just the first one that has the package.
* Fix 'update' target to work correctly.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091016133157-asvkv5jb6i9q2ibe
2009-10-16 15:31:57 +02:00
Juan RP
865b06be5d Build xbps-{bin,cmpver,digest,pkgdb,repo} as static, and install them
as foo.static.

Updated README to note the new requirements for it. It will be used
to reduce the number of dependencies when building packages in
the chroot.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091015222234-360i67zychjge3nh
2009-10-16 00:22:34 +02:00
Juan RP
cf04a48a1d Remove support for "keep_dirs", it won't be used.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091015142937-sbf72osvlulzq7d6
2009-10-15 16:29:37 +02:00
Juan RP
1febd85f42 xbps-pkgdb, shutils: use red/bold, red/yellow and bold for
msg_error, msg_warn and msg_normal respectively.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091015141731-9ci2bnvslqe5gq7j
2009-10-15 16:17:31 +02:00
Juan RP
c6d3868b8b shutils: remove tmpl_func.sh, moved to the xbps-templates repo.
xbps-src: added XBPS_COMMONVARSDIR that sources all .sh files in
	  setup_tmpl(), this replaces tmpl_funcs.sh.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091012203056-rtay2drhrwak4ldk
2009-10-12 22:30:56 +02:00
Juan RP
06d451e557 Remove 'automatic' flag while installing via xbps-src, it's not very
useful and won't be implemented.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091010155336-uyjgohik8y1y21bz
2009-10-10 17:53:36 +02:00
Juan RP
3d8fb79e94 xbps-bin: add support to check integrity of all installed packages,
through "xbps-bin check all".

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091005224237-plr75i3wveirhu4p
2009-10-06 00:42:37 +02:00
Juan RP
06f70e182c xbps-bin: rename the 'files' target to 'show-files' for consistency.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091005220659-l3rdop78ju04mi9v
2009-10-06 00:06:59 +02:00
Juan RP
042084b306 xbps-bin: do not mark package as broken if the any task in the check
target failed, just print the info.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091005220111-m2xkbbeupq2v7ccn
2009-10-06 00:01:11 +02:00
Juan RP
f02dd4ccb4 xbps-bin/install.c: improve some printfs.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091005190430-z70qmlhx4ca93jk6
2009-10-05 21:04:30 +02:00
Juan RP
ca2dd0f873 While upgrading a package, print informative line about old package
being removed.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091002152314-hig1qoobs42rvx9z
2009-10-02 17:23:14 +02:00
Juan RP
e668ba5193 Fix #438201 "Upgrading essential pkgs results in duplicated reqby entries"
Always remove reqby entries while upgrading "essential" packages.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091001053542-amaw61ib23hy453n
2009-10-01 07:35:42 +02:00
Juan RP
10531d7d45 Fix xbps_configure_pkg() reporting old version when upgrading packages.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20090825040302-azurxpyalot07j81
2009-08-25 06:03:02 +02:00
Juan RP
59b1942617 Fix memleaks in xbps_show_pkg_deps() and xbps_show_pkg_reverse_deps().
--HG--
extra : convert_revision : xtraeme%40gmail.com-20090822052256-tnf5s1od4oluhygp
2009-08-22 07:22:56 +02:00
Juan RP
6d84cde6f1 xbps-bin: add two new targets 'show-deps' and 'show-revdeps" to print
dependencies and reverse dependencies of a package, respectively.

'xbps-bin show' no longer prints the deps anymore.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20090821231219-n26o21xcxor46nk1
2009-08-22 01:12:19 +02:00
Juan RP
ecfa25833f Improve marginally configuring/purging all packages by looking at its
state in the object dictionary rather than opening and externalizing
the dictionary of every package.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20090821093126-0xw980x0pqtq59q2
2009-08-21 11:31:26 +02:00
Juan RP
9680251382 Add shell utils required by xbps-src.
These files are moved from the GIT repository.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20090818153742-98s9y92f5m19l3c2
2009-08-18 17:37:42 +02:00
Juan RP
deedf07d4e xbps-repo: fix swapped args in xbps_repo_addpkg_index().
--HG--
extra : convert_revision : xtraeme%40gmail.com-20090818140504-ea3rvio2ipbs501i
2009-08-18 16:05:04 +02:00
Juan RP
ca9d72d460 Implement blueprint 'xbps-repo-list-via-cmdline'.
A new target (add-pkgidx) has been added to the xbps-repo command,
that takes two args, local repository dir and path to binpkg.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20090818121244-pfdagkfqeukn1t2r
2009-08-18 14:12:44 +02:00
Juan RP
8621a2437b Rename xbps.conf to xbps-src.conf, because it's only used by xbps-src.
--HG--
rename : etc/xbps.conf => etc/xbps-src.conf
extra : convert_revision : xtraeme%40gmail.com-20090817230604-gcvdp2q44bq2lqra
2009-08-18 01:06:04 +02:00
juan
3f3b6d00dd Initial import of xbps with code as August '09.
--HG--
extra : convert_revision : juan%40xbps-20090817170720-amxxac4a2e8bza1j
2009-08-17 19:07:20 +02:00