Fix tix3g migration hook installing the wrong PLATFORM in collection.conf.
Fix the hook marker not existing and change its name to allow upgrading from broken experimental builds.
This commit is contained in:
parent
93dd46192d
commit
e5465e64a1
|
@ -58,6 +58,7 @@ install: all
|
||||||
touch $(DESTDIR)$(DATADIR)/sysinstall/hooks/sortix-1.1-init
|
touch $(DESTDIR)$(DATADIR)/sysinstall/hooks/sortix-1.1-init
|
||||||
touch $(DESTDIR)$(DATADIR)/sysinstall/hooks/sortix-1.1-passwd
|
touch $(DESTDIR)$(DATADIR)/sysinstall/hooks/sortix-1.1-passwd
|
||||||
touch $(DESTDIR)$(DATADIR)/sysinstall/hooks/sortix-1.1-group
|
touch $(DESTDIR)$(DATADIR)/sysinstall/hooks/sortix-1.1-group
|
||||||
|
touch $(DESTDIR)$(DATADIR)/sysinstall/hooks/sortix-1.1-tix3g
|
||||||
|
|
||||||
sysinstall: $(SYSINSTALL_OBJS)
|
sysinstall: $(SYSINSTALL_OBJS)
|
||||||
$(CC) $(SYSINSTALL_OBJS) -o $@ -lmount -ldisplay
|
$(CC) $(SYSINSTALL_OBJS) -o $@ -lmount -ldisplay
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/utsname.h>
|
#include <sys/utsname.h>
|
||||||
|
|
||||||
|
#include <ctype.h>
|
||||||
#include <err.h>
|
#include <err.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
@ -427,7 +428,7 @@ void upgrade_prepare(const struct release* old_release,
|
||||||
|
|
||||||
// TODO: After releasing Sortix 1.1, remove this compatibility.
|
// TODO: After releasing Sortix 1.1, remove this compatibility.
|
||||||
if ( hook_needs_to_be_run(source_prefix, target_prefix,
|
if ( hook_needs_to_be_run(source_prefix, target_prefix,
|
||||||
"sortix-1.1-tix-3g") )
|
"sortix-1.1-tix3g") )
|
||||||
{
|
{
|
||||||
char* path = join_paths(target_prefix, "/tix/collection.conf");
|
char* path = join_paths(target_prefix, "/tix/collection.conf");
|
||||||
if ( !path )
|
if ( !path )
|
||||||
|
@ -441,6 +442,8 @@ void upgrade_prepare(const struct release* old_release,
|
||||||
printf(" - Migrating to tix version 3...\n");
|
printf(" - Migrating to tix version 3...\n");
|
||||||
struct utsname uts;
|
struct utsname uts;
|
||||||
uname(&uts);
|
uname(&uts);
|
||||||
|
for ( size_t i = 0; uts.sysname[i]; i++ )
|
||||||
|
uts.sysname[i] = tolower((unsigned char) uts.sysname[i]);
|
||||||
if ( fprintf(fp, "TIX_COLLECTION_VERSION=3\n") < 0 ||
|
if ( fprintf(fp, "TIX_COLLECTION_VERSION=3\n") < 0 ||
|
||||||
fprintf(fp, "PREFIX=\n") < 0 ||
|
fprintf(fp, "PREFIX=\n") < 0 ||
|
||||||
fprintf(fp, "PLATFORM=%s-%s\n",
|
fprintf(fp, "PLATFORM=%s-%s\n",
|
||||||
|
@ -458,7 +461,7 @@ void upgrade_prepare(const struct release* old_release,
|
||||||
}
|
}
|
||||||
free(path);
|
free(path);
|
||||||
// Delay deleting installed.list since it's needed for the upgrade.
|
// Delay deleting installed.list since it's needed for the upgrade.
|
||||||
hook_want_finalization(target_prefix, "sortix-1.1-tix-3g");
|
hook_want_finalization(target_prefix, "sortix-1.1-tix3g");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -472,7 +475,7 @@ void upgrade_finalize(const struct release* old_release,
|
||||||
(void) source_prefix;
|
(void) source_prefix;
|
||||||
(void) target_prefix;
|
(void) target_prefix;
|
||||||
|
|
||||||
if ( hook_needs_finalization(target_prefix, "sortix-1.1-tix-3g") )
|
if ( hook_needs_finalization(target_prefix, "sortix-1.1-tix3g") )
|
||||||
{
|
{
|
||||||
printf(" - Finishing migration to tix version 3...\n");
|
printf(" - Finishing migration to tix version 3...\n");
|
||||||
char* path = join_paths(target_prefix, "/tix/installed.list");
|
char* path = join_paths(target_prefix, "/tix/installed.list");
|
||||||
|
@ -499,7 +502,7 @@ void upgrade_finalize(const struct release* old_release,
|
||||||
_exit(2);
|
_exit(2);
|
||||||
}
|
}
|
||||||
free(path);
|
free(path);
|
||||||
hook_did_finalization(target_prefix, "sortix-1.1-tix-3g");
|
hook_did_finalization(target_prefix, "sortix-1.1-tix3g");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue