mirror of
https://github.com/eledio-devices/thirdparty-littlefs.git
synced 2025-11-02 00:38:28 +01:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0bb1f7af17 | ||
|
|
447d89cbd8 | ||
|
|
28d2d96a83 |
21
.travis.yml
21
.travis.yml
@@ -140,12 +140,13 @@ jobs:
|
|||||||
- LFS_VERSION_MINOR=$((0xffff & ($LFS_VERSION >> 0)))
|
- LFS_VERSION_MINOR=$((0xffff & ($LFS_VERSION >> 0)))
|
||||||
# Grab latests patch from repo tags, default to 0, needs finagling to get past github's pagination api
|
# Grab latests patch from repo tags, default to 0, needs finagling to get past github's pagination api
|
||||||
- PREV_URL=https://api.github.com/repos/$TRAVIS_REPO_SLUG/git/refs/tags/v$LFS_VERSION_MAJOR.$LFS_VERSION_MINOR.
|
- PREV_URL=https://api.github.com/repos/$TRAVIS_REPO_SLUG/git/refs/tags/v$LFS_VERSION_MAJOR.$LFS_VERSION_MINOR.
|
||||||
- PREV_URL=$(curl -f -u "$GEKY_BOT_RELEASES" "$PREV_URL" -I
|
- PREV_URL=$(curl -u "$GEKY_BOT_RELEASES" "$PREV_URL" -I
|
||||||
| sed -n '/^Link/{s/.*<\(.*\)>; rel="last"/\1/;p;q0};$q1'
|
| sed -n '/^Link/{s/.*<\(.*\)>; rel="last"/\1/;p;q0};$q1'
|
||||||
|| echo $PREV_URL)
|
|| echo $PREV_URL)
|
||||||
- LFS_VERSION_PATCH=$(curl -f -u "$GEKY_BOT_RELEASES" "$PREV_URL"
|
- LFS_VERSION_PATCH=$(curl -u "$GEKY_BOT_RELEASES" "$PREV_URL"
|
||||||
| jq 'map(.ref | match("\\bv.*\\..*\\.(.*)$";"g")
|
| jq 'map(.ref | match("\\bv.*\\..*\\.(.*)$";"g")
|
||||||
.captures[].string | tonumber + 1) | max // 0')
|
.captures[].string | tonumber) | max + 1'
|
||||||
|
|| echo 0)
|
||||||
# We have our new version
|
# We have our new version
|
||||||
- LFS_VERSION="v$LFS_VERSION_MAJOR.$LFS_VERSION_MINOR.$LFS_VERSION_PATCH"
|
- LFS_VERSION="v$LFS_VERSION_MAJOR.$LFS_VERSION_MINOR.$LFS_VERSION_PATCH"
|
||||||
- echo "VERSION $LFS_VERSION"
|
- echo "VERSION $LFS_VERSION"
|
||||||
@@ -155,9 +156,19 @@ jobs:
|
|||||||
https://api.github.com/repos/$TRAVIS_REPO_SLUG/commits/master \
|
https://api.github.com/repos/$TRAVIS_REPO_SLUG/commits/master \
|
||||||
| jq -re '.sha')
|
| jq -re '.sha')
|
||||||
if [ "$TRAVIS_COMMIT" == "$CURRENT_COMMIT" ]
|
if [ "$TRAVIS_COMMIT" == "$CURRENT_COMMIT" ]
|
||||||
|
then
|
||||||
|
# Create a simple tag
|
||||||
|
curl -f -u "$GEKY_BOT_RELEASES" -X POST \
|
||||||
|
https://api.github.com/repos/$TRAVIS_REPO_SLUG/git/refs \
|
||||||
|
-d "{
|
||||||
|
\"ref\": \"refs/tags/$LFS_VERSION\",
|
||||||
|
\"sha\": \"$TRAVIS_COMMIT\"
|
||||||
|
}"
|
||||||
|
# Minor release?
|
||||||
|
if [[ "$LFS_VERSION" == *.0 ]]
|
||||||
then
|
then
|
||||||
# Build release notes
|
# Build release notes
|
||||||
PREV=$(git tag --sort=-v:refname -l "v*" | head -1)
|
PREV=$(git tag --sort=-v:refname -l "v*.0" | head -1)
|
||||||
if [ ! -z "$PREV" ]
|
if [ ! -z "$PREV" ]
|
||||||
then
|
then
|
||||||
echo "PREV $PREV"
|
echo "PREV $PREV"
|
||||||
@@ -170,11 +181,11 @@ jobs:
|
|||||||
https://api.github.com/repos/$TRAVIS_REPO_SLUG/releases \
|
https://api.github.com/repos/$TRAVIS_REPO_SLUG/releases \
|
||||||
-d "{
|
-d "{
|
||||||
\"tag_name\": \"$LFS_VERSION\",
|
\"tag_name\": \"$LFS_VERSION\",
|
||||||
\"target_commitish\": \"$TRAVIS_COMMIT\",
|
|
||||||
\"name\": \"${LFS_VERSION%.0}\",
|
\"name\": \"${LFS_VERSION%.0}\",
|
||||||
\"body\": $(jq -sR '.' <<< "$CHANGES")
|
\"body\": $(jq -sR '.' <<< "$CHANGES")
|
||||||
}"
|
}"
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Manage statuses
|
# Manage statuses
|
||||||
before_install:
|
before_install:
|
||||||
|
|||||||
2
Makefile
2
Makefile
@@ -26,7 +26,7 @@ override CFLAGS += -m$(WORD)
|
|||||||
endif
|
endif
|
||||||
override CFLAGS += -I.
|
override CFLAGS += -I.
|
||||||
override CFLAGS += -std=c99 -Wall -pedantic
|
override CFLAGS += -std=c99 -Wall -pedantic
|
||||||
override CFLAGS += -Wshadow -Wunused-parameter -Wjump-misses-init
|
override CFLAGS += -Wshadow -Wunused-parameter -Wjump-misses-init -Wsign-compare
|
||||||
|
|
||||||
|
|
||||||
all: $(TARGET)
|
all: $(TARGET)
|
||||||
|
|||||||
2
lfs.c
2
lfs.c
@@ -2481,7 +2481,7 @@ int lfs_deorphan(lfs_t *lfs) {
|
|||||||
lfs_dir_t cwd = {.d.tail[0] = 0, .d.tail[1] = 1};
|
lfs_dir_t cwd = {.d.tail[0] = 0, .d.tail[1] = 1};
|
||||||
|
|
||||||
// iterate over all directory directory entries
|
// iterate over all directory directory entries
|
||||||
for (int i = 0; i < lfs->cfg->block_count; i++) {
|
for (lfs_size_t i = 0; i < lfs->cfg->block_count; i++) {
|
||||||
if (lfs_pairisnull(cwd.d.tail)) {
|
if (lfs_pairisnull(cwd.d.tail)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,18 +32,18 @@ lfs_alloc_singleproc() {
|
|||||||
tests/test.py << TEST
|
tests/test.py << TEST
|
||||||
const char *names[] = {"bacon", "eggs", "pancakes"};
|
const char *names[] = {"bacon", "eggs", "pancakes"};
|
||||||
lfs_mount(&lfs, &cfg) => 0;
|
lfs_mount(&lfs, &cfg) => 0;
|
||||||
for (int n = 0; n < sizeof(names)/sizeof(names[0]); n++) {
|
for (unsigned n = 0; n < sizeof(names)/sizeof(names[0]); n++) {
|
||||||
sprintf((char*)buffer, "$1/%s", names[n]);
|
sprintf((char*)buffer, "$1/%s", names[n]);
|
||||||
lfs_file_open(&lfs, &file[n], (char*)buffer,
|
lfs_file_open(&lfs, &file[n], (char*)buffer,
|
||||||
LFS_O_WRONLY | LFS_O_CREAT | LFS_O_APPEND) => 0;
|
LFS_O_WRONLY | LFS_O_CREAT | LFS_O_APPEND) => 0;
|
||||||
}
|
}
|
||||||
for (int n = 0; n < sizeof(names)/sizeof(names[0]); n++) {
|
for (unsigned n = 0; n < sizeof(names)/sizeof(names[0]); n++) {
|
||||||
size = strlen(names[n]);
|
size = strlen(names[n]);
|
||||||
for (int i = 0; i < $SIZE; i++) {
|
for (int i = 0; i < $SIZE; i++) {
|
||||||
lfs_file_write(&lfs, &file[n], names[n], size) => size;
|
lfs_file_write(&lfs, &file[n], names[n], size) => size;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (int n = 0; n < sizeof(names)/sizeof(names[0]); n++) {
|
for (unsigned n = 0; n < sizeof(names)/sizeof(names[0]); n++) {
|
||||||
lfs_file_close(&lfs, &file[n]) => 0;
|
lfs_file_close(&lfs, &file[n]) => 0;
|
||||||
}
|
}
|
||||||
lfs_unmount(&lfs) => 0;
|
lfs_unmount(&lfs) => 0;
|
||||||
|
|||||||
@@ -301,7 +301,7 @@ tests/test.py << TEST
|
|||||||
size = strlen("hedgehoghog");
|
size = strlen("hedgehoghog");
|
||||||
const lfs_soff_t offsets[] = {512, 1020, 513, 1021, 511, 1019};
|
const lfs_soff_t offsets[] = {512, 1020, 513, 1021, 511, 1019};
|
||||||
|
|
||||||
for (int i = 0; i < sizeof(offsets) / sizeof(offsets[0]); i++) {
|
for (unsigned i = 0; i < sizeof(offsets) / sizeof(offsets[0]); i++) {
|
||||||
lfs_soff_t off = offsets[i];
|
lfs_soff_t off = offsets[i];
|
||||||
memcpy(buffer, "hedgehoghog", size);
|
memcpy(buffer, "hedgehoghog", size);
|
||||||
lfs_file_seek(&lfs, &file[0], off, LFS_SEEK_SET) => off;
|
lfs_file_seek(&lfs, &file[0], off, LFS_SEEK_SET) => off;
|
||||||
|
|||||||
@@ -23,14 +23,14 @@ tests/test.py << TEST
|
|||||||
|
|
||||||
lfs_mount(&lfs, &cfg) => 0;
|
lfs_mount(&lfs, &cfg) => 0;
|
||||||
|
|
||||||
for (int i = 0; i < sizeof(startsizes)/sizeof(startsizes[0]); i++) {
|
for (unsigned i = 0; i < sizeof(startsizes)/sizeof(startsizes[0]); i++) {
|
||||||
sprintf((char*)buffer, "hairyhead%d", i);
|
sprintf((char*)buffer, "hairyhead%d", i);
|
||||||
lfs_file_open(&lfs, &file[0], (const char*)buffer,
|
lfs_file_open(&lfs, &file[0], (const char*)buffer,
|
||||||
LFS_O_WRONLY | LFS_O_CREAT | LFS_O_TRUNC) => 0;
|
LFS_O_WRONLY | LFS_O_CREAT | LFS_O_TRUNC) => 0;
|
||||||
|
|
||||||
strcpy((char*)buffer, "hair");
|
strcpy((char*)buffer, "hair");
|
||||||
size = strlen((char*)buffer);
|
size = strlen((char*)buffer);
|
||||||
for (int j = 0; j < startsizes[i]; j += size) {
|
for (lfs_off_t j = 0; j < startsizes[i]; j += size) {
|
||||||
lfs_file_write(&lfs, &file[0], buffer, size) => size;
|
lfs_file_write(&lfs, &file[0], buffer, size) => size;
|
||||||
}
|
}
|
||||||
lfs_file_size(&lfs, &file[0]) => startsizes[i];
|
lfs_file_size(&lfs, &file[0]) => startsizes[i];
|
||||||
@@ -55,13 +55,13 @@ tests/test.py << TEST
|
|||||||
|
|
||||||
lfs_mount(&lfs, &cfg) => 0;
|
lfs_mount(&lfs, &cfg) => 0;
|
||||||
|
|
||||||
for (int i = 0; i < sizeof(startsizes)/sizeof(startsizes[0]); i++) {
|
for (unsigned i = 0; i < sizeof(startsizes)/sizeof(startsizes[0]); i++) {
|
||||||
sprintf((char*)buffer, "hairyhead%d", i);
|
sprintf((char*)buffer, "hairyhead%d", i);
|
||||||
lfs_file_open(&lfs, &file[0], (const char*)buffer, LFS_O_RDWR) => 0;
|
lfs_file_open(&lfs, &file[0], (const char*)buffer, LFS_O_RDWR) => 0;
|
||||||
lfs_file_size(&lfs, &file[0]) => hotsizes[i];
|
lfs_file_size(&lfs, &file[0]) => hotsizes[i];
|
||||||
|
|
||||||
size = strlen("hair");
|
size = strlen("hair");
|
||||||
int j = 0;
|
lfs_off_t j = 0;
|
||||||
for (; j < startsizes[i] && j < hotsizes[i]; j += size) {
|
for (; j < startsizes[i] && j < hotsizes[i]; j += size) {
|
||||||
lfs_file_read(&lfs, &file[0], buffer, size) => size;
|
lfs_file_read(&lfs, &file[0], buffer, size) => size;
|
||||||
memcmp(buffer, "hair", size) => 0;
|
memcmp(buffer, "hair", size) => 0;
|
||||||
@@ -87,13 +87,13 @@ tests/test.py << TEST
|
|||||||
|
|
||||||
lfs_mount(&lfs, &cfg) => 0;
|
lfs_mount(&lfs, &cfg) => 0;
|
||||||
|
|
||||||
for (int i = 0; i < sizeof(startsizes)/sizeof(startsizes[0]); i++) {
|
for (unsigned i = 0; i < sizeof(startsizes)/sizeof(startsizes[0]); i++) {
|
||||||
sprintf((char*)buffer, "hairyhead%d", i);
|
sprintf((char*)buffer, "hairyhead%d", i);
|
||||||
lfs_file_open(&lfs, &file[0], (const char*)buffer, LFS_O_RDONLY) => 0;
|
lfs_file_open(&lfs, &file[0], (const char*)buffer, LFS_O_RDONLY) => 0;
|
||||||
lfs_file_size(&lfs, &file[0]) => coldsizes[i];
|
lfs_file_size(&lfs, &file[0]) => coldsizes[i];
|
||||||
|
|
||||||
size = strlen("hair");
|
size = strlen("hair");
|
||||||
int j = 0;
|
lfs_off_t j = 0;
|
||||||
for (; j < startsizes[i] && j < hotsizes[i] && j < coldsizes[i];
|
for (; j < startsizes[i] && j < hotsizes[i] && j < coldsizes[i];
|
||||||
j += size) {
|
j += size) {
|
||||||
lfs_file_read(&lfs, &file[0], buffer, size) => size;
|
lfs_file_read(&lfs, &file[0], buffer, size) => size;
|
||||||
|
|||||||
Reference in New Issue
Block a user