Skip to content

Commit

Permalink
Merge branch 'bee-cache/bee-cache'
Browse files Browse the repository at this point in the history
* bee-cache/bee-cache:
  bee-remove: rerun bee-cache update after metadir was removed
  bee-cache-update: cleanup cachedir if metadir does not exist
  bee-cache: Fix print-conflicts
  bee-install: deprecate DEPENDENCIES file
  bee-cache/bee-dep: Remove old bee-dep
  bee-install: Change conflict output
  beesh: Show conflicts with installed packages
  bee-install: Print conflicts after installing/updating a package
  bee-cache: Add new command 'print-conflicts'
  bee-cache: Introduce new --fields option
  bee-cache: Add new command 'print-conflicting-files'
  bee-cache: Add new tool to manage inventory
  bee-cache-update: Preserve uniqueness of inventory entries..
  bee-cache-update: reverse sort INVENTORY
  bee-cache-update: Use CONTENT.bee-remove to create .bcr file
  bee-remove: Change suffix of renamed CONTENT file
  bee-remove: Only remove packages that have a CONTENT file
  • Loading branch information
mariux committed Jul 30, 2012
2 parents d714c32 + 29456a8 commit 994a04a
Show file tree
Hide file tree
Showing 17 changed files with 329 additions and 3,081 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/bee.sh
/bee-cache.sh
/bee-check.sh
/bee-init.sh
/bee-install.sh
Expand All @@ -16,7 +17,6 @@
/beeversion
/beegetopt
/beeflock
/bee-dep
/beelib.config.sh
/bee.1
/bee-check.1
Expand All @@ -25,7 +25,6 @@
/bee-list.1
/bee-query.1
/bee-remove.1
/bee-dep.1
/beefind.sh
/bee-cache-inventory
/bee-cache-update.sh
Expand Down
8 changes: 1 addition & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ PROGRAMS_SHELL+=bee
PROGRAMS_SHELL+=beefind
PROGRAMS_SHELL+=beesh

HELPER_BEE_C+=bee-dep

HELPER_BEE_SHELL+=bee-cache
HELPER_BEE_SHELL+=bee-check
HELPER_BEE_SHELL+=bee-download
HELPER_BEE_SHELL+=bee-init
Expand Down Expand Up @@ -107,7 +106,6 @@ HELPER_HOOKS_SHELL+=gconf-install-schemas

MANPAGES+=bee.1
MANPAGES+=bee-check.1
MANPAGES+=bee-dep.1
MANPAGES+=bee-download.1
MANPAGES+=bee-list.1
MANPAGES+=bee-init.1
Expand Down Expand Up @@ -145,7 +143,6 @@ BEESEP_OBJECTS=beesep.o
BEECUT_OBJECTS=beecut.o
BEEUNIQ_OBJECTS=beeuniq.o
BEESORT_OBJECTS=bee_tree.o bee_version_compare.o bee_version_output.o bee_version_parse.o bee_getopt.o beesort.o
BEEDEP_OBJECTS=bee-dep.o graph.o hash.o beedep_tree.o node.o
BEEGETOPT_OBJECTS=bee_getopt.o beegetopt.o
BEEFLOCK_OBJECTS=bee_getopt.o beeflock.o
BEECACHEINVENTORY_OBJECTS=bee-cache-inventory.o bee_getopt.o
Expand Down Expand Up @@ -173,9 +170,6 @@ beeuniq: $(addprefix src/, ${BEEUNIQ_OBJECTS})
beesort: $(addprefix src/, ${BEESORT_OBJECTS})
$(call quiet-command,${CC} ${LDFLAGS} -o $@ $^,"LD $@")

bee-dep: $(addprefix src/, ${BEEDEP_OBJECTS})
$(call quiet-command,${CC} ${LDFLAGS} -o $@ $^,"LD $@")

beegetopt: $(addprefix src/, ${BEEGETOPT_OBJECTS})
$(call quiet-command,${CC} ${LDFLAGS} -o $@ $^,"LD $@")

Expand Down
86 changes: 0 additions & 86 deletions manpages/bee-dep.1.in

This file was deleted.

26 changes: 19 additions & 7 deletions src/bee-cache-update.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,37 @@ function print_info()
function create_pkgbcfile()
{
local PKGALLPKG=${1}
local CONTENTFILE=${BEE_METADIR}/${PKGALLPKG}/CONTENT
local PKGMETADIR=${BEE_METADIR}/${PKGALLPKG}
local CONTENTFILE=${PKGMETADIR}/CONTENT
local PKGBCFILE=${CACHEDIR}/${PKGALLPKG}.bc
local PKGBCRFILE=${PKGBCFILE%.bc}.bcr

local tmpfile=${PKGBCFILE}.tmp.$$

if [ ! -e "${CONTENTFILE}" ] ; then
if [ ! -d "${PKGMETADIR}" ] ; then
# cleanup cache if metadir does not exist
rm -f "${PKGBCFILE}" "${PKGBCRFILE}"
elif [ ! -e "${CONTENTFILE}" ] ; then
if [ -e "${PKGBCFILE}" ] ; then
print_info "moving ${PKGBCFILE} to ${PKGBCRFILE}.."
mv "${PKGBCFILE}" "${PKGBCRFILE}"
fi;
return 0
return 0
elif [ -e "${PKGBCRFILE}" ] ; then
return 0
elif [ -e "${CONTENTFILE}.bee-remove" ] ; then
CONTENTFILE=${CONTENTFILE}.bee-remove
PKGBCFILE=${PKGBCRFILE}
tmpfile=${PKGBCFILE}.tmp.$$
else
return 0
fi
fi

print_info "creating ${PKGBCFILE} .."
${BEE_LIBEXECDIR}/bee/bee-cache-inventory \
--prepend "${PKGALLPKG} " \
${CONTENTFILE} \
| sort -k 8 -k 1 \
| sort -r -k 8 -k 1 \
>${tmpfile}

if [ ${PIPESTATUS[0]} != 0 -o ${PIPESTATUS[1]} != 0 ] ; then
Expand Down Expand Up @@ -92,7 +104,7 @@ function update_inventory()

print_info "merging ${PKGBCFILE} with ${INVENTORYFILE} .."

sort -u -m -k 8 -k 1 >${tmpfile} \
sort -u -m -u -r -k 8 -k 1 >${tmpfile} \
${INVENTORYFILE} \
${PKGBCFILE}

Expand All @@ -115,7 +127,7 @@ function create_inventory()

${BEE_LIBEXECDIR}/bee/bee-cache-inventory \
${BEE_METADIR} \
| sort -k 8 -k 1 \
| sort -r -k 8 -k 1 \
>${tmpfile}

if [ ${PIPESTATUS[0]} != 0 -o ${PIPESTATUS[1]} != 0 ] ; then
Expand Down
Loading

0 comments on commit 994a04a

Please sign in to comment.