Skip to content
Snippets Groups Projects
Verified Commit e571a84d authored by Dan Johansen's avatar Dan Johansen
Browse files

remove sync first option

add sync filesystem patch
add makepkg seccomp fix patch
Signed-off-by: default avatarDan Johansen <strit@manjaro.org>
parent e97b6bad
No related branches found
No related tags found
No related merge requests found
From 2eb709681537fed1156b2e1dc134e194e7b5c762 Mon Sep 17 00:00:00 2001
From: Kevin Mihelich <kevin@archlinuxarm.org>
Date: Sat, 13 Sep 2014 18:58:16 -0600
Subject: [PATCH 1/3] Sychronize filesystem
Since many problems arise from improper flushing of the filesystem,
particularly package installations followed by a reboot very shorly after,
this will perform a sync() after installations and removals to ensure a
consistent filesystem state after package operations.
Signed-off-by: Kevin Mihelich <kevin@archlinuxarm.org>
---
lib/libalpm/trans.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c
index 4d97921f..531dbbe4 100644
--- a/lib/libalpm/trans.c
+++ b/lib/libalpm/trans.c
@@ -230,6 +230,9 @@ int SYMEXPORT alpm_trans_commit(alpm_handle_t *handle, alpm_list_t **data)
trans->state = STATE_COMMITED;
+ _alpm_log(handle, ALPM_LOG_DEBUG, "synchronizing filesystem\n");
+ sync();
+
return 0;
}
--
2.22.0
......@@ -10,7 +10,7 @@
pkgname=pacman
pkgver=5.2.1
_pkgver=1.2.0
pkgrel=1
pkgrel=2
pkgdesc="A library-based package manager with dependency support"
arch=('i686' 'x86_64' 'armv7h' 'aarch64')
url="http://www.archlinux.org/pacman/"
......@@ -31,7 +31,9 @@ source=(https://sources.archlinux.org/other/pacman/$pkgname-$pkgver.tar.gz
https://sources.archlinux.org/other/community/pacman-contrib/pacman-contrib-$_pkgver.tar.gz
pacman.conf
makepkg.conf
pacman-sync-first-option.patch
#pacman-sync-first-option.patch
0001-Sychronize-filesystem.patch
makepkg-fix-one-more-file-seccomp-issue.patch
etc-pacman.d-gnupg.mount
pacman-init.service)
......@@ -39,7 +41,10 @@ prepare() {
cd $srcdir/$pkgname-$pkgver
# Manjaro patches
patch -p1 -i $srcdir/pacman-sync-first-option.patch
#patch -p1 -i $srcdir/pacman-sync-first-option.patch
# Arch Linux ARM patches
patch -p1 -i $srcdir/0001-Sychronize-filesystem.patch
patch -p1 -i $srcdir/makepkg-fix-one-more-file-seccomp-issue.patch
./configure --prefix=/usr --sysconfdir=/etc \
--localstatedir=/var --enable-doc \
......@@ -114,8 +119,9 @@ esac
sha256sums=('1930c407265fd039cb3a8e6edc82f69e122aa9239d216d9d57b9d1b9315af312'
'317f53819e35647a19138cb0d68e16206af4a80f52115a7cd622c4a367f914b7'
'b6eb027e753e6b0532247d6f2c334d73032a8c9eae138f88865ed18397a67377'
'837f01bbc419a9ef20c5b649ed76f9602e349feb78c6fb4aba115c0720fe77e5'
'f187a5919f06c6e3d3e67f2d4b9ac14217accaae1ce7e226ff133bcbfde3f03d'
'8167155d3a3e15fc4a1b1e989fdb826779e7b3690a52e2ca9d307ae0b1550e1d'
'187bef40b14461ef7caba83e8124b6725e0cc9d46fa84353dae3b2afdc013589'
'e481a161bba76729cd434c97e0b319ddfcb1d93b2e4890d72b4e8a32982531d9'
'b6d14727ec465bb66d0a0358163b1bbfafcb4eaed55a0f57c30aabafae7eed68'
'65d8bdccdcccb64ae05160b5d1e7f3e45e1887baf89dda36c1bd44c62442f91b')
'862a0c30d1a1824b446a9400feba165d5cd5871491a4b7aeb5595d99db47ca93')
From 00cfc6c5c9700b597c384743c2f057a2ba7125e2 Mon Sep 17 00:00:00 2001
From: Eli Schwartz <eschwartz@archlinux.org>
Date: Thu, 9 Jan 2020 20:49:17 -0500
Subject: [pacman-dev] [PATCH] makepkg: fix one more file-seccomp issue
When file is called via fakeroot, it doesn't matter whether you use -z
or not, it is still incompatible with seccomp. Fix by configuring it
with FILECMD when used in the fakeroot 'tidy' run.
Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
---
scripts/libmakepkg/tidy/strip.sh.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/libmakepkg/tidy/strip.sh.in b/scripts/libmakepkg/tidy/strip.sh.in
index 1bd810f0..876f00f0 100644
--- a/scripts/libmakepkg/tidy/strip.sh.in
+++ b/scripts/libmakepkg/tidy/strip.sh.in
@@ -111,7 +111,7 @@ tidy_strip() {
local binary strip_flags
find . -type f -perm -u+w -print0 2>/dev/null | while IFS= read -rd '' binary ; do
- case "$(file -bi "$binary")" in
+ case "$(@FILECMD@ -bi "$binary")" in
*application/x-sharedlib*) # Libraries (.so)
strip_flags="$STRIP_SHARED";;
*application/x-archive*) # Libraries (.a)
--
2.24.1
......@@ -9,7 +9,7 @@ After=etc-pacman.d-gnupg.mount
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/pacman-key --init
ExecStart=/usr/bin/pacman-key --populate archlinux manjaro
ExecStart=/usr/bin/pacman-key --populate archlinux archlinuxarm manjaro manjaro-arm
[Install]
WantedBy=multi-user.target
diff -Nur a/etc/pacman.conf.in b/etc/pacman.conf.in
--- a/etc/pacman.conf.in 2013-04-30 13:05:45.000000000 +0200
+++ b/etc/pacman.conf.in 2014-12-23 11:43:38.039141449 +0100
@@ -15,6 +15,8 @@
#LogFile = @localstatedir@/log/pacman.log
#GPGDir = @sysconfdir@/pacman.d/gnupg/
HoldPkg = pacman glibc
+# If upgrades are available for these packages they will be asked for first
+SyncFirst = pacman
#XferCommand = /usr/bin/curl -L -C - -f -o %o %u
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#CleanMethod = KeepInstalled
diff -Nur a/src/pacman/conf.c b/src/pacman/conf.c
--- a/src/pacman/conf.c 2014-12-19 04:48:00.000000000 +0100
+++ b/src/pacman/conf.c 2014-12-23 11:45:05.435334649 +0100
@@ -132,6 +132,7 @@
alpm_list_free(oldconfig->explicit_removes);
FREELIST(oldconfig->holdpkg);
+ FREELIST(oldconfig->syncfirst);
FREELIST(oldconfig->ignorepkg);
FREELIST(oldconfig->ignoregrp);
FREELIST(oldconfig->assumeinstalled);
@@ -513,6 +514,8 @@
setrepeatingoption(value, "IgnoreGroup", &(config->ignoregrp));
} else if(strcmp(key, "HoldPkg") == 0) {
setrepeatingoption(value, "HoldPkg", &(config->holdpkg));
+ } else if(strcmp(key, "SyncFirst") == 0) {
+ setrepeatingoption(value, "SyncFirst", &(config->syncfirst));
} else if(strcmp(key, "CacheDir") == 0) {
setrepeatingoption(value, "CacheDir", &(config->cachedirs));
} else if(strcmp(key, "Architecture") == 0) {
diff -Nur a/src/pacman/conf.h b/src/pacman/conf.h
--- a/src/pacman/conf.h 2014-10-14 02:44:20.000000000 +0200
+++ b/src/pacman/conf.h 2014-12-23 11:45:38.021824780 +0100
@@ -99,6 +99,7 @@
/* select -Sc behavior */
unsigned short cleanmethod;
alpm_list_t *holdpkg;
+ alpm_list_t *syncfirst;
alpm_list_t *ignorepkg;
alpm_list_t *ignoregrp;
alpm_list_t *assumeinstalled;
diff -Nur a/src/pacman/sync.c b/src/pacman/sync.c
--- a/src/pacman/sync.c 2014-12-19 04:48:00.000000000 +0100
+++ b/src/pacman/sync.c 2014-12-23 11:51:26.049939350 +0100
@@ -548,6 +548,26 @@
return ret;
}
+static alpm_list_t *syncfirst(void) {
+ alpm_list_t *i, *res = NULL;
+ alpm_db_t *db_local = alpm_get_localdb(config->handle);
+ alpm_list_t *syncdbs = alpm_get_syncdbs(config->handle);
+
+ for(i = config->syncfirst; i; i = alpm_list_next(i)) {
+ const char *pkgname = i->data;
+ alpm_pkg_t *pkg = alpm_db_get_pkg(db_local, pkgname);
+ if(pkg == NULL) {
+ continue;
+ }
+
+ if(alpm_sync_get_new_version(pkg, syncdbs)) {
+ res = alpm_list_add(res, strdup(pkgname));
+ }
+ }
+
+ return res;
+}
+
static alpm_db_t *get_db(const char *dbname)
{
alpm_list_t *i;
@@ -959,6 +979,53 @@
}
}
+ /* check for syncfirsts */
+ if(!config->op_s_downloadonly && !config->print) {
+ /* check for newer versions of packages to be upgraded first */
+ alpm_list_t *i, *j, *syncfirsts = syncfirst();
+ if(syncfirsts) {
+ /* Do not ask user if all the -S targets are SyncFirst packages, see FS#15810 */
+ alpm_list_t *targets_diff = alpm_list_diff(targets, syncfirsts, (alpm_list_fn_cmp)strcmp);
+ if(config->op_s_upgrade || targets_diff) {
+ int syncfirst_ret = 1;
+ colon_printf(_("Some packages should be upgraded first...\n"));
+ if(trans_init(0, 1) == 0) {
+ for(i = syncfirsts; i; i = alpm_list_next(i)) {
+ syncfirst_ret = process_targname(alpm_get_syncdbs(config->handle), i->data, 0);
+ if (syncfirst_ret == 1) {
+ break;
+ }
+ }
+ }
+ if (syncfirst_ret == 0) {
+ syncfirst_ret = sync_prepare_execute();
+ } else {
+ trans_release();
+ }
+ if (syncfirst_ret == 0) {
+ /* reinitialize handle to take care of changes */
+ parseconfig(config->configfile);
+ /* remove syncfirsts from targets */
+ alpm_list_t *i = targets;
+ while(i) {
+ for(j = syncfirsts; j; j = alpm_list_next(j)) {
+ if(strcmp(i->data, j->data) == 0) {
+ targets = alpm_list_remove_item(targets, i);
+ break;
+ }
+ }
+ i = i->next;
+ }
+ }
+ printf("\n");
+ } else {
+ pm_printf(ALPM_LOG_DEBUG, "skipping SyncFirst\n");
+ }
+ alpm_list_free(targets_diff);
+ FREELIST(syncfirsts);
+ }
+ }
+
return sync_trans(targets);
}
......@@ -16,7 +16,7 @@
#GPGDir = /etc/pacman.d/gnupg/
HoldPkg = pacman glibc manjaro-system
# If upgrades are available for these packages they will be asked for first
SyncFirst = manjaro-system manjaro-keyring manjaro-arm-keyring
#SyncFirst = manjaro-system manjaro-keyring manjaro-arm-keyring
#XferCommand = /usr/bin/curl -C - -f %u > %o
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#CleanMethod = KeepInstalled
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment