From c92d31d7f7edf42635011c2fd9cc0c1730bce76d Mon Sep 17 00:00:00 2001 From: Francois B Date: Thu, 22 Mar 2018 09:36:34 +0100 Subject: [PATCH] addPPA check if PPA exist before add it --- core_functions.sh | 19 +++++--- repo_functions.sh | 114 +++++++++++++++++++++++----------------------- yggdrasil.sh | 7 +-- 3 files changed, 74 insertions(+), 66 deletions(-) diff --git a/core_functions.sh b/core_functions.sh index f691ca1..7e7307f 100644 --- a/core_functions.sh +++ b/core_functions.sh @@ -111,7 +111,7 @@ function yggInit () { if ! grep ^ /etc/apt/sources.list /etc/apt/sources.list.d/* | grep -q ubuntu-make; then printf "[INIT][UMAKE] PPA not found, adding PPA...\n" printf "[INIT][UMAKE] PPA not found, adding PPA...\n" &>> $logFile - addPPA "ppa:ubuntu-desktop/ubuntu-make" + addPPA "ubuntu-desktop/ubuntu-make" else printf "[INIT][UMAKE] PPA found [ ""$BOLDVERT""OK"$NORMAL" ] \n" fi @@ -218,11 +218,18 @@ function updateSystem () { # function addPPA () { typeset ret_code - printf "[PPA] adding : $* " - printf "\n[PPA] adding $*\n" &>> $logFile - sudo add-apt-repository -y $* &>> $logFile - ret_code=$? - retCode $ret_code + + if ! grep ^ /etc/apt/sources.list /etc/apt/sources.list.d/* | grep -q $*; then + printf "[PPA] adding : $* " + printf "\n[PPA] adding $*\n" &>> $logFile + sudo add-apt-repository -y "ppa:"$* &>> $logFile + ret_code=$? + retCode $ret_code + else + printf "[PPA] PPA already added [ ""$BOLDVERT""OK"$NORMAL" ] \n" + fi + + } # diff --git a/repo_functions.sh b/repo_functions.sh index 3f2c759..4022c3c 100644 --- a/repo_functions.sh +++ b/repo_functions.sh @@ -455,14 +455,14 @@ shotwell;addRepo_Shotwell" # Shotwell # function addRepo_Shotwell () { - addPPA "ppa:yg-jensge/shotwell" + addPPA "yg-jensge/shotwell" } # # Telegram # function addRepo_Telegram () { - addPPA "ppa:atareao/telegram" + addPPA "atareao/telegram" } # @@ -488,42 +488,42 @@ function addRepo_NodeLts8 () { # Kicad 4 # function addRepo_Kicad () { - addPPA "ppa:js-reynaud/kicad-4" + addPPA "js-reynaud/kicad-4" } # # Brackets IDE # function addRepo_Brackets () { - addPPA "ppa:webupd8team/brackets" + addPPA "webupd8team/brackets" } # # Darktable RAW Editor # function addRepo_DarkTable () { - addPPA "ppa:pmjdebruijn/darktable-release" + addPPA "pmjdebruijn/darktable-release" } # # WireShark # function addRepo_WireShark () { -addPPA "ppa:wireshark-dev/stable" +addPPA "wireshark-dev/stable" } # # NextCloud # function addRepo_NextCloud () { - addPPA "ppa:nextcloud-devs/client" + addPPA "nextcloud-devs/client" } # # Atom IDE # function addRepo_Atom () { - addPPA "ppa:webupd8team/atom" + addPPA "webupd8team/atom" } # @@ -613,7 +613,7 @@ function addRepo_Etcher () { # Ansible # function addRepo_Ansible () { - addPPA "ppa:ansible/ansible" + addPPA "ansible/ansible" } # @@ -656,21 +656,21 @@ function addRepo_Wine () { # LibreOffice 6 # function addRepo_Libreoffice6 () { - addPPA "ppa:libreoffice/ppa" + addPPA "libreoffice/ppa" } # # Kodi (Beta) # function addRepo_KodiBeta () { - addPPA "ppa:team-xbmc/unstable" + addPPA "team-xbmc/unstable" } # # Kodi (Nightly) # function addRepo_KodiNightly () { - addPPA "ppa:team-xbmc/xbmc-nightly" + addPPA "team-xbmc/xbmc-nightly" } # @@ -686,7 +686,7 @@ function addRepo_VSCode () { # Android-Studio # function addRepo_AndroidStudio () { - addPPA "ppa:maarten-fonville/android-studio" + addPPA "maarten-fonville/android-studio" } #-----------------------------------------------------------------------------# @@ -795,50 +795,50 @@ function addRequiredPPA () { runCmd "echo sience-config science-config/group select '$myHomedir ($myHomedir)' | sudo debconf-set-selections" \ "apply settings for science-config pkg" - addPPA "ppa:noobslab/themes" # themes from noobslab - addPPA "ppa:noobslab/icons" # icons from noobslab - addPPA "ppa:numix/ppa" # theme Numix - addPPA "ppa:ravefinity-project/ppa" # Themes - addPPA "ppa:teejee2008/ppa" # Aptik - Conky-Manage - addPPA "ppa:yktooo/ppa" # indicator-sound-switcher - addPPA "ppa:webupd8team/y-ppa-manager" # y-ppa-manager - addPPA "ppa:videolan/stable-daily" # video player - addPPA "ppa:nowrep/qupzilla" # web browser - addPPA "ppa:atareao/atareao" # pushbullet-indicator, imagedownloader, gqrcode, cpu-g - addPPA "ppa:fossfreedom/rhythmbox-plugins"; # Rhythmbox plugins - addPPA "ppa:fossfreedom/rhythmbox" # Rhythmbox - addPPA "ppa:nilarimogard/webupd8" # Audacious, Grive2, Pidgin-indicator - addPPA "ppa:oibaf/graphics-drivers" # free graphics-drivers + mesa - addPPA "ppa:team-xbmc/ppa" # Kodi - addPPA "ppa:webupd8team/java" # Oracle Java SE 7/8 - addPPA "ppa:hugin/hugin-builds" # image editor - addPPA "ppa:mumble/release" # Mumble - addPPA "ppa:atareao/utext" # Markdown editor - addPPA "ppa:danielrichter2007/grub-customizer" # grub-customizer - addPPA "ppa:lucioc/sayonara" # audio player - addPPA "ppa:haraldhv/shotcut" # video editor - addPPA "ppa:flacon/ppa" # audio extraction - addPPA "ppa:jaap.karssenberg/zim" # local wiki - addPPA "ppa:stebbins/handbrake-releases" # video transcoder - addPPA "ppa:graphics-drivers/ppa" # non-free nvidia drivers - addPPA "ppa:diodon-team/stable" # clipboard manager - addPPA "ppa:notepadqq-team/notepadqq" # notepad++ clone - addPPA "ppa:mariospr/frogr" # flickr manager - addPPA "ppa:ubuntuhandbook1/slowmovideo" # slow motion video editor - addPPA "ppa:transmissionbt/ppa" # bittorrent client - addPPA "ppa:geary-team/releases" # email client - addPPA "ppa:ubuntuhandbook1/corebird" # corebird - addPPA "ppa:tista/adapta" # adapta gtk theme - addPPA "ppa:maarten-baert/simplescreenrecorder" # simplescreenrecorder - addPPA "ppa:dhor/myway" # rawtherapee (newer version) - addPPA "ppa:zeal-developers/ppa" # Zeal (newer version) - addPPA "ppa:deluge-team/ppa" # Deluge P2P client - addPPA "ppa:kritalime/ppa" # Krita - addPPA "ppa:otto-kesselgulasch/gimp" # Gmic2 - addPPA "ppa:ozmartian/apps" # Vidcutter - addPPA "ppa:fossproject/ppa" # green-recorder - addPPA "ppa:quiterss/quiterss" # quiterss - addPPA "ppa:tmsu/ppa" # tmsu + addPPA "noobslab/themes" # themes from noobslab + addPPA "noobslab/icons" # icons from noobslab + addPPA "numix/ppa" # theme Numix + addPPA "ravefinity-project/ppa" # Themes + addPPA "teejee2008/ppa" # Aptik - Conky-Manage + addPPA "yktooo/ppa" # indicator-sound-switcher + addPPA "webupd8team/y-ppa-manager" # y-ppa-manager + addPPA "videolan/stable-daily" # video player + addPPA "nowrep/qupzilla" # web browser + addPPA "atareao/atareao" # pushbullet-indicator, imagedownloader, gqrcode, cpu-g + addPPA "fossfreedom/rhythmbox-plugins"; # Rhythmbox plugins + addPPA "fossfreedom/rhythmbox" # Rhythmbox + addPPA "nilarimogard/webupd8" # Audacious, Grive2, Pidgin-indicator + addPPA "oibaf/graphics-drivers" # free graphics-drivers + mesa + addPPA "team-xbmc/ppa" # Kodi + addPPA "webupd8team/java" # Oracle Java SE 7/8 + addPPA "hugin/hugin-builds" # image editor + addPPA "mumble/release" # Mumble + addPPA "atareao/utext" # Markdown editor + addPPA "danielrichter2007/grub-customizer" # grub-customizer + addPPA "lucioc/sayonara" # audio player + addPPA "haraldhv/shotcut" # video editor + addPPA "flacon/ppa" # audio extraction + addPPA "jaap.karssenberg/zim" # local wiki + addPPA "stebbins/handbrake-releases" # video transcoder + addPPA "graphics-drivers/ppa" # non-free nvidia drivers + addPPA "diodon-team/stable" # clipboard manager + addPPA "notepadqq-team/notepadqq" # notepad++ clone + addPPA "mariospr/frogr" # flickr manager + addPPA "ubuntuhandbook1/slowmovideo" # slow motion video editor + addPPA "transmissionbt/ppa" # bittorrent client + addPPA "geary-team/releases" # email client + addPPA "ubuntuhandbook1/corebird" # corebird + addPPA "tista/adapta" # adapta gtk theme + addPPA "maarten-baert/simplescreenrecorder" # simplescreenrecorder + addPPA "dhor/myway" # rawtherapee (newer version) + addPPA "zeal-developers/ppa" # Zeal (newer version) + addPPA "deluge-team/ppa" # Deluge P2P client + addPPA "kritalime/ppa" # Krita + addPPA "otto-kesselgulasch/gimp" # Gmic2 + addPPA "ozmartian/apps" # Vidcutter + addPPA "fossproject/ppa" # green-recorder + addPPA "quiterss/quiterss" # quiterss + addPPA "tmsu/ppa" # tmsu addKey "https://mkvtoolnix.download/gpg-pub-moritzbunkus.txt" addRepo mkv.list \ diff --git a/yggdrasil.sh b/yggdrasil.sh index 3e0212d..c003e4a 100755 --- a/yggdrasil.sh +++ b/yggdrasil.sh @@ -43,14 +43,14 @@ echo "--[ Yggdrasil log ]--[ "$cDate" ]--[ "$cTime" ]-----------------------" >> while getopts ":h,v,f,c,t,u" option; do case "$option" in t) #test purpose only - yggInit + #yggInit #installIdea #installNetTools #installOffice + #addPPA "tmsu/ppa" exit ;; f) # install all apps - #TODO: yggInit updateSystem addRequiredPPA @@ -76,8 +76,9 @@ while getopts ":h,v,f,c,t,u" option; do exit ;; c) # install themes and icons - #TODO: yggInit + updateSystem + addRequiredPPA installIcons installThemes exit