This commit is contained in:
Ward from fusion-voyager-3 2024-07-11 03:31:13 +03:00
parent 9e08875179
commit b9fe70b6d7
9 changed files with 405 additions and 146 deletions

View File

@ -2,7 +2,7 @@
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/pika-idk-manager.iml" filepath="$PROJECT_DIR$/.idea/pika-idk-manager.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/pikman-update-manager.iml" filepath="$PROJECT_DIR$/.idea/pikman-update-manager.iml" />
</modules>
</component>
</project>

View File

@ -8,7 +8,13 @@
</component>
<component name="ChangeListManager">
<list default="true" id="df2ca9e1-e07d-43f4-bc68-0a6113fc1fa2" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/src/bin/apt/apt_full_upgrade/main.rs" beforeDir="false" afterPath="$PROJECT_DIR$/src/bin/apt/apt_full_upgrade/main.rs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Cargo.lock" beforeDir="false" afterPath="$PROJECT_DIR$/Cargo.lock" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Cargo.toml" beforeDir="false" afterPath="$PROJECT_DIR$/Cargo.toml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/locales/en_US.json" beforeDir="false" afterPath="$PROJECT_DIR$/locales/en_US.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/bin/gui/apt_update_page/mod.rs" beforeDir="false" afterPath="$PROJECT_DIR$/src/bin/gui/apt_update_page/mod.rs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/bin/gui/apt_update_page/process.rs" beforeDir="false" afterPath="$PROJECT_DIR$/src/bin/gui/apt_update_page/process.rs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/lib/pika_unixsocket_tools/mod.rs" beforeDir="false" afterPath="$PROJECT_DIR$/src/lib/pika_unixsocket_tools/mod.rs" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -43,16 +49,18 @@
&quot;keyToString&quot;: {
&quot;ASKED_ADD_EXTERNAL_FILES&quot;: &quot;true&quot;,
&quot;Cargo.Run apt_update.executor&quot;: &quot;Run&quot;,
&quot;Cargo.Run pikman-update-manager.executor&quot;: &quot;Run&quot;,
&quot;Cargo.Test pikman-update-manager.executor&quot;: &quot;Run&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;RunOnceActivity.rust.reset.selective.auto.import&quot;: &quot;true&quot;,
&quot;git-widget-placeholder&quot;: &quot;master&quot;,
&quot;last_opened_file_path&quot;: &quot;/home/ward/RustroverProjects/pika-idk-manager/src/lib&quot;,
&quot;last_opened_file_path&quot;: &quot;/home/ward/RustroverProjects/pikman-update-manager/src/lib&quot;,
&quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
&quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
&quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
&quot;org.rust.cargo.project.model.PROJECT_DISCOVERY&quot;: &quot;true&quot;,
&quot;org.rust.cargo.project.model.impl.CargoExternalSystemProjectAware.subscribe.first.balloon&quot;: &quot;&quot;,
&quot;org.rust.disableDetachedFileInspection/home/ward/RustroverProjects/pika-idk-manager/src/apt_update_progress_socket/lib.rs&quot;: &quot;true&quot;,
&quot;org.rust.disableDetachedFileInspection/home/ward/RustroverProjects/pikman-update-manager/src/apt_update_progress_socket/lib.rs&quot;: &quot;true&quot;,
&quot;org.rust.first.attach.projects&quot;: &quot;true&quot;
}
}</component>
@ -69,9 +77,9 @@
<recent name="$PROJECT_DIR$" />
</key>
</component>
<component name="RunManager" selected="Cargo.Run apt_update">
<configuration name="Run apt_update" type="CargoCommandRunConfiguration" factoryName="Cargo Command">
<option name="command" value="run --package pika-idk-manager --bin pika-idk-manager" />
<component name="RunManager" selected="Cargo.Run pikman-update-manager">
<configuration name="Build all" type="CargoCommandRunConfiguration" factoryName="Cargo Command">
<option name="command" value="build" />
<option name="workingDirectory" value="file://$PROJECT_DIR$" />
<envs />
<option name="emulateTerminal" value="true" />
@ -87,7 +95,24 @@
<option name="CARGO.BUILD_TASK_PROVIDER" enabled="true" />
</method>
</configuration>
<configuration name="Test pika-idk-manager" type="CargoCommandRunConfiguration" factoryName="Cargo Command">
<configuration name="Run pikman-update-manager" type="CargoCommandRunConfiguration" factoryName="Cargo Command">
<option name="command" value="run --package pikman-update-manager --bin pikman-update-manager" />
<option name="workingDirectory" value="file://$PROJECT_DIR$" />
<envs />
<option name="emulateTerminal" value="true" />
<option name="channel" value="DEFAULT" />
<option name="requiredFeatures" value="true" />
<option name="allFeatures" value="false" />
<option name="withSudo" value="false" />
<option name="buildTarget" value="REMOTE" />
<option name="backtrace" value="SHORT" />
<option name="isRedirectInput" value="false" />
<option name="redirectInputPath" value="" />
<method v="2">
<option name="CARGO.BUILD_TASK_PROVIDER" enabled="true" />
</method>
</configuration>
<configuration name="Test pikman-update-manager" type="CargoCommandRunConfiguration" factoryName="Cargo Command">
<option name="command" value="test --workspace" />
<option name="workingDirectory" value="file://$PROJECT_DIR$" />
<envs />
@ -104,6 +129,11 @@
<option name="CARGO.BUILD_TASK_PROVIDER" enabled="true" />
</method>
</configuration>
<list>
<item itemvalue="Cargo.Run pikman-update-manager" />
<item itemvalue="Cargo.Test pikman-update-manager" />
<item itemvalue="Cargo.Build all" />
</list>
</component>
<component name="RustProjectSettings">
<option name="toolchainHomeDirectory" value="$USER_HOME$/.cargo/bin" />
@ -133,7 +163,7 @@
<workItem from="1720556059466" duration="12649000" />
<workItem from="1720594302708" duration="52000" />
<workItem from="1720597532937" duration="7050000" />
<workItem from="1720648284536" duration="7092000" />
<workItem from="1720648284536" duration="9271000" />
</task>
<servers />
</component>

