Skip to content

Commit

Permalink
Fix the prefix_range btree class to support sub-ranges, call it 1.1.0…
Browse files Browse the repository at this point in the history
… because btree indexes will have to get rebuilt (cmp function behavior change)
  • Loading branch information
dimitri committed Nov 30, 2009
1 parent a59d2a9 commit e1bcb8e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -0,0 +1,2 @@
/prefix.so
/prefix.sql
11 changes: 3 additions & 8 deletions Makefile
@@ -1,5 +1,5 @@
PKGNAME = prefix
PKGVERS = 1.0.0
PKGVERS = 1.1.0

DEBDIR = /tmp/$(PKGNAME)
EXPORT = $(DEBDIR)/export/$(PKGNAME)-$(PKGVERS)
Expand Down Expand Up @@ -34,20 +34,15 @@ deb:
rm -rf $(DEBDIR)
mkdir -p $(DEBDIR)/$(PKGNAME)-$(PKGVERS)
mkdir -p $(EXPORT)
cp -a . $(EXPORT)
rsync -Ca . $(EXPORT)

# get rid of temp and build files
for n in ".#*" "*~" "build-stamp" "configure-stamp" "prefix.sql" "prefix.so"; do \
find $(EXPORT) -name "$$n" -print0|xargs -0 rm -f; \
done

# get rid of CVS dirs
for n in "CVS" "CVSROOT"; do \
find $(EXPORT) -type d -name "$$n" -print0|xargs -0 rm -rf; \
done

# prepare the .orig without the debian/ packaging stuff
cp -a $(EXPORT) $(DEBDIR)
rsync -Ca $(EXPORT) $(DEBDIR)
rm -rf $(DEBDIR)/$(PKGNAME)-$(PKGVERS)/debian
(cd $(DEBDIR) && tar czf $(ORIG) $(PKGNAME)-$(PKGVERS))

Expand Down
6 changes: 6 additions & 0 deletions debian/changelog
@@ -1,3 +1,9 @@
prefix (1.1.0-1) unstable; urgency=high

* Fix Btree opclass for supporting sub-ranges

-- Dimitri Fontaine <dim@tapoueh.org> Mon, 30 Nov 2009 10:02:40 +0100

prefix (1.0.0-1) unstable; urgency=low

* Release 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion debian/rules
Expand Up @@ -31,7 +31,7 @@ clean:
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_prep
dh_installdirs

mkdir -p $(TGT83) $(TGT84)
Expand Down
6 changes: 5 additions & 1 deletion prefix.c
Expand Up @@ -520,7 +520,11 @@ int pr_cmp(prefix_range *a, prefix_range *b) {
cmp = memcmp(p, q, mlen);

if( cmp == 0 )
return (a->first == b->first) ? (a->last - b->last) : (a->first - b->first);
/*
* we are comparing e.g. '1' and '12' (the shorter contains the
* smaller), so let's pretend '12' < '1' as it contains less elements.
*/
return (alen == mlen) ? 1 : -1;

return cmp;
}
Expand Down

0 comments on commit e1bcb8e

Please sign in to comment.