Add make script
This commit is contained in:
parent
c2010b7136
commit
a16485f28a
27
Makefile
27
Makefile
@ -11,15 +11,19 @@ install:
|
||||
mkdir -p $(DESTDIR)/usr/share/glib-2.0/schemas/
|
||||
mkdir -p $(DESTDIR)/usr/share/applications
|
||||
mkdir -p $(DESTDIR)/usr/share/icons/hicolor/scalable/apps
|
||||
cp -vf target/release/pikman-update-manager $(DESTDIR)/usr/bin/
|
||||
cp -vf target/release/apt_update $(DESTDIR)/usr/lib/pika/pikman-update-manager/scripts/
|
||||
cp -vf target/release/apt_full_upgrade $(DESTDIR)/usr/lib/pika/pikman-update-manager/scripts/
|
||||
cp -vf data/wget.sh $(DESTDIR)/usr/lib/pika/pikman-update-manager/scripts/
|
||||
cp -vf target/debug/pikman-update-manager $(DESTDIR)/usr/bin/
|
||||
cp -vf data/flatpak-installer $(DESTDIR)/usr/bin/
|
||||
cp -vf data/software-properties-gtk $(DESTDIR)/usr/bin/
|
||||
cp -vf target/debug/apt_update $(DESTDIR)/usr/lib/pika/pikman-update-manager/scripts/
|
||||
cp -vf target/debug/apt_full_upgrade $(DESTDIR)/usr/lib/pika/pikman-update-manager/scripts/
|
||||
cp -vf data/modify_repo.sh $(DESTDIR)/usr/lib/pika/pikman-update-manager/scripts/
|
||||
cp -vf data/*.gschema.xml $(DESTDIR)/usr/share/glib-2.0/schemas/
|
||||
#cp -vf data/com.github.pikaos-linux.pikagnomelayouts.desktop $(DESTDIR)/usr/share/applications/
|
||||
#cp -vfr data/polkit-1 $(DESTDIR)/usr/share/
|
||||
chmod 755 $(DESTDIR)/usr/bin/pika/pikman-update-manager
|
||||
cp -vf data/com.github.pikaos-linux.pikmanupdatemanager.svg $(DESTDIR)/usr/share/icons/hicolor/scalable/apps/
|
||||
cp -vf data/*.desktop $(DESTDIR)/usr/share/applications/
|
||||
cp -vfr data/polkit-1 $(DESTDIR)/usr/share/
|
||||
chmod 755 $(DESTDIR)/usr/bin/pikman-update-manager
|
||||
chmod 755 $(DESTDIR)/usr/bin/flatpak-installer
|
||||
chmod 755 $(DESTDIR)/usr/bin/software-properties-gtk
|
||||
chmod 755 $(DESTDIR)/usr/lib/pika/pikman-update-manager/scripts/*
|
||||
|
||||
install_no_build_debug:
|
||||
@ -29,11 +33,16 @@ install_no_build_debug:
|
||||
mkdir -p $(DESTDIR)/usr/share/applications
|
||||
mkdir -p $(DESTDIR)/usr/share/icons/hicolor/scalable/apps
|
||||
cp -vf target/debug/pikman-update-manager $(DESTDIR)/usr/bin/
|
||||
cp -vf data/flatpak-installer $(DESTDIR)/usr/bin/
|
||||
cp -vf data/software-properties-gtk $(DESTDIR)/usr/bin/
|
||||
cp -vf target/debug/apt_update $(DESTDIR)/usr/lib/pika/pikman-update-manager/scripts/
|
||||
cp -vf target/debug/apt_full_upgrade $(DESTDIR)/usr/lib/pika/pikman-update-manager/scripts/
|
||||
cp -vf data/modify_repo.sh $(DESTDIR)/usr/lib/pika/pikman-update-manager/scripts/
|
||||
cp -vf data/*.gschema.xml $(DESTDIR)/usr/share/glib-2.0/schemas/
|
||||
#cp -vf data/com.github.pikaos-linux.pikagnomelayouts.desktop $(DESTDIR)/usr/share/applications/
|
||||
#cp -vfr data/polkit-1 $(DESTDIR)/usr/share/
|
||||
cp -vf data/com.github.pikaos-linux.pikmanupdatemanager.svg $(DESTDIR)/usr/share/icons/hicolor/scalable/apps/
|
||||
cp -vf data/*.desktop $(DESTDIR)/usr/share/applications/
|
||||
cp -vfr data/polkit-1 $(DESTDIR)/usr/share/
|
||||
chmod 755 $(DESTDIR)/usr/bin/pikman-update-manager
|
||||
chmod 755 $(DESTDIR)/usr/bin/flatpak-installer
|
||||
chmod 755 $(DESTDIR)/usr/bin/software-properties-gtk
|
||||
chmod 755 $(DESTDIR)/usr/lib/pika/pikman-update-manager/scripts/*
|
9
data/com.github.pikaos-linux.pikmanupdatemanager.desktop
Normal file
9
data/com.github.pikaos-linux.pikmanupdatemanager.desktop
Normal file
@ -0,0 +1,9 @@
|
||||
[Desktop Entry]
|
||||
Name=Pikman Update Manager
|
||||
Exec=pikman-update-manager
|
||||
Icon=com.github.pikaos-linux.pikmanupdatemanager
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Encoding=UTF-8
|
||||
Categories=GNOME;GTK;Settings;X-GNOME-SystemSettings;X-GNOME-Settings-Panel;X-Unity-Settings-Panel;
|
||||
StartupNotify=true
|
17
data/com.github.pikaos-linux.pikmanupdatemanager.svg
Normal file
17
data/com.github.pikaos-linux.pikmanupdatemanager.svg
Normal file
@ -0,0 +1,17 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" version="1">
|
||||
<g style="opacity:0.2" transform="matrix(2,0,0,2,0,-1)">
|
||||
<circle cx="16" cy="17" r="14"/>
|
||||
<path style="fill:none;stroke:#000000;stroke-linejoin:round" d="M 29.5,20.5 H 23.5 L 29.5,26.5 Z"/>
|
||||
</g>
|
||||
<path style="fill:#fbc02d" d="M 7.7514,18 A 28,28 0 0 1 46,7.7514 28,28 0 0 1 56.249,46 L 32,32 Z"/>
|
||||
<path style="fill:#ff9932" d="M 56.249,46 A 28,28 0 0 1 32,60 28,28 0 0 1 7.7512,46 28,28 0 0 1 7.7514,18"/>
|
||||
<circle style="fill:#3f3f3f" cx="32" cy="32" r="22"/>
|
||||
<path style="opacity:0.2" d="M 32 10 A 22 22 0 0 0 10 32 A 22 22 0 0 0 10.035 32.5 A 22 22 0 0 1 32 11 A 22 22 0 0 1 53.98 32.262 A 22 22 0 0 0 54 32 A 22 22 0 0 0 32 10 z"/>
|
||||
<path style="opacity:0.2;stroke:#000000;stroke-width:2;stroke-linejoin:round" d="M 5,14 V 26 H 17 Z"/>
|
||||
<rect style="fill:#fac02d" width="14" height="2" x="20" y="31" rx="1" ry="1"/>
|
||||
<path style="fill:#ff9932;stroke:#ff9932;stroke-width:2;stroke-linejoin:round" d="M 59,39 H 47 L 59,51 Z"/>
|
||||
<path style="fill:#fbc02d;stroke:#fbc02d;stroke-width:2;stroke-linejoin:round" d="M 5,13 V 25 H 17 Z"/>
|
||||
<rect style="fill:none;stroke:#ff9932;stroke-width:3;stroke-linejoin:round" width="29" height="7" x="17.5" y="28.5" rx="3.5" ry="3.5"/>
|
||||
<path style="opacity:0.2;fill:#ffffff" d="M 32 4 C 22.95 4.038 14.416 8.366 9.193 15.756 L 5.707 12.293 C 5.519 12.106 5.265 12 5 12 C 4.869 12 4.739 12.026 4.617 12.076 C 4.244 12.231 4 12.596 4 13 L 4 14 C 4 13.596 4.244 13.231 4.617 13.076 C 4.991 12.921 5.421 13.007 5.707 13.293 L 9.24 16.826 C 14.469 9.437 22.948 5.031 32 5 C 47.17 5.004 59.577 17.088 59.982 32.252 L 60 32 C 60 16.536 47.464 4 32 4 z M 10.035 32.5 A 22 22 0 0 0 10 33 A 22 22 0 0 0 32 55 A 22 22 0 0 0 50.865 44.279 L 50.457 43.871 A 22 22 0 0 1 32 54 A 22 22 0 0 1 10.035 32.5 z M 47 38 A 1 1 0 0 0 46.154 39.5 A 1 1 0 0 1 47 39 L 59 39 A 1 1 0 0 1 60 40 L 60 39 A 1 1 0 0 0 59 38 L 47 38 z"/>
|
||||
<path style="fill:#ffffff;opacity:0.2" d="M 21 27 C 18.256 27 16 29.256 16 32 C 16 32.166 16.009 32.33 16.025 32.492 C 16.283 29.983 18.428 28 21 28 L 43 28 C 45.572 28 47.717 29.983 47.975 32.492 C 47.991 32.33 48 32.166 48 32 C 48 29.256 45.744 27 43 27 L 21 27 z M 19.061 32.5 C 19.022 32.659 19 32.826 19 33 C 19 34.134 19.866 35 21 35 L 43 35 C 44.134 35 45 34.134 45 33 C 45 32.826 44.978 32.659 44.939 32.5 C 44.726 33.379 43.96 34 43 34 L 21 34 C 20.04 34 19.274 33.379 19.061 32.5 z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 2.4 KiB |
2
data/flatpak-installer
Normal file
2
data/flatpak-installer
Normal file
@ -0,0 +1,2 @@
|
||||
#! /bin/bash
|
||||
pikman-update-manager --flatpak-installer "$@"
|
13
data/flatpak-installer.desktop
Normal file
13
data/flatpak-installer.desktop
Normal file
@ -0,0 +1,13 @@
|
||||
[Desktop Entry]
|
||||
Name=Flatpak Installer
|
||||
GenericName=Flatpak Installer
|
||||
Comment=Easily install Flatpaks
|
||||
Categories=GNOME;GTK;Settings;X-GNOME-SystemSettings;X-GNOME-Settings-Panel;X-Unity-Settings-Panel;
|
||||
Exec=flatpak-installer %s
|
||||
Icon=com.github.pikaos-linux.pikmanupdatemanager
|
||||
MimeType=application/vnd.flatpak.ref;
|
||||
Terminal=false
|
||||
Type=Application
|
||||
X-GNOME-Gettext-Domain=com.github.pikaos-linux.pikmanupdatemanager
|
||||
Keywords=Python;
|
||||
NoDisplay=true
|
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE policyconfig PUBLIC
|
||||
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
|
||||
"http://www.freedesktop.org/software/polkit/policyconfig-1.dtd">
|
||||
<policyconfig>
|
||||
|
||||
<action id="com.github.pikaos-linux.pikmanupdatemanager.modify.repo">
|
||||
<message>Authentication is required to modify APT sources</message>
|
||||
<icon_name>com.github.pikaos-linux.pika-kernel-manager</icon_name>
|
||||
<defaults>
|
||||
<allow_any>yes</allow_any>
|
||||
<allow_inactive>yes</allow_inactive>
|
||||
<allow_active>yes</allow_active>
|
||||
</defaults>
|
||||
<annotate key="org.freedesktop.policykit.exec.path">/usr/lib/pika/pikman-update-manager/scripts/modify_repo.sh</annotate>
|
||||
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
|
||||
</action>
|
||||
|
||||
</policyconfig>
|
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE policyconfig PUBLIC
|
||||
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
|
||||
"http://www.freedesktop.org/software/polkit/policyconfig-1.dtd">
|
||||
<policyconfig>
|
||||
|
||||
<action id="com.github.pikaos-linux.pikmanupdatemanager.update.manager">
|
||||
<message>Authentication is required to update the APT cache</message>
|
||||
<icon_name>com.github.pikaos-linux.pika-kernel-manager</icon_name>
|
||||
<defaults>
|
||||
<allow_any>yes</allow_any>
|
||||
<allow_inactive>yes</allow_inactive>
|
||||
<allow_active>yes</allow_active>
|
||||
</defaults>
|
||||
<annotate key="org.freedesktop.policykit.exec.path">/usr/lib/pika/pikman-update-manager/scripts/apt_update</annotate>
|
||||
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
|
||||
</action>
|
||||
|
||||
</policyconfig>
|
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE policyconfig PUBLIC
|
||||
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
|
||||
"http://www.freedesktop.org/software/polkit/policyconfig-1.dtd">
|
||||
<policyconfig>
|
||||
|
||||
<action id="com.github.pikaos-linux.pikmanupdatemanager.upgrade.manager">
|
||||
<message>Authentication is required to upgrade APT packages</message>
|
||||
<icon_name>com.github.pikaos-linux.pika-kernel-manager</icon_name>
|
||||
<defaults>
|
||||
<allow_any>yes</allow_any>
|
||||
<allow_inactive>yes</allow_inactive>
|
||||
<allow_active>yes</allow_active>
|
||||
</defaults>
|
||||
<annotate key="org.freedesktop.policykit.exec.path">/usr/lib/pika/pikman-update-manager/scripts/apt_full_upgrade</annotate>
|
||||
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
|
||||
</action>
|
||||
|
||||
</policyconfig>
|
2
data/software-properties-gtk
Normal file
2
data/software-properties-gtk
Normal file
@ -0,0 +1,2 @@
|
||||
#! /bin/bash
|
||||
pikman-update-manager --software-properties "$@"
|
43
data/software-properties-gtk.desktop
Normal file
43
data/software-properties-gtk.desktop
Normal file
@ -0,0 +1,43 @@
|
||||
[Desktop Entry]
|
||||
Name=Software & Updates (Repositary Management)
|
||||
GenericName=Software & Updates (Repositary Management)
|
||||
Comment=Configure the sources for installable software and updates
|
||||
Comment[cs]=Konfigurovat zdroje pro instalovatelný software a aktualizace
|
||||
Comment[da]=Konfigurér kilderne for installérbar software og opdateringer
|
||||
Comment[de]=Quellen zum Installieren von Software und Aktualisierungen einrichten
|
||||
Comment[el]=Ρύθμιση των πηγών για λογισμικό και ενημερώσεις
|
||||
Comment[en_AU]=Configure the sources for installable software and updates
|
||||
Comment[en_GB]=Configure the sources for installable software and updates
|
||||
Comment[es]=Configura los orígenes para el software instalable y las actualizaciones
|
||||
Comment[fi]=Muokkaa asennettavien ohjelmien ja päivitysten lähteitä
|
||||
Comment[fr]=Configurer les canaux logiciels (sources de mise à jour) et les mises à jour via Internet
|
||||
Comment[gl]=Configurar as fontes para programas e actualizacións instalables
|
||||
Comment[he]=הגדרת מקורות התוכנות להתקנה והעדכונים
|
||||
Comment[hr]=Podesi repozitorije i nadogradnje
|
||||
Comment[hu]=Telepíthető szoftverek és frissítések forrásának beállítása
|
||||
Comment[it]=Configura le sorgenti per gli aggiornamenti e per il software installabile
|
||||
Comment[ka]=პროგრამების დაყენებისა და განახლების წყაროების კონფიგურირება
|
||||
Comment[ko]=설치할 수 있는 소프트웨어와 업데이트를 위한 소스를 설정
|
||||
Comment[ku]=Ji bo nivîsbarî û rojanekirinên têne sazkirin çavkaniyan veava bike
|
||||
Comment[nl]=Softwarekanalen en internet-updates configureren
|
||||
Comment[pl]=Konfiguruj źródła pakietów oprogramowania i aktualizacji
|
||||
Comment[pt]=Configurar os repositórios de software e actualizações instaláveis
|
||||
Comment[pt_BR]=Configurar as fontes de aplicativos e atualizações
|
||||
Comment[ro]=Configurează sursele pentru software instalabil şi actualizări
|
||||
Comment[ru]=Настроить источники установки программ и обновлений
|
||||
Comment[sv]=Konfigurera källorna för installerbara programvaror och uppdateringar
|
||||
Comment[th]=ปรับแต่งแหล่งสำหรับซอฟต์แวร์และปรับปรุงที่ติดตั้งได้
|
||||
Comment[tr]=Kurulabilir yazılım ve güncellemeler için kaynakları yapılandır
|
||||
Comment[zh_CN]=设定可安装和升级的源
|
||||
Comment[zh_TW]=設置可安裝的軟體及更新部份之來源。
|
||||
Keywords=Drivers;Repositories;Repository;PPA;
|
||||
Exec=software-properties-gtk
|
||||
Icon=software-properties
|
||||
Terminal=false
|
||||
X-MultipleArgs=false
|
||||
Type=Application
|
||||
Categories=GNOME;GTK;Settings;X-GNOME-SystemSettings;X-GNOME-Settings-Panel;X-Unity-Settings-Panel;
|
||||
X-GNOME-Settings-Panel=software-properties
|
||||
X-Unity-Settings-Panel=software-properties
|
||||
MimeType=text/x-apt-sources-list;
|
||||
X-Ubuntu-Gettext-Domain=software-properties
|
@ -1,91 +0,0 @@
|
||||
#! /bin/python3
|
||||
|
||||
import socket
|
||||
import os
|
||||
|
||||
import sys
|
||||
import time
|
||||
|
||||
import apt_pkg
|
||||
|
||||
import apt
|
||||
import apt.progress.base
|
||||
|
||||
def get_change(current, total):
|
||||
if current == total:
|
||||
return 100.0
|
||||
try:
|
||||
return float("{:.1f}".format(((current * 100) / total)))
|
||||
except ZeroDivisionError:
|
||||
return 0.0
|
||||
|
||||
class UpdateProgressSocket(apt.progress.base.AcquireProgress):
|
||||
# Init
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
# Start
|
||||
def start(self):
|
||||
self.current_bytes = 0
|
||||
self.total_bytes = 0
|
||||
print("Starting APT Cache Update.")
|
||||
return super().start()
|
||||
|
||||
# Stop
|
||||
def stop(self):
|
||||
print("\nAPT Cache Update Complete!")
|
||||
return super().stop()
|
||||
|
||||
# Progrss pulse
|
||||
def pulse(self, owner):
|
||||
# Calculate current progress percentage
|
||||
progress_percent = get_change(self.current_bytes, self.total_bytes)
|
||||
|
||||
# apt_update_progress ipc sock
|
||||
socket_path = "/tmp/pika_apt_update.sock"
|
||||
|
||||
# Create a Unix domain socket
|
||||
with socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) as client:
|
||||
client.connect(socket_path)
|
||||
# Send percentage to socket as UTF-8
|
||||
client.sendall(str(progress_percent).encode('utf-8'))
|
||||
|
||||
#response = client.recv(1024)
|
||||
#print(f"Received: {response.decode('utf-8')}")
|
||||
|
||||
return True
|
||||
|
||||
|
||||
def fail(self, item):
|
||||
print("Failure at: %s %s" % (item.uri, item.shortdesc))
|
||||
|
||||
def fetch(self, item):
|
||||
print("Fetch: %s %s" % (item.uri, item.shortdesc))
|
||||
|
||||
def ims_hit(self, item):
|
||||
print("Download: %s %s" % (item.uri, item.shortdesc))
|
||||
|
||||
def media_change(self, medium, drive):
|
||||
print(f"Please insert medium {medium} in drive {drive}")
|
||||
sys.stdin.readline()
|
||||
# return False
|
||||
|
||||
def update_cache():
|
||||
# First of all, open the cache
|
||||
cache = apt.Cache()
|
||||
# Now, lets update the package list
|
||||
cache.update(UpdateProgressSocket())
|
||||
# We need to re-open the cache because it needs to read the package list
|
||||
cache.open(None)
|
||||
# We need to re-open the cache because it needs to read the package list
|
||||
for pkg in cache:
|
||||
if pkg.is_upgradable:
|
||||
print(f"{pkg.name} ({pkg.installed.version} -> {pkg.candidate.version})")
|
||||
|
||||
def process(data):
|
||||
# Echo the input data
|
||||
return data
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
update_cache()
|
@ -550,8 +550,13 @@ pub fn build_ui(app: &Application) {
|
||||
.position(|r| r == "--flatpak-installer")
|
||||
.unwrap() as i32)
|
||||
+ 1) as usize;
|
||||
flatpak_entry_signal_action
|
||||
if index > gtk_application_args.len() -1 {
|
||||
flatpak_entry_signal_action
|
||||
.activate(Some(&glib::Variant::from("")));
|
||||
} else {
|
||||
flatpak_entry_signal_action
|
||||
.activate(Some(&glib::Variant::from(>k_application_args[index])));
|
||||
}
|
||||
}
|
||||
|
||||
0
|
||||
|
Loading…
Reference in New Issue
Block a user