398
Cargo.lock generated
View File

@ -26,6 +26,21 @@ dependencies = [
"memchr",
]
[[package]]
name = "android-tzdata"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0"
[[package]]
name = "android_system_properties"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311"
dependencies = [
"libc",
]
[[package]]
name = "arc-swap"
version = "1.7.1"
@ -46,9 +61,9 @@ dependencies = [
[[package]]
name = "async-trait"
version = "0.1.80"
version = "0.1.81"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca"
checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107"
dependencies = [
"proc-macro2",
"quote",
@ -95,9 +110,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "bitflags"
version = "2.5.0"
version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1"
checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de"
[[package]]
name = "bstr"
@ -109,6 +124,12 @@ dependencies = [
"serde",
]
[[package]]
name = "bumpalo"
version = "3.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c"
[[package]]
name = "byteorder"
version = "1.5.0"
@ -133,11 +154,11 @@ checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9"
[[package]]
name = "cairo-rs"
version = "0.19.4"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2ac2a4d0e69036cf0062976f6efcba1aaee3e448594e6514bb2ddf87acce562"
checksum = "797fd5a634dcb0ad0d7d583df794deb0a236d88e759cd34b7da20198c6c9d145"
dependencies = [
"bitflags 2.5.0",
"bitflags 2.6.0",
"cairo-sys-rs",
"glib",
"libc",
@ -146,9 +167,9 @@ dependencies = [
[[package]]
name = "cairo-sys-rs"
version = "0.19.2"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fd3bb3119664efbd78b5e6c93957447944f16bdbced84c17a9f41c7829b81e64"
checksum = "428290f914b9b86089f60f5d8a9f6e440508e1bcff23b25afd51502b0a2da88f"
dependencies = [
"glib-sys",
"libc",
@ -157,9 +178,9 @@ dependencies = [
[[package]]
name = "cc"
version = "1.0.100"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c891175c3fb232128f48de6590095e59198bbeb8620c310be349bfc3afd12c7b"
checksum = "eaff6f8ce506b9773fa786672d63fc7a191ffea1be33f72bbd4aeacefca9ffc8"
[[package]]
name = "cfg-expr"
@ -183,6 +204,20 @@ version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "chrono"
version = "0.4.38"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401"
dependencies = [
"android-tzdata",
"iana-time-zone",
"js-sys",
"num-traits",
"wasm-bindgen",
"windows-targets 0.52.6",
]
[[package]]
name = "cloudabi"
version = "0.0.3"
@ -211,6 +246,12 @@ dependencies = [
"crossbeam-utils 0.8.20",
]
[[package]]
name = "core-foundation-sys"
version = "0.8.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f"
[[package]]
name = "crossbeam-deque"
version = "0.8.5"
@ -457,9 +498,9 @@ dependencies = [
[[package]]
name = "gdk-pixbuf"
version = "0.19.8"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "624eaba126021103c7339b2e179ae4ee8cdab842daab419040710f38ed9f8699"
checksum = "28bb53ecb56857c683c9ec859908e076dd3969c7d67598bd8b1ce095d211304a"
dependencies = [
"gdk-pixbuf-sys",
"gio",
@ -469,9 +510,9 @@ dependencies = [
[[package]]
name = "gdk-pixbuf-sys"
version = "0.19.8"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4efa05a4f83c8cc50eb4d883787b919b85e5f1d8dd10b5a1df53bf5689782379"
checksum = "9f6681a0c1330d1d3968bec1529f7172d62819ef0bdbb0d18022320654158b03"
dependencies = [
"gio-sys",
"glib-sys",
@ -482,9 +523,9 @@ dependencies = [
[[package]]
name = "gdk4"
version = "0.8.2"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "db265c9dd42d6a371e09e52deab3a84808427198b86ac792d75fd35c07990a07"
checksum = "4b7d7237c1487ed4b300aac7744efcbf1319e12d60d7afcd6f505414bd5b5dea"
dependencies = [
"cairo-rs",
"gdk-pixbuf",
@ -497,9 +538,9 @@ dependencies = [
[[package]]
name = "gdk4-sys"
version = "0.8.2"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c9418fb4e8a67074919fe7604429c45aa74eb9df82e7ca529767c6d4e9dc66dd"
checksum = "a67576c8ec012156d7f680e201a807b4432a77babb3157e0555e990ab6bcd878"
dependencies = [
"cairo-sys-rs",
"gdk-pixbuf-sys",
@ -529,9 +570,9 @@ checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd"
[[package]]
name = "gio"
version = "0.19.8"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4c49f117d373ffcc98a35d114db5478bc223341cff53e39a5d6feced9e2ddffe"
checksum = "398e3da68749fdc32783cbf7521ec3f65c9cf946db8c7774f8460af49e52c6e2"
dependencies = [
"futures-channel",
"futures-core",
@ -547,9 +588,9 @@ dependencies = [
[[package]]
name = "gio-sys"
version = "0.19.8"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2cd743ba4714d671ad6b6234e8ab2a13b42304d0e13ab7eba1dcdd78a7d6d4ef"
checksum = "e4feb96b31c32730ea3e1e89aecd2e4e37ecb1c473ad8f685e3430a159419f63"
dependencies = [
"glib-sys",
"gobject-sys",
@ -560,11 +601,11 @@ dependencies = [
[[package]]
name = "glib"
version = "0.19.9"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "39650279f135469465018daae0ba53357942a5212137515777d5fdca74984a44"
checksum = "fee90a615ce05be7a32932cfb8adf2c4bbb4700e80d37713c981fb24c0c56238"
dependencies = [
"bitflags 2.5.0",
"bitflags 2.6.0",
"futures-channel",
"futures-core",
"futures-executor",
@ -582,9 +623,9 @@ dependencies = [
[[package]]
name = "glib-macros"
version = "0.19.9"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4429b0277a14ae9751350ad9b658b1be0abb5b54faa5bcdf6e74a3372582fad7"
checksum = "4da558d8177c0c8c54368818b508a4244e1286fce2858cef4e547023f0cfa5ef"
dependencies = [
"heck",
"proc-macro-crate",
@ -595,9 +636,9 @@ dependencies = [
[[package]]
name = "glib-sys"
version = "0.19.8"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c2dc18d3a82b0006d470b13304fbbb3e0a9bd4884cf985a60a7ed733ac2c4a5"
checksum = "4958c26e5a01c9af00dea669a97369eccbec29a8e6d125c24ea2d85ee7467b60"
dependencies = [
"libc",
"system-deps",
@ -635,9 +676,9 @@ dependencies = [
[[package]]
name = "gobject-sys"
version = "0.19.8"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2e697e252d6e0416fd1d9e169bda51c0f1c926026c39ca21fbe8b1bb5c3b8b9e"
checksum = "c6908864f5ffff15b56df7e90346863904f49b949337ed0456b9287af61903b8"
dependencies = [
"glib-sys",
"libc",
@ -646,9 +687,9 @@ dependencies = [
[[package]]
name = "graphene-rs"
version = "0.19.8"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f5fb86031d24d9ec0a2a15978fc7a65d545a2549642cf1eb7c3dda358da42bcf"
checksum = "630e940ad5824f90221d6579043a9cd1f8bec86b4a17faaf7827d58eb16e8c1f"
dependencies = [
"glib",
"graphene-sys",
@ -657,9 +698,9 @@ dependencies = [
[[package]]
name = "graphene-sys"
version = "0.19.8"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2f530e0944bccba4b55065e9c69f4975ad691609191ebac16e13ab8e1f27af05"
checksum = "6fb8fade7b754982f47ebbed241fd2680816fdd4598321784da10b9e1168836a"
dependencies = [
"glib-sys",
"libc",
@ -669,9 +710,9 @@ dependencies = [
[[package]]
name = "gsk4"
version = "0.8.2"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7563884bf6939f4468e5d94654945bdd9afcaf8c3ba4c5dd17b5342b747221be"
checksum = "1f3cf2091e1af185b347b3450817d93dea6fe435df7abd4c2cd7fb5bcb4cfda8"
dependencies = [
"cairo-rs",
"gdk4",
@ -684,9 +725,9 @@ dependencies = [
[[package]]
name = "gsk4-sys"
version = "0.8.2"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23024bf2636c38bbd1f822f58acc9d1c25b28da896ff0f291a1a232d4272b3dc"
checksum = "6aa69614a26d8760c186c3690f1b0fbb917572ca23ef83137445770ceddf8cde"
dependencies = [
"cairo-sys-rs",
"gdk4-sys",
@ -700,9 +741,9 @@ dependencies = [
[[package]]
name = "gtk4"
version = "0.8.2"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b04e11319b08af11358ab543105a9e49b0c491faca35e2b8e7e36bfba8b671ab"
checksum = "eaffc6c743c9160514cc9b67eace364e5dc5798369fa809cdb04e035c21c5c5d"
dependencies = [
"cairo-rs",
"field-offset",
@ -721,9 +762,9 @@ dependencies = [
[[package]]
name = "gtk4-macros"
version = "0.8.2"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec655a7ef88d8ce9592899deb8b2d0fa50bab1e6dd69182deb764e643c522408"
checksum = "188211f546ce5801f6d0245c37b6249143a2cb4fa040e54829ca1e76796e9f09"
dependencies = [
"proc-macro-crate",
"proc-macro2",
@ -733,9 +774,9 @@ dependencies = [
[[package]]
name = "gtk4-sys"
version = "0.8.2"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8c8aa86b7f85ea71d66ea88c1d4bae1cfacf51ca4856274565133838d77e57b5"
checksum = "1114a207af8ada02cf4658a76692f4190f06f093380d5be07e3ca8b43aa7c666"
dependencies = [
"cairo-sys-rs",
"gdk-pixbuf-sys",
@ -783,6 +824,29 @@ version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024"
[[package]]
name = "iana-time-zone"
version = "0.1.60"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141"
dependencies = [
"android_system_properties",
"core-foundation-sys",
"iana-time-zone-haiku",
"js-sys",
"wasm-bindgen",
"windows-core",
]
[[package]]
name = "iana-time-zone-haiku"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f"
dependencies = [
"cc",
]
[[package]]
name = "ignore"
version = "0.4.22"
@ -834,6 +898,15 @@ version = "1.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b"
[[package]]
name = "js-sys"
version = "0.3.69"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d"
dependencies = [
"wasm-bindgen",
]
[[package]]
name = "kernel32-sys"
version = "0.2.2"
@ -852,11 +925,10 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
[[package]]
name = "libadwaita"
version = "0.6.0"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91b4990248b9e1ec5e72094a2ccaea70ec3809f88f6fd52192f2af306b87c5d9"
checksum = "2ff9c222b5c783729de45185f07b2fec2d43a7f9c63961e777d3667e20443878"
dependencies = [
"gdk-pixbuf",
"gdk4",
"gio",
"glib",
@ -868,9 +940,9 @@ dependencies = [
[[package]]
name = "libadwaita-sys"
version = "0.6.0"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23a748e4e92be1265cd9e93d569c0b5dfc7814107985aa6743d670ab281ea1a8"
checksum = "1c44d8bdbad31d6639e1f20cc9c1424f1a8e02d751fc28d44659bf743fb9eca6"
dependencies = [
"gdk4-sys",
"gio-sys",
@ -930,9 +1002,9 @@ dependencies = [
[[package]]
name = "log"
version = "0.4.21"
version = "0.4.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c"
checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
[[package]]
name = "maybe-uninit"
@ -1037,6 +1109,15 @@ dependencies = [
"windows-sys 0.52.0",
]
[[package]]
name = "num-traits"
version = "0.2.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
dependencies = [
"autocfg",
]
[[package]]
name = "num_cpus"
version = "1.16.0"
@ -1049,9 +1130,9 @@ dependencies = [
[[package]]
name = "object"
version = "0.36.0"
version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434"
checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce"
dependencies = [
"memchr",
]
@ -1064,9 +1145,9 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
[[package]]
name = "pango"
version = "0.19.8"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f0d328648058085cfd6897c9ae4272884098a926f3a833cd50c8c73e6eccecd"
checksum = "54768854025df6903061d0084fd9702a253ddfd60db7d9b751d43b76689a7f0a"
dependencies = [
"gio",
"glib",
@ -1076,9 +1157,9 @@ dependencies = [
[[package]]
name = "pango-sys"
version = "0.19.8"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ff03da4fa086c0b244d4a4587d3e20622a3ecdb21daea9edf66597224c634ba0"
checksum = "b07cc57d10cee4ec661f718a6902cee18c2f4cfae08e87e5a390525946913390"
dependencies = [
"glib-sys",
"gobject-sys",
@ -1138,7 +1219,7 @@ dependencies = [
"libc",
"redox_syscall 0.5.2",
"smallvec 1.13.2",
"windows-targets 0.52.5",
"windows-targets 0.52.6",
]
[[package]]
@ -1148,14 +1229,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
[[package]]
name = "pika-idk-manager"
name = "pikman-update-manager"
version = "0.1.0"
dependencies = [
"async-channel",
"async-trait",
"chrono",
"crossbeam-utils 0.8.20",
"futures 0.3.30",
"gtk4",
"libadwaita",
"lock_api 0.4.12",
"pretty-bytes",
"rust-apt",
"rust-i18n",
@ -1232,7 +1316,7 @@ version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd"
dependencies = [
"bitflags 2.5.0",
"bitflags 2.6.0",
]
[[package]]
@ -1267,7 +1351,7 @@ checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b"
[[package]]
name = "rust-apt"
version = "0.7.0"
source = "git+https://gitlab.com/volian/rust-apt#31d5a9ebe4e9e08ec28b080e36dd7f1c3e7dd17b"
source = "git+https://gitlab.com/volian/rust-apt#89f7f127b3af5595bec61ab520a813d8bf9fc502"
dependencies = [
"cxx",
"cxx-build",
@ -1356,7 +1440,7 @@ version = "0.38.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f"
dependencies = [
"bitflags 2.5.0",
"bitflags 2.6.0",
"errno",
"libc",
"linux-raw-sys",
@ -1413,18 +1497,18 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
[[package]]
name = "serde"
version = "1.0.203"
version = "1.0.204"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094"
checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.203"
version = "1.0.204"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba"
checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222"
dependencies = [
"proc-macro2",
"quote",
@ -1433,9 +1517,9 @@ dependencies = [
[[package]]
name = "serde_json"
version = "1.0.118"
version = "1.0.120"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d947f6b3163d8857ea16c4fa0dd4840d52f3041039a85decd46867eb1abef2e4"
checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5"
dependencies = [
"itoa",
"ryu",
@ -1514,9 +1598,9 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
[[package]]
name = "syn"
version = "2.0.68"
version = "2.0.70"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9"
checksum = "2f0209b68b3613b093e0ec905354eccaedcfe83b8cb37cbdeae64026c3064c16"
dependencies = [
"proc-macro2",
"quote",
@ -1525,22 +1609,22 @@ dependencies = [
[[package]]
name = "system-deps"
version = "6.2.2"
version = "7.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349"
checksum = "6c81f13d9a334a6c242465140bd262fae382b752ff2011c4f7419919a9c97922"
dependencies = [
"cfg-expr",
"heck",
"pkg-config",
"toml 0.8.2",
"toml 0.8.14",
"version-compare",
]
[[package]]
name = "target-lexicon"
version = "0.12.14"
version = "0.12.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f"
checksum = "4873307b7c257eddcb50c9bedf158eb669578359fb28428bef438fec8e6ba7c2"
[[package]]
name = "termcolor"
@ -1704,14 +1788,14 @@ dependencies = [
[[package]]
name = "toml"
version = "0.8.2"
version = "0.8.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d"
checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335"
dependencies = [
"serde",
"serde_spanned",
"toml_datetime",
"toml_edit 0.20.2",
"toml_edit 0.22.15",
]
[[package]]
@ -1733,20 +1817,7 @@ dependencies = [
"serde",
"serde_spanned",
"toml_datetime",
"winnow",
]
[[package]]
name = "toml_edit"
version = "0.20.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338"
dependencies = [
"indexmap 2.2.6",
"serde",
"serde_spanned",
"toml_datetime",
"winnow",
"winnow 0.5.40",
]
[[package]]
@ -1757,7 +1828,20 @@ checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1"
dependencies = [
"indexmap 2.2.6",
"toml_datetime",
"winnow",
"winnow 0.5.40",
]
[[package]]
name = "toml_edit"
version = "0.22.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d59a3a72298453f564e2b111fa896f8d07fabb36f51f06d7e875fc5e0b5a3ef1"
dependencies = [
"indexmap 2.2.6",
"serde",
"serde_spanned",
"toml_datetime",
"winnow 0.6.13",
]
[[package]]
@ -1805,6 +1889,60 @@ version = "0.11.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
[[package]]
name = "wasm-bindgen"
version = "0.2.92"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8"
dependencies = [
"cfg-if 1.0.0",
"wasm-bindgen-macro",
]
[[package]]
name = "wasm-bindgen-backend"
version = "0.2.92"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da"
dependencies = [
"bumpalo",
"log",
"once_cell",
"proc-macro2",
"quote",
"syn",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-macro"
version = "0.2.92"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
]
[[package]]
name = "wasm-bindgen-macro-support"
version = "0.2.92"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7"
dependencies = [
"proc-macro2",
"quote",
"syn",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-shared"
version = "0.2.92"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96"
[[package]]
name = "winapi"
version = "0.2.8"
@ -1848,6 +1986,15 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "windows-core"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
dependencies = [
"windows-targets 0.52.6",
]
[[package]]
name = "windows-sys"
version = "0.48.0"
@ -1863,7 +2010,7 @@ version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
dependencies = [
"windows-targets 0.52.5",
"windows-targets 0.52.6",
]
[[package]]
@ -1883,18 +2030,18 @@ dependencies = [
[[package]]
name = "windows-targets"
version = "0.52.5"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb"
checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
dependencies = [
"windows_aarch64_gnullvm 0.52.5",
"windows_aarch64_msvc 0.52.5",
"windows_i686_gnu 0.52.5",
"windows_aarch64_gnullvm 0.52.6",
"windows_aarch64_msvc 0.52.6",
"windows_i686_gnu 0.52.6",
"windows_i686_gnullvm",
"windows_i686_msvc 0.52.5",
"windows_x86_64_gnu 0.52.5",
"windows_x86_64_gnullvm 0.52.5",
"windows_x86_64_msvc 0.52.5",
"windows_i686_msvc 0.52.6",
"windows_x86_64_gnu 0.52.6",
"windows_x86_64_gnullvm 0.52.6",
"windows_x86_64_msvc 0.52.6",
]
[[package]]
@ -1905,9 +2052,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.52.5"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263"
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
[[package]]
name = "windows_aarch64_msvc"
@ -1917,9 +2064,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
[[package]]
name = "windows_aarch64_msvc"
version = "0.52.5"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6"
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
[[package]]
name = "windows_i686_gnu"
@ -1929,15 +2076,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
[[package]]
name = "windows_i686_gnu"
version = "0.52.5"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670"
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
[[package]]
name = "windows_i686_gnullvm"
version = "0.52.5"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9"
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
[[package]]
name = "windows_i686_msvc"
@ -1947,9 +2094,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
[[package]]
name = "windows_i686_msvc"
version = "0.52.5"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf"
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
[[package]]
name = "windows_x86_64_gnu"
@ -1959,9 +2106,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
[[package]]
name = "windows_x86_64_gnu"
version = "0.52.5"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9"
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
[[package]]
name = "windows_x86_64_gnullvm"
@ -1971,9 +2118,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.52.5"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596"
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
[[package]]
name = "windows_x86_64_msvc"
@ -1983,9 +2130,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
[[package]]
name = "windows_x86_64_msvc"
version = "0.52.5"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0"
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
[[package]]
name = "winnow"
@ -1996,6 +2143,15 @@ dependencies = [
"memchr",
]
[[package]]
name = "winnow"
version = "0.6.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1"
dependencies = [
"memchr",
]
[[package]]
name = "ws2_32-sys"
version = "0.2.1"

View File

@ -1,5 +1,5 @@
[package]
name = "pika-idk-manager"
name = "pikman-update-manager"
version = "0.1.0"
edition = "2021"
@ -9,7 +9,7 @@ name = "pika_unixsocket_tools"
path = "src/lib/lib.rs"
[[bin]]
name = "pika-idk-manager"
name = "pikman-update-manager"
path = "src/bin/gui/main.rs"
[[bin]]
@ -21,8 +21,8 @@ name = "apt_full_upgrade"
path = "src/bin/apt/apt_full_upgrade/main.rs"
[dependencies]
adw = { version = "0.6.0", package = "libadwaita", features = ["v1_4"] }
gtk = { version = "0.8.2", package = "gtk4", features = ["v4_12"] }
adw = { version = "0.7.0", package = "libadwaita", features = ["v1_4"] }
gtk = { version = "0.9.0", package = "gtk4", features = ["v4_12"] }
async-channel = "2.1.1"
rust-i18n = "3.0.1"
rust-apt = { git = "https://gitlab.com/volian/rust-apt" }
@ -33,3 +33,7 @@ serde_json = "1.0.118"
async-trait = "0.1.80"
futures = "0.3.30"
pretty-bytes = "0.2.2"
crossbeam-utils = "0.8.20"
chrono = "0.4.38"
lock_api = "0.4.2"

View File

@ -1,5 +1,5 @@
{
"application_name": "Pika IDK yet Manager",
"application_name": "Pikman Update Manager",
"installed_version_badge_text": "Installed",
"candidate_version_badge_text": "Upgradable",
"arch_label_label": "Arch"

View File

@ -51,7 +51,7 @@ pub fn apt_update_page(
let excluded_updates_vec: Rc<RefCell<Vec<String>>> = Rc::new(RefCell::new(Vec::new()));
thread::spawn(move || {
Runtime::new().unwrap().block_on(start_socket_server(
Runtime::new().unwrap().block_on(start_socket_server_no_log(
update_percent_sender,
"/tmp/pika_apt_update_percent.sock",
));
@ -61,12 +61,13 @@ pub fn apt_update_page(
Runtime::new().unwrap().block_on(start_socket_server(
update_status_sender,
"/tmp/pika_apt_update_status.sock",
"/var/log/pika-apt-update.log"
));
});
thread::spawn(move || {
let apt_update_command = Command::new("pkexec")
.args(["/home/ward/RustroverProjects/pika-idk-manager/target/debug/apt_update"])
.args(["/home/ward/RustroverProjects/pikman-update-manager/target/debug/apt_update"])
.status()
.unwrap();
match apt_update_command.code().unwrap() {

View File

@ -1,7 +1,7 @@
use adw::prelude::*;
use gtk::glib::*;
use gtk::*;
use pika_unixsocket_tools::pika_unixsocket_tools::start_socket_server;
use pika_unixsocket_tools::pika_unixsocket_tools::{start_socket_server, start_socket_server_no_log};
use pretty_bytes::converter::convert;
use rust_apt::cache::Upgrade;
use rust_apt::new_cache;
@ -289,7 +289,7 @@ fn apt_full_upgrade_from_socket(window: adw::ApplicationWindow) {
let upgrade_status_sender_clone0 = upgrade_status_sender.clone();
thread::spawn(move || {
Runtime::new().unwrap().block_on(start_socket_server(
Runtime::new().unwrap().block_on(start_socket_server_no_log(
upgrade_percent_sender,
"/tmp/pika_apt_upgrade_percent.sock",
));
@ -299,12 +299,13 @@ fn apt_full_upgrade_from_socket(window: adw::ApplicationWindow) {
Runtime::new().unwrap().block_on(start_socket_server(
upgrade_status_sender,
"/tmp/pika_apt_upgrade_status.sock",
"/var/log/pika-apt-upgrade.log"
));
});
thread::spawn(move || {
let apt_upgrade_command = Command::new("pkexec")
.args(["/home/ward/RustroverProjects/pika-idk-manager/target/debug/apt_full_upgrade"])
.args(["/home/ward/RustroverProjects/pikman-update-manager/target/debug/apt_full_upgrade"])
.status()
.unwrap();
match apt_upgrade_command.code().unwrap() {

View File

@ -1,8 +1,10 @@
use std::fs;
use std::path::Path;
use rust_i18n::t;
use tokio::io::{AsyncReadExt, AsyncWriteExt};
use tokio::net::{UnixListener, UnixStream};
use tokio::task;
use chrono;
pub async fn send_successful_to_socket(socket_path: &str) {
// Connect to the Unix socket
@ -35,16 +37,32 @@ pub async fn send_failed_to_socket(socket_path: &str) {
}
// Function to handle a single client connection
pub async fn handle_client(mut stream: UnixStream, buffer_sender: async_channel::Sender<String>) {
pub async fn handle_client(mut stream: UnixStream, buffer_sender: async_channel::Sender<String>, log_file_path: String) {
// Buffer to store incoming data
let mut buffer = [0; 1024];
let mut enable_log = true;
// Remove existing log file if exists
if Path::new(&log_file_path).exists() {
match std::fs::remove_file(&log_file_path) {
Ok(_) => {}
Err(_) => {
enable_log = false;
eprintln!("Warning: {} file couldn't be deleted, logging disabled", log_file_path);
}
};
}
// Read data from the stream
match stream.read(&mut buffer).await {
Ok(size) => {
// Print the received message
let message = String::from_utf8_lossy(&buffer[..size]).to_string();
// Write to log file
// Send to async buffer sender
buffer_sender
.send_blocking(String::from_utf8_lossy(&buffer[..size]).to_string())
.send_blocking(message)
.expect("Buffer channel closed")
}
Err(e) => {
@ -54,7 +72,7 @@ pub async fn handle_client(mut stream: UnixStream, buffer_sender: async_channel:
}
}
pub async fn start_socket_server(buffer_sender: async_channel::Sender<String>, socket_path: &str) {
pub async fn start_socket_server(buffer_sender: async_channel::Sender<String>, socket_path: &str, log_file_path: &str) {
// Remove the socket file if it already exists
if Path::new(socket_path).exists() {
fs::remove_file(socket_path).expect("Could not remove existing socket file");
@ -71,7 +89,56 @@ pub async fn start_socket_server(buffer_sender: async_channel::Sender<String>, s
match listener.accept().await {
Ok((stream, _)) => {
// Handle the connection in a separate task
task::spawn(handle_client(stream, buffer_sender.clone()));
task::spawn(handle_client(stream, buffer_sender.clone(), log_file_path.to_owned()));
}
Err(e) => {
// Print error message if a connection fails
eprintln!("Connection failed: {}", e);
}
}
}
}
pub async fn handle_client_no_log(mut stream: UnixStream, buffer_sender: async_channel::Sender<String>) {
// Buffer to store incoming data
let mut buffer = [0; 1024];
// Read data from the stream
match stream.read(&mut buffer).await {
Ok(size) => {
let message = String::from_utf8_lossy(&buffer[..size]).to_string();
// Write to log file
// Send to async buffer sender
buffer_sender
.send_blocking(message)
.expect("Buffer channel closed")
}
Err(e) => {
// Print error message if reading fails
eprintln!("Failed to read from stream: {}", e);
}
}
}
pub async fn start_socket_server_no_log(buffer_sender: async_channel::Sender<String>, socket_path: &str) {
// Remove the socket file if it already exists
if Path::new(socket_path).exists() {
fs::remove_file(socket_path).expect("Could not remove existing socket file");
}
// Bind the Unix listener to the socket path
let listener = UnixListener::bind(socket_path).expect("Could not bind");
println!("Server listening on {}", socket_path);
// Loop to accept incoming connections
loop {
// Accept an incoming connection
match listener.accept().await {
Ok((stream, _)) => {
// Handle the connection in a separate task
task::spawn(crate::pika_unixsocket_tools::handle_client_no_log(stream, buffer_sender.clone()));
}
Err(e) => {
// Print error message if a connection fails