Compare commits

..
5 Commits
Author SHA1 Message Date
Patrick McCarty 8ac1869adf Call checkrenamed() with correct arguments
Some of the renames tests omitted the leading forward slash for the two
function arguments, so add them here.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2018-04-19 11:15:26 -07:00
Patrick McCarty fde00265e2 test: fix some typos in checkrenamed()
Due to these typos being present, several tests were passing that should
not have been.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2018-04-19 11:15:26 -07:00
Matthew Johnson 25d3ef658d Add deprecation message to README
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-04-19 11:04:08 -07:00
Matthew Johnson 3cf2ade205 Release v3.7.5
This release specifies that /usr/src/kernel/* files are not state files.
These files are needed to ship kernel source files for kernel
development.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-12-13 16:47:30 -08:00
Miguel Bernal Marin e814a73480 heuristics: set /usr/src/kernel as not state dir
The kernel sources will be shipped in /usr/src/kernel but /usr/src/* is
state.

This commit enables /usr/src/kernel and its contents as a no state
directory.

Fixes #108

Signed-off-by: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com>
2017-12-13 16:40:27 -08:00
4 changed files with 31 additions and 15 deletions
+9
View File
@@ -1,3 +1,12 @@
With the release of mixer-tools v4.3.0 [1] the swupd-server project is
deprecated. All functionality has been re-written into the mixer tool under
the `mixer build update` command. All development done around creating update
content consumed by swupd-client is now done in that project.
[1] https://github.com/clearlinux/mixer-tools
---
The swupd-server package provides a reference implementation of a software The swupd-server package provides a reference implementation of a software
update server-side component that generates update content consumable by a update server-side component that generates update content consumable by a
software update client (swupd-client). Such content includes manifests that software update client (swupd-client). Such content includes manifests that
+1 -1
View File
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script. # Process this file with autoconf to produce a configure script.
AC_PREREQ([2.66]) AC_PREREQ([2.66])
AC_INIT(swupd-server, 3.7.4, matthew.johnson@intel.com) AC_INIT(swupd-server, 3.7.5, matthew.johnson@intel.com)
AM_INIT_AUTOMAKE([foreign -Wall -W subdir-objects]) AM_INIT_AUTOMAKE([foreign -Wall -W subdir-objects])
AM_SILENT_RULES([yes]) AM_SILENT_RULES([yes])
AC_PROG_CC AC_PROG_CC
+8 -1
View File
@@ -45,6 +45,7 @@ static void runtime_state_heuristics(struct file *file)
/* these are shipped directories that are not themselves state, /* these are shipped directories that are not themselves state,
* rather only their contents are state */ * rather only their contents are state */
if ((strcmp(file->filename, "/usr/src/debug") == 0) || if ((strcmp(file->filename, "/usr/src/debug") == 0) ||
(strcmp(file->filename, "/usr/src/kernel") == 0) ||
(strcmp(file->filename, "/dev") == 0) || (strcmp(file->filename, "/dev") == 0) ||
(strcmp(file->filename, "/home") == 0) || (strcmp(file->filename, "/home") == 0) ||
(strcmp(file->filename, "/proc") == 0) || (strcmp(file->filename, "/proc") == 0) ||
@@ -56,6 +57,12 @@ static void runtime_state_heuristics(struct file *file)
return; return;
} }
/* the contents of these directory are not state,
* but it belongs to a state directory */
if ((strncmp(file->filename, "/usr/src/kernel/", 16) == 0)) {
return;
}
/* the contents of these directory are state, ideally this never /* the contents of these directory are state, ideally this never
* triggers if our package builds are clean */ * triggers if our package builds are clean */
if ((strncmp(file->filename, "/dev/", 5) == 0) || if ((strncmp(file->filename, "/dev/", 5) == 0) ||
@@ -72,7 +79,7 @@ static void runtime_state_heuristics(struct file *file)
return; return;
} }
/* these are commonly added directories for user customizatio, /* these are commonly added directories for user customization,
* ideally this never triggers if our package builds are clean */ * ideally this never triggers if our package builds are clean */
if ((strncmp(file->filename, "/acct", 5) == 0) || if ((strncmp(file->filename, "/acct", 5) == 0) ||
(strncmp(file->filename, "/cache", 6) == 0) || (strncmp(file->filename, "/cache", 6) == 0) ||
+13 -13
View File
@@ -47,7 +47,7 @@ gendataCs() {
} }
checkrenamed(){ checkrenamed(){
local flags sh1 ver name fromsha1="bad" tosha1 local flags sha1 ver name fromsha1="bad" tosha1
# Check that $1 is renamed to $2 # Check that $1 is renamed to $2
exec 9< $DIR/www/20/Manifest.test-bundle exec 9< $DIR/www/20/Manifest.test-bundle
# skip the header # skip the header
@@ -58,11 +58,11 @@ checkrenamed(){
while read -r -u9 flags sha1 ver name while read -r -u9 flags sha1 ver name
do do
case "$flags" in case "$flags" in
(?"dr"?) [ "$name" = "$1" ] && fromsha1=$sha1 ;; (?"d.r") [ "$name" = "$1" ] && fromsha1=$sha1 ;;
(?".r"?) [ "$name" = "$2" ] && tosha1=$sha1 ;; (?"..r") [ "$name" = "$2" ] && tosha1=$sha1 ;;
esac esac
done done
if [ "$fromsh1" = "$tosha1" ] ; then return 0 ; else return 1 ; fi if [ "$fromsha1" = "$tosha1" ] ; then return 0 ; else return 1 ; fi
} }
# Guts of doing an update # Guts of doing an update
@@ -87,7 +87,7 @@ do_an_update() {
gendataA 10 foo gendataA 10 foo
gendataA 20 bar gendataA 20 bar
do_an_update do_an_update
checkrenamed foo bar checkrenamed /foo /bar
} }
@test "ignore rename detection for small files" { @test "ignore rename detection for small files" {
@@ -142,8 +142,8 @@ do_an_update() {
gendataA 20 bar gendataA 20 bar
gendataA 20 baz gendataA 20 baz
do_an_update do_an_update
checkrenamed foo bar checkrenamed /foo /bar
checkrenamed foz baz checkrenamed /foz /baz
} }
@test "rename two files to two, one slightly different" { @test "rename two files to two, one slightly different" {
@@ -153,8 +153,8 @@ do_an_update() {
gendataB 20 baz gendataB 20 baz
do_an_update do_an_update
# we don't actually know how the client we do this rename, but don't care # we don't actually know how the client we do this rename, but don't care
checkrenamed foo bar checkrenamed /foo /bar
checkrenamed foz baz checkrenamed /foz /baz
} }
@test "rename two files to two, each pair slightly different" { @test "rename two files to two, each pair slightly different" {
@@ -163,8 +163,8 @@ do_an_update() {
gendataA 20 bar gendataA 20 bar
gendataB 20 baz gendataB 20 baz
do_an_update do_an_update
checkrenamed foo bar checkrenamed /foo /bar
checkrenamed foz baz checkrenamed /foz /baz
} }
@test "rename two files to two, one very different" { @test "rename two files to two, one very different" {
@@ -183,9 +183,9 @@ do_an_update() {
gendataA 20 bar gendataA 20 bar
gendataCs 20 baz gendataCs 20 baz
do_an_update do_an_update
run checkrenamed foo bar run checkrenamed /foo /bar
if [ $status -eq 1 ] ; then if [ $status -eq 1 ] ; then
checkrenamed foz bar checkrenamed /foz /bar
fi fi
} }